summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV Narayanan <v.narayanan@sun.com>2009-12-11 12:31:16 +0530
committerV Narayanan <v.narayanan@sun.com>2009-12-11 12:31:16 +0530
commite3c1ee24fc0128915a3d09ac82c433ab1ae186ee (patch)
tree4ef6e2cd8d9f1279c79a051934fe9ad08d986c35
parentba71a9e5d68f134a6964fe5af1833b1aa6c79590 (diff)
downloadmariadb-git-e3c1ee24fc0128915a3d09ac82c433ab1ae186ee.tar.gz
Bug#49329 example (and other) engines use wrong collation for open tables hash
This fix changes the character set used within the IBMDB2I handler to hash table names to information about open tables. Previously, tables with names that differed only in letter case would hash to the same data structure. This caused incorrect behavior or errors when two such tables were in use simultaneously. mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result: Bug#49329 example (and other) engines use wrong collation for open tables hash Result file for the test case. mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test: Bug#49329 example (and other) engines use wrong collation for open tables hash Test case for the bug fix. storage/ibmdb2i/ha_ibmdb2i.cc: Bug#49329 example (and other) engines use wrong collation for open tables hash change the character set used within the IBMDB2I handler to hash table names to information about open tables.
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result9
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test10
-rw-r--r--storage/ibmdb2i/ha_ibmdb2i.cc2
3 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result
new file mode 100644
index 00000000000..d5bfc2579fd
--- /dev/null
+++ b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result
@@ -0,0 +1,9 @@
+create table ABC (i int) engine=ibmdb2i;
+insert into ABC values(1);
+create table abc (i int) engine=ibmdb2i;
+insert into abc values (2);
+select * from ABC;
+i
+1
+drop table ABC;
+drop table abc;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test
new file mode 100644
index 00000000000..615df284d8f
--- /dev/null
+++ b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test
@@ -0,0 +1,10 @@
+source suite/ibmdb2i/include/have_ibmdb2i.inc;
+source include/have_case_sensitive_file_system.inc;
+
+create table ABC (i int) engine=ibmdb2i;
+insert into ABC values(1);
+create table abc (i int) engine=ibmdb2i;
+insert into abc values (2);
+select * from ABC;
+drop table ABC;
+drop table abc;
diff --git a/storage/ibmdb2i/ha_ibmdb2i.cc b/storage/ibmdb2i/ha_ibmdb2i.cc
index 0fc2d1e83dc..39096be7848 100644
--- a/storage/ibmdb2i/ha_ibmdb2i.cc
+++ b/storage/ibmdb2i/ha_ibmdb2i.cc
@@ -284,7 +284,7 @@ static int ibmdb2i_init_func(void *p)
was_ILE_inited = false;
ibmdb2i_hton= (handlerton *)p;
VOID(pthread_mutex_init(&ibmdb2i_mutex,MY_MUTEX_INIT_FAST));
- (void) hash_init(&ibmdb2i_open_tables,system_charset_info,32,0,0,
+ (void) hash_init(&ibmdb2i_open_tables,table_alias_charset,32,0,0,
(hash_get_key) ibmdb2i_get_key,0,0);
ibmdb2i_hton->state= SHOW_OPTION_YES;