List:Commits« Previous MessageNext Message »
From:Mikael Ronström Date:August 8 2006 1:03pm
Subject:bk commit - 5.1 tree (mikael:1.2265) BUG#21173
View as plain text  
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2006/08/08 08:47:58-04:00 mikael@dator5.(none)
#   BUG#21173: SHOW TABLE STATUS crashes on InnoDB tables
#   Don't use get_auto_increment on tables without auto_increment fields
#
# mysql-test/r/partition.result
#   2006/08/08 08:47:55-04:00 mikael@dator5.(none) +8 -0
#   new test case
#
# mysql-test/t/partition.test
#   2006/08/08 08:47:55-04:00 mikael@dator5.(none) +10 -0
#   new test case
#
# sql/ha_partition.cc
#   2006/08/08 08:47:55-04:00 mikael@dator5.(none) +9 -4
#   Don't use get_auto_increment on tables without auto_increment fields
#
diff -Nru a/mysql-test/r/partition.result  
b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result	2006-08-08 08:54:17 -04:00
+++ b/mysql-test/r/partition.result	2006-08-08 08:54:17 -04:00
@@ -1,5 +1,13 @@
  drop table if exists t1;
  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	
+drop table t1;
+create table t1 (a int)
  partition by list (a)
  (partition p0 values in (1));
  create procedure pz()
diff -Nru a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test	2006-08-08 08:54:17 -04:00
+++ b/mysql-test/t/partition.test	2006-08-08 08:54:17 -04:00
@@ -10,6 +10,16 @@
  --enable_warnings

  #
+# Bug 21173: SHOW TABLE STATUS crashes server in InnoDB
+#
+create table t1 (a int)
+engine = innodb
+partition by key (a);
+insert into t1 values (0);
+show table status;
+drop table t1;
+
+#
  # Bug 19309 Partitions: Crash if double procedural alter
  #
  create table t1 (a int)
diff -Nru a/sql/ha_partition.cc b/sql/ha_partition.cc
--- a/sql/ha_partition.cc	2006-08-08 08:54:17 -04:00
+++ b/sql/ha_partition.cc	2006-08-08 08:54:17 -04:00
@@ -4183,9 +4183,15 @@
      ulonglong nb_reserved_values;
      DBUG_PRINT("info", ("HA_STATUS_AUTO"));
      /* we don't want to reserve any values, it's pure information */
-    get_auto_increment(0, 0, 0, &stats.auto_increment_value,
-                       &nb_reserved_values);
-    release_auto_increment();
+
+    if (table->found_next_number_field)
+    {
+      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)
    {
@@ -5363,7 +5369,6 @@
    if (increment)                                // If not check for  
values
      *nb_reserved_values= (last_value == ULONGLONG_MAX) ?
        ULONGLONG_MAX : ((last_value - *first_value) / increment);
-
    DBUG_VOID_RETURN;
  }


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.2265) BUG#21173Mikael Ronström8 Aug