List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:November 12 2008 4:28pm
Subject:bzr commit into mysql-5.1 branch (Sergey.Glukhov:2706) Bug#38909
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1-bug-38909/

 2706 Sergey Glukhov	2008-11-12
      Bug#38909 CREATE_OPTIONS in information_schema produces wrong results
      table->partition_info is unitialized when we open frm file only.
      The fix is check share->partition_info_len which is set on
      frm opening stage.
modified:
  mysql-test/r/information_schema_part.result
  mysql-test/t/information_schema_part.test
  sql/sql_show.cc

per-file messages:
  mysql-test/r/information_schema_part.result
    test result
  mysql-test/t/information_schema_part.test
    test case
  sql/sql_show.cc
    table->partition_info is unitialized when we open frm file only.
    The fix is check share->partition_info_len which is set on
    frm opening stage.
=== modified file 'mysql-test/r/information_schema_part.result'
--- a/mysql-test/r/information_schema_part.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/r/information_schema_part.result	2008-11-12 15:21:38 +0000
@@ -145,3 +145,8 @@ table_schema = "test" AND table_name = "
 PARTITION_DESCRIPTION
 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53
 drop table t1;
+create table t1 (f1 int key) partition by key(f1) partitions 2;
+select create_options from information_schema.tables where table_schema="test";
+create_options
+partitioned
+drop table t1;

=== modified file 'mysql-test/t/information_schema_part.test'
--- a/mysql-test/t/information_schema_part.test	2006-05-31 13:33:10 +0000
+++ b/mysql-test/t/information_schema_part.test	2008-11-12 15:21:38 +0000
@@ -121,3 +121,10 @@ SHOW CREATE TABLE t1;
 SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
 table_schema = "test" AND table_name = "t1";
 drop table t1;
+
+#
+# Bug#38909 CREATE_OPTIONS in information_schema produces wrong results
+#
+create table t1 (f1 int key) partition by key(f1) partitions 2;
+select create_options from information_schema.tables where table_schema="test";
+drop table t1;

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2008-11-04 07:43:21 +0000
+++ b/sql/sql_show.cc	2008-11-12 15:21:38 +0000
@@ -3498,6 +3498,7 @@ static int get_schema_tables_record(THD 
     TABLE_SHARE *share= show_table->s;
     handler *file= show_table->file;
     handlerton *tmp_db_type= share->db_type();
+    bool is_partitioned= false;
     if (share->tmp_table == SYSTEM_TMP_TABLE)
       table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"), cs);
     else if (share->tmp_table)
@@ -3514,7 +3515,10 @@ static int get_schema_tables_record(THD 
 #ifdef WITH_PARTITION_STORAGE_ENGINE
     if (share->db_type() == partition_hton &&
         share->partition_info_len)
+    {
       tmp_db_type= share->default_part_db_type;
+      is_partitioned= true;
+    }
 #endif
     tmp_buff= (char *) ha_resolve_storage_engine_name(tmp_db_type);
     table->field[4]->store(tmp_buff, strlen(tmp_buff), cs);
@@ -3559,9 +3563,7 @@ static int get_schema_tables_record(THD 
                    NullS);
     }
 #ifdef WITH_PARTITION_STORAGE_ENGINE
-    if (show_table->s->db_type() == partition_hton && 
-        show_table->part_info != NULL && 
-        show_table->part_info->no_parts > 0)
+    if (is_partitioned)
       ptr= strmov(ptr, " partitioned");
 #endif
     if (share->transactional != HA_CHOICE_UNDEF)

Thread
bzr commit into mysql-5.1 branch (Sergey.Glukhov:2706) Bug#38909Sergey Glukhov12 Nov