MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:May 25 2010 1:45pm
Subject:bzr commit into mysql-trunk branch (mattias.jonsson:3027)
View as plain text  
#At file:///Users/mattiasj/mysql-bzr/topush-trunk-merge/ based on revid:alik@stripped

 3027 Mattias Jonsson	2010-05-25 [merge]
      merge

    modified:
      mysql-test/r/partition_error.result
      mysql-test/t/partition_error.test
      sql/ha_partition.cc
      sql/sql_parse.cc
=== modified file 'mysql-test/r/partition_error.result'
--- a/mysql-test/r/partition_error.result	2010-03-20 20:23:42 +0000
+++ b/mysql-test/r/partition_error.result	2010-05-25 13:45:01 +0000
@@ -1,5 +1,13 @@
 drop table if exists t1;
 #
+# Bug#49477: Assertion `0' failed in ha_partition.cc:5530
+# with temporary table and partitions
+#
+CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
+CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
+ERROR HY000: Cannot create temporary table with partitions
+DROP TABLE t1;
+#
 # Bug#50392: insert_id is not reset for partitioned tables
 #            auto_increment on duplicate entry
 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);

=== modified file 'mysql-test/t/partition_error.test'
--- a/mysql-test/t/partition_error.test	2010-03-20 20:23:42 +0000
+++ b/mysql-test/t/partition_error.test	2010-05-25 13:45:01 +0000
@@ -9,6 +9,15 @@ drop table if exists t1;
 --enable_warnings
  
 --echo #
+--echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530
+--echo # with temporary table and partitions
+--echo #
+CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
+--error ER_PARTITION_NO_TEMPORARY
+CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
+DROP TABLE t1;
+
+--echo #
 --echo # Bug#50392: insert_id is not reset for partitioned tables
 --echo #            auto_increment on duplicate entry
 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2010-05-11 16:02:50 +0000
+++ b/sql/ha_partition.cc	2010-05-25 13:45:01 +0000
@@ -90,7 +90,9 @@ static int partition_initialize(void *p)
   partition_hton->create= partition_create_handler;
   partition_hton->partition_flags= partition_flags;
   partition_hton->alter_table_flags= alter_table_flags;
-  partition_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;
+  partition_hton->flags= HTON_NOT_USER_SELECTABLE |
+                         HTON_HIDDEN |
+                         HTON_TEMPORARY_NOT_SUPPORTED;
 
   return 0;
 }
@@ -1896,6 +1898,13 @@ uint ha_partition::del_ren_cre_table(con
   handler **file, **abort_file;
   DBUG_ENTER("del_ren_cre_table()");
 
+  /* Not allowed to create temporary partitioned tables */
+  if (create_info && create_info->options & HA_LEX_CREATE_TMP_TABLE)
+  {
+    my_error(ER_PARTITION_NO_TEMPORARY, MYF(0));
+    DBUG_RETURN(TRUE);
+  }
+
   if (get_from_handler_file(from, ha_thd()->mem_root))
     DBUG_RETURN(TRUE);
   DBUG_ASSERT(m_file_buffer);

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-05-23 20:41:18 +0000
+++ b/sql/sql_parse.cc	2010-05-25 13:45:01 +0000
@@ -2958,7 +2958,7 @@ end_with_restore_list:
           access is granted. We need to check if first_table->grant.privilege
           contains any table-specific privilege.
         */
-        DBUG_PRINT("debug", ("first_table->grant.privilege: %x",
+        DBUG_PRINT("debug", ("first_table->grant.privilege: %lx",
                              first_table->grant.privilege));
         if (check_some_access(thd, SHOW_CREATE_TABLE_ACLS, first_table) ||
             (first_table->grant.privilege & SHOW_CREATE_TABLE_ACLS) == 0)


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-trunk branch (mattias.jonsson:3027)Mattias Jonsson25 May