Commit 90300c07 authored by unknown's avatar unknown
Browse files

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1

into sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-4.1

parents dadf91f0 3aca0a0c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2515,3 +2515,12 @@ SELECT b FROM t1 WHERE b=0x8000000000000000;
b
9223372036854775808
DROP TABLE t1;
CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
INSERT INTO `t2` VALUES (0,'READ');
CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
INSERT INTO `t3` VALUES (1,'fs');
select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
id	name	gid	uid	ident	level
1	fs	NULL	NULL	0	READ
drop table t1,t2,t3;
+15 −0
Original line number Diff line number Diff line
@@ -2060,3 +2060,18 @@ CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
INSERT INTO t1 VALUES (0x8000000000000000);
SELECT b FROM t1 WHERE b=0x8000000000000000;
DROP TABLE t1;

#
# IN with outer join condition (BUG#9393)
#
CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);

CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
INSERT INTO `t2` VALUES (0,'READ');

CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
INSERT INTO `t3` VALUES (1,'fs');

select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);

drop table t1,t2,t3;
+6 −0
Original line number Diff line number Diff line
@@ -769,6 +769,12 @@ class Item_func_in :public Item_int_func
  bool nulls_in_row();
  bool is_bool_func() { return 1; }
  CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
  /*
    IN() protect from NULL only first argument, if construction like
    "expression IN ()" will be allowed, we will need to check number of
    argument here, because "NOT(NULL IN ())" is TRUE.
  */
  table_map not_null_tables() const { return args[0]->not_null_tables(); }
};

/* Functions used by where clause */