Commit ed0e4a96 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


mysql-test/r/distinct.result:
  Auto merged
mysql-test/r/join_nested.result:
  Auto merged
mysql-test/r/null_key.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/subselect3.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/func_time.result:
  manual merge
mysql-test/r/information_schema.result:
  manual merge
mysql-test/t/func_time.test:
  manual merge
mysql-test/t/information_schema.test:
  manual merge
sql/opt_range.cc:
  manual merge
sql/sql_delete.cc:
  manual merge
sql/sql_lex.h:
  manual merge
parents 4ebef052 a3083046
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -530,7 +530,8 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT DISTINCT a,b FROM t1 GROUP BY a,b;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
CREATE TABLE t2(a INT, b INT, c INT, d INT, PRIMARY KEY (a,b));
CREATE TABLE t2(a INT, b INT NOT NULL, c INT NOT NULL, d INT, 
PRIMARY KEY (a,b));
INSERT INTO t2 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
EXPLAIN SELECT DISTINCT a FROM t2;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -644,3 +645,26 @@ SELECT COUNT(*) FROM
COUNT(*)
2
DROP TABLE t1, t2;
CREATE TABLE t1 (a INT, UNIQUE (a));
INSERT INTO t1 VALUES (4),(null),(2),(1),(null),(3);
EXPLAIN SELECT DISTINCT a FROM t1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	index	NULL	a	5	NULL	6	Using index
SELECT DISTINCT a FROM t1;
a
NULL
1
2
3
4
EXPLAIN SELECT a FROM t1 GROUP BY a;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	index	NULL	a	5	NULL	6	Using index
SELECT a FROM t1 GROUP BY a;
a
NULL
1
2
3
4
DROP TABLE t1;
+14 −0
Original line number Diff line number Diff line
@@ -1183,6 +1183,20 @@ set time_zone= @@global.time_zone;
select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
NULL
CREATE TABLE t1 (a int, t1 time, t2 time, d date, PRIMARY KEY  (a));
INSERT INTO t1 VALUES (1, '10:00:00', NULL, NULL), 
(2, '11:00:00', '11:15:00', '1972-02-06');
SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d) 
FROM t1;
t1	t2	SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) )	QUARTER(d)
10:00:00	NULL	NULL	NULL
11:00:00	11:15:00	00:15:00	1
SELECT t1, t2, SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) ), QUARTER(d)
FROM t1 ORDER BY a DESC;
t1	t2	SEC_TO_TIME( TIME_TO_SEC( t2 ) - TIME_TO_SEC( t1 ) )	QUARTER(d)
11:00:00	11:15:00	00:15:00	1
10:00:00	NULL	NULL	NULL
DROP TABLE t1;
End of 5.0 tests
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
+10 −0
Original line number Diff line number Diff line
@@ -1342,6 +1342,16 @@ id select_type table type possible_keys key key_len ref rows Extra
1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
2	DERIVED	tables	ALL	NULL	NULL	NULL	NULL	2	
drop view v1;
create table t1 (f1 int(11));
create table t2 (f1 int(11), f2 int(11));
select table_name from information_schema.tables
where table_schema = 'test' and table_name not in
(select table_name from information_schema.columns
where table_schema = 'test' and column_name = 'f3');
table_name
t1
t2
drop table t1,t2;
End of 5.0 tests.
select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE	SUPPORT	COMMENT	TRANSACTIONS	XA	SAVEPOINTS
+28 −0
Original line number Diff line number Diff line
@@ -1605,3 +1605,31 @@ WHERE t1.id='5';
id	ct	pc	nm
5	NULL	NULL	NULL
DROP TABLE t1,t2,t3,t4;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT, c INT);
CREATE TABLE t4 (a INT, c INT);
CREATE TABLE t5 (a INT, c INT);
SELECT b FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a)
LEFT JOIN t5 USING (a)) USING (a);
b
SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a)
LEFT JOIN t5 USING (a)) USING (a);
ERROR 23000: Column 'c' in field list is ambiguous
SELECT b FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a)
JOIN t5 USING (a)) USING (a);
b
SELECT c FROM t1 JOIN (t2 JOIN t3 USING (a) JOIN t4 USING (a)
JOIN t5 USING (a)) USING (a);
ERROR 23000: Column 'c' in field list is ambiguous
DROP TABLE t1,t2,t3,t4,t5;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT);
CREATE TABLE t3 (a INT, b INT);
INSERT INTO t1 VALUES (1,1);
INSERT INTO t2 VALUES (1,1);
INSERT INTO t3 VALUES (1,1);
SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a);
ERROR 23000: Column 'a' in from clause is ambiguous
DROP TABLE t1,t2,t3;
End of 5.0 tests
+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1	SIMPLE	t1	ref	a,b	a	5	const	3	Using where; Using index
explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a,b	a	5	const	2	Using where; Using index
1	SIMPLE	t1	range	a,b	a	9	NULL	3	Using where; Using index
explain select * from t1 where a > 1 and a < 3 limit 1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	a	a	5	NULL	1	Using where; Using index
@@ -258,7 +258,7 @@ INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4
INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
explain select id from t1 where uniq_id is null;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	idx1	idx1	5	const	1	Using where
1	SIMPLE	t1	ref	idx1	idx1	5	const	5	Using where
explain select id from t1 where uniq_id =1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	const	idx1	idx1	5	const	1	
Loading