diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2008-10-02 13:10:06 +0500 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2008-10-02 13:10:06 +0500 |
commit | 1ce81aac15f0e7a89aef78f8e25ec7976f37972c (patch) | |
tree | 0c7ed2ea227afd90471853f9cc4cc08c79549230 /mysql-test/r | |
parent | d3e317d16befe9e6d7ade3e0527dca10609577ad (diff) | |
parent | 652565d3622d2c6a81313aa6faf5e44fd2c9d57b (diff) | |
download | mariadb-git-1ce81aac15f0e7a89aef78f8e25ec7976f37972c.tar.gz |
merge
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/distinct.result | 59 | ||||
-rw-r--r-- | mysql-test/r/federated.result | 70 | ||||
-rw-r--r-- | mysql-test/r/loaddata.result | 120 | ||||
-rw-r--r-- | mysql-test/r/mysqldump.result | 6 | ||||
-rw-r--r-- | mysql-test/r/sp-error.result | 7 | ||||
-rw-r--r-- | mysql-test/r/sp.result | 10 |
6 files changed, 240 insertions, 32 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 8cfe5aa78b5..114d3088fe8 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -608,6 +608,65 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a; a a DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20) +default NULL); +INSERT INTO t1 VALUES (1,1,'ORANGE'); +INSERT INTO t1 VALUES (2,2,'APPLE'); +INSERT INTO t1 VALUES (3,2,'APPLE'); +INSERT INTO t1 VALUES (4,3,'PEAR'); +SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name = +'APPLE'; +SELECT @v1, @v2; +@v1 @v2 +2 APPLE +SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id, +fruit_name HAVING fruit_name = 'APPLE'; +SELECT @v3, @v4; +@v3 @v4 +2 APPLE +SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE +fruit_name = 'APPLE'; +SELECT @v5, @v6, @v7, @v8; +@v5 @v6 @v7 @v8 +3 PEAR 3 PEAR +SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1 +WHERE fruit_name = 'APPLE'; +SELECT @v5, @v6, @v7, @v8, @v9, @v10; +@v5 @v6 @v7 @v8 @v9 @v10 +3 PEAR 3 PEAR 5 PEARAPPLE +SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO +@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE'; +SELECT @v11, @v12, @v13, @v14; +@v11 @v12 @v13 @v14 +6 PEARPEAR 6 PEARPEAR +SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE'; +SELECT @v15, @v16; +@v15 @v16 +6 PEARPEAR +SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name = +'APPLE'; +SELECT @v17, @v18; +@v17 @v18 +4 Bob +DROP TABLE IF EXISTS t2; +CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20) +default NULL); +SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE +'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE'; +LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2; +SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE +'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE'; +LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2; +SELECT @v19, @v20; +@v19 @v20 +2 APPLE +SELECT * FROM t2; +fruit_id fruit_name +2 APPLE +2 APPLE +DROP TABLE t1; +DROP TABLE t2; CREATE TABLE t1 (a CHAR(1)); INSERT INTO t1 VALUES('A'), (0); SELECT a FROM t1 WHERE a=0; diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 2c001a9e860..45b615864ac 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -9,6 +9,10 @@ DROP DATABASE IF EXISTS federated; CREATE DATABASE federated; DROP DATABASE IF EXISTS federated; CREATE DATABASE federated; +SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; +SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; DROP TABLE IF EXISTS federated.t1; Warnings: Note 1051 Unknown table 't1' @@ -83,7 +87,7 @@ t2 CREATE TABLE `t2` ( ) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1' INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); -SELECT * FROM federated.t2; +SELECT * FROM federated.t2 ORDER BY id, name; id name 1 foo 2 fee @@ -108,7 +112,7 @@ ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%'; INSERT INTO federated.t1 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t1 (id, name) VALUES (2, 'fee'); -SELECT * FROM federated.t1; +SELECT * FROM federated.t1 ORDER BY id,name; id name 1 foo 2 fee @@ -122,7 +126,7 @@ ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%'; INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo'); INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee'); -SELECT * FROM federated.`t1%`; +SELECT * FROM federated.`t1%` ORDER BY id, name; id name 1 foo 2 fee @@ -160,6 +164,7 @@ INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010); SELECT * FROM federated.t1; id name other created 1 First Name 11111 2004-04-04 04:04:04 +10 Tenth Name 101010 2004-04-04 04:04:04 2 Second Name 22222 2004-04-04 04:04:04 3 Third Name 33333 2004-04-04 04:04:04 4 Fourth Name 44444 2004-04-04 04:04:04 @@ -168,7 +173,6 @@ id name other created 7 Seventh Name 77777 2004-04-04 04:04:04 8 Eigth Name 88888 2004-04-04 04:04:04 9 Ninth Name 99999 2004-04-04 04:04:04 -10 Tenth Name 101010 2004-04-04 04:04:04 SELECT * FROM federated.t1 WHERE id = 5; id name other created 5 Fifth Name 55555 2004-04-04 04:04:04 @@ -182,6 +186,7 @@ SELECT * FROM federated.t1 WHERE name = 'Sixth Name' AND other = 44444; id name other created SELECT * FROM federated.t1 WHERE name like '%th%'; id name other created +10 Tenth Name 101010 2004-04-04 04:04:04 3 Third Name 33333 2004-04-04 04:04:04 4 Fourth Name 44444 2004-04-04 04:04:04 5 Fifth Name 55555 2004-04-04 04:04:04 @@ -189,7 +194,6 @@ id name other created 7 Seventh Name 77777 2004-04-04 04:04:04 8 Eigth Name 88888 2004-04-04 04:04:04 9 Ninth Name 99999 2004-04-04 04:04:04 -10 Tenth Name 101010 2004-04-04 04:04:04 UPDATE federated.t1 SET name = '3rd name' WHERE id = 3; SELECT * FROM federated.t1 WHERE name = '3rd name'; id name other created @@ -310,6 +314,7 @@ VALUES ('Tenth Name', 101010, '2005-03-12 12:00:01'); SELECT * FROM federated.t1; id name other created 1 First Name 11111 2004-01-01 01:01:01 +10 Tenth Name 101010 2005-03-12 12:00:01 2 Second Name 22222 2004-01-23 02:43:00 3 Third Name 33333 2004-02-14 02:14:00 4 Fourth Name 44444 2003-04-05 00:00:00 @@ -318,7 +323,6 @@ id name other created 7 Seventh Name 77777 2003-12-12 18:32:00 8 Eigth Name 88888 2005-03-12 11:00:00 9 Ninth Name 99999 2005-03-12 11:00:01 -10 Tenth Name 101010 2005-03-12 12:00:01 SELECT * FROM federated.t1 WHERE id = 5; id name other created 5 Fifth Name 55555 2001-02-02 02:02:02 @@ -330,6 +334,7 @@ id name other created 4 Fourth Name 44444 2003-04-05 00:00:00 SELECT * FROM federated.t1 WHERE name like '%th%'; id name other created +10 Tenth Name 101010 2005-03-12 12:00:01 3 Third Name 33333 2004-02-14 02:14:00 4 Fourth Name 44444 2003-04-05 00:00:00 5 Fifth Name 55555 2001-02-02 02:02:02 @@ -337,7 +342,6 @@ id name other created 7 Seventh Name 77777 2003-12-12 18:32:00 8 Eigth Name 88888 2005-03-12 11:00:00 9 Ninth Name 99999 2005-03-12 11:00:01 -10 Tenth Name 101010 2005-03-12 12:00:01 UPDATE federated.t1 SET name = '3rd name' WHERE id = 3; SELECT * FROM federated.t1 WHERE name = '3rd name'; id name other created @@ -444,17 +448,17 @@ id name other 7 Seventh Name NULL SELECT * FROM federated.t1 WHERE name IS NULL; id name other -4 NULL NULL 10 NULL fee fie foe fum +4 NULL NULL SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL; id name other 4 NULL NULL SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL; id name other +10 NULL fee fie foe fum 2 Second Name NULL 4 NULL NULL 7 Seventh Name NULL -10 NULL fee fie foe fum UPDATE federated.t1 SET name = 'Fourth Name', other = 'four four four' WHERE name IS NULL AND other IS NULL; @@ -466,6 +470,7 @@ id name other SELECT * FROM federated.t1; id name other 1 First Name 11111 +10 Tenth Name fee fie foe fum 2 Second Name two two two two 3 Third Name 33333 4 Fourth Name four four four @@ -474,7 +479,6 @@ id name other 7 Seventh Name seven seven 8 Eigth Name 88888 9 Ninth Name 99999 -10 Tenth Name fee fie foe fum DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, @@ -655,8 +659,8 @@ id col1 col2 col3 col4 SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'five 5 five five 5') OR (col2 = 'three Three' AND col3 = 33); id col1 col2 col3 col4 -5 5 five 5 five five 5 5 55555 3 3 three Three 33 33333 +5 5 five 5 five five 5 5 55555 SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'Two two') OR (col2 = 444 AND col3 = 4444444); id col1 col2 col3 col4 @@ -667,25 +671,25 @@ OR col3 = 33 OR col4 = 4444444; id col1 col2 col3 col4 1 1 one One 11 1111 +10 10 Tenth ten TEN 1010101 1010 2 2 Two two 22 2222 3 3 three Three 33 33333 4 4 fourfourfour 444 4444444 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE id > 5; id col1 col2 col3 col4 +10 10 Tenth ten TEN 1010101 1010 6 6 six six Sixsix 6666 6 7 7 seven Sevenseven 77777 7777 8 8 eight eight eight 88888 88 9 9 nine Nine 999999 999999 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE id >= 5; id col1 col2 col3 col4 +10 10 Tenth ten TEN 1010101 1010 5 5 five 5 five five 5 5 55555 6 6 six six Sixsix 6666 6 7 7 seven Sevenseven 77777 7777 8 8 eight eight eight 88888 88 9 9 nine Nine 999999 999999 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE id < 5; id col1 col2 col3 col4 1 1 one One 11 1111 @@ -702,6 +706,7 @@ id col1 col2 col3 col4 SELECT * FROM federated.t1 WHERE id != 5; id col1 col2 col3 col4 1 1 one One 11 1111 +10 10 Tenth ten TEN 1010101 1010 2 2 Two two 22 2222 3 3 three Three 33 33333 4 4 fourfourfour 444 4444444 @@ -709,7 +714,6 @@ id col1 col2 col3 col4 7 7 seven Sevenseven 77777 7777 8 8 eight eight eight 88888 88 9 9 nine Nine 999999 999999 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE id > 3 AND id < 7; id col1 col2 col3 col4 4 4 fourfourfour 444 4444444 @@ -737,25 +741,25 @@ id col1 col2 col3 col4 SELECT * FROM federated.t1 WHERE id < 3 OR id > 7; id col1 col2 col3 col4 1 1 one One 11 1111 +10 10 Tenth ten TEN 1010101 1010 2 2 Two two 22 2222 8 8 eight eight eight 88888 88 9 9 nine Nine 999999 999999 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE col2 = 'three Three'; id col1 col2 col3 col4 3 3 three Three 33 33333 SELECT * FROM federated.t1 WHERE col2 > 'one'; id col1 col2 col3 col4 1 1 one One 11 1111 +10 10 Tenth ten TEN 1010101 1010 2 2 Two two 22 2222 3 3 three Three 33 33333 6 6 six six Sixsix 6666 6 7 7 seven Sevenseven 77777 7777 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE col2 LIKE 's%'; id col1 col2 col3 col4 -7 7 seven Sevenseven 77777 7777 6 6 six six Sixsix 6666 6 +7 7 seven Sevenseven 77777 7777 SELECT * FROM federated.t1 WHERE col2 LIKE 'si%'; id col1 col2 col3 col4 6 6 six six Sixsix 6666 6 @@ -765,6 +769,7 @@ id col1 col2 col3 col4 SELECT * FROM federated.t1 WHERE col2 NOT LIKE 'e%'; id col1 col2 col3 col4 1 1 one One 11 1111 +10 10 Tenth ten TEN 1010101 1010 2 2 Two two 22 2222 3 3 three Three 33 33333 4 4 fourfourfour 444 4444444 @@ -772,18 +777,17 @@ id col1 col2 col3 col4 6 6 six six Sixsix 6666 6 7 7 seven Sevenseven 77777 7777 9 9 nine Nine 999999 999999 -10 10 Tenth ten TEN 1010101 1010 SELECT * FROM federated.t1 WHERE col2 <> 'one One'; id col1 col2 col3 col4 -4 4 fourfourfour 444 4444444 -5 5 five 5 five five 5 5 55555 -8 8 eight eight eight 88888 88 -9 9 nine Nine 999999 999999 +10 10 Tenth ten TEN 1010101 1010 2 2 Two two 22 2222 3 3 three Three 33 33333 +4 4 fourfourfour 444 4444444 +5 5 five 5 five five 5 5 55555 6 6 six six Sixsix 6666 6 7 7 seven Sevenseven 77777 7777 -10 10 Tenth ten TEN 1010101 1010 +8 8 eight eight eight 88888 88 +9 9 nine Nine 999999 999999 DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `col1` varchar(8) NOT NULL DEFAULT '', @@ -950,11 +954,11 @@ INSERT INTO federated.t1 (name, floatval, other) VALUES (0, 00.3333, NULL); SELECT * FROM federated.t1; id name floatval other +1 NULL NULL NULL +NULL 0 0.3333 NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 NULL NULL NULL NULL foo 33.3333 NULL -NULL 0 0.3333 NULL SELECT count(*) FROM federated.t1 WHERE id IS NULL AND name IS NULL @@ -983,13 +987,13 @@ Warning 1101 BLOB/TEXT column 'blurb' can't have a default value INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values."); INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE."); INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. "); -INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:"); +INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:"); SELECT * FROM federated.t1; blurb_id blurb 1 MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values. 2 All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE. 3 A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. -4 Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt: +4 Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt: DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `a` int NOT NULL, @@ -1741,20 +1745,20 @@ create trigger federated.t1_bi before insert on federated.t1 for each row set ne create table federated.t2 (a int, b int); insert into federated.t2 values (13, 17), (19, 23); insert into federated.t1 (a, b) values (1, 2), (3, 5), (7, 11); -select * from federated.t1; +select * from federated.t1 order by a; a b c 1 2 2 3 5 15 7 11 77 delete from federated.t1; insert into federated.t1 (a, b) select * from federated.t2; -select * from federated.t1; +select * from federated.t1 order by a; a b c 13 17 221 19 23 437 delete from federated.t1; load data infile '../std_data_ln/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b); -select * from federated.t1; +select * from federated.t1 order by a; a b c 3 4 12 5 6 30 @@ -2081,8 +2085,10 @@ Table Checksum test.t1 2465757603 DROP TABLE t1; DROP TABLE t1; +End of 5.0 tests +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; -End of 5.0 tests diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 18b0d84a296..6e879114119 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -328,3 +328,123 @@ DROP VIEW v2; DROP VIEW v3; # -- End of Bug#35469. +Bug#37114 +SET SESSION character_set_client=latin1; +SET SESSION character_set_server=latin1; +SET SESSION character_set_connection=latin1; +SET @OLD_SQL_MODE=@@SESSION.SQL_MODE; +test LOAD DATA INFILE +SET sql_mode = ''; +SELECT '1 \\aa\n' INTO DUMPFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt'; +CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM; +SET sql_mode = 'NO_BACKSLASH_ESCAPES'; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ' '; +SELECT * FROM t1; +id val1 +1 \aa +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114_out.txt' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1; +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114_out.txt' FIELDS TERMINATED BY ' ' FROM t1; +INSERT INTO t1 (id, val1) VALUES (1, '\aa'); +SELECT * FROM t1; +id val1 +1 \aa +1 \aa +SET sql_mode=''; +INSERT INTO t1 (id, val1) VALUES (1, '\aa'); +SELECT * FROM t1; +id val1 +1 \aa +1 \aa +1 aa +DROP TABLE t1; +test SELECT INTO OUTFILE +CREATE TABLE t1 (id INT PRIMARY KEY, val1 CHAR(4)); +CREATE TABLE t2 LIKE t1; +SET sql_mode = ''; +INSERT INTO t1 (id, val1) VALUES (5, '\ttab'); +INSERT INTO t1 (id, val1) VALUES (4, '\\r'); +SET sql_mode = 'NO_BACKSLASH_ESCAPES'; +INSERT INTO t1 (id, val1) VALUES (3, '\tx'); +1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS TERMINATED BY ' '; +SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION +SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC; +t id val1 hex(val1) +before 3 \tx 5C7478 +after 3 \tx 5C7478 +before 4 \r 5C72 +after 4 \r 5C72 +before 5 tab 09746162 +after 5 tab 09746162 +TRUNCATE t2; +SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt"); +LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt") +3 \tx +4 \r +5 tab + +1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' '; +SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION +SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC; +t id val1 hex(val1) +before 3 \tx 5C7478 +after 3 \tx 5C7478 +before 4 \r 5C72 +after 4 \r 5C72 +before 5 tab 09746162 +after 5 tab 09746162 +TRUNCATE t2; +SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt"); +LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt") +3 \\tx +4 \\r +5 tab + +SET sql_mode = ''; +2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS TERMINATED BY ' '; +SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION +SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC; +t id val1 hex(val1) +before 3 \tx 5C7478 +after 3 \tx 5C7478 +before 4 \r 5C72 +after 4 \r 5C72 +before 5 tab 09746162 +after 5 tab 09746162 +TRUNCATE t2; +SET sql_mode = 'NO_BACKSLASH_ESCAPES'; +SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt"); +LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt") +3 \\tx +4 \\r +5 tab + +SET sql_mode = ''; +2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' '; +SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION +SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC; +t id val1 hex(val1) +before 3 \tx 5C7478 +after 3 \tx 5C7478 +before 4 \r 5C72 +after 4 \r 5C72 +before 5 tab 09746162 +after 5 tab 09746162 +TRUNCATE t2; +SET sql_mode = 'NO_BACKSLASH_ESCAPES'; +SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt"); +LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt") +3 \tx +4 \r +5 tab + +set session sql_mode=@OLD_SQL_MODE; +DROP TABLE t1,t2; +End of 5.0 tests diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 163231c9f66..08a18d8de75 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1,3 +1,8 @@ +Bug#37938 - Test "mysqldump" lacks various insert statements +Turn off concurrent inserts to avoid random errors +NOTE: We reset the variable back to saved value at the end of test +SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT = 0; DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3; drop database if exists mysqldump_test_db; drop database if exists db1; @@ -3565,6 +3570,7 @@ DROP TABLE t1,t2; -- Dump completed on DATE +SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT; # # End of 5.0 tests # diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 0fc0adc89ad..e83e8c2c71d 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1513,3 +1513,10 @@ end loop label1; end loop; end| ERROR 42000: End-label label1 without match +CREATE TABLE t1 (a INT)| +INSERT INTO t1 VALUES (1),(2)| +CREATE PROCEDURE p1(a INT) BEGIN END| +CALL p1((SELECT * FROM t1))| +ERROR 21000: Subquery returns more than 1 row +DROP PROCEDURE IF EXISTS p1| +DROP TABLE t1| diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index be21251d92e..e788d30a14b 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6662,6 +6662,16 @@ drop procedure p1; drop function f1; drop view v1; drop table t1; +drop procedure if exists `p2` $ +create procedure `p2`(in `a` text charset utf8) +begin +declare `pos` int default 1; +declare `str` text charset utf8; +set `str` := `a`; +select substr(`str`, `pos`+ 1 ) into `str`; +end $ +call `p2`('s s s s s s'); +drop procedure `p2`; # ------------------------------------------------------------------ # -- End of 5.0 tests # ------------------------------------------------------------------ |