Loading mysql-test/r/distinct.result +25 −1 Original line number Diff line number Diff line Loading @@ -530,7 +530,8 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT DISTINCT a,b FROM t1 GROUP BY a,b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 CREATE TABLE t2(a INT, b INT, c INT, d INT, PRIMARY KEY (a,b)); CREATE TABLE t2(a INT, b INT NOT NULL, c INT NOT NULL, d INT, PRIMARY KEY (a,b)); INSERT INTO t2 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4); EXPLAIN SELECT DISTINCT a FROM t2; id select_type table type possible_keys key key_len ref rows Extra Loading Loading @@ -644,3 +645,26 @@ SELECT COUNT(*) FROM COUNT(*) 2 DROP TABLE t1, t2; CREATE TABLE t1 (a INT, UNIQUE (a)); INSERT INTO t1 VALUES (4),(null),(2),(1),(null),(3); EXPLAIN SELECT DISTINCT a FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 6 Using index SELECT DISTINCT a FROM t1; a NULL 1 2 3 4 EXPLAIN SELECT a FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 6 Using index SELECT a FROM t1 GROUP BY a; a NULL 1 2 3 4 DROP TABLE t1; mysql-test/r/func_time.result +14 −0 Original line number Diff line number Diff line Loading @@ -1183,6 +1183,20 @@ set time_zone= @@global.time_zone; select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE NULL CREATE TABLE t1 (a int, t1 time, t2 time, d date, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1, '10:00:00', NULL, NULL), (2, '11:00:00', '11:15:00', '1972-02-06'); SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) FROM t1; t1 t2 SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ) QUARTER(d) 10:00:00 NULL NULL NULL 11:00:00 11:15:00 00:15:00 1 SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) FROM t1 ORDER BY a DESC; t1 t2 SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ) QUARTER(d) 11:00:00 11:15:00 00:15:00 1 10:00:00 NULL NULL NULL DROP TABLE t1; End of 5.0 tests select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND) Loading mysql-test/r/grant.result +20 −0 Original line number Diff line number Diff line Loading @@ -1037,4 +1037,24 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost; ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16) REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY; ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) CREATE USER bug23556@localhost; CREATE DATABASE bug23556; GRANT SELECT ON bug23556.* TO bug23556@localhost; USE bug23556; CREATE TABLE t1 (a INT PRIMARY KEY); INSERT INTO t1 VALUES (1),(2),(3),(4),(5); GRANT DELETE ON t1 TO bug23556@localhost; USE bug23556; TRUNCATE t1; ERROR 42000: DROP command denied to user 'bug23556'@'localhost' for table 't1' USE bug23556; REVOKE DELETE ON t1 FROM bug23556@localhost; GRANT DROP ON t1 TO bug23556@localhost; USE bug23556; TRUNCATE t1; USE bug23556; DROP TABLE t1; USE test; DROP DATABASE bug23556; DROP USER bug23556@localhost; End of 5.0 tests mysql-test/r/information_schema.result +10 −0 Original line number Diff line number Diff line Loading @@ -1342,6 +1342,16 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found 2 DERIVED tables ALL NULL NULL NULL NULL 2 drop view v1; create table t1 (f1 int(11)); create table t2 (f1 int(11), f2 int(11)); select table_name from information_schema.tables where table_schema = 'test' and table_name not in (select table_name from information_schema.columns where table_schema = 'test' and column_name = 'f3'); table_name t1 t2 drop table t1,t2; End of 5.0 tests. select * from information_schema.engines WHERE ENGINE="MyISAM"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS Loading mysql-test/r/join_nested.result +28 −0 Original line number Diff line number Diff line Loading @@ -1605,3 +1605,31 @@ WHERE t1.id='5'; id ct pc nm 5 NULL NULL NULL DROP TABLE t1,t2,t3,t4; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT); CREATE TABLE t3 (a INT, c INT); CREATE TABLE t4 (a INT, c INT); CREATE TABLE t5 (a INT, c INT); SELECT b FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); ERROR 23000: Column 'c' in field list is ambiguous SELECT b FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); ERROR 23000: Column 'c' in field list is ambiguous DROP TABLE t1,t2,t3,t4,t5; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT); CREATE TABLE t3 (a INT, b INT); INSERT INTO t1 VALUES (1,1); INSERT INTO t2 VALUES (1,1); INSERT INTO t3 VALUES (1,1); SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a); ERROR 23000: Column 'a' in from clause is ambiguous DROP TABLE t1,t2,t3; End of 5.0 tests Loading
mysql-test/r/distinct.result +25 −1 Original line number Diff line number Diff line Loading @@ -530,7 +530,8 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT DISTINCT a,b FROM t1 GROUP BY a,b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 CREATE TABLE t2(a INT, b INT, c INT, d INT, PRIMARY KEY (a,b)); CREATE TABLE t2(a INT, b INT NOT NULL, c INT NOT NULL, d INT, PRIMARY KEY (a,b)); INSERT INTO t2 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4); EXPLAIN SELECT DISTINCT a FROM t2; id select_type table type possible_keys key key_len ref rows Extra Loading Loading @@ -644,3 +645,26 @@ SELECT COUNT(*) FROM COUNT(*) 2 DROP TABLE t1, t2; CREATE TABLE t1 (a INT, UNIQUE (a)); INSERT INTO t1 VALUES (4),(null),(2),(1),(null),(3); EXPLAIN SELECT DISTINCT a FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 6 Using index SELECT DISTINCT a FROM t1; a NULL 1 2 3 4 EXPLAIN SELECT a FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 6 Using index SELECT a FROM t1 GROUP BY a; a NULL 1 2 3 4 DROP TABLE t1;
mysql-test/r/func_time.result +14 −0 Original line number Diff line number Diff line Loading @@ -1183,6 +1183,20 @@ set time_zone= @@global.time_zone; select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE NULL CREATE TABLE t1 (a int, t1 time, t2 time, d date, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1, '10:00:00', NULL, NULL), (2, '11:00:00', '11:15:00', '1972-02-06'); SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) FROM t1; t1 t2 SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ) QUARTER(d) 10:00:00 NULL NULL NULL 11:00:00 11:15:00 00:15:00 1 SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) FROM t1 ORDER BY a DESC; t1 t2 SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ) QUARTER(d) 11:00:00 11:15:00 00:15:00 1 10:00:00 NULL NULL NULL DROP TABLE t1; End of 5.0 tests select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND); date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND) Loading
mysql-test/r/grant.result +20 −0 Original line number Diff line number Diff line Loading @@ -1037,4 +1037,24 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost; ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16) REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY; ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) CREATE USER bug23556@localhost; CREATE DATABASE bug23556; GRANT SELECT ON bug23556.* TO bug23556@localhost; USE bug23556; CREATE TABLE t1 (a INT PRIMARY KEY); INSERT INTO t1 VALUES (1),(2),(3),(4),(5); GRANT DELETE ON t1 TO bug23556@localhost; USE bug23556; TRUNCATE t1; ERROR 42000: DROP command denied to user 'bug23556'@'localhost' for table 't1' USE bug23556; REVOKE DELETE ON t1 FROM bug23556@localhost; GRANT DROP ON t1 TO bug23556@localhost; USE bug23556; TRUNCATE t1; USE bug23556; DROP TABLE t1; USE test; DROP DATABASE bug23556; DROP USER bug23556@localhost; End of 5.0 tests
mysql-test/r/information_schema.result +10 −0 Original line number Diff line number Diff line Loading @@ -1342,6 +1342,16 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found 2 DERIVED tables ALL NULL NULL NULL NULL 2 drop view v1; create table t1 (f1 int(11)); create table t2 (f1 int(11), f2 int(11)); select table_name from information_schema.tables where table_schema = 'test' and table_name not in (select table_name from information_schema.columns where table_schema = 'test' and column_name = 'f3'); table_name t1 t2 drop table t1,t2; End of 5.0 tests. select * from information_schema.engines WHERE ENGINE="MyISAM"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS Loading
mysql-test/r/join_nested.result +28 −0 Original line number Diff line number Diff line Loading @@ -1605,3 +1605,31 @@ WHERE t1.id='5'; id ct pc nm 5 NULL NULL NULL DROP TABLE t1,t2,t3,t4; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT); CREATE TABLE t3 (a INT, c INT); CREATE TABLE t4 (a INT, c INT); CREATE TABLE t5 (a INT, c INT); SELECT b FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a) LEFT JOIN t5 USING (a)) USING (a); ERROR 23000: Column 'c' in field list is ambiguous SELECT b FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); b SELECT c FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a) JOIN t5 USING (a)) USING (a); ERROR 23000: Column 'c' in field list is ambiguous DROP TABLE t1,t2,t3,t4,t5; CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT, b INT); CREATE TABLE t3 (a INT, b INT); INSERT INTO t1 VALUES (1,1); INSERT INTO t2 VALUES (1,1); INSERT INTO t3 VALUES (1,1); SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a); ERROR 23000: Column 'a' in from clause is ambiguous DROP TABLE t1,t2,t3; End of 5.0 tests