diff options
author | unknown <monty@hundin.mysql.fi> | 2002-01-30 16:37:47 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-01-30 16:37:47 +0200 |
commit | 85278245af45fc301dc7940bec9a3434003285a6 (patch) | |
tree | 3ca7f6fddbb9bdc0b635f243af69c6606924c3c2 /mysql-test/t/join.test | |
parent | 9369764f2226e0e8cb9724bcdac256f45330ba67 (diff) | |
parent | 8a56717c4ce14aa7e36e04a8dc880dcc1311ea28 (diff) | |
download | mariadb-git-85278245af45fc301dc7940bec9a3434003285a6.tar.gz |
Merge from 3.23.48 tree
BitKeeper/etc/logging_ok:
auto-union
Docs/manual.texi:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/mem/mem0dbg.c:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/que/que0que.c:
Auto merged
innobase/rem/rem0rec.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/sync/sync0arr.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
innobase/trx/trx0undo.c:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/t/join.test:
Auto merged
mysys/hash.c:
Auto merged
scripts/mysql_config.sh:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/sql_acl.cc:
Auto merged
Diffstat (limited to 'mysql-test/t/join.test')
-rw-r--r-- | mysql-test/t/join.test | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index eb95c403760..cbd4898785a 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -1,7 +1,8 @@ # # This failed for lia Perminov # -drop table if exists t1,t2; +drop table if exists t1,t2,t3; + create table t1 (id int primary key); create table t2 (id int); insert into t1 values (75); @@ -120,3 +121,76 @@ INSERT INTO t1 (d) VALUES ('2001-08-01'),('0000-00-00'); SELECT * FROM t1 LEFT JOIN t2 USING (d) WHERE t2.d IS NULL; SELECT * from t1 WHERE t1.d IS NULL; DROP TABLE t1,t2; + +# +# Problem with reference from const tables +# +CREATE TABLE t1 ( + Document_ID varchar(50) NOT NULL default '', + Contractor_ID varchar(6) NOT NULL default '', + Language_ID char(3) NOT NULL default '', + Expiration_Date datetime default NULL, + Publishing_Date datetime default NULL, + Title text, + Column_ID varchar(50) NOT NULL default '', + PRIMARY KEY (Language_ID,Document_ID,Contractor_ID) +); + +INSERT INTO t1 VALUES ('xep80','1','ger','2001-12-31 20:00:00','2001-11-12 10:58:00','Kartenbestellung - jetzt auch online','anle'),('','999998','',NULL,NULL,NULL,''); + +CREATE TABLE t2 ( + Contractor_ID char(6) NOT NULL default '', + Language_ID char(3) NOT NULL default '', + Document_ID char(50) NOT NULL default '', + CanRead char(1) default NULL, + Customer_ID int(11) NOT NULL default '0', + PRIMARY KEY (Contractor_ID,Language_ID,Document_ID,Customer_ID) +); + +INSERT INTO t2 VALUES ('5','ger','xep80','1',999999),('1','ger','xep80','1',999999); +CREATE TABLE t3 ( + Language_ID char(3) NOT NULL default '', + Column_ID char(50) NOT NULL default '', + Contractor_ID char(6) NOT NULL default '', + CanRead char(1) default NULL, + Active char(1) default NULL, + PRIMARY KEY (Language_ID,Column_ID,Contractor_ID) +); +INSERT INTO t3 VALUES ('ger','home','1','1','1'),('ger','Test','1','0','0'),('ger','derclu','1','0','0'),('ger','clubne','1','0','0'),('ger','philos','1','0','0'),('ger','clubko','1','0','0'),('ger','clubim','1','1','1'),('ger','progra','1','0','0'),('ger','progvo','1','0','0'),('ger','progsp','1','0','0'),('ger','progau','1','0','0'),('ger','progku','1','0','0'),('ger','progss','1','0','0'),('ger','nachl','1','0','0'),('ger','mitgli','1','0','0'),('ger','mitsu','1','0','0'),('ger','mitbus','1','0','0'),('ger','ergmar','1','1','1'),('ger','home','4','1','1'),('ger','derclu','4','1','1'),('ger','clubne','4','0','0'),('ger','philos','4','1','1'),('ger','clubko','4','1','1'),('ger','clubim','4','1','1'),('ger','progra','4','1','1'),('ger','progvo','4','1','1'),('ger','progsp','4','1','1'),('ger','progau','4','0','0'),('ger','progku','4','1','1'),('ger','progss','4','1','1'),('ger','nachl','4','1','1'),('ger','mitgli','4','0','0'),('ger','mitsu','4','0','0'),('ger','mitbus','4','0','0'),('ger','ergmar','4','1','1'),('ger','progra2','1','0','0'),('ger','archiv','4','1','1'),('ger','anmeld','4','1','1'),('ger','thema','4','1','1'),('ger','edito','4','1','1'),('ger','madis','4','1','1'),('ger','enma','4','1','1'),('ger','madis','1','1','1'),('ger','enma','1','1','1'),('ger','vorsch','4','0','0'),('ger','veranst','4','0','0'),('ger','anle','4','1','1'),('ger','redak','4','1','1'),('ger','nele','4','1','1'),('ger','aukt','4','1','1'),('ger','callcenter','4','1','1'),('ger','anle','1','0','0'); +delete from t1 where Contractor_ID='999998'; +insert into t1 (Contractor_ID) Values ('999998'); +SELECT DISTINCT COUNT(t1.Title) FROM t1, +t2, t3 WHERE +t1.Document_ID='xep80' AND t1.Contractor_ID='1' AND +t1.Language_ID='ger' AND '2001-12-21 23:14:24' >= +Publishing_Date AND '2001-12-21 23:14:24' <= Expiration_Date AND +t1.Document_ID = t2.Document_ID AND +t1.Language_ID = t2.Language_ID AND +t1.Contractor_ID = t2.Contractor_ID AND ( +t2.Customer_ID = '4' OR +t2.Customer_ID = '999999' OR +t2.Customer_ID = '1' )AND t2.CanRead += '1' AND t1.Column_ID=t3.Column_ID AND +t1.Language_ID=t3.Language_ID AND ( +t3.Contractor_ID = '4' OR +t3.Contractor_ID = '999999' OR +t3.Contractor_ID = '1') AND +t3.CanRead='1' AND t3.Active='1'; +SELECT DISTINCT COUNT(t1.Title) FROM t1, +t2, t3 WHERE +t1.Document_ID='xep80' AND t1.Contractor_ID='1' AND +t1.Language_ID='ger' AND '2001-12-21 23:14:24' >= +Publishing_Date AND '2001-12-21 23:14:24' <= Expiration_Date AND +t1.Document_ID = t2.Document_ID AND +t1.Language_ID = t2.Language_ID AND +t1.Contractor_ID = t2.Contractor_ID AND ( +t2.Customer_ID = '4' OR +t2.Customer_ID = '999999' OR +t2.Customer_ID = '1' )AND t2.CanRead += '1' AND t1.Column_ID=t3.Column_ID AND +t1.Language_ID=t3.Language_ID AND ( +t3.Contractor_ID = '4' OR +t3.Contractor_ID = '999999' OR +t3.Contractor_ID = '1') AND +t3.CanRead='1' AND t3.Active='1'; +drop table t1,t2,t3; |