3817 Martin Skold 2012-02-17 [merge]
Merge from 7.1
modified:
mysql-test/suite/ndb/r/ndb_basic.result
mysql-test/suite/ndb/t/ndb_basic.test
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.h
sql/ha_ndbcluster_binlog.cc
3816 Jonas Oreland 2012-02-17 [merge]
ndb - merge 71 to 72
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 2012-01-10 08:53:25 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result 2012-02-17 10:27:55 +0000
@@ -1001,4 +1001,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
+Warning 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 2012-01-10 08:53:25 +0000
+++ b/mysql-test/suite/ndb/t/ndb_basic.test 2012-02-17 10:27:55 +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 21:10:43 +0000
+++ b/sql/ha_ndbcluster.cc 2012-02-17 10:27:55 +0000
@@ -9274,6 +9274,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)
+ {
+ my_errno= ER_TOO_LONG_IDENT;
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TOO_LONG_IDENT,
+ "Ndb has an internal limit of %u bytes on the size of schema identifiers", NDB_MAX_DDL_NAME_BYTESIZE);
+ 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 11:11:20 +0000
+++ b/sql/ha_ndbcluster.h 2012-02-17 10:27:55 +0000
@@ -21,6 +21,10 @@
*/
+/* 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 21:10:43 +0000
+++ b/sql/ha_ndbcluster_binlog.cc 2012-02-17 10:27:55 +0000
@@ -1022,8 +1022,12 @@ ndb_schema_table__create(THD *thd)
STRING_WITH_LEN("mysql"),
STRING_WITH_LEN("ndb_schema"),
// table_definition
- "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.5-cluster-7.2 branch (Martin.Skold:3816 to 3817) | Martin Skold | 20 Feb |