1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

5.3 merge

This commit is contained in:
Sergei Golubchik
2012-01-13 15:50:02 +01:00
750 changed files with 17402 additions and 7153 deletions

View File

@@ -1,6 +1,9 @@
drop table if exists t1,t2,t3,t4,t11;
drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
drop view if exists v1;
SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch=ifnull(@optimizer_switch_for_select_test,'outer_join_with_cache=off');
set join_cache_level=1;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -2196,10 +2199,10 @@ a a
select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1;
a a
1 2
2 2
3 2
1 3
2 2
2 3
3 2
3 3
select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1;
a a
@@ -5088,6 +5091,33 @@ ON t3.f31 = t6.f61
WHERE t7.f71>0;
f23
DROP TABLE t1,t2,t3,t4,t5,t6,t7;
CREATE TABLE t1(f1 int UNSIGNED) engine=myisam;
INSERT INTO t1 VALUES (3),(2),(1);
set sql_buffer_result=0;
SELECT f1 FROM t1 GROUP BY 1;
f1
1
2
3
SELECT f1 FROM t1 GROUP BY '123' = 'abc';
f1
3
SELECT 1 FROM t1 GROUP BY 1;
1
1
set sql_buffer_result=1;
SELECT f1 FROM t1 GROUP BY 1;
f1
1
2
3
SELECT f1 FROM t1 GROUP BY '123' = 'abc';
f1
3
SELECT 1 FROM t1 GROUP BY 1;
1
1
drop table t1;
#
# Bug #58422: Incorrect result when OUTER JOIN'ing
# with an empty table
@@ -5204,3 +5234,40 @@ avg(distinct(t1.a))
0
DROP TABLE t1;
# End of test BUG#57203
# lp:822760 Wrong result with view + invalid dates
#
CREATE TABLE t1 (f1 date);
INSERT IGNORE INTO t1 VALUES ('0000-00-00');
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM t1 HAVING f1 = 'zz';
f1
0000-00-00
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
SELECT * FROM t1 HAVING f1 <= 'aa' ;
f1
0000-00-00
Warnings:
Warning 1292 Incorrect datetime value: 'aa'
SELECT * FROM t1 HAVING f1 = 'zz' AND f1 <= 'aa' ;
f1
0000-00-00
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
Warning 1292 Incorrect datetime value: 'aa'
SELECT * FROM t1 WHERE f1 = 'zz' AND f1 <= 'aa' ;
f1
0000-00-00
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
Warning 1292 Incorrect datetime value: 'aa'
Warning 1292 Incorrect datetime value: 'zz'
SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ;
f1
0000-00-00
Warnings:
Warning 1292 Incorrect datetime value: 'zz'
Warning 1292 Incorrect datetime value: 'aa'
DROP TABLE t1;
DROP VIEW v1;
SET optimizer_switch=@save_optimizer_switch;