Commit 93c01eb1 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt

into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


libmysql/libmysql.c:
  Auto merged
mysql-test/r/join_nested.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/type_binary.result:
  Auto merged
mysql-test/r/user_var.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_newdecimal.test:
  Auto merged
mysql-test/t/user_var.test:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/table.cc:
  Auto merged
strings/decimal.c:
  Auto merged
sql/mysqld.cc:
  manual merge
sql/sql_base.cc:
  manual merge
parents 2afe42d3 53c9b0d0
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -1562,3 +1562,46 @@ id ngroupbynsa
2	1
2	1
DROP TABLE t1,t2,t3,t4,t5;
CREATE TABLE t1 (
id int NOT NULL PRIMARY KEY,
ct int DEFAULT NULL,
pc int DEFAULT NULL,
INDEX idx_ct (ct),
INDEX idx_pc (pc)
);
INSERT INTO t1 VALUES  
(1,NULL,NULL),(2,NULL,NULL),(3,NULL,NULL),(4,NULL,NULL),(5,NULL,NULL);
CREATE TABLE t2 (
id int NOT NULL PRIMARY KEY,
sr int NOT NULL,
nm varchar(255) NOT NULL,
INDEX idx_sr (sr)
);
INSERT INTO t2 VALUES
(2441905,4308,'LesAbymes'),(2441906,4308,'Anse-Bertrand');
CREATE TABLE t3 (
id int NOT NULL PRIMARY KEY,
ct int NOT NULL,
ln int NOT NULL,
INDEX idx_ct (ct),
INDEX idx_ln (ln)
);
CREATE TABLE t4 (
id int NOT NULL PRIMARY KEY,
nm varchar(255) NOT NULL
);
INSERT INTO t4 VALUES (4308,'Guadeloupe'),(4309,'Martinique');
SELECT t1.*
FROM t1 LEFT JOIN
(t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
WHERE t1.id='5';
id	ct	pc
5	NULL	NULL
SELECT t1.*, t4.nm
FROM t1 LEFT JOIN
(t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
LEFT JOIN t4 ON t2.sr=t4.id
WHERE t1.id='5';
id	ct	pc	nm
5	NULL	NULL	NULL
DROP TABLE t1,t2,t3,t4;
+7 −0
Original line number Diff line number Diff line
@@ -1536,6 +1536,13 @@ a
1
2
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM 'SELECT a FROM t1 WHERE (SELECT b FROM t2 limit ?) IS NULL';
SET @arg=1;
EXECUTE stmt USING @arg;
a
1
2
DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2;
End of 5.0 tests.
create procedure proc_1() reset query cache;
+9 −0
Original line number Diff line number Diff line
@@ -136,4 +136,13 @@ insert into t1 values(NULL, 0x412020);
ERROR 22001: Data too long for column 'vb' at row 1
drop table t1;
set @@sql_mode= @old_sql_mode;
create table t1(f1 int, f2 binary(2) not null, f3 char(2) not null);
insert into t1 set f1=1;
Warnings:
Warning	1364	Field 'f2' doesn't have a default value
Warning	1364	Field 'f3' doesn't have a default value
select hex(f2), hex(f3) from t1;
hex(f2)	hex(f3)
0000	
drop table t1;
End of 5.0 tests
+8 −1
Original line number Diff line number Diff line
@@ -301,7 +301,14 @@ select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
select @var;
@var
3
drop table t1;
create table t2 as select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
select * from t2;
@var:=f2
3
select @var;
@var
3
drop table t1,t2;
insert into city 'blah';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''blah'' at line 1
SHOW COUNT(*) WARNINGS;
+51 −0
Original line number Diff line number Diff line
@@ -994,3 +994,54 @@ SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa

DROP TABLE t1,t2,t3,t4,t5;

#
# Test for bug #24345: crash with nested left outer join when outer table is substituted
#                      for a row that happens to have a null value for the join attribute.
#

CREATE TABLE t1 (
  id int NOT NULL PRIMARY KEY,
  ct int DEFAULT NULL,
  pc int DEFAULT NULL,
  INDEX idx_ct (ct),
  INDEX idx_pc (pc)
);
INSERT INTO t1 VALUES  
 (1,NULL,NULL),(2,NULL,NULL),(3,NULL,NULL),(4,NULL,NULL),(5,NULL,NULL);

CREATE TABLE t2 (
  id int NOT NULL PRIMARY KEY,
  sr int NOT NULL,
  nm varchar(255) NOT NULL,
  INDEX idx_sr (sr)
);
INSERT INTO t2 VALUES
  (2441905,4308,'LesAbymes'),(2441906,4308,'Anse-Bertrand');

CREATE TABLE t3 (
  id int NOT NULL PRIMARY KEY,
  ct int NOT NULL,
  ln int NOT NULL,
  INDEX idx_ct (ct),
  INDEX idx_ln (ln)
);

CREATE TABLE t4 (
  id int NOT NULL PRIMARY KEY,
  nm varchar(255) NOT NULL
);

INSERT INTO t4 VALUES (4308,'Guadeloupe'),(4309,'Martinique');

SELECT t1.*
  FROM t1 LEFT JOIN
       (t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
    WHERE t1.id='5';

SELECT t1.*, t4.nm
  FROM t1 LEFT JOIN
      (t2 LEFT JOIN t3 ON t3.ct=t2.id AND t3.ln='5') ON t1.ct=t2.id
          LEFT JOIN t4 ON t2.sr=t4.id
    WHERE t1.id='5';

DROP TABLE t1,t2,t3,t4;
Loading