Commit 7f444caa authored by Elena Stepanova's avatar Elena Stepanova

MDEV-4028 - Converted rdiff files to uniform

MDEV-11 - Modifed tests and result files to use explicit column lists
          in INSERT and SELECT statements
parent 1701ee33
......@@ -4,7 +4,7 @@ SHOW CREATE TABLE t1;
SHOW COLUMNS IN t1;
INSERT INTO t1 VALUES (1,'a');
INSERT INTO t1 (a,b) VALUES (2,'b');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......
......@@ -14,7 +14,7 @@
# - CREATE TABLE .. (column1 <column options>, column2 <column options>) ENGINE=<storage_engine>;
# - INSERT INTO TABLE .. VALUES (val1,val2);
# - DROP TABLE ..
# - SELECT * FROM ..
# - SELECT a,b FROM ..
# - SHOW CREATE TABLE ..
# - SHOW COLUMNS IN ...
#
......@@ -62,10 +62,10 @@ if (!$mysql_errname)
--source unexpected_result.inc
}
SELECT * FROM t1;
SELECT a,b FROM t1;
if ($mysql_errname)
{
--let $functionality = SELECT * FROM ..
--let $functionality = SELECT a,b FROM ..
--source unexpected_result.inc
}
......
......@@ -105,7 +105,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
2 2
4 3
......
......@@ -111,7 +111,7 @@ SHOW CREATE TABLE t1;
--source alter_table.inc
--source mask_engine.inc
SHOW CREATE TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
# Character set, collate
......
......@@ -4,15 +4,15 @@ ALTER TABLE t1 DISCARD TABLESPACE;
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a) VALUES (1),(2);
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT * FROM t1;
SELECT a FROM t1;
ERROR HY000: Got error -1 from storage engine
ALTER TABLE t1 IMPORT TABLESPACE;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......
......@@ -30,7 +30,7 @@ if (!$mysql_errname)
--source create_table.inc
INSERT INTO t1 (a) VALUES (1),(2);
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
# http://dev.mysql.com/doc/mysql-enterprise-backup/3.5/en/partial.restoring.single.html
# To get a "clean" backup we need to either use innobackup, or to monitor show engine innodb status,
......@@ -64,7 +64,7 @@ EOF
--source alter_table.inc
--let $error_codes = ER_GET_ERRNO
SELECT * FROM t1;
SELECT a FROM t1;
--source check_errors.inc
if ($mysql_errname != ER_GET_ERRNO)
{
......@@ -76,7 +76,7 @@ EOF
--let $alter_definition = IMPORT TABLESPACE
--source alter_table.inc
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
# Adding a warning suppression based on what InnoDB currently does
# when it attempts to access a table without an *.ibd file
......
......@@ -4,7 +4,7 @@ INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -17,7 +17,7 @@ INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
a 1
a 2
......@@ -30,7 +30,7 @@ INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
a 1
a 5
......
......@@ -25,7 +25,7 @@ if (!$mysql_errname)
INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a');
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -45,7 +45,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a');
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -65,7 +65,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a');
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......
......@@ -5,7 +5,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -15,7 +15,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
200
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -28,7 +28,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i');
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
850
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -48,6 +48,6 @@ ERROR 22003: Out of range value for column 'a' at row 1
SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
850
SELECT * FROM t1;
SELECT a FROM t1;
a
DROP TABLE t1;
......@@ -25,7 +25,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# auto_increment_increment
......@@ -34,13 +34,13 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f');
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
SET auto_increment_increment = 50;
INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i');
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -60,7 +60,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a) VALUES (NULL);
SELECT LAST_INSERT_ID();
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
DROP TABLE t1;
}
......
......@@ -8,7 +8,7 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1
INSERT INTO t1 (b) VALUES ('a'),('b');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
1 a
2 b
......@@ -16,7 +16,7 @@ SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
1
INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
1 a
2 b
......@@ -27,7 +27,7 @@ LAST_INSERT_ID()
3
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
INSERT INTO t1 (a,b) VALUES (NULL,'e');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
1 a
2 b
......@@ -38,7 +38,7 @@ SELECT LAST_INSERT_ID();
LAST_INSERT_ID()
5
INSERT INTO t1 (a,b) VALUES (0,'f');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
0 f
1 a
......@@ -61,7 +61,7 @@ SHOW TABLE STATUS FROM test LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 # # # # # # # # # 8 # # # # # # #
INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
0 f
1 a
......@@ -84,7 +84,7 @@ SHOW TABLE STATUS FROM test LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 # # # # # # # # # 21 # # # # # # #
INSERT INTO t1 (a,b) VALUES (NULL,'l');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
0 f
1 a
......@@ -105,7 +105,7 @@ SHOW TABLE STATUS FROM test LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 # # # # # # # # # 22 # # # # # # #
INSERT INTO t1 (a,b) VALUES (-5,'m');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
a b
-5 m
0 f
......@@ -123,7 +123,7 @@ a b
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AUTO_INCREMENT = 100;
INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
100 a
101 b
......
......@@ -26,22 +26,22 @@ if (!$mysql_errname)
# Automatic values
INSERT INTO t1 (b) VALUES ('a'),('b');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
let $sql_mode = `SELECT @@sql_mode`;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
INSERT INTO t1 (a,b) VALUES (NULL,'e');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
INSERT INTO t1 (a,b) VALUES (0,'f');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
--replace_result $sql_mode <INITIAL_SQL_MODE>
......@@ -63,7 +63,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
......@@ -77,7 +77,7 @@ if (!$mysql_errname)
SHOW TABLE STATUS FROM test LIKE 't1';
INSERT INTO t1 (a,b) VALUES (NULL,'l');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
SELECT LAST_INSERT_ID();
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
......@@ -87,7 +87,7 @@ if (!$mysql_errname)
# but won't check what happens to the sequence after that, since the behavior is undefined
INSERT INTO t1 (a,b) VALUES (-5,'m');
SELECT * FROM t1 ORDER BY a;
SELECT a,b FROM t1 ORDER BY a;
DROP TABLE t1;
}
......@@ -106,7 +106,7 @@ if (!$mysql_errname)
{
INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
SELECT LAST_INSERT_ID();
DROP TABLE t1;
}
......
......@@ -4,7 +4,7 @@ SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
a int(11) # 0
INSERT INTO t1 (a) VALUES (1);
SELECT * FROM t1;
SELECT a FROM t1;
a
1
ALTER TABLE t1 ADD COLUMN b <CHAR_COLUMN> DEFAULT '';
......@@ -13,7 +13,7 @@ Field Type Null Key Default Extra
a int(11) # 0
b char(8) #
INSERT INTO t1 (b) VALUES ('a');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 a
1
......
......@@ -25,7 +25,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a) VALUES (1);
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--let $alter_definition = ADD COLUMN b $char_col DEFAULT ''
--source alter_table.inc
......@@ -41,7 +41,7 @@ if (!$mysql_errname)
INSERT INTO t1 (b) VALUES ('a');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
}
DROP TABLE t1;
}
......
......@@ -144,7 +144,7 @@ if (!$mysql_errname)
}
--replace_regex /[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}/<TIMESTAMP>/
SELECT * FROM t1;
SELECT c FROM t1;
DROP TABLE t1;
}
......
......@@ -29,7 +29,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
INSERT INTO t1 (a,b) VALUES (-100,100);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -56,7 +56,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (1.0,-1.0);
INSERT INTO t1 (a,b) VALUES (-100,100);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -86,7 +86,7 @@ if (!$mysql_errname)
INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615);
INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1);
--sorted_result
SELECT * FROM t1;
SELECT t,s,m,i,b FROM t1;
DROP TABLE t1;
}
......
......@@ -27,7 +27,7 @@ if (!$mysql_errname)
SHOW COLUMNS IN t1;
INSERT INTO t1 (a,b) VALUES (1.1,1234);
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -52,7 +52,7 @@ if (!$mysql_errname)
SHOW COLUMNS IN t1;
INSERT INTO t1 (a,b) VALUES (1,1234.5);
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -80,7 +80,7 @@ if (!$mysql_errname)
SHOW COLUMNS IN t1;
INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0);
SELECT * FROM t1;
SELECT t,s,m,i,b FROM t1;
DROP TABLE t1;
}
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO
INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
INSERT INTO t1 (a,b) SELECT a, b FROM t1;
DELETE FROM t1 WHERE b IN ('c');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
1 a
......@@ -16,7 +16,7 @@ a b
5 e
5 e
DELETE FROM t1 WHERE a < 0 OR b = 'a';
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10000 foobar
10000 foobar
......@@ -27,7 +27,7 @@ a b
5 e
5 e
DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10000 foobar
10000 foobar
......@@ -38,7 +38,7 @@ a b
5 e
CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t2 (c,d) SELECT b, a FROM t1;
SELECT * FROM t2;
SELECT c,d FROM t2;
c d
b 2
b 2
......@@ -48,7 +48,7 @@ e 5
foobar 10000
foobar 10000
DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10000 foobar
10000 foobar
......@@ -57,21 +57,21 @@ a b
4 d
5 e
5 e
SELECT * FROM t2;
SELECT c,d FROM t2;
c d
foobar 10000
foobar 10000
DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
2 b
2 b
4 d
5 e
5 e
SELECT * FROM t2;
SELECT c,d FROM t2;
c d
DELETE FROM t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
DROP TABLE t1, t2;
......@@ -25,16 +25,16 @@ if ($mysql_errname)
--source unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DELETE FROM t1 WHERE a < 0 OR b = 'a';
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# ORDER BY and LIMIT
DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# Multi-table DELETE
......@@ -43,23 +43,23 @@ SELECT * FROM t1;
--source create_table.inc
INSERT INTO t2 (c,d) SELECT b, a FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
DELETE FROM t1;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# Cleanup
DROP TABLE t1, t2;
......
......@@ -4,7 +4,7 @@ INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,
INSERT INTO t1 (a,b) SELECT a, b FROM t1;
CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t2 (c,d) SELECT b, a FROM t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
1 a
......@@ -18,7 +18,7 @@ a b
4 d
5 e
5 e
SELECT * FROM t2;
SELECT c,d FROM t2;
c d
a 1
a 1
......@@ -33,7 +33,7 @@ e 5
foobar 10000
foobar 10000
DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
10000 foobar
......@@ -49,10 +49,10 @@ a b
DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
Warnings:
Warning 1242 Subquery returns more than 1 row
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
SELECT * FROM t2;
SELECT c,d FROM t2;
c d
foobar 10000
foobar 10000
......
......@@ -18,9 +18,9 @@ INSERT INTO t1 (a,b) SELECT a, b FROM t1;
--source create_table.inc
INSERT INTO t2 (c,d) SELECT b, a FROM t1;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1;
if ($mysql_errname)
......@@ -29,13 +29,13 @@ if ($mysql_errname)
--source unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 );
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
# Cleanup
DROP TABLE t1, t2;
......
......@@ -17,7 +17,7 @@ SLEEP(1)
0
0
connection default;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
connection con1;
......@@ -34,7 +34,7 @@ SLEEP(1)
0
0
connection default;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
SET LOW_PRIORITY_UPDATES = 1;
......@@ -52,7 +52,7 @@ SLEEP(1)
0
0
connection default;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
disconnect con1;
disconnect con2;
......
......@@ -73,7 +73,7 @@ if ($found)
--connection default
--reap
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
......@@ -113,7 +113,7 @@ if ($found)
--connection default
--reap
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b');
SET LOW_PRIORITY_UPDATES = 1;
......@@ -148,7 +148,7 @@ if ($found)
--connection default
--reap
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--disconnect con1
--disconnect con2
......
......@@ -2,24 +2,24 @@ DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX> (a), b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo';
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
2 b
3 c
4 d
5 e
CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t2 SELECT b, a FROM t1;
SELECT * FROM t2;
INSERT INTO t2 (c,d) SELECT b, a FROM t1;
SELECT c,d FROM t2;
c d
b 2
c 3
d 4
e 5
DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
SELECT * FROM t2;
SELECT c,d FROM t2;
c d
DROP TABLE t2;
DROP TABLE t1;
......@@ -30,20 +30,20 @@ if (!$mysql_errname)
if (!$mysql_errname)
{
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--let $create_definition = c $char_col, d $int_col
--let $table_name = t2
--source create_table.inc
INSERT INTO t2 SELECT b, a FROM t1;
INSERT INTO t2 (c,d) SELECT b, a FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t2;
SELECT c,d FROM t2;
DROP TABLE t2;
}
DROP TABLE t1;
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (b)) ENGINE=<ST
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
DELETE FROM t1 WHERE b > 'y';
DELETE FROM t1 WHERE a=2;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
3 c
......@@ -17,7 +17,7 @@ CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_EN
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z');
DELETE FROM t1 WHERE b > 'y';
DELETE FROM t1 WHERE a=2;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
3 c
......@@ -30,7 +30,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <INT_COLUMN>, <CUSTOM_INDEX>(a), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9);
DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
SELECT * FROM t1;
SELECT a,b,c FROM t1;
a b c
1 2 3
4 5 6
......
......@@ -29,7 +29,7 @@ if (!$mysql_errname)
DELETE FROM t1 WHERE a=2;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DELETE FROM t1;
}
DROP TABLE t1;
......@@ -49,7 +49,7 @@ if (!$mysql_errname)
DELETE FROM t1 WHERE a=2;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DELETE FROM t1;
DROP TABLE t1;
}
......@@ -66,7 +66,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9);
DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
--sorted_result
SELECT * FROM t1;
SELECT a,b,c FROM t1;
DROP TABLE t1;
}
......
......@@ -26,11 +26,11 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
DELETE FROM t1 WHERE a=2;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
DELETE FROM t2 WHERE a=2;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 c
2 d
SELECT * FROM t2;
SELECT a,b FROM t2;
a b
1 a
DROP TABLE t1;
......@@ -54,7 +54,7 @@ ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`
INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a');
INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a');
UPDATE t1 SET a=a+1;
SELECT * FROM t2;
SELECT a,b FROM t2;
a b
5 a
5 a
......@@ -63,7 +63,7 @@ a b
5 d
5 e
DELETE FROM t1 WHERE b='a' LIMIT 2;
SELECT * FROM t2;
SELECT a,b FROM t2;
a b
TRUNCATE TABLE t1;
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`))
......
......@@ -73,8 +73,9 @@ if (!$mysql_errname)
DELETE FROM t2 WHERE a=2;
--sorted_result
SELECT * FROM t1;
SELECT * FROM t2;
SELECT a,b FROM t1;
--sorted_result
SELECT a,b FROM t2;
--let $error_codes = ER_ROW_IS_REFERENCED
DROP TABLE t1;
......@@ -119,7 +120,7 @@ if (!$mysql_errname)
--source unexpected_result.inc
}
--sorted_result
SELECT * FROM t2;
SELECT a,b FROM t2;
DELETE FROM t1 WHERE b='a' LIMIT 2;
if ($mysql_errname)
......@@ -128,7 +129,7 @@ if (!$mysql_errname)
--source unexpected_result.inc
}
--sorted_result
SELECT * FROM t2;
SELECT a,b FROM t2;
--let $error_codes = ER_TRUNCATE_ILLEGAL_FK
TRUNCATE TABLE t1;
......
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t1 VALUES (100,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
100 foobar
......@@ -10,7 +10,7 @@ a b
4 d
5 e
INSERT t1 VALUE (10,'foo'),(11,'abc');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
10 foo
......@@ -21,7 +21,7 @@ a b
4 d
5 e
INSERT INTO t1 (b,a) VALUES ('test',0);
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 test
1 a
......@@ -33,7 +33,7 @@ a b
4 d
5 e
INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 test
1 a
......@@ -46,7 +46,7 @@ a b
5 e
NULL NULL
INSERT t1 (a) VALUE (10),(20);
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 test
1 a
......@@ -61,7 +61,7 @@ a b
5 e
NULL NULL
INSERT INTO t1 SET a = 11, b = 'f';
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 test
1 a
......@@ -77,7 +77,7 @@ a b
5 e
NULL NULL
INSERT t1 SET b = DEFAULT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 test
1 a
......@@ -94,9 +94,9 @@ a b
NULL NULL
NULL NULL
CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 SELECT a,b FROM t1;
INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo';
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0 test
1 a
......@@ -113,8 +113,8 @@ a b
5 e
NULL NULL
NULL NULL
INSERT t1 SELECT * FROM t1;
SELECT * FROM t1;
INSERT t1 (a,b) SELECT a,b FROM t1;
SELECT a,b FROM t1;
a b
0 test
0 test
......
......@@ -22,40 +22,40 @@ if ($mysql_errname)
--source unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT t1 VALUE (10,'foo'),(11,'abc');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT INTO t1 (b,a) VALUES ('test',0);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT t1 (a) VALUE (10),(20);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# INSERT [INTO] .. SET
INSERT INTO t1 SET a = 11, b = 'f';
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT t1 SET b = DEFAULT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# INSERT .. SELECT
--let $table_name = t2
--source create_table.inc
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 SELECT a,b FROM t1;
if ($mysql_errname)
{
--let $functionality = INSERT .. SELECT
......@@ -65,11 +65,11 @@ if ($mysql_errname)
INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo';
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT t1 SELECT * FROM t1;
INSERT t1 (a,b) SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
# Cleanup
DROP TABLE t1, t2;
......
......@@ -6,17 +6,17 @@ connect con0,localhost,root,,;
SET lock_wait_timeout = 1;
INSERT DELAYED INTO t1 (a,b) VALUES (3,'c');
INSERT DELAYED INTO t1 SET a=4, b='d';
INSERT DELAYED INTO t1 SELECT 5, 'e';
INSERT DELAYED INTO t1 (a,b) SELECT 5, 'e';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con0;
connection default;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 f
2 b
UNLOCK TABLES;
FLUSH TABLES;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 f
2 b
......
......@@ -41,16 +41,16 @@ if (!$mysql_errname)
INSERT DELAYED INTO t1 SET a=4, b='d';
# DELAYED is ignored with INSERT .. SELECT
--let $error_codes = ER_LOCK_WAIT_TIMEOUT
INSERT DELAYED INTO t1 SELECT 5, 'e';
INSERT DELAYED INTO t1 (a,b) SELECT 5, 'e';
--source check_errors.inc
--disconnect con0
--connection default
SELECT * FROM t1;
SELECT a,b FROM t1;
}
UNLOCK TABLES;
FLUSH TABLES;
SELECT * FROM t1;
SELECT a,b FROM t1;
# Cleanup
DROP TABLE t1;
......
......@@ -26,7 +26,7 @@ SLEEP(1)
0
0
connection con0;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 f
2 b
......@@ -50,7 +50,7 @@ SLEEP(1)
0
0
connection con0;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 f
2 b
......
......@@ -80,7 +80,7 @@ if ($found)
--connection con0
--reap
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
......@@ -122,7 +122,7 @@ if ($found)
--connection con0
--reap
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--disconnect con1
--disconnect con2
......
......@@ -25,7 +25,7 @@ SLEEP(1)
0
0
connection con0;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 f
2 b
......
......@@ -76,7 +76,7 @@ if ($found)
--connection con0
--reap
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--disconnect con0
--disconnect con1
......
......@@ -5,7 +5,7 @@ INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f');
INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n');
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0
1 a
......@@ -34,7 +34,7 @@ ERROR 23000: Duplicate entry '3' for key 'a'
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
# If you got a difference in error message, just add it to rdiff file
INSERT INTO t1 (a,b) VALUES (0,'');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0
1 a
......@@ -50,7 +50,7 @@ INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1' for key 'a'
INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0
1 a
......@@ -73,7 +73,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
ERROR 23000: Duplicate entry '1-a' for key 'a'
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
# If you got a difference in error message, just add it to rdiff file
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
100 a
......@@ -90,7 +90,7 @@ INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1-a' for key 'a'
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a);
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
100 a
100 b
......@@ -122,7 +122,7 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
# If you got a difference in error message, just add it to rdiff file
INSERT INTO t1 (a,b) VALUES (0,'');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0
1 a
......@@ -138,7 +138,7 @@ INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b);
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0
1 aa
......
......@@ -24,7 +24,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
INSERT INTO t1 (a,b) VALUES (3,'a'),(0,'');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -49,7 +49,7 @@ if (!$mysql_errname)
--source check_errors.inc
INSERT INTO t1 (a,b) VALUES (0,'');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
if ($mysql_errname)
......@@ -63,7 +63,7 @@ if (!$mysql_errname)
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -86,12 +86,12 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
--source check_errors.inc
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY
INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x');
......@@ -120,7 +120,7 @@ if (!$mysql_errname)
--source check_errors.inc
INSERT INTO t1 (a,b) VALUES (0,'');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
if ($mysql_errname)
......@@ -134,7 +134,7 @@ if (!$mysql_errname)
--source unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ',';
SELECT * FROM t1;
FIELDS TERMINATED BY ',' (a,b);
SELECT a,b FROM t1;
a b
1 foo
2 bar
......@@ -10,8 +10,8 @@ a b
4 abc
LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
CHARACTER SET utf8 COLUMNS TERMINATED BY ','
ESCAPED BY '/';
SELECT * FROM t1;
ESCAPED BY '/' (a,b);
SELECT a,b FROM t1;
a b
1 foo
1 foo
......@@ -21,46 +21,66 @@ a b
3
4 abc
4 abc
LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
(a) SET b='loaded';
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
SELECT a,b FROM t1;
a b
0 loaded
1 foo
1 foo
102 loaded
2 bar
2 bar
3
3
4 abc
4 abc
5 loaded
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
OPTIONALLY ENCLOSED BY ''''
LINES STARTING BY 'prefix:'
IGNORE 2 LINES
(a,b);
IGNORE 2 LINES (a,b);
Warnings:
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
0
0 loaded
1 foo
1 foo
100 foo
102 loaded
2 bar
2 bar
3
3
4 abc
4 abc
5 loaded
7 test
LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
(a) SET b='loaded';
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
SELECT * FROM t1;
LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1;
SELECT a,b FROM t1;
a b
0
0 loaded
1 foo
1 foo
1 foo
100 foo
102 loaded
2 bar
2 bar
2 bar
3
3
3
4 abc
4 abc
4 abc
5 loaded
......
......@@ -22,23 +22,40 @@ EOF
--replace_result $datadir <DATADIR>
eval
LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ',';
FIELDS TERMINATED BY ',' (a,b);
if ($mysql_errname)
{
--source unexpected_result.inc
--remove_file $datadir/se_loaddata.dat
}
if (!$mysql_errname)
{
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--replace_result $datadir <DATADIR>
eval
LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
CHARACTER SET utf8 COLUMNS TERMINATED BY ','
ESCAPED BY '/';
ESCAPED BY '/' (a,b);
--sorted_result
SELECT a,b FROM t1;
--remove_file $datadir/se_loaddata.dat
--write_file $datadir/se_loaddata.dat
5;YYY;
102;'zzz';
0;'test';
EOF
--replace_result $datadir <DATADIR>
eval
LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
(a) SET b='loaded';
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--remove_file $datadir/se_loaddata.dat
--write_file $datadir/se_loaddata.dat
......@@ -57,31 +74,30 @@ EOF
FIELDS TERMINATED BY ';'
OPTIONALLY ENCLOSED BY ''''
LINES STARTING BY 'prefix:'
IGNORE 2 LINES
(a,b);
IGNORE 2 LINES (a,b);
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--remove_file $datadir/se_loaddata.dat
--write_file $datadir/se_loaddata.dat
5;YYY;
102;'zzz';
0;'test';
1 foo
2 bar
3
4 abc
EOF
--replace_result $datadir <DATADIR>
eval
LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1
FIELDS TERMINATED BY ';'
(a) SET b='loaded';
LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--remove_file $datadir/se_loaddata.dat
}
# Cleanup
--remove_file $datadir/se_loaddata.dat
DROP TABLE t1;
--source cleanup_engine.inc
......
......@@ -12,7 +12,7 @@ id2 COUNT(DISTINCT id)
3 1
UPDATE t1 SET id=-1 WHERE id=1;
connection con1;
SELECT * FROM t1;
SELECT id,id2 FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
LOCK TABLE t1 READ;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
......@@ -38,7 +38,7 @@ DROP TABLE IF EXISTS t2;
UNLOCK TABLES;
CREATE TABLE t2 (id <INT_COLUMN>, id2 <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
LOCK TABLE t1 WRITE, t2 WRITE;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 (id,id2) SELECT id,id2 FROM t1;
UPDATE t1 SET id=1 WHERE id=-1;
DROP TABLE t1,t2;
CREATE TABLE t1 (i1 <INT_COLUMN>, nr <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
......@@ -105,7 +105,7 @@ LOCK TABLE t1 WRITE, t2 WRITE;
CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
FLUSH TABLE t1;
DROP TEMPORARY TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
UNLOCK TABLES;
DROP TABLE t1, t2;
......@@ -43,7 +43,7 @@ connection con1;
# With WRITE lock held by connection 'default',
# nobody else can access the table
--let $error_codes = ER_LOCK_WAIT_TIMEOUT
SELECT * FROM t1;
SELECT id,id2 FROM t1;
--source check_errors.inc
--let $error_codes = ER_LOCK_WAIT_TIMEOUT
LOCK TABLE t1 READ;
......@@ -94,7 +94,7 @@ UNLOCK TABLES;
--let $create_definition = id $int_col, id2 $int_col
--source create_table.inc
LOCK TABLE t1 WRITE, t2 WRITE;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 (id,id2) SELECT id,id2 FROM t1;
UPDATE t1 SET id=1 WHERE id=-1;
if ($mysql_errname)
{
......@@ -232,7 +232,7 @@ LOCK TABLE t1 WRITE, t2 WRITE;
--source create_table.inc
FLUSH TABLE t1;
DROP TEMPORARY TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
UNLOCK TABLES;
DROP TABLE t1, t2;
......
......@@ -10,7 +10,7 @@ INSERT INTO t2 (a,b) SELECT a, b FROM t1;
ALTER TABLE t1 REPAIR PARTITION p0;
Table Op Msg_type Msg_text
test.t1 repair status OK
INSERT INTO t1 VALUES (3,'c');
INSERT INTO t1 (a,b) VALUES (3,'c');
ALTER TABLE t1 REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1;
Table Op Msg_type Msg_text
test.t1 repair status OK
......@@ -22,7 +22,7 @@ INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h');
ALTER TABLE t1 REPAIR PARTITION LOCAL ALL EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
INSERT INTO t1 VALUES (10,'j');
INSERT INTO t1 (a,b) VALUES (10,'j');
ALTER TABLE t1 REPAIR PARTITION p1 QUICK USE_FRM;
Table Op Msg_type Msg_text
test.t1 repair status OK
......@@ -76,7 +76,7 @@ Table Op Msg_type Msg_text
test.t1 check Error Failed to read from the .par file
test.t1 check Error Incorrect information in file: './test/t1.frm'
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
ERROR HY000: Failed to read from the .par file
# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY).
# If you got a difference in error message, just add it to rdiff file
......@@ -118,7 +118,7 @@ Table Op Msg_type Msg_text
test.t1 check error Size of datafile is: 26 Should be: 39
test.t1 check error Partition p0 returned error
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
8 h
10 j
......@@ -142,7 +142,7 @@ test.t1 check error Record-count is not ok; is 3 Should be: 2
test.t1 check warning Found 3 key parts. Should be: 2
test.t1 check error Partition p0 returned error
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
8 h
10 j
......@@ -166,7 +166,7 @@ Table Op Msg_type Msg_text
test.t1 check error Size of datafile is: 39 Should be: 52
test.t1 check error Partition p1 returned error
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
8 h
10 j
......@@ -193,7 +193,7 @@ test.t1 check error Record-count is not ok; is 4 Should be: 3
test.t1 check warning Found 4 key parts. Should be: 3
test.t1 check error Partition p1 returned error
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
8 h
10 j
......@@ -218,7 +218,7 @@ Restoring <DATADIR>/test/t1.par
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
8 h
10 j
......
......@@ -35,7 +35,7 @@ if (!$mysql_errname)
let $alter_definition = REPAIR PARTITION p0;
--source ../alter_table.inc
INSERT INTO t1 VALUES (3,'c');
INSERT INTO t1 (a,b) VALUES (3,'c');
let $alter_definition = REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1;
--source ../alter_table.inc
......@@ -57,7 +57,7 @@ if (!$mysql_errname)
let $alter_definition = REPAIR PARTITION LOCAL ALL EXTENDED;
--source ../alter_table.inc
INSERT INTO t1 VALUES (10,'j');
INSERT INTO t1 (a,b) VALUES (10,'j');
let $alter_definition = REPAIR PARTITION p1 QUICK USE_FRM;
--source ../alter_table.inc
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO
TRUNCATE TABLE t1;
INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
TRUNCATE TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2;
......@@ -46,23 +46,23 @@ t1 CREATE TABLE `t1` (
) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 2 */
SELECT * FROM t1;
SELECT a,c FROM t1;
a c
1 d
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2;
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g');
ALTER TABLE t1 TRUNCATE PARTITION p0;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
101 g
3 c
EXPLAIN PARTITIONS SELECT * FROM t1;
EXPLAIN PARTITIONS SELECT a,b FROM t1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 # # # # # #
INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
ALTER TABLE t1 TRUNCATE PARTITION ALL;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
DROP TABLE t1;
......@@ -33,7 +33,7 @@ if (!$mysql_errname)
INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
TRUNCATE TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -64,7 +64,7 @@ if (!$mysql_errname)
INSERT INTO t1 (c) VALUES ('d');
--source ../mask_engine.inc
SHOW CREATE TABLE t1;
SELECT * FROM t1;
SELECT a,c FROM t1;
DROP TABLE t1;
}
......@@ -93,16 +93,16 @@ if (!$mysql_errname)
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--replace_column 5 # 6 # 7 # 8 # 9 # 10 #
EXPLAIN PARTITIONS SELECT * FROM t1;
EXPLAIN PARTITIONS SELECT a,b FROM t1;
INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
let $alter_definition = TRUNCATE PARTITION ALL;
--source ../alter_table.inc
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......
......@@ -64,7 +64,7 @@ INSERT INTO t1 (a,b) VALUES (14,'n');
--source check_errors.inc
CHECK TABLE t1;
--let $error_codes = 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY
SELECT * FROM t1;
SELECT a,b FROM t1;
--source check_errors.inc
--enable_warnings
REPAIR TABLE t1;
......@@ -143,7 +143,7 @@ if ($have_default_index)
EOF
CHECK TABLE t1;
--let $error_codes = 0,ER_NOT_KEYFILE,144
SELECT * FROM t1;
SELECT a,b FROM t1;
--source check_errors.inc
}
}
......
......@@ -46,7 +46,7 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Error Incorrect file format 't1'
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
ERROR HY000: Incorrect file format 't1'
# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY).
# If you got a difference in error message, just add it to rdiff file
......@@ -84,7 +84,7 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check error Size of datafile is: 39 Should be: 65
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
ERROR HY000: Incorrect key file for table 't1'; try to repair it
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
......@@ -99,7 +99,7 @@ Table Op Msg_type Msg_text
test.t1 check warning Table is marked as crashed and last repair failed
test.t1 check error Size of datafile is: 39 Should be: 65
test.t1 check error Corrupt
SELECT * FROM t1;
SELECT a,b FROM t1;
ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
......
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -9,7 +9,7 @@ a b
4 d
5 e
REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
10 foo
......@@ -26,7 +26,7 @@ ERROR 23000: Duplicate entry '2' for key 'a'
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
# If you got a difference in error message, just add it to rdiff file
REPLACE INTO t1 (a,b) VALUES (2,'d');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 d
......@@ -39,7 +39,7 @@ ERROR 23000: Duplicate entry 'b' for key 'PRIMARY'
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY).
# If you got a difference in error message, just add it to rdiff file
REPLACE INTO t1 (a,b) VALUES (4,'b');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
3 c
......
......@@ -13,11 +13,11 @@ DROP TABLE IF EXISTS t1;
REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
......@@ -37,7 +37,7 @@ if (!$mysql_errname)
--source check_errors.inc
REPLACE INTO t1 (a,b) VALUES (2,'d');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......@@ -58,7 +58,7 @@ if (!$mysql_errname)
--source check_errors.inc
REPLACE INTO t1 (a,b) VALUES (4,'b');
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
}
......
......@@ -144,7 +144,7 @@ a b a b
200 bar 200 bar
200 bar 200 bar
200 bar 200 bar
SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200);
SELECT alias1.* FROM ( SELECT a,b FROM t1 ) alias1, t2 WHERE t2.a IN (100,200);
a b
1 z
1 z
......@@ -233,7 +233,7 @@ SUM(t2.a)
SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a);
MIN(t2.a)
1
SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > '';
SELECT alias.b FROM t1 NATURAL JOIN ( SELECT a,b FROM t1 ) alias WHERE b > '';
b
bar
bar
......@@ -247,7 +247,7 @@ z
z
z
z
SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL;
SELECT t2.b FROM ( SELECT a,b FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL;
b
bar
bar
......@@ -306,15 +306,15 @@ z
z
z
z
SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2;
SELECT ( SELECT MIN(a) FROM ( SELECT a,b FROM t1 ) alias1 ) AS min_a FROM t2;
min_a
1
1
1
SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 );
SELECT a,b FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 );
a b
1 z
SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 );
SELECT a,b FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 );
a b
200 bar
SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a );
......@@ -325,19 +325,19 @@ a b
100 foobar
200 bar
200 bar
SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 );
SELECT a,b FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 );
a b
100 foobar
200 bar
SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' );
SELECT a,b FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' );
a b
1 z
100 foobar
SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 );
SELECT a,b FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 );
a b
1 z
1 z
SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b );
SELECT a,b FROM t1 WHERE EXISTS ( SELECT a,b FROM t2 WHERE t2.b > t1.b );
a b
100 foobar
100 foobar
......@@ -371,12 +371,12 @@ a b
100 foobar
200 bar
200 bar
SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1;
SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION DISTINCT SELECT a,b FROM t1;
a b
1 z
100 foobar
200 bar
SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1;
SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION ALL SELECT a,b FROM t1;
a b
1 z
1 z
......
......@@ -108,7 +108,7 @@ SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2
WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a;
--sorted_result
SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200);
SELECT alias1.* FROM ( SELECT a,b FROM t1 ) alias1, t2 WHERE t2.a IN (100,200);
--sorted_result
SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 };
......@@ -134,10 +134,10 @@ SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b;
SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a);
--sorted_result
SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > '';
SELECT alias.b FROM t1 NATURAL JOIN ( SELECT a,b FROM t1 ) alias WHERE b > '';
--sorted_result
SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL;
SELECT t2.b FROM ( SELECT a,b FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL;
--sorted_result
SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2;
......@@ -151,15 +151,15 @@ SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2;
# Subquery as scalar operand, subquery in the FROM clause
--sorted_result
SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2;
SELECT ( SELECT MIN(a) FROM ( SELECT a,b FROM t1 ) alias1 ) AS min_a FROM t2;
# Comparison using subqueries
--sorted_result
SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 );
SELECT a,b FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 );
--sorted_result
SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 );
SELECT a,b FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 );
# Subquery with IN, correlated subquery
......@@ -169,20 +169,20 @@ SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FRO
# Subquery with ANY, ALL
--sorted_result
SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 );
SELECT a,b FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 );
--sorted_result
SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' );
SELECT a,b FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' );
# Row subqueries
--sorted_result
SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 );
SELECT a,b FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 );
# Subquery with EXISTS
--sorted_result
SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b );
SELECT a,b FROM t1 WHERE EXISTS ( SELECT a,b FROM t2 WHERE t2.b > t1.b );
# Subquery in ORDER BY
......@@ -197,10 +197,10 @@ SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b );
# Union
--sorted_result
SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1;
SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION DISTINCT SELECT a,b FROM t1;
--sorted_result
SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1;
SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION ALL SELECT a,b FROM t1;
# Cleanup
......
......@@ -12,7 +12,7 @@ LOCK TABLE t1 READ;
connection con0;
UPDATE t1 SET b = CONCAT(b,b);
connection con2;
SELECT * FROM t1;
SELECT a,b FROM t1;
connection con1;
UNLOCK TABLES;
connection con0;
......
......@@ -49,12 +49,12 @@ let $condition = LIKE 'Waiting for table%';
let $wait_timeout = 2;
--source include/wait_show_condition.inc
--send
SELECT * FROM t1;
SELECT a,b FROM t1;
--connection con1
let $show_statement = SHOW PROCESSLIST;
let $field = Info;
let $condition = = 'SELECT * FROM t1';
let $condition = = 'SELECT a,b FROM t1';
let $wait_timeout = 2;
--source include/wait_show_condition.inc
if (!$found)
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO
TRUNCATE TABLE t1;
INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
TRUNCATE TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
DROP TABLE t1;
CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
......@@ -22,7 +22,7 @@ INSERT INTO t1 (c) VALUES ('d');
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 # # # # # # # # # 2 # # # # # # #
SELECT * FROM t1;
SELECT a,c FROM t1;
a c
1 d
DROP TABLE t1;
......
......@@ -19,7 +19,7 @@ if (!$mysql_errname)
{
INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c');
TRUNCATE TABLE t1;
SELECT * FROM t1;
SELECT a,b FROM t1;
}
DROP TABLE t1;
......@@ -51,7 +51,7 @@ if (!$mysql_errname)
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
SHOW TABLE STATUS LIKE 't1';
SELECT * FROM t1;
SELECT a,c FROM t1;
DROP TABLE t1;
}
......
......@@ -9,7 +9,7 @@ connection con2;
INSERT INTO t1 (a) VALUES (1);
connection con1;
# If consistent read works on this isolation level (REPEATABLE READ), the following SELECT should not return the value we inserted (1)
SELECT * FROM t1;
SELECT a FROM t1;
a
COMMIT;
connection default;
......
......@@ -9,7 +9,7 @@ connection con2;
INSERT INTO t1 (a) VALUES (1);
connection con1;
# If consistent read works on this isolation level (SERIALIZABLE), the following SELECT should not return the value we inserted (1)
SELECT * FROM t1;
SELECT a FROM t1;
a
COMMIT;
connection default;
......
......@@ -38,7 +38,7 @@ if ($mysql_errname)
connection con1;
--echo # If consistent read works on this isolation level ($trx_isolation), the following SELECT should not return the value we inserted (1)
SELECT * FROM t1;
SELECT a FROM t1;
COMMIT;
connection default;
......
......@@ -4,7 +4,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'
INSERT INTO t1 (a,b) SELECT a, b FROM t1;
BEGIN;
DELETE FROM t1 WHERE b IN ('c');
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
1 a
......@@ -24,7 +24,7 @@ a b
8 h
DELETE FROM t1 WHERE a < 0 OR b = 'a';
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10000 foobar
10000 foobar
......@@ -46,7 +46,7 @@ SAVEPOINT spt1;
DELETE FROM t1;
RELEASE SAVEPOINT spt1;
ROLLBACK;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10000 foobar
10000 foobar
......
......@@ -22,11 +22,11 @@ if ($mysql_errname)
--source ../unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DELETE FROM t1 WHERE a < 0 OR b = 'a';
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
BEGIN;
DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
......@@ -35,7 +35,7 @@ DELETE FROM t1;
RELEASE SAVEPOINT spt1;
ROLLBACK;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
BEGIN;
DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1;
......
......@@ -4,7 +4,7 @@ BEGIN;
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo');
INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc');
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
10 foo
......@@ -21,7 +21,7 @@ INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
RELEASE SAVEPOINT spt1;
INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
ROLLBACK;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
10 foo
......@@ -39,7 +39,7 @@ INSERT t1 SET b = DEFAULT;
ROLLBACK TO SAVEPOINT spt1;
INSERT INTO t1 (b,a) VALUES ('test1',10);
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
10 NULL
......
......@@ -15,7 +15,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo');
INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc');
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
BEGIN;
INSERT INTO t1 (b,a) VALUES ('test',0);
......@@ -25,7 +25,7 @@ RELEASE SAVEPOINT spt1;
INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT);
ROLLBACK;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
BEGIN;
INSERT t1 (a) VALUE (10),(20);
......@@ -36,7 +36,7 @@ ROLLBACK TO SAVEPOINT spt1;
INSERT INTO t1 (b,a) VALUES ('test1',10);
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
......
......@@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
connection con1;
CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
START TRANSACTION;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
BEGIN;
......@@ -14,53 +14,53 @@ INSERT INTO t1 (a) VALUES(1);
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
INSERT INTO t1 (a) VALUES (2);
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
INSERT INTO t1 (a) SELECT a+100 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
INSERT INTO t1 (a) SELECT a+200 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
201
202
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
201
202
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -81,7 +81,7 @@ connection con2;
INSERT INTO t1 (a) VALUES (1);
connection con1;
# If consistent read works on this isolation level (READ COMMITTED), the following SELECT should not return the value we inserted (1)
SELECT * FROM t1;
SELECT a FROM t1;
a
1
COMMIT;
......
......@@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
connection con1;
CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
START TRANSACTION;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
BEGIN;
......@@ -14,7 +14,7 @@ INSERT INTO t1 (a) VALUES(1);
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
connection con2;
......@@ -22,35 +22,35 @@ INSERT INTO t1 (a) VALUES (2);
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
INSERT INTO t1 (a) SELECT a+100 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
102
2
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
102
2
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
102
2
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
......@@ -59,7 +59,7 @@ a
INSERT INTO t1 (a) SELECT a+200 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
......@@ -70,7 +70,7 @@ a
301
302
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
......@@ -81,7 +81,7 @@ a
301
302
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
101
......@@ -106,7 +106,7 @@ connection con2;
INSERT INTO t1 (a) VALUES (1);
connection con1;
# If consistent read works on this isolation level (READ UNCOMMITTED), the following SELECT should not return the value we inserted (1)
SELECT * FROM t1;
SELECT a FROM t1;
a
1
COMMIT;
......
......@@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
connection con1;
CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
START TRANSACTION;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
BEGIN;
......@@ -14,50 +14,50 @@ INSERT INTO t1 (a) VALUES(1);
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
INSERT INTO t1 (a) VALUES (2);
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
INSERT INTO t1 (a) SELECT a+100 FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
INSERT INTO t1 (a) SELECT a+200 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
201
202
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
201
202
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......
......@@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
connection con1;
CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
START TRANSACTION;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
BEGIN;
......@@ -15,7 +15,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
INSERT INTO t1 (a) VALUES (2);
......@@ -23,32 +23,32 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'.
# If it differs from the result file, it might indicate a problem.
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
INSERT INTO t1 (a) SELECT a+100 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
INSERT INTO t1 (a) SELECT a+200 FROM t1;
# WARNING: Statement ended with errno 0, errname ''.
# If it differs from the result file, it might indicate a problem.
SELECT * FROM t1;
SELECT a FROM t1;
a
COMMIT;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection default;
disconnect con1;
......
......@@ -3,23 +3,23 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
connect con1,localhost,root,,;
BEGIN;
SELECT * FROM t1 WHERE b='a' FOR UPDATE;
SELECT a,b FROM t1 WHERE b='a' FOR UPDATE;
a b
1 a
3 a
connection default;
SET lock_wait_timeout = 1;
SELECT * FROM t1 WHERE b='a';
SELECT a,b FROM t1 WHERE b='a';
a b
1 a
3 a
SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE;
SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
UPDATE t1 SET b='c' WHERE b='a';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection con1;
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -27,7 +27,7 @@ a b
disconnect con1;
connection default;
UPDATE t1 SET b='c' WHERE b='a';
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 c
2 b
......
......@@ -22,7 +22,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
--connect (con1,localhost,root,,)
BEGIN;
--sorted_result
SELECT * FROM t1 WHERE b='a' FOR UPDATE;
SELECT a,b FROM t1 WHERE b='a' FOR UPDATE;
if ($mysql_errname)
{
--let $functionality = SELECT .. FOR UPDATE
......@@ -35,7 +35,7 @@ SET lock_wait_timeout = 1;
# Should still be able to select
--sorted_result
SELECT * FROM t1 WHERE b='a';
SELECT a,b FROM t1 WHERE b='a';
if ($mysql_errname)
{
--let $functionality = SELECT .. FOR UPDATE or locking
......@@ -46,7 +46,7 @@ if ($mysql_errname)
--sorted_result
--let $error_codes = ER_LOCK_WAIT_TIMEOUT
SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE;
SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
--source ../check_errors.inc
if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT)
{
......@@ -66,7 +66,7 @@ if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT)
--connection con1
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--disconnect con1
--connection default
......@@ -78,7 +78,7 @@ if ($mysql_errname)
--source ../unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
......
......@@ -3,17 +3,17 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
connect con1,localhost,root,,;
BEGIN;
SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE;
SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
a b
1 a
3 a
connection default;
SET lock_wait_timeout = 1;
SELECT * FROM t1 WHERE b='a';
SELECT a,b FROM t1 WHERE b='a';
a b
1 a
3 a
SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE;
SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
a b
1 a
3 a
......@@ -21,7 +21,7 @@ UPDATE t1 SET b='c' WHERE b='a';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection con1;
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 a
2 b
......@@ -29,7 +29,7 @@ a b
disconnect con1;
connection default;
UPDATE t1 SET b='c' WHERE b='a';
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
1 c
2 b
......
......@@ -22,7 +22,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a');
--connect (con1,localhost,root,,)
BEGIN;
--sorted_result
SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE;
SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
if ($mysql_errname)
{
--let $functionality = LOCK IN SHARE MODE
......@@ -35,14 +35,14 @@ SET lock_wait_timeout = 1;
# Should still be able to select
--sorted_result
SELECT * FROM t1 WHERE b='a';
SELECT a,b FROM t1 WHERE b='a';
if ($mysql_errname)
{
--let $functionality = LOCK IN SHARE MODE
--source ../unexpected_result.inc
}
--sorted_result
SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE;
SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE;
if ($mysql_errname)
{
--let $functionality = LOCK IN SHARE MODE
......@@ -61,7 +61,7 @@ if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT)
--connection con1
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
--disconnect con1
--connection default
......@@ -73,7 +73,7 @@ if ($mysql_errname)
--source ../unexpected_result.inc
}
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
DROP TABLE t1;
......
......@@ -31,7 +31,7 @@ let $create_definition = a $int_col;
START TRANSACTION;
--sorted_result
SELECT * FROM t1; # First snapshot
SELECT a FROM t1; # First snapshot
connection con2;
......@@ -42,7 +42,7 @@ INSERT INTO t1 (a) VALUES(1);
connection con1;
--sorted_result
SELECT * FROM t1; # Second snapshot
SELECT a FROM t1; # Second snapshot
connection con2;
--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT
......@@ -51,25 +51,25 @@ INSERT INTO t1 (a) VALUES (2);
connection con1;
--sorted_result
SELECT * FROM t1; # Third snapshot
SELECT a FROM t1; # Third snapshot
--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1 (a) SELECT a+100 FROM t1;
--source ../strict_check_errors.inc
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
connection con2;
--sorted_result
SELECT * FROM t1; # Inside the transaction
SELECT a FROM t1; # Inside the transaction
COMMIT;
--sorted_result
SELECT * FROM t1; # Outside the transaction
SELECT a FROM t1; # Outside the transaction
connection con1;
--sorted_result
SELECT * FROM t1; # Inside the transaction
SELECT a FROM t1; # Inside the transaction
# Note: INSERT .. SELECT might be tricky, for example for InnoDB
# even with REPEATABLE-READ it works as if it is executed with READ COMMITTED.
......@@ -81,14 +81,14 @@ INSERT INTO t1 (a) SELECT a+200 FROM t1;
--source ../strict_check_errors.inc
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
COMMIT;
--sorted_result
SELECT * FROM t1; # Outside the transaction
SELECT a FROM t1; # Outside the transaction
connection con2;
--sorted_result
SELECT * FROM t1; # After both transactions have committed
SELECT a FROM t1; # After both transactions have committed
connection default;
disconnect con1;
......
......@@ -6,7 +6,7 @@ BEGIN;
UPDATE t1 SET a=a+100;
UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100;
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10050 NULL
10050 NULL
......@@ -31,7 +31,7 @@ UPDATE t1 SET b = '';
ROLLBACK TO SAVEPOINT spt1;
UPDATE t1 SET b = 'upd' WHERE a = 10050;
COMMIT;
SELECT * FROM t1;
SELECT a,b FROM t1;
a b
10050 upd
10050 upd
......
......@@ -26,7 +26,7 @@ if (!$mysql_errname)
UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100;
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
BEGIN;
UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3;
......@@ -41,7 +41,7 @@ if (!$mysql_errname)
UPDATE t1 SET b = 'upd' WHERE a = 10050;
COMMIT;
--sorted_result
SELECT * FROM t1;
SELECT a,b FROM t1;
}
DROP TABLE t1;
......
......@@ -7,18 +7,18 @@ connection con2;
XA START 'xa1';
INSERT INTO t1 (a) VALUES (1);
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
INSERT INTO t1 (a) VALUES (2);
XA END 'xa1';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
XA PREPARE 'xa1';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
connection con2;
XA RECOVER;
......@@ -26,7 +26,7 @@ formatID gtrid_length bqual_length data
1 3 0 xa1
XA COMMIT 'xa1';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -34,7 +34,7 @@ connection con2;
XA START 'xa2';
INSERT INTO t1 (a) VALUES (3);
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -42,14 +42,14 @@ connection con2;
INSERT INTO t1 (a) VALUES (4);
XA END 'xa2';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
connection con2;
XA COMMIT 'xa2' ONE PHASE;
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -59,7 +59,7 @@ connection con2;
XA START 'xa3';
INSERT INTO t1 (a) VALUES (5);
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -69,7 +69,7 @@ connection con2;
INSERT INTO t1 (a) VALUES (6);
XA END 'xa3';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -78,7 +78,7 @@ a
connection con2;
XA PREPARE 'xa3';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......@@ -87,7 +87,7 @@ a
connection con2;
XA ROLLBACK 'xa3';
connection con1;
SELECT * FROM t1;
SELECT a FROM t1;
a
1
2
......
......@@ -30,7 +30,7 @@ INSERT INTO t1 (a) VALUES (1);
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
INSERT INTO t1 (a) VALUES (2);
......@@ -38,14 +38,14 @@ XA END 'xa1';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
XA PREPARE 'xa1';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
XA RECOVER;
......@@ -53,7 +53,7 @@ XA COMMIT 'xa1';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
# One-phase COMMIT
......@@ -63,7 +63,7 @@ INSERT INTO t1 (a) VALUES (3);
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
INSERT INTO t1 (a) VALUES (4);
......@@ -71,14 +71,14 @@ XA END 'xa2';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
XA COMMIT 'xa2' ONE PHASE;
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
# Rollback
......@@ -88,7 +88,7 @@ INSERT INTO t1 (a) VALUES (5);
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
INSERT INTO t1 (a) VALUES (6);
......@@ -96,21 +96,21 @@ XA END 'xa3';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
XA PREPARE 'xa3';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
--connection con2
XA ROLLBACK 'xa3';
--connection con1
--sorted_result
SELECT * FROM t1;
SELECT a FROM t1;
DROP TABLE t1;
......
......@@ -22,7 +22,7 @@ formatID gtrid_length bqual_length data
1 3 0 xa2
XA ROLLBACK 'xa1';
XA COMMIT 'xa2';
SELECT * FROM t1;
SELECT a FROM t1;
a
3
4
......
......@@ -64,7 +64,7 @@ EOF
XA RECOVER;
XA ROLLBACK 'xa1';
XA COMMIT 'xa2';
SELECT * FROM t1;
SELECT a FROM t1;
DROP TABLE t1;
--source ../cleanup_engine.inc
......
......@@ -27,16 +27,16 @@ if (!$mysql_errname)
# Valid values
INSERT INTO t1 VALUES ('','','','','');
INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('','','','','');
INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
--sorted_result
SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1;
# Invalid values
INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1;
INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
INSERT INTO t1 (b,b0,b1,b20,b255) SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1;
--sorted_result
SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1;
......
......@@ -12,20 +12,20 @@ b0 binary(0) # # # #
b1 binary(1) # # # #
b20 binary(20) # # # #
b255 binary(255) # # # #
INSERT INTO t1 VALUES ('','','','','');
INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('','','','','');
INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1;
HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255)
00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000
INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b0' at row 1
Warning 1265 Data truncated for column 'b1' at row 1
Warning 1265 Data truncated for column 'b20' at row 1
Warning 1265 Data truncated for column 'b255' at row 1
INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1;
INSERT INTO t1 (b,b0,b1,b20,b255) SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1;
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
Warning 1265 Data truncated for column 'b0' at row 1
......
......@@ -88,7 +88,7 @@ SHOW INDEX IN t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 v16 1 v16 # # 10 NULL # #
INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b');
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 (b,b20,v16,v128) SELECT b,b20,v16,v128 FROM t1;
EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%';
id select_type table type possible_keys key key_len ref rows Extra
# # # # # NULL # # # #
......
......@@ -130,7 +130,7 @@ if (!$mysql_errname)
SHOW INDEX IN t1;
INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b');
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 (b,b20,v16,v128) SELECT b,b20,v16,v128 FROM t1;
--replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 #
EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%';
......
......@@ -43,28 +43,28 @@ if (!$mysql_errname)
SHOW COLUMNS IN t1;
}
INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
--sorted_result
SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
INSERT INTO t1 VALUES (1,0,-1,0);
INSERT INTO t1 (a,b,c,d) VALUES (1,0,-1,0);
--sorted_result
SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0);
INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0);
--sorted_result
SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
# Out of range values
# (should produce warnings)
INSERT INTO t1 VALUES (0x10,0,0,1);
INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1);
--sorted_result
SELECT * FROM t1;
SELECT a,b,c,d FROM t1;
INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0);
INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0);
--sorted_result
SELECT * FROM t1;
SELECT a,b,c,d FROM t1;
DROP TABLE t1;
......
......@@ -18,29 +18,29 @@ a bit(1) # # #
b bit(20) # # #
c bit(64) # # #
d bit(1) # # #
INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1);
SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0;
BIN(a) HEX(b) c+0
0 FFFFF 18446744073709551615
INSERT INTO t1 VALUES (1,0,-1,0);
INSERT INTO t1 (a,b,c,d) VALUES (1,0,-1,0);
SELECT a+0, b+0, c+0 FROM t1 WHERE d<100;
a+0 b+0 c+0
0 1048575 18446744073709551615
1 0 18446744073709551615
INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0);
INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0);
SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2);
a+0 b+0 c+0
1 0 18446744073709551615
1 102 255
INSERT INTO t1 VALUES (0x10,0,0,1);
INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
SELECT * FROM t1;
SELECT a,b,c,d FROM t1;
a b c d
INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0);
INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0);
Warnings:
Warning 1264 Out of range value for column 'c' at row 1
SELECT * FROM t1;
SELECT a,b,c,d FROM t1;
a b c d
DROP TABLE t1;
CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
......
......@@ -33,7 +33,7 @@ if (!$mysql_errname)
# Valid values
# (cannot get MAX for all columns due to max_allowed_packet limitations)
INSERT INTO t1 VALUES
INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
('','','','','','','','','',''),
('a','b','c','d','e','f','g','h','i','j'),
('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
......@@ -44,7 +44,7 @@ if (!$mysql_errname)
# Invalid values (produce warnings, except for mediumblob and longblob columns for which the values are within limits)
INSERT INTO t1 VALUES
INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
--sorted_result
......
......@@ -22,7 +22,7 @@ b17m longblob # # #
t tinyblob # # #
m mediumblob # # #
l longblob # # #
INSERT INTO t1 VALUES
INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
('','','','','','','','','',''),
('a','b','c','d','e','f','g','h','i','j'),
('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'),
......@@ -33,7 +33,7 @@ LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m
1 1 1 1 1 1 1 1 1 1
5 5 5 5 5 5 5 5 5 6
65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152
INSERT INTO t1 VALUES
INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES
( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) );
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
......
......@@ -25,40 +25,40 @@ if (!$mysql_errname)
# Valid values
INSERT INTO t1 VALUES (1,TRUE);
INSERT INTO t1 (b1,b2) VALUES (1,TRUE);
--sorted_result
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
INSERT INTO t1 VALUES (FALSE,0);
INSERT INTO t1 (b1,b2) VALUES (FALSE,0);
--sorted_result
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
INSERT INTO t1 VALUES (2,3);
INSERT INTO t1 (b1,b2) VALUES (2,3);
--sorted_result
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
INSERT INTO t1 VALUES (-1,-2);
INSERT INTO t1 (b1,b2) VALUES (-1,-2);
--sorted_result
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
--sorted_result
SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1;
--sorted_result
SELECT * FROM t1 WHERE b1 = TRUE;
SELECT b1,b2 FROM t1 WHERE b1 = TRUE;
--sorted_result
SELECT * FROM t1 WHERE b2 = FALSE;
SELECT b1,b2 FROM t1 WHERE b2 = FALSE;
# Invalid values
INSERT INTO t1 VALUES ('a','b');
INSERT INTO t1 (b1,b2) VALUES ('a','b');
--sorted_result
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
INSERT INTO t1 VALUES (128,-129);
INSERT INTO t1 (b1,b2) VALUES (128,-129);
--sorted_result
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
# This is why we don't have zerofill and unsigned tests
# for boolean columns:
......
......@@ -6,23 +6,23 @@ SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
b1 tinyint(1) # # #
b2 tinyint(1) # # #
INSERT INTO t1 VALUES (1,TRUE);
SELECT * FROM t1;
INSERT INTO t1 (b1,b2) VALUES (1,TRUE);
SELECT b1,b2 FROM t1;
b1 b2
1 1
INSERT INTO t1 VALUES (FALSE,0);
SELECT * FROM t1;
INSERT INTO t1 (b1,b2) VALUES (FALSE,0);
SELECT b1,b2 FROM t1;
b1 b2
0 0
1 1
INSERT INTO t1 VALUES (2,3);
SELECT * FROM t1;
INSERT INTO t1 (b1,b2) VALUES (2,3);
SELECT b1,b2 FROM t1;
b1 b2
0 0
1 1
2 3
INSERT INTO t1 VALUES (-1,-2);
SELECT * FROM t1;
INSERT INTO t1 (b1,b2) VALUES (-1,-2);
SELECT b1,b2 FROM t1;
b1 b2
-1 -2
0 0
......@@ -34,28 +34,28 @@ false false
true true
true true
true true
SELECT * FROM t1 WHERE b1 = TRUE;
SELECT b1,b2 FROM t1 WHERE b1 = TRUE;
b1 b2
1 1
SELECT * FROM t1 WHERE b2 = FALSE;
SELECT b1,b2 FROM t1 WHERE b2 = FALSE;
b1 b2
0 0
INSERT INTO t1 VALUES ('a','b');
INSERT INTO t1 (b1,b2) VALUES ('a','b');
Warnings:
Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1
Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
b1 b2
-1 -2
0 0
0 0
1 1
2 3
INSERT INTO t1 VALUES (128,-129);
INSERT INTO t1 (b1,b2) VALUES (128,-129);
Warnings:
Warning 1264 Out of range value for column 'b1' at row 1
Warning 1264 Out of range value for column 'b2' at row 1
SELECT * FROM t1;
SELECT b1,b2 FROM t1;
b1 b2
-1 -2
0 0
......
......@@ -27,19 +27,19 @@ if (!$mysql_errname)
# Valid values
INSERT INTO t1 VALUES ('','','','','');
INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','','');
INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
--sorted_result
SELECT * FROM t1;
SELECT c,c0,c1,c20,c255 FROM t1;
# Invalid values
INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1;
INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1;
--sorted_result
SELECT * FROM t1;
SELECT c,c0,c1,c20,c255 FROM t1;
--sorted_result
SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20;
......
......@@ -12,20 +12,20 @@ c0 char(0) # # #
c1 char(1) # # #
c20 char(20) # # #
c255 char(255) # # #
INSERT INTO t1 VALUES ('','','','','');
INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
SELECT * FROM t1;
INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','','');
INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
SELECT c,c0,c1,c20,c255 FROM t1;
c c0 c1 c20 c255
a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.
INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'c0' at row 1
Warning 1265 Data truncated for column 'c1' at row 1
Warning 1265 Data truncated for column 'c20' at row 1
Warning 1265 Data truncated for column 'c255' at row 1
INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1;
INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1;
Warnings:
Warning 1265 Data truncated for column 'c' at row 2
Warning 1265 Data truncated for column 'c0' at row 2
......@@ -36,7 +36,7 @@ Warning 1265 Data truncated for column 'c0' at row 3
Warning 1265 Data truncated for column 'c1' at row 3
Warning 1265 Data truncated for column 'c20' at row 3
Warning 1265 Data truncated for column 'c255' at row 3
SELECT * FROM t1;
SELECT c,c0,c1,c20,c255 FROM t1;
c c0 c1 c20 c255
......
......@@ -96,10 +96,10 @@ varchar1b 2
varchar2b 1
varchar3b 1
SET SESSION optimizer_switch = 'engine_condition_pushdown=on';
EXPLAIN SELECT * FROM t1 WHERE c > 'a';
EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
id select_type table type possible_keys key key_len ref rows Extra
# # # range c_v c_v # # # Using index condition
SELECT * FROM t1 WHERE c > 'a';
SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
c c20 v16 v128
b char3 varchar1a varchar1b
c char4 varchar3a varchar3b
......@@ -133,10 +133,10 @@ r1a
r1a
r2a
r3a
EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
id select_type table type possible_keys key key_len ref rows Extra
# # # range # v16 # # # #
SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
c c20 v16 v128
a char1 varchar1a varchar1b
b char3 varchar1a varchar1b
......
......@@ -135,9 +135,9 @@ if (!$mysql_errname)
SET SESSION optimizer_switch = 'engine_condition_pushdown=on';
--replace_column 1 # 2 # 3 # 7 # 8 # 9 #
EXPLAIN SELECT * FROM t1 WHERE c > 'a';
EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
--sorted_result
SELECT * FROM t1 WHERE c > 'a';
SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
SET SESSION optimizer_switch = @@global.optimizer_switch;
DROP TABLE t1;
......@@ -175,9 +175,9 @@ if (!$mysql_errname)
SELECT SUBSTRING(v16,7,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%';
--replace_column 1 # 2 # 3 # 5 # 7 # 8 # 9 # 10 #
EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
--sorted_result
SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16;
DROP TABLE t1;
}
......
......@@ -32,22 +32,22 @@ if (!$mysql_errname)
# Valid values
# '1970-01-01 00:00:01'
INSERT INTO t1 VALUES
INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES
('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'),
('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'),
('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'),
(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm));
--sorted_result
SELECT * FROM t1;
SELECT d,dt,ts,t,y,y4,y2 FROM t1;
# Invalid values
INSERT INTO t1 VALUES
INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES
('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' );
--sorted_result
SELECT * FROM t1;
SELECT d,dt,ts,t,y,y4,y2 FROM t1;
DROP TABLE t1;
}
......
......@@ -19,18 +19,18 @@ y year(4) # # #
y4 year(4) # # #
y2 year(2) # # #
SET @tm = '2012-04-09 05:27:00';
INSERT INTO t1 VALUES
INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES
('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'),
('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'),
('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'),
(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm));
SELECT * FROM t1;
SELECT d,dt,ts,t,y,y4,y2 FROM t1;
d dt ts t y y4 y2
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00
1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00
2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12
9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99
INSERT INTO t1 VALUES
INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES
('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' );
Warnings:
Warning 1265 Data truncated for column 'd' at row 1
......@@ -40,7 +40,7 @@ Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'y4' at row 1
Warning 1264 Out of range value for column 'y2' at row 1
SELECT * FROM t1;
SELECT d,dt,ts,t,y,y4,y2 FROM t1;
d dt ts t y y4 y2
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00
......
......@@ -28,16 +28,16 @@ if (!$mysql_errname)
--replace_column 3 # 4 # 5 #
SHOW COLUMNS IN t1;
INSERT INTO t1 VALUES ('','test2','4'),('',5,2);
INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2);
--sorted_result
SELECT * FROM t1;
SELECT a,b,c FROM t1;
# Out of range values
# (should produce warnings)
INSERT INTO t1 VALUES (0,'test6',-1);
INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1);
--sorted_result
SELECT * FROM t1;
SELECT a,b,c FROM t1;
# Non-unique values in enum
# (should produce a warning)
......@@ -53,14 +53,14 @@ if (!$mysql_errname)
--replace_column 3 # 4 # 5 #
SHOW COLUMNS IN t1;
INSERT INTO t1 VALUES ('','test3','75','A');
INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A');
--sorted_result
SELECT * FROM t1;
SELECT a,b,c,e FROM t1;
# Simple comparison
--sorted_result
SELECT * FROM t1 WHERE b='test2' OR a != '';
SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != '';
DROP TABLE t1;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment