# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2006/08/08 09:58:55-04:00 mikael@dator5.(none)
# BUG#21173: SHOW TABLE STATUS crashes mysqld
# Review fixes
#
# mysql-test/r/partition.result
# 2006/08/08 09:58:53-04:00 mikael@dator5.(none) +19 -1
# New test cases
#
# mysql-test/t/partition.test
# 2006/08/08 09:58:53-04:00 mikael@dator5.(none) +11 -1
# New test cases
#
# sql/ha_partition.cc
# 2006/08/08 09:58:53-04:00 mikael@dator5.(none) +6 -2
# Added comments after review
# + removed erroneus setting
#
diff -Nru a/mysql-test/r/partition.result
b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result 2006-08-09 07:16:03 -04:00
+++ b/mysql-test/r/partition.result 2006-08-09 07:16:03 -04:00
@@ -2,10 +2,28 @@
create table t1 (a int)
engine = innodb
partition by key (a);
-insert into t1 values (0);
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)
diff -Nru a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test 2006-08-09 07:16:03 -04:00
+++ b/mysql-test/t/partition.test 2006-08-09 07:16:03 -04:00
@@ -15,10 +15,20 @@
create table t1 (a int)
engine = innodb
partition by key (a);
-insert into t1 values (0);
+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
#
diff -Nru a/sql/ha_partition.cc b/sql/ha_partition.cc
--- a/sql/ha_partition.cc 2006-08-09 07:16:03 -04:00
+++ b/sql/ha_partition.cc 2006-08-09 07:16:03 -04:00
@@ -4186,12 +4186,16 @@
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();
}
- else
- stats.auto_increment_value= ~(ulonglong)(0);
}
if (flag & HA_STATUS_VARIABLE)
{
Mikael Ronstrom, Senior Software Architect
MySQL AB, www.mysql.com
Jumpstart your cluster:
http://www.mysql.com/consulting/packaged/cluster.html
My blog:
http://mikaelronstrom.blogspot.com
| Thread |
|---|
| • bk commit - 5.1 tree (mikael:1.2266) BUG#21173 | Mikael Ronström | 9 Aug |