diff options
author | unknown <anjuta@arthur.local> | 2006-06-01 12:34:44 +0300 |
---|---|---|
committer | unknown <anjuta@arthur.local> | 2006-06-01 12:34:44 +0300 |
commit | 59a33015b461216c22fdf51585a53c9afecf9bfb (patch) | |
tree | 10eb7910fd2359d5b3c6457f3f9070b48a9eab20 | |
parent | 588082712a50ecc4bc213291c6fe74986ec69c38 (diff) | |
download | mariadb-git-59a33015b461216c22fdf51585a53c9afecf9bfb.tar.gz |
Fixed Bug#19479:mysqldump creates invalid dump.
Only check for FN_DEVCHAR in filenames if FN_DEVCHAR is defined.
This allows to use table names with ":" on non windows platforms.
On Windows platform get an error if you use table name that contains FN_DEVCHAR
include/config-win.h:
Moved FN_DEVCHAR to config-win.h
include/my_global.h:
Moved FN_DEVCHAR to config-win.h
mysql-test/r/create.result:
Added testcase for Bug#19479:mysqldump creates invalid dump
BitKeeper/etc/ignore:
Added sql/share/iso639-2.txt sql/share/fixerrmsg.pl to the ignore list
mysql-test/t/create.test:
Added testcase for Bug#19479:mysqldump creates invalid dump
mysys/mf_fn_ext.c:
Added checking of BASKSLASH_MBTAIL as dirname_part depends on it.
Fixed cast and indentation.
sql/table.cc:
Only check for FN_DEVCHAR in filenames if FN_DEVCHAR is defined.
This allows to use table names with ":" on non windows platforms.
On Windows platform get an error if you use table name that contains FN_DEVCHAR
-rw-r--r-- | .bzrignore | 2 | ||||
-rw-r--r-- | include/config-win.h | 1 | ||||
-rw-r--r-- | include/my_global.h | 1 | ||||
-rw-r--r-- | mysql-test/r/create.result | 14 | ||||
-rw-r--r-- | mysql-test/t/create.test | 15 | ||||
-rw-r--r-- | mysys/mf_fn_ext.c | 6 | ||||
-rw-r--r-- | sql/table.cc | 8 |
7 files changed, 43 insertions, 4 deletions
diff --git a/.bzrignore b/.bzrignore index 80ed7872005..5eb09b07063 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1282,3 +1282,5 @@ extra/yassl/taocrypt/benchmark/benchmark extra/yassl/taocrypt/test/test extra/yassl/testsuite/testsuite client/mysql_upgrade +sql/share/iso639-2.txt +sql/share/fixerrmsg.pl diff --git a/include/config-win.h b/include/config-win.h index 8d937ffed22..75133ddc837 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -384,6 +384,7 @@ inline double ulonglong2double(ulonglong value) #define FN_LIBCHAR '\\' #define FN_ROOTDIR "\\" +#define FN_DEVCHAR ':' #define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ #define FN_NO_CASE_SENCE /* Files are not case-sensitive */ #define OS_FILE_LIMIT 2048 diff --git a/include/my_global.h b/include/my_global.h index 7adf4845984..e7205c94c18 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -599,7 +599,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ #define FN_PARENTDIR ".." /* Parent directory; Must be a string */ -#define FN_DEVCHAR ':' #ifndef FN_LIBCHAR #ifdef __EMX__ diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 27a6c8a9d03..57ec76a0b53 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -773,3 +773,17 @@ Warnings: Warning 1071 Specified key was too long; max key length is 765 bytes insert into t1 values('aaa'); drop table t1; +drop table if exists `about:text`; +create table `about:text` ( +_id int not null auto_increment, +`about:text` varchar(255) not null default '', +primary key (_id) +); +show create table `about:text`; +Table Create Table +about:text CREATE TABLE `about:text` ( + `_id` int(11) NOT NULL auto_increment, + `about:text` varchar(255) NOT NULL default '', + PRIMARY KEY (`_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table `about:text`; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index e22c2b5c426..d1e9818088d 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -674,4 +674,19 @@ create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb insert into t1 values('aaa'); drop table t1; +# +# Bug#19479:mysqldump creates invalid dump +# +--disable_warnings +drop table if exists `about:text`; +--enable_warnings +create table `about:text` ( +_id int not null auto_increment, +`about:text` varchar(255) not null default '', +primary key (_id) +); + +show create table `about:text`; +drop table `about:text`; + # End of 5.0 tests diff --git a/mysys/mf_fn_ext.c b/mysys/mf_fn_ext.c index 9c86a8072ef..d7b1f8c1d61 100644 --- a/mysys/mf_fn_ext.c +++ b/mysys/mf_fn_ext.c @@ -40,14 +40,14 @@ my_string fn_ext(const char *name) DBUG_ENTER("fn_ext"); DBUG_PRINT("mfunkt",("name: '%s'",name)); -#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) +#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) || defined(BASKSLASH_MBTAIL) { char buff[FN_REFLEN]; gpos=(my_string) name+dirname_part(buff,(char*) name); } #else - if (!(gpos=strrchr(name,FNLIBCHAR))) - gpos=name; + if (!(gpos= strrchr(name, FN_LIBCHAR))) + gpos= (my_string) name; #endif pos=strchr(gpos,FN_EXTCHAR); DBUG_RETURN (pos ? pos : strend(gpos)); diff --git a/sql/table.cc b/sql/table.cc index 8e23bea2540..a71435ac0db 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1614,6 +1614,10 @@ bool check_db_name(char *name) if (*name == '/' || *name == '\\' || *name == FN_LIBCHAR || *name == FN_EXTCHAR) return 1; +#ifdef FN_DEVCHAR + if (*name == FN_DEVCHAR) + return 1; +#endif name++; } return last_char_is_space || (uint) (name - start) > NAME_LEN; @@ -1656,6 +1660,10 @@ bool check_table_name(const char *name, uint length) #endif if (*name == '/' || *name == '\\' || *name == FN_EXTCHAR) return 1; +#ifdef FN_DEVCHAR + if (*name == FN_DEVCHAR) + return 1; +#endif name++; } #if defined(USE_MB) && defined(USE_MB_IDENT) |