List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:December 6 2010 4:33pm
Subject:bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:3512) Bug#58061
View as plain text  
#At file:///Users/mattiasj/mysql-bzr/b58061-51-bt/ based on revid:mats.kindahl@stripped

 3512 Mattias Jonsson	2010-12-06
      Bug#58061: crash with group_concat +
                 too small myisam_data_pointer_size + partition
      
      Problem was bad error handling withing the
      information_schema/show code resulting in a crash
      
      Even if an internal fatal error had occured (the temporary
      result table was full), it tried to continue which later
      crashed the server.
      
      Fixed by checking for the fatal error and break and not
      resetting the error when it occured.
     @ mysql-test/r/partition_i_s.result
        New result file
     @ mysql-test/t/partition_i_s.test
        New test file
     @ sql/sql_show.cc
        Do not ignore a fatal error or continue if it occurs.

    added:
      mysql-test/r/partition_i_s.result
      mysql-test/t/partition_i_s.test
    modified:
      sql/sql_show.cc
=== added file 'mysql-test/r/partition_i_s.result'
--- a/mysql-test/r/partition_i_s.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/partition_i_s.result	2010-12-06 16:33:25 +0000
@@ -0,0 +1,36 @@
+drop table if exists t1;
+call mtr.add_suppression("The table '.*' is full");
+SET @old_myisam_data_pointer_size= @@myisam_data_pointer_size;
+SET global myisam_data_pointer_size=2;
+CREATE TABLE t1
+(aaaaaaaaaaaaaaaaa INT,
+bbbbbbbbbbbbnnnbbbb INT,
+caaaaaaaaaaaaaaaa INT,
+bbbbbbbbbbbjbbbbbbb INT,
+daaaaaaaaaaaaaaaa INT,
+bbbbbdbbbbbybbbbbbb INT,
+eaaaaaaaaaaaaaaaa INT,
+bbbbbbbbbhhbbbbbbbb INT,
+ddaaaaaaaaaaaaaaa INT,
+bbbbbbbbbgbbbbbbbbb INT,
+afaaaaaaaaaaaaaaa INT,
+bbbbbbbbbfbbbbbbbbb INT,
+aagaaaaaaaaaaaaaa INT,
+bbbbbbbbbcbbbbbbbbb INT,
+aaahaaaaaaaaaaaaa INT,
+bbbbbbbbbdbbbbbbbbb INT,
+aaaajaaaaaaaaaaaa INT,
+bbbbbbbbbbabbbbbbbb INT,
+aaaaakaaaaaaaaaaa INT,
+bbbbbbbbbbbpbbbbbbb INT,
+aaaaaalaaaaaaaaaa INT,
+bbbbbbbbbbbobbbbbbb INT PRIMARY KEY)
+ENGINE = MyISAM
+PARTITION BY KEY() PARTITIONS 1;
+SELECT `table_schema`,1 as `nest_level`,'myisam' AS `engine`,`table_name`,
+group_concat(`column_name` order by `column_name`) AS `cols` FROM
+INFORMATION_SCHEMA.`COLUMNS` 
+WHERE `table_name`='t1' GROUP BY `table_schema`,`table_name` ;
+ERROR HY000: The table '<tmp-table>' is full
+DROP TABLE t1;
+SET @@global.myisam_data_pointer_size= @old_myisam_data_pointer_size;

=== added file 'mysql-test/t/partition_i_s.test'
--- a/mysql-test/t/partition_i_s.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/partition_i_s.test	2010-12-06 16:33:25 +0000
@@ -0,0 +1,45 @@
+--source include/have_partition.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+
+call mtr.add_suppression("The table '.*' is full");
+SET @old_myisam_data_pointer_size= @@myisam_data_pointer_size;
+SET global myisam_data_pointer_size=2;
+
+CREATE TABLE t1
+(aaaaaaaaaaaaaaaaa INT,
+ bbbbbbbbbbbbnnnbbbb INT,
+ caaaaaaaaaaaaaaaa INT,
+ bbbbbbbbbbbjbbbbbbb INT,
+ daaaaaaaaaaaaaaaa INT,
+ bbbbbdbbbbbybbbbbbb INT,
+ eaaaaaaaaaaaaaaaa INT,
+ bbbbbbbbbhhbbbbbbbb INT,
+ ddaaaaaaaaaaaaaaa INT,
+ bbbbbbbbbgbbbbbbbbb INT,
+ afaaaaaaaaaaaaaaa INT,
+ bbbbbbbbbfbbbbbbbbb INT,
+ aagaaaaaaaaaaaaaa INT,
+ bbbbbbbbbcbbbbbbbbb INT,
+ aaahaaaaaaaaaaaaa INT,
+ bbbbbbbbbdbbbbbbbbb INT,
+ aaaajaaaaaaaaaaaa INT,
+ bbbbbbbbbbabbbbbbbb INT,
+ aaaaakaaaaaaaaaaa INT,
+ bbbbbbbbbbbpbbbbbbb INT,
+ aaaaaalaaaaaaaaaa INT,
+ bbbbbbbbbbbobbbbbbb INT PRIMARY KEY)
+ENGINE = MyISAM
+PARTITION BY KEY() PARTITIONS 1;
+
+--replace_regex /table '.*' is full/table '<tmp-table>' is full/
+--error ER_RECORD_FILE_FULL
+SELECT `table_schema`,1 as `nest_level`,'myisam' AS `engine`,`table_name`,
+group_concat(`column_name` order by `column_name`) AS `cols` FROM
+INFORMATION_SCHEMA.`COLUMNS` 
+WHERE `table_name`='t1' GROUP BY `table_schema`,`table_name` ;
+DROP TABLE t1;
+SET @@global.myisam_data_pointer_size= @old_myisam_data_pointer_size;

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2010-11-30 17:51:25 +0000
+++ b/sql/sql_show.cc	2010-12-06 16:33:25 +0000
@@ -3271,7 +3271,8 @@ err1:
 
 err:
   pthread_mutex_unlock(&LOCK_open);
-  thd->clear_error();
+  if (!thd->is_fatal_error)
+    thd->clear_error();
   return res;
 }
 
@@ -3458,6 +3459,11 @@ int get_all_tables(THD *thd, TABLE_LIST 
               if (!fill_schema_table_from_frm(thd, table, schema_table, db_name,
                                               table_name, schema_table_idx))
                 continue;
+              if (thd->is_fatal_error)
+              {
+                error= 1;
+                goto err;
+              }
             }
 
             int res;


Attachment: [text/bzr-bundle] bzr/mattias.jonsson@oracle.com-20101206163325-8bp0hhgwli7bm7t6.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:3512) Bug#58061Mattias Jonsson6 Dec