Loading mysql-test/r/partition.result +26 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,32 @@ partition by key(a) partitions 1e+300; ERROR 42000: Only normal integers allowed as number here near '1e+300' at line 3 create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 4 4096 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 2 8192 16384 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 4 4096 16384 0 0 0 5 NULL NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 8 2048 16384 0 0 0 9 NULL NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by list (a) (partition p0 values in (1)); create procedure pz() Loading mysql-test/t/partition.test +22 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,28 @@ partitions 1.5; create table t1 (a int) partition by key(a) partitions 1e+300; # # Bug 21173: SHOW TABLE STATUS crashes server in InnoDB # create table t1 (a int) engine = innodb partition by key (a); show table status; insert into t1 values (0), (1), (2), (3); show table status; drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; drop table t1; >>>>>>> # # Bug 19309 Partitions: Crash if double procedural alter # Loading sql/ha_partition.cc +13 −4 Original line number Diff line number Diff line Loading @@ -4183,10 +4183,20 @@ void ha_partition::info(uint flag) ulonglong nb_reserved_values; DBUG_PRINT("info", ("HA_STATUS_AUTO")); /* we don't want to reserve any values, it's pure information */ if (table->found_next_number_field) { /* Can only call get_auto_increment for tables that actually have auto_increment columns, otherwise there will be problems in handlers that don't expect get_auto_increment for non-autoincrement tables. */ get_auto_increment(0, 0, 0, &stats.auto_increment_value, &nb_reserved_values); release_auto_increment(); } } if (flag & HA_STATUS_VARIABLE) { DBUG_PRINT("info", ("HA_STATUS_VARIABLE")); Loading Loading @@ -5363,7 +5373,6 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, if (increment) // If not check for values *nb_reserved_values= (last_value == ULONGLONG_MAX) ? ULONGLONG_MAX : ((last_value - *first_value) / increment); DBUG_VOID_RETURN; } Loading Loading
mysql-test/r/partition.result +26 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,32 @@ partition by key(a) partitions 1e+300; ERROR 42000: Only normal integers allowed as number here near '1e+300' at line 3 create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 4 4096 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 2 8192 16384 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 4 4096 16384 0 0 0 5 NULL NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 InnoDB 10 Compact 8 2048 16384 0 0 0 9 NULL NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by list (a) (partition p0 values in (1)); create procedure pz() Loading
mysql-test/t/partition.test +22 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,28 @@ partitions 1.5; create table t1 (a int) partition by key(a) partitions 1e+300; # # Bug 21173: SHOW TABLE STATUS crashes server in InnoDB # create table t1 (a int) engine = innodb partition by key (a); show table status; insert into t1 values (0), (1), (2), (3); show table status; drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; drop table t1; >>>>>>> # # Bug 19309 Partitions: Crash if double procedural alter # Loading
sql/ha_partition.cc +13 −4 Original line number Diff line number Diff line Loading @@ -4183,10 +4183,20 @@ void ha_partition::info(uint flag) ulonglong nb_reserved_values; DBUG_PRINT("info", ("HA_STATUS_AUTO")); /* we don't want to reserve any values, it's pure information */ if (table->found_next_number_field) { /* Can only call get_auto_increment for tables that actually have auto_increment columns, otherwise there will be problems in handlers that don't expect get_auto_increment for non-autoincrement tables. */ get_auto_increment(0, 0, 0, &stats.auto_increment_value, &nb_reserved_values); release_auto_increment(); } } if (flag & HA_STATUS_VARIABLE) { DBUG_PRINT("info", ("HA_STATUS_VARIABLE")); Loading Loading @@ -5363,7 +5373,6 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, if (increment) // If not check for values *nb_reserved_values= (last_value == ULONGLONG_MAX) ? ULONGLONG_MAX : ((last_value - *first_value) / increment); DBUG_VOID_RETURN; } Loading