summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2008-12-24 19:09:00 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2008-12-24 19:09:00 +0400
commit15015b59e4102babc2fa8a92a3a5b07528cfbeaf (patch)
tree475a047c1e31f86dfbf2d3335d97d22d275924fa
parent853f4ba37b8434576bdb7d0b13d81573eaaa8742 (diff)
parent65c3d37111c510f544196c6d57b46674a80ef6d7 (diff)
downloadmariadb-git-15015b59e4102babc2fa8a92a3a5b07528cfbeaf.tar.gz
5.0-bugteam->5.1-bugteam merge
-rw-r--r--mysql-test/r/lowercase_utf8.result9
-rw-r--r--mysql-test/t/lowercase_utf8-master.opt4
-rw-r--r--mysql-test/t/lowercase_utf8.test9
-rw-r--r--sql/sql_show.cc18
4 files changed, 36 insertions, 4 deletions
diff --git a/mysql-test/r/lowercase_utf8.result b/mysql-test/r/lowercase_utf8.result
new file mode 100644
index 00000000000..043226e1f64
--- /dev/null
+++ b/mysql-test/r/lowercase_utf8.result
@@ -0,0 +1,9 @@
+set names utf8;
+create table `Ö` (id int);
+show tables from test like 'Ö';
+Tables_in_test (Ö)
+show tables from test like 'ö';
+Tables_in_test (ö)
+drop table `Ö`;
diff --git a/mysql-test/t/lowercase_utf8-master.opt b/mysql-test/t/lowercase_utf8-master.opt
new file mode 100644
index 00000000000..1b70aa33023
--- /dev/null
+++ b/mysql-test/t/lowercase_utf8-master.opt
@@ -0,0 +1,4 @@
+--lower-case-table-names=1 --character-set-server=utf8
+
+
+
diff --git a/mysql-test/t/lowercase_utf8.test b/mysql-test/t/lowercase_utf8.test
new file mode 100644
index 00000000000..01b154598fd
--- /dev/null
+++ b/mysql-test/t/lowercase_utf8.test
@@ -0,0 +1,9 @@
+#
+# Bug#25830 SHOW TABLE STATUS behaves differently depending on table name
+#
+set names utf8;
+create table `Ö` (id int);
+show tables from test like 'Ö';
+show tables from test like 'ö';
+drop table `Ö`;
+
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 0128fd43d28..7b96aaf72fe 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -468,11 +468,18 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint col_access=thd->col_access;
#endif
+ uint wild_length= 0;
TABLE_LIST table_list;
DBUG_ENTER("find_files");
- if (wild && !wild[0])
- wild=0;
+ if (wild)
+ {
+ if (!wild[0])
+ wild= 0;
+ else
+ wild_length= strlen(wild);
+ }
+
bzero((char*) &table_list,sizeof(table_list));
@@ -536,8 +543,11 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
{
if (lower_case_table_names)
{
- if (wild_case_compare(files_charset_info, uname, wild))
- continue;
+ if (my_wildcmp(files_charset_info,
+ uname, uname + file_name_len,
+ wild, wild + wild_length,
+ wild_prefix, wild_one, wild_many))
+ continue;
}
else if (wild_compare(uname, wild, 0))
continue;