diff options
author | unknown <monty@hundin.mysql.fi> | 2002-01-03 00:46:43 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-01-03 00:46:43 +0200 |
commit | b79170b7fd6b77bbc6cc083fbcaa13faf7f02f92 (patch) | |
tree | 4e18e3ee4d74189f2a784d419334e02f025eacd1 /mysql-test/r | |
parent | 301cdf9f240106978b04d4f8044b24e4a3fa6d00 (diff) | |
download | mariadb-git-b79170b7fd6b77bbc6cc083fbcaa13faf7f02f92.tar.gz |
New CAST syntax
Cleanup of multi-table-delete in sql_yacc.yy
Changed syntax of MAXIMUM QUERIES PER HOUR to MAX_QUERIES_PER_HOUR to
not get too many reserved words.
Docs/manual.texi:
Updated information about CAST
mysql-test/r/bigint.result:
New CAST syntax
mysql-test/r/create.result:
New CAST syntax
mysql-test/r/variables.result:
Fix after merge with 3.23
mysql-test/t/bigint.test:
New CAST syntax
mysql-test/t/create.test:
New CAST syntax
sql/item_create.cc:
New CAST syntax
sql/item_func.h:
New CAST syntax
sql/item_timefunc.cc:
New CAST syntax
sql/item_timefunc.h:
New CAST syntax
sql/lex.h:
Changed syntax to MAX_QUERIES_PER_HOUR to not get too many reserved words.
sql/mysql_priv.h:
Cleanup multi-delete
sql/sql_parse.cc:
Cleanup multi-delete
sql/sql_yacc.yy:
Cleanup multi-delete.
New CAST syntax.
Removed some restricted words.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/bigint.result | 12 | ||||
-rw-r--r-- | mysql-test/r/create.result | 2 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 9 |
3 files changed, 16 insertions, 7 deletions
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 1618f3f27a2..b7eaa179484 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -55,12 +55,12 @@ select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 drop table t1; -select UNSIGNED 1-2; -UNSIGNED 1-2 +select CAST(1-2 AS UNSIGNED); +CAST(1-2 AS UNSIGNED) 18446744073709551615 -select SIGNED (UNSIGNED 1-2); -SIGNED (UNSIGNED 1-2) +select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER); +CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER) -1 -select UNSIGNED '-1'; -UNSIGNED '-1' +select CONVERT('-1',UNSIGNED); +CONVERT('-1',UNSIGNED) 18446744073709551615 diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 21c2f1efaf4..625b84ae837 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -87,7 +87,7 @@ d bigint(17) 0 e double(18,1) 0.0 f bigint(17) 0 drop table t2; -create table t2 select DATE "2001-12-29" as d, TIME "20:45:11" as t, DATETIME "2001-12-29 20:45:11" as dt; +create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt; describe t2; Field Type Null Key Default Extra d date 0000-00-00 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 52189c36831..e1f21f324ce 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1,3 +1,4 @@ +drop table if exists t1; set @`test`=1,@TEST=3,@select=2,@t5=1.23456; select @test,@`select`,@TEST,@not_used; @test @`select` @TEST @not_used @@ -24,14 +25,22 @@ select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; select @t5; @t5 1.23456 +CREATE TABLE t1 (c_id INT(4) NOT NULL, c_name CHAR(20), c_country CHAR(3), PRIMARY KEY(c_id)); +INSERT INTO t1 VALUES (1,'Bozo','USA'),(2,'Ronald','USA'),(3,'Kinko','IRE'),(4,'Mr. Floppy','GB'); +SELECT @min_cid:=min(c_id), @max_cid:=max(c_id) from t1; @min_cid:=min(c_id) @max_cid:=max(c_id) 1 4 +SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid; c_id c_name c_country 1 Bozo USA 4 Mr. Floppy GB +SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid OR c_id=666; c_id c_name c_country 1 Bozo USA 4 Mr. Floppy GB +ALTER TABLE t1 DROP PRIMARY KEY; +select * from t1 where c_id=@min_cid OR c_id=@max_cid; c_id c_name c_country 1 Bozo USA 4 Mr. Floppy GB +drop table t1; |