From: Date: March 7 2006 10:05am Subject: bk commit into 5.1 tree (bar:1.2150) BUG#17142 List-Archive: http://lists.mysql.com/commits/3536 X-Bug: 17142 Message-Id: <200603070905.k2795Xn7082524@bar.intranet.mysql.r18.ru> Below is the list of changes that have just been committed into a local 5.1 repository of bar. When bar does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2150 06/03/07 13:05:24 bar@stripped +3 -0 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. mysql-test/r/upgrade.result 1.3 06/03/07 13:04:25 bar@stripped +16 -0 Adding test case. mysql-test/t/upgrade.test 1.3 06/03/07 13:04:21 bar@stripped +18 -0 Adding test case. sql/table.cc 1.212 06/03/07 13:02:25 bar@stripped +3 -0 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. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: bar # Host: bar.intranet.mysql.r18.ru # Root: /usr/home/bar/mysql-5.1-new.b17142 --- 1.211/sql/table.cc 2006-03-03 15:03:23 +04:00 +++ 1.212/sql/table.cc 2006-03-07 13:02:25 +04:00 @@ -298,6 +298,9 @@ 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, --- 1.2/mysql-test/r/upgrade.result 2006-02-26 18:03:40 +04:00 +++ 1.3/mysql-test/r/upgrade.result 2006-03-07 13:04:25 +04:00 @@ -41,3 +41,19 @@ t-1 drop database `mysqltest1`; drop database `mysqltest-1`; +drop table if exists `txu@0023P@0023p1`; +drop table if exists `txu#P#p1`; +create table `txu#P#p1` (s1 int); +insert into `txu#P#p1` values (1); +select * from `txu@0023P@0023p1`; +ERROR 42S02: Table 'test.txu@0023P@0023p1' doesn't exist +create table `txu@0023P@0023p1` (s1 int); +insert into `txu@0023P@0023p1` values (2); +select * from `txu@0023P@0023p1`; +s1 +2 +select * from `txu#P#p1`; +s1 +1 +drop table `txu@0023P@0023p1`; +drop table `txu#P#p1`; --- 1.2/mysql-test/t/upgrade.test 2006-02-26 18:03:40 +04:00 +++ 1.3/mysql-test/t/upgrade.test 2006-03-07 13:04:21 +04:00 @@ -29,3 +29,21 @@ show tables in `mysqltest-1`; drop database `mysqltest1`; drop database `mysqltest-1`; + +# +# Bug#17142: Crash if create with encoded name +# +--disable_warnings +drop table if exists `txu@0023P@0023p1`; +drop table if exists `txu#P#p1`; +--enable_warnings +create table `txu#P#p1` (s1 int); +insert into `txu#P#p1` values (1); +--error 1146 +select * from `txu@0023P@0023p1`; +create table `txu@0023P@0023p1` (s1 int); +insert into `txu@0023P@0023p1` values (2); +select * from `txu@0023P@0023p1`; +select * from `txu#P#p1`; +drop table `txu@0023P@0023p1`; +drop table `txu#P#p1`;