List:Commits« Previous MessageNext Message »
From:Martin Skold Date:April 16 2010 8:12am
Subject:bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3177) Bug#33158
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-6.3/

 3177 Martin Skold	2010-04-16
      Bug#33158 NDB table name problem(sensitive/insensitive): Using table_alias_charset
      for comparing table names, added tests
      modified:
        mysql-test/suite/ndb/r/ndb_cache.result
        mysql-test/suite/ndb/r/ndb_charset.result
        mysql-test/suite/ndb/t/ndb_cache.test
        mysql-test/suite/ndb/t/ndb_charset.test
        sql/ha_ndbcluster.cc

=== modified file 'mysql-test/suite/ndb/r/ndb_cache.result'
--- a/mysql-test/suite/ndb/r/ndb_cache.result	2008-10-21 22:53:32 +0000
+++ b/mysql-test/suite/ndb/r/ndb_cache.result	2010-04-16 08:12:51 +0000
@@ -367,4 +367,15 @@ drop table t1;
 alter tablespace tbsp drop datafile 'mydatafile.fil' engine ndb;
 drop tablespace tbsp engine ndb;
 drop logfile group lfg engine ndb;
+reset query cache;
+flush status;
+pk	a	b	c
+1	2	3	First row
+pk	a	b	c
+1	2	3	First row
+pk	a	b	c
+1	2	3	First row
+show status like "Qcache_hits";
+Variable_name	Value
+Qcache_hits	1
 SET GLOBAL query_cache_size=0;

=== modified file 'mysql-test/suite/ndb/r/ndb_charset.result'
--- a/mysql-test/suite/ndb/r/ndb_charset.result	2007-12-07 10:05:19 +0000
+++ b/mysql-test/suite/ndb/r/ndb_charset.result	2010-04-16 08:12:51 +0000
@@ -318,3 +318,7 @@ select * from t1;
 a
 aaabb
 drop table t1;
+create table t1(a int) engine = ndbcluster;
+create table T1(a int) engine = ndbcluster;
+drop table T1;
+drop table t1;

=== modified file 'mysql-test/suite/ndb/t/ndb_cache.test'
--- a/mysql-test/suite/ndb/t/ndb_cache.test	2008-10-21 23:03:34 +0000
+++ b/mysql-test/suite/ndb/t/ndb_cache.test	2010-04-16 08:12:51 +0000
@@ -242,6 +242,42 @@ drop logfile group lfg engine ndb;
 
 # end of tests for bug#39395
 
+# bug#33158
+# bug#33158 NDB table name problem(sensitive/insensitive)
+# Check that tables with same letters, but different case
+# don't conflict in query cache
+reset query cache;
+flush status;
+disable_query_log;
+if (`SELECT @@lower_case_table_names = 0`)
+{
+  CREATE TABLE t1 ( pk int not null primary key,
+  a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
+  insert into t1 value (1, 2, 3, 'First row');
+  select * from t1;
+  CREATE TABLE T1 ( pk int not null primary key,
+  a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
+  insert into T1 value (1, 2, 3, 'First row');
+  select * from T1;
+  select * from T1;
+  drop table t1,T1;
+}
+if (`SELECT @@lower_case_table_names <> 0`)
+{
+  CREATE TABLE t1 ( pk int not null primary key,
+  a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
+  insert into t1 value (1, 2, 3, 'First row');
+  select * from t1;
+  CREATE TABLE tt1 ( pk int not null primary key,
+  a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
+  insert into tt1 value (1, 2, 3, 'First row');
+  select * from tt1;
+  select * from tt1;
+  drop table t1,tt1;
+}
+enable_query_log;
+show status like "Qcache_hits";
+
 SET GLOBAL query_cache_size=0;
 
 

=== modified file 'mysql-test/suite/ndb/t/ndb_charset.test'
--- a/mysql-test/suite/ndb/t/ndb_charset.test	2007-11-29 10:29:35 +0000
+++ b/mysql-test/suite/ndb/t/ndb_charset.test	2010-04-16 08:12:51 +0000
@@ -253,4 +253,22 @@ replace into t1 set a = 'aaabb';
 select * from t1;
 drop table t1;
 
+# bug#33158 NDB table name problem(sensitive/insensitive)
+# Check that tables with same letters, but different case
+# don't conflict
+create table t1(a int) engine = ndbcluster;
+
+if (`SELECT @@lower_case_table_names = 0`)
+{
+  create table T1(a int) engine = ndbcluster;
+  drop table T1;
+}
+if (`SELECT @@lower_case_table_names <> 0`)
+{
+  --echo create table T1(a int) engine = ndbcluster;
+  --echo drop table T1;
+}
+drop table t1;
+
+
 # End of 4.1 tests

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2010-03-01 19:26:45 +0000
+++ b/sql/ha_ndbcluster.cc	2010-04-16 08:12:51 +0000
@@ -667,7 +667,7 @@ Thd_ndb::Thd_ndb()
   m_error_code= 0;
   query_state&= NDB_QUERY_NORMAL;
   options= 0;
-  (void) hash_init(&open_tables, &my_charset_bin, 5, 0, 0,
+  (void) hash_init(&open_tables, table_alias_charset, 5, 0, 0,
                    (hash_get_key)thd_ndb_share_get_key, 0, 0);
   m_unsent_bytes= 0;
   m_execute_count= 0;
@@ -8712,9 +8712,9 @@ int ndbcluster_table_exists_in_engine(ha
   for (uint i= 0 ; i < list.count ; i++)
   {
     NdbDictionary::Dictionary::List::Element& elmt= list.elements[i];
-    if (my_strcasecmp(system_charset_info, elmt.database, db))
+    if (my_strcasecmp(table_alias_charset, elmt.database, db))
       continue;
-    if (my_strcasecmp(system_charset_info, elmt.name, name))
+    if (my_strcasecmp(table_alias_charset, elmt.name, name))
       continue;
     DBUG_PRINT("info", ("Found table"));
     DBUG_RETURN(HA_ERR_TABLE_EXIST);
@@ -8996,7 +8996,7 @@ int ndbcluster_find_files(handlerton *ht
                         NdbDictionary::Object::UserTable) != 0)
     ERR_RETURN(dict->getNdbError());
 
-  if (hash_init(&ndb_tables, system_charset_info,list.count,0,0,
+  if (hash_init(&ndb_tables, table_alias_charset,list.count,0,0,
                 (hash_get_key)tables_get_key,0,0))
   {
     DBUG_PRINT("error", ("Failed to init HASH ndb_tables"));
@@ -9342,7 +9342,7 @@ static int ndbcluster_init(void *p)
     goto ndbcluster_init_error;
   }
 
-  (void) hash_init(&ndbcluster_open_tables,system_charset_info,32,0,0,
+  (void) hash_init(&ndbcluster_open_tables,table_alias_charset,32,0,0,
                    (hash_get_key) ndbcluster_get_key,0,0);
   /* start the ndb injector thread */
   if (ndbcluster_binlog_start())

Thread
bzr commit into mysql-5.1-telco-6.3 branch (Martin.Skold:3177) Bug#33158Martin Skold16 Apr