diff options
author | unknown <monty@mysql.com> | 2004-11-08 17:53:32 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-11-08 17:53:32 +0200 |
commit | 47a5ac0e30599ea287fd206d4d21b7c304fd8c80 (patch) | |
tree | 8b26ea79c2cf98b50f42ec02a9c92e62c98f6276 /mysql-test/t/join_outer.test | |
parent | 87abc13d6fcca99cccfdc76782cbbd0b880fa9bf (diff) | |
parent | 8793e2197aeab3a2d434a180f804f295de3a3cce (diff) | |
download | mariadb-git-47a5ac0e30599ea287fd206d4d21b7c304fd8c80.tar.gz |
Merge with 4.1 to get new thd->mem_root handling
BitKeeper/etc/ignore:
auto-union
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
innobase/include/row0mysql.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/fulltext.result:
Auto merged
mysql-test/r/func_in.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/type_float.result:
Auto merged
mysql-test/r/user_var.result:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/user_var.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_error.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'mysql-test/t/join_outer.test')
-rw-r--r-- | mysql-test/t/join_outer.test | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index fc06aa4f544..665b4fafbca 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -507,6 +507,82 @@ select s.*, '*', m.*, (s.match_1_h - m.home) UUX from drop table t1, t2; +# Tests for bugs #6307 and 6460 + +create table t1 (a int, b int, unique index idx (a, b)); +create table t2 (a int, b int, c int, unique index idx (a, b)); + +insert into t1 values (1, 10), (1,11), (2,10), (2,11); +insert into t2 values (1,10,3); + +select t1.a, t1.b, t2.c from t1 left join t2 + on t1.a=t2.a and t1.b=t2.b and t2.c=3 + where t1.a=1 and t2.c is null; + +drop table t1, t2; + +CREATE TABLE t1 ( + ts_id bigint(20) default NULL, + inst_id tinyint(4) default NULL, + flag_name varchar(64) default NULL, + flag_value text, + UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE t2 ( + ts_id bigint(20) default NULL, + inst_id tinyint(4) default NULL, + flag_name varchar(64) default NULL, + flag_value text, + UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES + (111056548820001, 0, 'flag1', NULL), + (111056548820001, 0, 'flag2', NULL), + (2, 0, 'other_flag', NULL); + +INSERT INTO t2 VALUES + (111056548820001, 3, 'flag1', 'sss'); + +SELECT t1.flag_name,t2.flag_value + FROM t1 LEFT JOIN t2 + ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND + t2.inst_id = 3) + WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND + t2.flag_value IS NULL; + +DROP TABLE t1,t2; + +CREATE TABLE invoice ( + id int(11) unsigned NOT NULL auto_increment, + text_id int(10) unsigned default NULL, + PRIMARY KEY (id) +); + +INSERT INTO invoice VALUES("1", "0"); +INSERT INTO invoice VALUES("2", "10"); + +CREATE TABLE text_table ( + text_id char(3) NOT NULL default '', + language_id char(3) NOT NULL default '', + text_data text, + PRIMARY KEY (text_id,language_id) +); + +INSERT INTO text_table VALUES("0", "EN", "0-EN"); +INSERT INTO text_table VALUES("0", "SV", "0-SV"); +INSERT INTO text_table VALUES("10", "EN", "10-EN"); +INSERT INTO text_table VALUES("10", "SV", "10-SV"); + +SELECT invoice.id, invoice.text_id, text_table.text_data + FROM invoice LEFT JOIN text_table + ON invoice.text_id = text_table.text_id + AND text_table.language_id = 'SV' + WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%'); + +DROP TABLE invoice, text_table; + # Test for bug #5896 CREATE TABLE t0 (a0 int PRIMARY KEY); |