List:Commits« Previous MessageNext Message »
From:Martin Skold Date:February 17 2012 8:57am
Subject:bzr push into mysql-5.1-telco-7.0 branch (Martin.Skold:4863)
View as plain text  
 4863 Martin Skold	2012-02-17 [merge]
      Merge

    modified:
      storage/ndb/src/kernel/vm/mt.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result	2011-10-08 16:56:43 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result	2012-02-17 08:03:56 +0000
@@ -994,4 +994,12 @@ ENGINE=ndb;
 show warnings;
 Level	Code	Message
 drop table t1;
+create table
+abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123(id int
+primary key) engine=ndb;
+ERROR HY000: Can't create table 'test.abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123' (errno: 1059)
+show warnings;
+Level	Code	Message
+Error	1059	Ndb has an internal limit of 63 bytes on the size of schema identifiers
+Error	1005	Can't create table 'test.abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123' (errno: 1059)
 End of 5.1 tests

=== modified file 'mysql-test/suite/ndb/t/ndb_basic.test'
--- a/mysql-test/suite/ndb/t/ndb_basic.test	2011-09-01 18:42:31 +0000
+++ b/mysql-test/suite/ndb/t/ndb_basic.test	2012-02-17 08:03:56 +0000
@@ -837,4 +837,13 @@ ENGINE=ndb;
 show warnings;
 drop table t1;
 
+#
+#Bug #11753491 44940: MYSQLD CRASHES WHEN CREATING A CLUSTER TABLE WITH 64 CHARACTER TABLE NAME
+#
+--error 1005
+create table
+abcdefghijklmnopqrstuvwxyz1234567890bcdefghijklmnopqrstuvwxyz123(id int
+primary key) engine=ndb;
+show warnings;
+
 --echo End of 5.1 tests

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2012-02-13 14:45:39 +0000
+++ b/sql/ha_ndbcluster.cc	2012-02-17 08:03:56 +0000
@@ -8851,6 +8851,19 @@ int ha_ndbcluster::create(const char *na
   DBUG_ASSERT(*fn_rext((char*)name) == 0);
   set_dbname(name);
   set_tabname(name);
+  
+  /*
+    Check that database name and table name will fit within limits
+  */
+  if (strlen(m_dbname) > NDB_MAX_DDL_NAME_BYTESIZE ||
+      strlen(m_tabname) > NDB_MAX_DDL_NAME_BYTESIZE)
+  {
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                        ER_TOO_LONG_IDENT,
+                        "Ndb has an internal limit of %u bytes on the size of schema identifiers", NDB_MAX_DDL_NAME_BYTESIZE);
+    my_errno= ER_TOO_LONG_IDENT;
+    DBUG_RETURN(my_errno);
+  }
 
   if ((my_errno= check_ndb_connection(thd)))
     DBUG_RETURN(my_errno);

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2012-01-31 10:01:22 +0000
+++ b/sql/ha_ndbcluster.h	2012-02-17 08:03:56 +0000
@@ -26,6 +26,10 @@
 #pragma interface                       /* gcc class implementation */
 #endif
 
+/* DDL names have to fit in system table ndb_schema */
+#define NDB_MAX_DDL_NAME_BYTESIZE 63
+#define NDB_MAX_DDL_NAME_BYTESIZE_STR "63"
+
 /* Blob tables and events are internal to NDB and must never be accessed */
 #define IS_NDB_BLOB_PREFIX(A) is_prefix(A, "NDB$BLOB")
 

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2012-02-13 14:45:39 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2012-02-17 08:03:56 +0000
@@ -1396,8 +1396,12 @@ static int ndbcluster_create_schema_tabl
   */
   end= strmov(buf, "CREATE TABLE IF NOT EXISTS "
                    NDB_REP_DB "." NDB_SCHEMA_TABLE
-                   " ( db VARBINARY(63) NOT NULL,"
-                   " name VARBINARY(63) NOT NULL,"
+                   " ( db VARBINARY("
+                   NDB_MAX_DDL_NAME_BYTESIZE_STR
+                   ") NOT NULL,"
+                   " name VARBINARY("
+                   NDB_MAX_DDL_NAME_BYTESIZE_STR
+                   ") NOT NULL,"
                    " slock BINARY(32) NOT NULL,"
                    " query BLOB NOT NULL,"
                    " node_id INT UNSIGNED NOT NULL,"

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (Martin.Skold:4863) Martin Skold17 Feb