summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/cast.result24
-rw-r--r--mysql-test/r/func_group.result15
-rw-r--r--mysql-test/r/func_str.result18
-rw-r--r--mysql-test/r/mysql_comments.result50
-rw-r--r--mysql-test/r/select.result8
-rw-r--r--mysql-test/r/skip_grants.result5
-rw-r--r--mysql-test/r/subselect.result11
7 files changed, 128 insertions, 3 deletions
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 524ff48d69e..88601eceb0a 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -414,4 +414,28 @@ NULL
NULL
20070719
drop table t1;
+CREATE TABLE t1 (f1 DATE);
+INSERT INTO t1 VALUES ('2007-07-19'), (NULL);
+SELECT HOUR(f1),
+MINUTE(f1),
+SECOND(f1) FROM t1;
+HOUR(f1) MINUTE(f1) SECOND(f1)
+0 0 0
+NULL NULL NULL
+SELECT HOUR(CAST('2007-07-19' AS DATE)),
+MINUTE(CAST('2007-07-19' AS DATE)),
+SECOND(CAST('2007-07-19' AS DATE));
+HOUR(CAST('2007-07-19' AS DATE)) MINUTE(CAST('2007-07-19' AS DATE)) SECOND(CAST('2007-07-19' AS DATE))
+0 0 0
+SELECT HOUR(CAST(NULL AS DATE)),
+MINUTE(CAST(NULL AS DATE)),
+SECOND(CAST(NULL AS DATE));
+HOUR(CAST(NULL AS DATE)) MINUTE(CAST(NULL AS DATE)) SECOND(CAST(NULL AS DATE))
+NULL NULL NULL
+SELECT HOUR(NULL),
+MINUTE(NULL),
+SECOND(NULL);
+HOUR(NULL) MINUTE(NULL) SECOND(NULL)
+NULL NULL NULL
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index e7f27ebb07e..1e130877088 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1392,4 +1392,19 @@ SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01';
MIN(b)
NULL
DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+SET SQL_MODE=ONLY_FULL_GROUP_BY;
+SELECT a FROM t1 HAVING COUNT(*)>2;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SELECT COUNT(*), a FROM t1;
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SET SQL_MODE=DEFAULT;
+SELECT a FROM t1 HAVING COUNT(*)>2;
+a
+1
+SELECT COUNT(*), a FROM t1;
+COUNT(*) a
+4 1
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index e0b4161a6a0..d0809eca65b 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -722,9 +722,9 @@ Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `bin(130)` varchar(64) NOT NULL default '',
- `oct(130)` varchar(64) NOT NULL default '',
- `conv(130,16,10)` varchar(64) NOT NULL default '',
+ `bin(130)` varchar(64) default NULL,
+ `oct(130)` varchar(64) default NULL,
+ `conv(130,16,10)` varchar(64) default NULL,
`hex(130)` varchar(6) NOT NULL default '',
`char(130)` varbinary(4) NOT NULL default '',
`format(130,10)` varchar(4) NOT NULL default '',
@@ -1096,6 +1096,18 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select decode('','zxcv') AS `enc` from `test`.`t1`
drop table t1;
+create table t1 (a bigint not null)engine=myisam;
+insert into t1 set a = 1024*1024*1024*4;
+delete from t1 order by (inet_ntoa(a)) desc limit 10;
+drop table t1;
+create table t1 (a char(36) not null)engine=myisam;
+insert ignore into t1 set a = ' ';
+insert ignore into t1 set a = ' ';
+select * from t1 order by (oct(a));
+a
+
+
+drop table t1;
End of 4.1 tests
create table t1 (d decimal default null);
insert into t1 values (null);
diff --git a/mysql-test/r/mysql_comments.result b/mysql-test/r/mysql_comments.result
new file mode 100644
index 00000000000..366ceeb5bbf
--- /dev/null
+++ b/mysql-test/r/mysql_comments.result
@@ -0,0 +1,50 @@
+drop table if exists t1;
+drop function if exists foofct;
+drop procedure if exists empty;
+drop procedure if exists foosp;
+drop procedure if exists nicesp;
+drop trigger if exists t1_empty;
+drop trigger if exists t1_bi;
+"Pass 1 : --disable-comments"
+1
+1
+2
+2
+foofct("call 1")
+call 1
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nreturn\n\n\n\nx
+foofct("call 2")
+call 2
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nbegin\n \n \n \n\n \n\n \n return x;\nend
+Procedure sql_mode Create Procedure
+empty CREATE DEFINER=`root`@`localhost` PROCEDURE `empty`()\nbegin\nend
+id data
+foo 42
+Procedure sql_mode Create Procedure
+foosp CREATE DEFINER=`root`@`localhost` PROCEDURE `foosp`()\ninsert into test.t1\n\n\n\n\n \n\n \n values ("foo", 42)
+Procedure sql_mode Create Procedure
+nicesp CREATE DEFINER=`root`@`localhost` PROCEDURE `nicesp`(a int)\nbegin\n \n declare b int;\n declare c float;\n\n \n \n\n \nend
+"Pass 2 : --enable-comments"
+1
+1
+2
+2
+foofct("call 1")
+call 1
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nreturn\n-- comment 1a\n# comment 1b\n/* comment 1c */\nx # after body, on same line
+foofct("call 2")
+call 2
+Function sql_mode Create Function
+foofct CREATE DEFINER=`root`@`localhost` FUNCTION `foofct`(x char(20)) RETURNS char(20) CHARSET latin1\nbegin\n -- comment 1a\n # comment 1b\n /*\n comment 1c\n */\n\n -- empty line below\n\n -- empty line above\n return x;\nend
+Procedure sql_mode Create Procedure
+empty CREATE DEFINER=`root`@`localhost` PROCEDURE `empty`()\nbegin\nend
+id data
+foo 42
+Procedure sql_mode Create Procedure
+foosp CREATE DEFINER=`root`@`localhost` PROCEDURE `foosp`()\ninsert into test.t1\n## These comments are part of the procedure body, and should be kept.\n# Comment 2a\n-- Comment 2b\n/* Comment 2c */\n -- empty line below\n\n -- empty line above\n values ("foo", 42) # comment 3, still part of the body
+Procedure sql_mode Create Procedure
+nicesp CREATE DEFINER=`root`@`localhost` PROCEDURE `nicesp`(a int)\nbegin\n -- declare some variables here\n declare b int;\n declare c float;\n\n -- do more stuff here\n -- commented nicely and so on\n\n -- famous last words ...\nend
+End of 5.0 tests
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 36faba94404..98324bb85e9 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2827,6 +2827,14 @@ FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
drop table t1;
+CREATE TABLE t1 (c0 int);
+CREATE TABLE t2 (c0 int);
+INSERT INTO t1 VALUES(@@connect_timeout);
+INSERT INTO t2 VALUES(@@connect_timeout);
+SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout);
+c0 c0
+X X
+DROP TABLE t1, t2;
End of 4.1 tests
CREATE TABLE t1 (
K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '',
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 3052bae8e97..1ef35b051d6 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -70,3 +70,8 @@ count(*)
select count(*) from information_schema.USER_PRIVILEGES;
count(*)
0
+CREATE FUNCTION a RETURNS STRING SONAME '';
+ERROR HY000: Can't initialize function 'a'; UDFs are unavailable with the --skip-grant-tables option
+DROP FUNCTION a;
+ERROR 42000: FUNCTION test.a does not exist
+End of 5.0 tests
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index be99bdb1afc..bfacfc86eef 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4139,4 +4139,15 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
(SELECT SUM(t1.a) FROM t2 WHERE a=1)
3
DROP TABLE t1,t2;
+CREATE TABLE t1 (a1 INT, a2 INT);
+CREATE TABLE t2 (b1 INT, b2 INT);
+INSERT INTO t1 VALUES (100, 200);
+INSERT INTO t1 VALUES (101, 201);
+INSERT INTO t2 VALUES (101, 201);
+INSERT INTO t2 VALUES (103, 203);
+SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
+((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL
+0
+0
+DROP TABLE t1, t2;
End of 5.0 tests.