List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:January 21 2011 9:07am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4122)
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@stripped

 4122 Magnus Blåudd	2011-01-21
      ndb
       - Fix problem with 'ha_create_table_from_engine' modifiying the
         strings that db and table_name parameters point to on lowercase
         table name platforms.
         These parameters may point to read only strings and should not be modified.

    modified:
      sql/ha_ndbcluster.cc
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-01-17 12:31:29 +0000
+++ b/sql/ha_ndbcluster.cc	2011-01-21 09:07:51 +0000
@@ -9824,11 +9824,18 @@ static void ndbcluster_drop_database(han
 int ndb_create_table_from_engine(THD *thd, const char *db,
                                  const char *table_name)
 {
+  // Copy db and table_name to stack buffers since functions used by
+  // ha_create_table_from_engine may convert to lowercase on some platforms
+  char db_buf[FN_REFLEN + 1];
+  char table_name_buf[FN_REFLEN + 1];
+  strnmov(db_buf, db, sizeof(db_buf));
+  strnmov(table_name_buf, table_name, sizeof(table_name_buf));
+
   LEX *old_lex= thd->lex, newlex;
   thd->lex= &newlex;
   newlex.current_select= NULL;
   lex_start(thd);
-  int res= ha_create_table_from_engine(thd, db, table_name);
+  int res= ha_create_table_from_engine(thd, db_buf, table_name_buf);
   thd->lex= old_lex;
   return res;
 }

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110121090751-hzu7y4ee5n1b8onc.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4122) Magnus Blåudd21 Jan