diff options
author | unknown <sergefp@mysql.com> | 2004-08-29 19:44:28 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2004-08-29 19:44:28 +0400 |
commit | 02d3c022814a524a7af8cb2abe0573bb1613ff5d (patch) | |
tree | e1775a2e1fbf4deebe6559971306e225ae08f419 | |
parent | ebf4ce0501486f5eba7b69fe77fb1c49bbd22763 (diff) | |
download | mariadb-git-02d3c022814a524a7af8cb2abe0573bb1613ff5d.tar.gz |
Fix for BUG#5242: Made SQL Syntax Prepared Statement names case-insensitive.
mysql-test/r/ps.result:
Testcase for BUG#5242
mysql-test/t/ps.test:
Testcase for BUG#5242
-rw-r--r-- | mysql-test/r/ps.result | 18 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 21 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 |
3 files changed, 40 insertions, 1 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 98095930669..e161904cd6f 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -241,3 +241,21 @@ prepare stmt1 from "select * from t1 into outfile 'f1.txt'"; execute stmt1; deallocate prepare stmt1; drop table t1; +prepare stmt1 from 'select 1'; +prepare STMT1 from 'select 2'; +execute sTmT1; +2 +2 +deallocate prepare StMt1; +deallocate prepare Stmt1; +ERROR HY000: Unknown prepared statement handler (Stmt1) given to DEALLOCATE PREPARE +set names utf8; +prepare `ü` from 'select 1234'; +execute `ü` ; +1234 +1234 +set names latin1; +execute `ü`; +1234 +1234 +set names default; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 8b9704f2a06..e54bf8076e0 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -240,3 +240,24 @@ prepare stmt1 from "select * from t1 into outfile 'f1.txt'"; execute stmt1; deallocate prepare stmt1; drop table t1; + +# +# BUG#5242 "Prepared statement names are case sensitive" +# +prepare stmt1 from 'select 1'; +prepare STMT1 from 'select 2'; +execute sTmT1; +deallocate prepare StMt1; + +--error 1243 +deallocate prepare Stmt1; + +# also check that statement names are in right charset. +set names utf8; +prepare `ü` from 'select 1234'; +execute `ü` ; +set names latin1; +execute `ü`; +set names default; + + diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 26e2cebb909..c7d8e81d11b 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1503,7 +1503,7 @@ Statement_map::Statement_map() : hash_init(&st_hash, default_charset_info, START_STMT_HASH_SIZE, 0, 0, get_statement_id_as_hash_key, delete_statement_as_hash_key, MYF(0)); - hash_init(&names_hash, &my_charset_bin, START_NAME_HASH_SIZE, 0, 0, + hash_init(&names_hash, system_charset_info, START_NAME_HASH_SIZE, 0, 0, (hash_get_key) get_stmt_name_hash_key, NULL,MYF(0)); } |