diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2010-03-30 22:52:45 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2010-03-30 22:52:45 +0200 |
commit | 47906997c778edc506aa1ca16a113afef1650c54 (patch) | |
tree | 8edd91e616222b12e1b2bf54c848e345d37ad590 /sql/table.cc | |
parent | 6da92d8f1973aed699bc88450211bb30f6ef5750 (diff) | |
download | mariadb-git-47906997c778edc506aa1ca16a113afef1650c54.tar.gz |
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Problem was that the ha_data structure was introduced in 5.1
and only used for partitioning first, but with the intention
of be of use for others engines as well, and when used by other
engines it would clash if it also was partitioned.
Solution is to move the partitioning specific data to a separate
structure, with its own mutex (which is used for auto_increment).
Also did rename PARTITION_INFO to PARTITION_STATS since there
already exist a class named partition_info, also cleaned up
some related variables.
mysql-test/r/partition_binlog_stmt.result:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
New result file
mysql-test/t/partition_binlog_stmt.test:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
New result file
sql/ha_ndbcluster.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
sql/ha_ndbcluster.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
sql/ha_partition.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed the partitioning engines use of ha_data in
TABLE_SHARE and added ha_part_data instead, since
they collide if used in the same time.
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
Removed some dead code.
sql/ha_partition.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed some dead code.
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
Removed the partitioning engines use of ha_data in
TABLE_SHARE and added ha_part_data instead, since
they collide if used in the same time.
sql/handler.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
sql/handler.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
sql/mysql_priv.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed the partitioning engines use of ha_data in
TABLE_SHARE and added ha_part_data instead, since
they collide if used in the same time.
Added key_PARTITION_LOCK_auto_inc for instrumentation.
sql/mysqld.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed the partitioning engines use of ha_data in
TABLE_SHARE and added ha_part_data instead, since
they collide if used in the same time.
Added key_PARTITION_LOCK_auto_inc for instrumentation.
sql/partition_info.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed part_state* since it was not in use.
sql/sql_partition.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed part_state* since it was not in use.
sql/sql_partition.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Cleaned up old commented out code.
Removed part_state* since it was not in use.
sql/sql_show.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Rename of PARTITION_INFO to PARTITION_STATS to better
match the use (and there is also a class named
partition_info...)
Renamed partition_info to partition_info_str, since
partition_info is a name of a class.
sql/sql_table.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Renamed partition_info to partition_info_str, since
partition_info is a name of a class.
sql/table.cc:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed the partitioning engines use of ha_data in
TABLE_SHARE and added ha_part_data instead, since
they collide if used in the same time.
Renamed partition_info to partition_info_str, since
partition_info is a name of a class.
removed part_state* since it was not in use.
sql/table.h:
Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table
Removed the partitioning engines use of ha_data in
TABLE_SHARE and added ha_part_data instead, since
they collide if used in the same time.
Renamed partition_info to partition_info_str, since
partition_info is a name of a class.
removed part_state* since it was not in use.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sql/table.cc b/sql/table.cc index fa1186c2a45..8d63626fb81 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -954,28 +954,28 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, } if (next_chunk + 5 < buff_end) { - uint32 partition_info_len = uint4korr(next_chunk); + uint32 partition_info_str_len = uint4korr(next_chunk); #ifdef WITH_PARTITION_STORAGE_ENGINE if ((share->partition_info_buffer_size= - share->partition_info_len= partition_info_len)) + share->partition_info_str_len= partition_info_str_len)) { - if (!(share->partition_info= (char*) + if (!(share->partition_info_str= (char*) memdup_root(&share->mem_root, next_chunk + 4, - partition_info_len + 1))) + partition_info_str_len + 1))) { my_free(buff, MYF(0)); goto err; } } #else - if (partition_info_len) + if (partition_info_str_len) { DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined")); my_free(buff, MYF(0)); goto err; } #endif - next_chunk+= 5 + partition_info_len; + next_chunk+= 5 + partition_info_str_len; } #if MYSQL_VERSION_ID < 50200 if (share->mysql_version >= 50106 && share->mysql_version <= 50109) @@ -1638,6 +1638,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, my_hash_free(&share->name_hash); if (share->ha_data_destroy) share->ha_data_destroy(share->ha_data); +#ifdef WITH_PARTITION_STORAGE_ENGINE + if (share->ha_part_data_destroy) + share->ha_part_data_destroy(share->ha_part_data); +#endif open_table_error(share, error, share->open_errno, errarg); DBUG_RETURN(error); @@ -1829,7 +1833,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, } #ifdef WITH_PARTITION_STORAGE_ENGINE - if (share->partition_info_len && outparam->file) + if (share->partition_info_str_len && outparam->file) { /* In this execution we must avoid calling thd->change_item_tree since @@ -1850,10 +1854,8 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, bool tmp; bool work_part_info_used; - tmp= mysql_unpack_partition(thd, share->partition_info, - share->partition_info_len, - share->part_state, - share->part_state_len, + tmp= mysql_unpack_partition(thd, share->partition_info_str, + share->partition_info_str_len, outparam, is_create_table, share->default_part_db_type, &work_part_info_used); |