diff options
author | unknown <bar@mysql.com> | 2005-12-31 09:01:26 +0400 |
---|---|---|
committer | unknown <bar@mysql.com> | 2005-12-31 09:01:26 +0400 |
commit | 9c7412cae85e2fde1959902c574241308cc71ecd (patch) | |
tree | 6a3476c826545341821fbccb1f42ba381c5ca30a /mysql-test | |
parent | 80d3e73466c170f09618fffe1ea800274ea49c3f (diff) | |
download | mariadb-git-9c7412cae85e2fde1959902c574241308cc71ecd.tar.gz |
WL#1324 table name to file name encoding
- Encoding itself, implemented as a charset
"filename". Originally planned to use '.'
as an escape character, but now changed to '@'
for two reasons: "ls" does not return
file names starting with '.' considering them
as a kind of hidden files; some platforms
do not allow several dots in a file name.
- replacing many calls of my_snprintf() and
strnxmov() to the new build_table_filename().
- Adding MY_APPEND_EXT mysys flag, to append
an extention rather that replace it.
- Replacing all numeric constants in fn_format
flag arguments to their mysys definitions, e.g.
MY_UNPACK_FILENAME,
- Predictability in several function/methods:
when a table name can appear with or withot .frm
extension. Some functions/methods were changed
so accept names strictly with .frm, other - strictly
without .frm extensions. Several DBUG_ASSERTs were
added to check whether an extension is passed.
Many files:
table name to file name encoding
mysql_priv.h:
Prototypes for new table name encoding tools.
ctype-utf8.c:
Implementing "filename" charset for
table name to file name encoding.
row0mysql.c:
Fixing table name prefix.
mf_format.c:
Adding MY_APPEND_EXT processing.
Many files:
Fixing tests.
my_sys.h:
Adding new flag to append rather than replace an extension.
m_ctype.h:
Adding "filename" charset definition.
include/m_ctype.h:
Adding "filename" charset definition.
include/my_sys.h:
Adding new flag to append rather than replace an extension.
mysql-test/t/alter_table.test:
Fixing tests.
mysql-test/t/create.test:
Fixing tests.
mysql-test/t/show_check.test:
Fixing tests.
mysql-test/r/alter_table.result:
Fixing tests.
mysql-test/r/create.result:
Fixing tests.
mysql-test/r/mysqldump.result:
Fixing tests.
mysys/mf_format.c:
Adding MY_APPEND_EXT processing.
sql/discover.cc:
table name to file name encoding
sql/ha_berkeley.cc:
table name to file name encoding
sql/ha_innodb.cc:
table name to file name encoding
sql/ha_myisam.cc:
table name to file name encoding
sql/ha_myisammrg.cc:
table name to file name encoding
sql/ha_ndbcluster.cc:
table name to file name encoding
sql/ha_partition.cc:
table name to file name encoding
sql/handler.cc:
table name to file name encoding.
sql/init.cc:
table name to file name encoding
sql/mysqld.cc:
table name to file name encoding
sql/parse_file.cc:
table name to file name encoding
sql/sql_acl.cc:
table name to file name encoding
sql/sql_base.cc:
table name to file name encoding
sql/sql_db.cc:
table name to file name encoding
sql/sql_delete.cc:
table name to file name encoding
sql/sql_rename.cc:
table name to file name encoding
sql/sql_show.cc:
table name to file name encoding
sql/sql_table.cc:
table name to file name encoding
sql/sql_trigger.cc:
table name to file name encoding
sql/sql_view.cc:
table name to file name encoding
sql/strfunc.cc:
table name to file name encoding
sql/table.cc:
table name to file name encoding
sql/unireg.cc:
table name to file name encoding
storage/innobase/row/row0mysql.c:
Fixing table name prefix.
,
storage/myisam/mi_create.c:
table name to file name encoding
storage/myisam/mi_delete_table.c:
table name to file name encoding
storage/myisam/mi_open.c:
table name to file name encoding
storage/myisam/mi_rename.c:
table name to file name encoding
strings/ctype-utf8.c:
Implementing "filename" charset for
table name to file name encoding.
sql/mysql_priv.h:
Prototypes for new table name encoding tools.
storage/myisammrg/myrg_create.c:
table name to file name encoding
storage/myisammrg/myrg_open.c:
table name to file name encoding
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/alter_table.result | 8 | ||||
-rw-r--r-- | mysql-test/r/create.result | 11 | ||||
-rw-r--r-- | mysql-test/r/mysqldump.result | 2 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 38 | ||||
-rw-r--r-- | mysql-test/t/alter_table.test | 4 | ||||
-rw-r--r-- | mysql-test/t/create.test | 7 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 52 |
7 files changed, 77 insertions, 45 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 5b40b250786..e218e008525 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -373,10 +373,10 @@ t1 0 PRIMARY 2 User A 0 NULL NULL BTREE t1 1 Host 1 Host A NULL NULL NULL BTREE disabled DROP TABLE t1; create table t1 (a int); -alter table t1 rename to `t1\\`; -ERROR 42000: Incorrect table name 't1\\' -rename table t1 to `t1\\`; -ERROR 42000: Incorrect table name 't1\\' +alter table t1 rename to ``; +ERROR 42000: Incorrect table name '' +rename table t1 to ``; +ERROR 42000: Incorrect table name '' drop table t1; drop table if exists t1, t2; Warnings: diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index ae2cbfffba7..7b15785a042 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -41,7 +41,14 @@ ERROR 42000: Incorrect table definition; there can be only one auto column and i create table not_existing_database.test (a int); ERROR 42000: Unknown database 'not_existing_database' create table `a/a` (a int); -ERROR 42000: Incorrect table name 'a/a' +show create table `a/a`; +Table Create Table +a/a CREATE TABLE `a/a` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t1 like `a/a`; +drop table `a/a`; +drop table `t1`; create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); @@ -360,8 +367,6 @@ create table t3 like non_existing_table; ERROR 42S02: Unknown table 'non_existing_table' create temporary table t3 like t1; ERROR 42S01: Table 't3' already exists -create table t3 like `a/a`; -ERROR 42000: Incorrect table name 'a/a' drop table t1, t2, t3; drop table t3; drop database mysqltest; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index e3182d81d46..d6791d9e245 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1627,7 +1627,7 @@ mysqldump: Couldn't find table: "T_" test_sequence ------ Testing with illegal database names ------ mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database -mysqldump: Got error: 1102: Incorrect database name 'mysqld\ump_test_db' when selecting the database +mysqldump: Got error: 1049: Unknown database 'mysqld\ump_test_db' when selecting the database drop table t1, t2, t3; drop database mysqldump_test_db; use test; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 31d318be141..e3487b1bdf6 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -274,8 +274,42 @@ f float(3,3) YES NULL drop table t1; SET @old_sql_mode= @@sql_mode, sql_mode= ''; SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF; -CREATE TABLE `a/b` (i INT); -ERROR 42000: Incorrect table name 'a/b' +CREATE TABLE ```ab``cd``` (i INT); +SHOW CREATE TABLE ```ab``cd```; +Table Create Table +`ab`cd` CREATE TABLE ```ab``cd``` ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE ```ab``cd```; +CREATE TABLE ```ab````cd``` (i INT); +SHOW CREATE TABLE ```ab````cd```; +Table Create Table +`ab``cd` CREATE TABLE ```ab````cd``` ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE ```ab````cd```; +CREATE TABLE ```a` (i INT); +SHOW CREATE TABLE ```a`; +Table Create Table +`a CREATE TABLE ```a` ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE ```a`; +CREATE TABLE `a.1` (i INT); +SHOW CREATE TABLE `a.1`; +Table Create Table +a.1 CREATE TABLE `a.1` ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE `a.1`; +SET sql_mode= 'ANSI_QUOTES'; +CREATE TABLE """a" (i INT); +SHOW CREATE TABLE """a"; +Table Create Table +"a CREATE TABLE """a" ( + i int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE """a"; SET sql_mode= ''; SET sql_quote_show_create= OFF; CREATE TABLE t1 (i INT); diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 90109c17b62..3cddd752763 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -232,9 +232,9 @@ DROP TABLE t1; # create table t1 (a int); --error 1103 -alter table t1 rename to `t1\\`; +alter table t1 rename to ``; --error 1103 -rename table t1 to `t1\\`; +rename table t1 to ``; drop table t1; # diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 4e99b0c4b8b..b61dd6add84 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -41,8 +41,11 @@ create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null -- error 1049 create table not_existing_database.test (a int); ---error 1103 create table `a/a` (a int); +show create table `a/a`; +create table t1 like `a/a`; +drop table `a/a`; +drop table `t1`; --error 1103 create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); --error 1059 @@ -304,8 +307,6 @@ create table non_existing_database.t1 like t1; create table t3 like non_existing_table; --error 1050 create temporary table t3 like t1; ---error 1103 -create table t3 like `a/a`; drop table t1, t2, t3; drop table t3; drop database mysqltest; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index f263b21f99a..32cd9d7db39 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -162,33 +162,28 @@ drop table t1; SET @old_sql_mode= @@sql_mode, sql_mode= ''; SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF; -######### hook for WL#1324 # ---error 1103 -CREATE TABLE `a/b` (i INT); -# the above test should WORK when WL#1324 is done, -# it should be removed and -# the following part should be uncommented then -######################################################### -# begin of part that must be uncommented when WL#1324 is done -######################################################### -#CREATE TABLE ```ab``cd``` (i INT); -#SHOW CREATE TABLE ```ab``cd```; -#DROP TABLE ```ab``cd```; - -#CREATE TABLE ```ab````cd``` (i INT); -#SHOW CREATE TABLE ```ab````cd```; -#DROP TABLE ```ab````cd```; -# -#CREATE TABLE ```a` (i INT); -#SHOW CREATE TABLE ```a`; -#DROP TABLE ```a`; -# -#SET sql_mode= 'ANSI_QUOTES'; -# -#CREATE TABLE """a" (i INT); -#SHOW CREATE TABLE """a"; -#DROP TABLE """a"; -# +CREATE TABLE ```ab``cd``` (i INT); +SHOW CREATE TABLE ```ab``cd```; +DROP TABLE ```ab``cd```; + +CREATE TABLE ```ab````cd``` (i INT); +SHOW CREATE TABLE ```ab````cd```; +DROP TABLE ```ab````cd```; + +CREATE TABLE ```a` (i INT); +SHOW CREATE TABLE ```a`; +DROP TABLE ```a`; + +CREATE TABLE `a.1` (i INT); +SHOW CREATE TABLE `a.1`; +DROP TABLE `a.1`; + +SET sql_mode= 'ANSI_QUOTES'; + +CREATE TABLE """a" (i INT); +SHOW CREATE TABLE """a"; +DROP TABLE """a"; + #Bug #4374 SHOW TABLE STATUS FROM ignores collation_connection #set names latin1; #create database `ä`; @@ -196,9 +191,6 @@ CREATE TABLE `a/b` (i INT); #--replace_column 7 # 8 # 9 # #show table status from `ä` LIKE 'ä'; #drop database `ä`; -######################################################### -# end of part that must be uncommented when WL#1324 is done -######################################################### # to test quotes around keywords.. : |