summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-03-07 13:05:24 +0400
committerunknown <bar@mysql.com>2006-03-07 13:05:24 +0400
commit06691fc3c6a7310669c236f4c533ffeafee3a754 (patch)
tree20c7873bffe143edef4ab5cb510e91b327d00854 /sql/table.cc
parent38ccc8c2c1fffe1445aed095dc16ae78fa058095 (diff)
downloadmariadb-git-06691fc3c6a7310669c236f4c533ffeafee3a754.tar.gz
Bug#17142 Crash if create with encoded name
upgrade.result, upgrade.test: Adding test case. table.cc: Don't try to open a table with old-formatted name, if the table name contains "@" character. This is to avoid mixing two different names to each other. Thanks Monty for suggesting this fix. sql/table.cc: Bug#17142 Crash if create with encoded name Don't try to open a table with old-formatted name, if the table name contains "@" character. This is to avoid mixing two different names to each other. mysql-test/t/upgrade.test: Adding test case. mysql-test/r/upgrade.result: Adding test case.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index d6a715ae1b4..d0d8e6ad1b1 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -298,6 +298,9 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
strxmov(path, share->normalized_path.str, reg_ext, NullS);
if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
{
+ if (strchr(share->table_name.str, '@'))
+ goto err_not_open;
+
/* Try unecoded 5.0 name */
uint length;
strxnmov(path, sizeof(path)-1,