diff options
author | unknown <monty@hundin.mysql.fi> | 2002-04-25 01:16:42 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-04-25 01:16:42 +0300 |
commit | 0a03601fab2174e2a7590ff36d4ce2aee08adc5f (patch) | |
tree | 539e3f41736108728458d901c552313e5f058e8f /mysql-test | |
parent | a56d1215f52b8d6ed9428b358034f439e03cbf5b (diff) | |
parent | 64cc56125791c5e3773399b6d3a40be81510b460 (diff) | |
download | mariadb-git-0a03601fab2174e2a7590ff36d4ce2aee08adc5f.tar.gz |
merge
BitKeeper/etc/logging_ok:
auto-union
configure.in:
Auto merged
BitKeeper/deleted/.del-identity.result~e41453a364242503:
Auto merged
BitKeeper/deleted/.del-identity.test~326f469b59105404:
Auto merged
include/my_pthread.h:
Auto merged
innobase/dict/dict0crea.c:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/dict/dict0load.c:
Auto merged
innobase/include/univ.i:
Auto merged
innobase/lock/lock0lock.c:
Auto merged
innobase/pars/pars0opt.c:
Auto merged
innobase/que/que0que.c:
Auto merged
innobase/row/row0ins.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/row/row0upd.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/sync/sync0sync.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/myisampack.c:
Auto merged
mysql-test/t/func_test.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
mysys/my_pthread.c:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/share/danish/errmsg.txt:
Auto merged
sql/share/english/errmsg.txt:
Auto merged
sql/share/french/errmsg.txt:
Auto merged
sql/share/german/errmsg.txt:
Auto merged
sql/share/greek/errmsg.txt:
Auto merged
sql/share/hungarian/errmsg.txt:
Auto merged
sql/sql_show.cc:
Auto merged
sql/share/italian/errmsg.txt:
Auto merged
sql/share/japanese/errmsg.txt:
Auto merged
sql/share/korean/errmsg.txt:
Auto merged
sql/share/norwegian-ny/errmsg.txt:
Auto merged
sql/share/norwegian/errmsg.txt:
Auto merged
sql/share/polish/errmsg.txt:
Auto merged
sql/share/portuguese/errmsg.txt:
Auto merged
sql/share/romanian/errmsg.txt:
Auto merged
sql/share/russian/errmsg.txt:
Auto merged
sql/share/slovak/errmsg.txt:
Auto merged
sql/share/spanish/errmsg.txt:
Auto merged
sql/share/swedish/errmsg.txt:
Auto merged
sql/share/ukrainian/errmsg.txt:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_if.result | 35 | ||||
-rw-r--r-- | mysql-test/r/identity.result | 6 | ||||
-rw-r--r-- | mysql-test/t/func_if.test | 30 | ||||
-rw-r--r-- | mysql-test/t/func_test.test | 11 | ||||
-rw-r--r-- | mysql-test/t/identity.test | 2 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 1 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 11 |
7 files changed, 77 insertions, 19 deletions
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result new file mode 100644 index 00000000000..64ee8c67def --- /dev/null +++ b/mysql-test/r/func_if.result @@ -0,0 +1,35 @@ +IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0 +this is a 2 2.0 +s +a +A +a +aa +AA +aaa +BBB +s +a +A +a +aa +AA +aaa +BBB +s +A +AA +BBB +a +a +aa +aaa +s +A +AA +a +a +aa +aaa +sum(if(num is null,0.00,num)) +nan diff --git a/mysql-test/r/identity.result b/mysql-test/r/identity.result deleted file mode 100644 index 39123e9c127..00000000000 --- a/mysql-test/r/identity.result +++ /dev/null @@ -1,6 +0,0 @@ -select last_insert_id(345); -last_insert_id(345) -345 -select @@IDENTITY,last_insert_id(); -@@IDENTITY last_insert_id() -345 345 diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test new file mode 100644 index 00000000000..c5cc73ecd1f --- /dev/null +++ b/mysql-test/t/func_if.test @@ -0,0 +1,30 @@ +# +# Init section +# +drop table if exists t1; + +# +# Simple IF tests +# + +select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ; + +# +# Test of IF and case-sensitiveness +# +CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) TYPE=MyISAM; +INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0); +select if(1,st,st) s from t1 order by s; +select if(u=1,st,st) s from t1 order by s; +select if(u=1,binary st,st) s from t1 order by s; +select if(u=1,st,binary st) s from t1 where st like "%a%" order by s; +drop table t1; + +# +# Problem with IF() +# + +create table t1 (num double(12,2)); +insert into t1 values (144.54); +select sum(if(num is null,0.00,num)) from t1; +drop table t1; diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index 0439a96f077..ec44009b1a6 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -11,7 +11,6 @@ select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" li select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; select "aba" regexp concat("^","a"); select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; -select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ; select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); @@ -24,13 +23,3 @@ select -1.49 or -1.49,0.6 or 0.6; select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; select 1 and 0 or 2, 2 or 1 and 0; - -# -# Problem with IF() -# - -drop table if exists t1; -create table t1 (num double(12,2)); -insert into t1 values (144.54); -select sum(if(num is null,0.00,num)) from t1; -drop table t1; diff --git a/mysql-test/t/identity.test b/mysql-test/t/identity.test deleted file mode 100644 index 37183fd3b35..00000000000 --- a/mysql-test/t/identity.test +++ /dev/null @@ -1,2 +0,0 @@ -select last_insert_id(345); -select @@IDENTITY,last_insert_id(); diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index a2b7fa381ee..2613fc17866 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -20,6 +20,7 @@ drop table t1; #show variables; show variables like "wait_timeout%"; +show variables like "WAIT_timeout%"; show variables like "this_doesn't_exists%"; show table status from test like "this_doesn't_exists%"; show databases; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 0499263467c..b3127402238 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -27,3 +27,14 @@ SELECT * FROM t1 WHERE c_id=@min_cid OR c_id=@max_cid OR c_id=666; ALTER TABLE t1 DROP PRIMARY KEY; select * from t1 where c_id=@min_cid OR c_id=@max_cid; drop table t1; + +# +# Test system variables +# + +select @@VERSION=version(); +select last_insert_id(345); +select @@IDENTITY,last_insert_id(); +select @@identity; +--error 1193 +select @@unknown_variable; |