diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2002-12-02 18:47:52 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2002-12-02 18:47:52 +0200 |
commit | 36429430c6bd18b7cccd459711ddd0ab30a2e63e (patch) | |
tree | 6f0a4c3215c24c4d01bb05a9fd94575c3741d579 /mysql-test | |
parent | 61daab7900901170db7f2afe8cc16128c3ef11c7 (diff) | |
parent | 68b4940a6b6e154387d6e8b07e466a83a544b336 (diff) | |
download | mariadb-git-36429430c6bd18b7cccd459711ddd0ab30a2e63e.tar.gz |
Merge sinisa@work.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/mysql-test-run.sh | 6 | ||||
-rw-r--r-- | mysql-test/r/row_test.result | 62 | ||||
-rw-r--r-- | mysql-test/r/subselect.result | 22 | ||||
-rw-r--r-- | mysql-test/t/row_test.test | 38 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 22 |
5 files changed, 93 insertions, 57 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index d585243c6bc..745cde325f9 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -19,7 +19,7 @@ TZ=GMT-3; export TZ # for UNIX_TIMESTAMP tests to work # Program Definitions #-- -PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11 +PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$PATH MASTER_40_ARGS="--rpl-recovery-rank=1 --init-rpl-role=master" # Standard functions @@ -319,8 +319,8 @@ while test $# -gt 0; do VALGRIND="valgrind --alignment=8 --leak-check=yes" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc" - SLEEP_TIME_AFTER_RESTART=120 - SLEEP_TIME_FOR_DELETE=120 + SLEEP_TIME_AFTER_RESTART=60 + SLEEP_TIME_FOR_DELETE=60 ;; --valgrind-options=*) TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"` diff --git a/mysql-test/r/row_test.result b/mysql-test/r/row_test.result index f5bf9856a60..f6e989789c7 100644 --- a/mysql-test/r/row_test.result +++ b/mysql-test/r/row_test.result @@ -1,60 +1,60 @@ -SELECT (1,2,3)=(1,2,3); -(1,2,3)=(1,2,3) +SELECT ROW(1,2,3)=ROW(1,2,3); +ROW(1,2,3)=ROW(1,2,3) 1 -SELECT (2,2,3)=(1+1,2,3); -(2,2,3)=(1+1,2,3) +SELECT ROW(2,2,3)=ROW(1+1,2,3); +ROW(2,2,3)=ROW(1+1,2,3) 1 -SELECT (1,2,3)=(1+1,2,3); -(1,2,3)=(1+1,2,3) +SELECT ROW(1,2,3)=ROW(1+1,2,3); +ROW(1,2,3)=ROW(1+1,2,3) 0 -SELECT (1,2,3)<(1+1,2,3); -(1,2,3)<(1+1,2,3) +SELECT ROW(1,2,3)<ROW(1+1,2,3); +ROW(1,2,3)<ROW(1+1,2,3) 1 -SELECT (1,2,3)>(1+1,2,3); -(1,2,3)>(1+1,2,3) +SELECT ROW(1,2,3)>ROW(1+1,2,3); +ROW(1,2,3)>ROW(1+1,2,3) 0 -SELECT (1,2,3)<=(1+1,2,3); -(1,2,3)<=(1+1,2,3) +SELECT ROW(1,2,3)<=ROW(1+1,2,3); +ROW(1,2,3)<=ROW(1+1,2,3) 1 -SELECT (1,2,3)>=(1+1,2,3); -(1,2,3)>=(1+1,2,3) +SELECT ROW(1,2,3)>=ROW(1+1,2,3); +ROW(1,2,3)>=ROW(1+1,2,3) 0 -SELECT (1,2,3)<>(1+1,2,3); -(1,2,3)<>(1+1,2,3) +SELECT ROW(1,2,3)<>ROW(1+1,2,3); +ROW(1,2,3)<>ROW(1+1,2,3) 1 -SELECT (NULL,2,3)=(NULL,2,3); -(NULL,2,3)=(NULL,2,3) +SELECT ROW(NULL,2,3)=ROW(NULL,2,3); +ROW(NULL,2,3)=ROW(NULL,2,3) NULL -SELECT (NULL,2,3)<=>(NULL,2,3); -(NULL,2,3)<=>(NULL,2,3) +SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); +ROW(NULL,2,3)<=>ROW(NULL,2,3) 1 -SELECT (1,2,(3,4,5))=(1,2,(3,4,5)); -(1,2,(3,4,5))=(1,2,(3,4,5)) +SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); +ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)) 1 -SELECT ('test',2,3.33)=('test',2,3.33); -('test',2,3.33)=('test',2,3.33) +SELECT ROW('test',2,3.33)=ROW('test',2,3.33); +ROW('test',2,3.33)=ROW('test',2,3.33) 1 -SELECT ('test',2,3.33)=('test',2,3.33,4); +SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); Cardinality error (more/less than 3 columns) drop table if exists t1; create table t1 ( a int, b int, c int); insert into t1 values (1,2,3), (2,3,1), (3,2,1); -select * from t1 where (1,2,3)=(a,b,c); +select * from t1 where ROW(1,2,3)=ROW(a,b,c); a b c 1 2 3 -select * from t1 where (0,2,3)=(a,b,c); +select * from t1 where ROW(0,2,3)=ROW(a,b,c); a b c -select * from t1 where (1,2,3)<(a,b,c); +select * from t1 where ROW(1,2,3)<ROW(a,b,c); a b c 2 3 1 3 2 1 drop table t1; -select (1,1); +select ROW(1,1); Cardinality error (more/less than 1 columns) drop table if exists t1; create table t1 (i int); -select 1 from t1 where (1,1); +select 1 from t1 where ROW(1,1); Cardinality error (more/less than 1 columns) -select count(*) from t1 order by (1,1); +select count(*) from t1 order by ROW(1,1); Cardinality error (more/less than 1 columns) drop table t1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 8b82032e2e1..42e9ff7012f 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -413,6 +413,8 @@ a b 2 12 update t1 set b= (select b from t1); INSERT TABLE 't1' isn't allowed in FROM table list +update t1 set b= (select b from t2); +Subselect returns more than 1 record update t1 set b= (select b from t2 where t1.a = t2.a); select * from t1; a b @@ -434,6 +436,8 @@ a b 2 12 delete from t1 where b = (select b from t1); INSERT TABLE 't1' isn't allowed in FROM table list +delete from t1 where b = (select b from t2); +Subselect returns more than 1 record delete from t1 where b = (select b from t2 where t1.a = t2.a); select * from t1; a b @@ -459,6 +463,8 @@ a b 2 12 delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a); INSERT TABLE 't12' isn't allowed in FROM table list +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2); +Subselect returns more than 1 record delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a); select * from t11; a b @@ -471,9 +477,13 @@ a b drop table t11, t12, t2; CREATE TABLE t1 (x int); create table t2 (a int); +create table t3 (a int); insert into t2 values (1); +insert into t3 values (1),(2); INSERT INTO t1 (x) VALUES ((SELECT x FROM t1)); INSERT TABLE 't1' isn't allowed in FROM table list +INSERT INTO t1 (x) VALUES ((SELECT a FROM t3)); +Subselect returns more than 1 record INSERT INTO t1 (x) VALUES ((SELECT a FROM t2)); select * from t1; x @@ -501,14 +511,18 @@ x 3 3 0 -drop table t1, t2; +drop table t1, t2, t3; CREATE TABLE t1 (x int not null, y int, primary key (x)); create table t2 (a int); +create table t3 (a int); insert into t2 values (1); +insert into t3 values (1),(2); select * from t1; x y replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2)); INSERT TABLE 't1' isn't allowed in FROM table list +replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2)); +Subselect returns more than 1 record replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2)); select * from t1; x y @@ -533,7 +547,7 @@ x y 1 3 4 2 2 1 -drop table t1, t2; +drop table t1, t2, t3; SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); No tables used drop table if exists t; @@ -575,4 +589,8 @@ SELECT * FROM t; id 1 2 +CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1; +INSERT INTO t1 values (1),(1); +UPDATE t SET id=(SELECT * FROM t1); +Subselect returns more than 1 record drop table t; diff --git a/mysql-test/t/row_test.test b/mysql-test/t/row_test.test index db65e6bd157..5daacaa1ee6 100644 --- a/mysql-test/t/row_test.test +++ b/mysql-test/t/row_test.test @@ -1,33 +1,33 @@ -SELECT (1,2,3)=(1,2,3); -SELECT (2,2,3)=(1+1,2,3); -SELECT (1,2,3)=(1+1,2,3); -SELECT (1,2,3)<(1+1,2,3); -SELECT (1,2,3)>(1+1,2,3); -SELECT (1,2,3)<=(1+1,2,3); -SELECT (1,2,3)>=(1+1,2,3); -SELECT (1,2,3)<>(1+1,2,3); -SELECT (NULL,2,3)=(NULL,2,3); -SELECT (NULL,2,3)<=>(NULL,2,3); -SELECT (1,2,(3,4,5))=(1,2,(3,4,5)); -SELECT ('test',2,3.33)=('test',2,3.33); +SELECT ROW(1,2,3)=ROW(1,2,3); +SELECT ROW(2,2,3)=ROW(1+1,2,3); +SELECT ROW(1,2,3)=ROW(1+1,2,3); +SELECT ROW(1,2,3)<ROW(1+1,2,3); +SELECT ROW(1,2,3)>ROW(1+1,2,3); +SELECT ROW(1,2,3)<=ROW(1+1,2,3); +SELECT ROW(1,2,3)>=ROW(1+1,2,3); +SELECT ROW(1,2,3)<>ROW(1+1,2,3); +SELECT ROW(NULL,2,3)=ROW(NULL,2,3); +SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3); +SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5)); +SELECT ROW('test',2,3.33)=ROW('test',2,3.33); -- error 1239 -SELECT ('test',2,3.33)=('test',2,3.33,4); +SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4); drop table if exists t1; create table t1 ( a int, b int, c int); insert into t1 values (1,2,3), (2,3,1), (3,2,1); -select * from t1 where (1,2,3)=(a,b,c); -select * from t1 where (0,2,3)=(a,b,c); -select * from t1 where (1,2,3)<(a,b,c); +select * from t1 where ROW(1,2,3)=ROW(a,b,c); +select * from t1 where ROW(0,2,3)=ROW(a,b,c); +select * from t1 where ROW(1,2,3)<ROW(a,b,c); drop table t1; -- error 1239 -select (1,1); +select ROW(1,1); drop table if exists t1; create table t1 (i int); -- error 1239 -select 1 from t1 where (1,1); +select 1 from t1 where ROW(1,1); -- error 1239 -select count(*) from t1 order by (1,1); +select count(*) from t1 order by ROW(1,1); #TODO remove comments after parser fixing #-- error 1239 #select count(*) from t1 order by i having (1,1); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 1b8946b4696..9ed4250976b 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -246,6 +246,8 @@ insert into t2 values (1, 21),(2, 22),(3, 23); select * from t1; -- error 1093 update t1 set b= (select b from t1); +-- error 1240 +update t1 set b= (select b from t2); update t1 set b= (select b from t2 where t1.a = t2.a); select * from t1; drop table t1, t2; @@ -259,6 +261,8 @@ select * from t1; select * from t1 where b = (select b from t2 where t1.a = t2.a); -- error 1093 delete from t1 where b = (select b from t1); +-- error 1240 +delete from t1 where b = (select b from t2); delete from t1 where b = (select b from t2 where t1.a = t2.a); select * from t1; drop table t1, t2; @@ -275,6 +279,8 @@ select * from t11; select * from t12; -- error 1093 delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a); +-- error 1240 +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2); delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a); select * from t11; select * from t12; @@ -283,9 +289,13 @@ drop table t11, t12, t2; #insert with subselects CREATE TABLE t1 (x int); create table t2 (a int); +create table t3 (a int); insert into t2 values (1); +insert into t3 values (1),(2); -- error 1093 INSERT INTO t1 (x) VALUES ((SELECT x FROM t1)); +-- error 1240 +INSERT INTO t1 (x) VALUES ((SELECT a FROM t3)); INSERT INTO t1 (x) VALUES ((SELECT a FROM t2)); select * from t1; insert into t2 values (1); @@ -299,15 +309,19 @@ INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2; INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2)); -- sleep 1 select * from t1; -drop table t1, t2; +drop table t1, t2, t3; #replace with subselects CREATE TABLE t1 (x int not null, y int, primary key (x)); create table t2 (a int); +create table t3 (a int); insert into t2 values (1); +insert into t3 values (1),(2); select * from t1; -- error 1093 replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2)); +-- error 1240 +replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2)); replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2)); select * from t1; replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+2 FROM t2)); @@ -320,7 +334,7 @@ replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2 select * from t1; replace LOW_PRIORITY into t1 (x, y) VALUES ((SELECT a+1 FROM t2), (SELECT a FROM t2)); select * from t1; -drop table t1, t2; +drop table t1, t2, t3; -- error 1096 SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); @@ -338,4 +352,8 @@ SELECT * FROM t WHERE id IN (SELECT 5 UNION SELECT 2); -- error 1093 INSERT INTO t VALUES ((SELECT * FROM t)); SELECT * FROM t; +CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1; +INSERT INTO t1 values (1),(1); +-- error 1240 +UPDATE t SET id=(SELECT * FROM t1); drop table t; |