diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-05-19 16:30:36 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-05-19 22:05:55 +0200 |
commit | 91dfb6141f45aed5cf3fe585d8c5db86f9ddbfe9 (patch) | |
tree | 2a21bd15ac2547c12f0f60a8a5f680f0c996cd9b /mysql-test/t | |
parent | f76a17e355f4ee031f3cabbbd679643d85347834 (diff) | |
parent | c1b5d2801e81443c8ad02823e12d54f662e4c801 (diff) | |
download | mariadb-git-91dfb6141f45aed5cf3fe585d8c5db86f9ddbfe9.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/create_or_replace.test | 25 | ||||
-rw-r--r-- | mysql-test/t/grant.test | 8 | ||||
-rw-r--r-- | mysql-test/t/grant_not_windows.test | 14 | ||||
-rw-r--r-- | mysql-test/t/insert_select.test | 10 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 13 | ||||
-rw-r--r-- | mysql-test/t/mysql.test | 16 | ||||
-rw-r--r-- | mysql-test/t/mysql_cp932.test | 42 |
7 files changed, 110 insertions, 18 deletions
diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test index abf470b62d5..c1441d218cf 100644 --- a/mysql-test/t/create_or_replace.test +++ b/mysql-test/t/create_or_replace.test @@ -396,3 +396,28 @@ CREATE OR REPLACE TABLE t1 AS SELECT f1(); UNLOCK TABLES; DROP FUNCTION f1; DROP TABLE t1; + +--echo # +--echo # MDEV-11129 +--echo # CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() +--echo # references t1 +--echo # + +CREATE OR REPLACE TABLE t1(a INT); +DELIMITER $$; +CREATE FUNCTION f1() RETURNS VARCHAR(16383) +BEGIN + INSERT INTO t1 VALUES(1); + RETURN 'test'; +END; +$$ +DELIMITER ;$$ +--error ER_UPDATE_TABLE_USED +CREATE OR REPLACE TABLE t1 AS SELECT f1(); +LOCK TABLE t1 WRITE; +--error ER_TABLE_NOT_LOCKED +CREATE OR REPLACE TABLE t1 AS SELECT f1(); +UNLOCK TABLES; + +DROP FUNCTION f1; +DROP TABLE t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index a8ddf350b73..51d59844da6 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1568,15 +1568,7 @@ drop database mysqltest1; --echo End of 5.0 tests - -# -# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte -# set names utf8; -grant select on test.* to юзер_юзер@localhost; ---exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()" -revoke all on test.* from юзер_юзер@localhost; -drop user юзер_юзер@localhost; --error ER_WRONG_STRING_LENGTH grant select on test.* to очень_длинный_юзер890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@localhost; set names default; diff --git a/mysql-test/t/grant_not_windows.test b/mysql-test/t/grant_not_windows.test new file mode 100644 index 00000000000..55b09232edc --- /dev/null +++ b/mysql-test/t/grant_not_windows.test @@ -0,0 +1,14 @@ + # UTF8 parameters to mysql client do not work on Windows +--source include/not_windows.inc +--source include/not_embedded.inc + +# +# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte +# +set names utf8; +create user юзер_юзер@localhost; +grant select on test.* to юзер_юзер@localhost; +--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()" +revoke all on test.* from юзер_юзер@localhost; +drop user юзер_юзер@localhost; +set names default; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index bcd87c2688d..385e372bc3b 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -423,3 +423,13 @@ SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size; DROP TABLE t1; --echo End of 5.1 tests + +# +# MDEV-15318 CREATE .. SELECT VALUES produces invalid table structure +# +create table t1 (i int); +create table t2 as select values(i) as a from t1; +show create table t2; +drop table t1, t2; + +--echo End of 5.5 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index cbf12d81cad..77baa695b6d 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1764,6 +1764,19 @@ OPTIMIZE TABLE t1; DROP TABLE t1; # +# Check FLUSH FOR EXPORT +# + +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)) engine=myisam; +INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), + (6,'0'),(7,'0'); +flush tables test.t1 for export; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +insert into t1 values (8,'0'); +unlock tables; +drop table t1; + +# # Check some variables # show variables like 'myisam_block_size'; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 300695612fd..fc2ae849aa6 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -53,14 +53,22 @@ drop table t1; # # Bug#17939 Wrong table format when using UTF8 strings -# ---exec $MYSQL --default-character-set=utf8 --table -e "SELECT 'John Doe' as '__tañgè Ñãmé'" 2>&1 ---exec $MYSQL --default-character-set=utf8 --table -e "SELECT '__tañgè Ñãmé' as 'John Doe'" 2>&1 +write_file $MYSQL_TMP_DIR/mysql_in; +SELECT 'John Doe' as '__tañgè Ñãmé'; +SELECT '__tañgè Ñãmé' as 'John Doe'; +EOF +--exec $MYSQL --default-character-set=utf8 --table < $MYSQL_TMP_DIR/mysql_in 2>&1 +remove_file $MYSQL_TMP_DIR/mysql_in; # # Bug#18265 -- mysql client: No longer right-justifies numeric columns # ---exec $MYSQL -t --default-character-set utf8 test -e "create table t1 (i int, j int, k char(25) charset utf8); insert into t1 (i) values (1); insert into t1 (k) values ('<----------------------->'); insert into t1 (k) values ('<-----'); insert into t1 (k) values ('Τη γλώσσα'); insert into t1 (k) values ('ᛖᚴ ᚷᛖᛏ'); select * from t1; DROP TABLE t1;" +write_file $MYSQL_TMP_DIR/mysql_in; +create table t1 (i int, j int, k char(25) charset utf8); insert into t1 (i) values (1); insert into t1 (k) values ('<----------------------->'); insert into t1 (k) values ('<-----'); insert into t1 (k) values ('Τη γλώσσα'); insert into t1 (k) values ('ᛖᚴ ᚷᛖᛏ'); select * from t1; DROP TABLE t1; +EOF +--exec $MYSQL -t --default-character-set utf8 test < $MYSQL_TMP_DIR/mysql_in +remove_file $MYSQL_TMP_DIR/mysql_in; + # # "DESCRIBE" commands may return strange NULLness flags. diff --git a/mysql-test/t/mysql_cp932.test b/mysql-test/t/mysql_cp932.test index 60a129c3805..8fba5750d89 100644 --- a/mysql-test/t/mysql_cp932.test +++ b/mysql-test/t/mysql_cp932.test @@ -10,13 +10,43 @@ # BUG#16217 - MySQL client misinterprets multi-byte char as escape `\' # +let $mysql_in= $MYSQL_TMP_DIR/mysql_in; + # new command \C or charset ---exec $MYSQL --default-character-set=utf8 test -e "\C cp932 \g" ---exec $MYSQL --default-character-set=cp932 test -e "charset utf8;" +write_file $mysql_in; +\C cp932 \g +EOF +--exec $MYSQL --default-character-set=utf8 test < $mysql_in +remove_file $mysql_in; + +write_file $mysql_in; +charset utf8; +EOF +--exec $MYSQL --default-character-set=cp932 test < $mysql_in +remove_file $mysql_in; # its usage to switch internally in mysql to requested charset ---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select '\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('\'); select * from t1; drop table t1;" ---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select '\'" ---exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select '\'" ---exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select '\'" +write_file $mysql_in; +charset cp932; select '\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('\'); select * from t1; drop table t1; +EOF +--exec $MYSQL --default-character-set=utf8 test < $mysql_in +remove_file $mysql_in; + +write_file $mysql_in; +charset cp932; select '\' +EOF +--exec $MYSQL --default-character-set=utf8 test < $mysql_in +remove_file $mysql_in; + +write_file $mysql_in; +/*charset cp932 */; set character_set_client= cp932; select '\' +EOF +--exec $MYSQL --default-character-set=utf8 test < $mysql_in +remove_file $mysql_in; + +write_file $mysql_in; +/*!\C cp932 */; set character_set_client= cp932; select '\' +EOF +--exec $MYSQL --default-character-set=utf8 test < $mysql_in +remove_file $mysql_in; |