mirror of
https://github.com/MariaDB/server.git
synced 2025-10-21 08:47:42 +03:00
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/mysql-5.1-opt mysql-test/r/distinct.result: Auto merged mysql-test/r/row.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/strict.result: Auto merged mysql-test/t/select.test: Auto merged mysql-test/t/strict.test: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/item_cmpfunc.cc: Manual merge
This commit is contained in:
@@ -668,3 +668,17 @@ NULL
|
||||
3
|
||||
4
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES(1,1),(1,2),(1,3);
|
||||
SELECT DISTINCT a, b FROM t1;
|
||||
a b
|
||||
1 1
|
||||
1 2
|
||||
1 3
|
||||
SELECT DISTINCT a, a, b FROM t1;
|
||||
a a b
|
||||
1 1 1
|
||||
1 1 2
|
||||
1 1 3
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@@ -175,6 +175,24 @@ ROW(2,10) <=> ROW(3,4)
|
||||
SELECT ROW(NULL,10) <=> ROW(3,NULL);
|
||||
ROW(NULL,10) <=> ROW(3,NULL)
|
||||
0
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1));
|
||||
ERROR 21000: Operand should contain 2 column(s)
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1),ROW(1,ROW(2,3)));
|
||||
ERROR 21000: Operand should contain 2 column(s)
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,ROW(2,2,2)));
|
||||
ERROR 21000: Operand should contain 2 column(s)
|
||||
SELECT ROW(1,ROW(2,3,4)) IN (ROW(1,ROW(2,3,4)),ROW(1,ROW(2,2)));
|
||||
ERROR 21000: Operand should contain 3 column(s)
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1));
|
||||
ERROR 21000: Operand should contain 2 column(s)
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1),ROW(1,ROW(2,4)));
|
||||
ERROR 21000: Operand should contain 2 column(s)
|
||||
SELECT ROW(1,ROW(2,3)) IN ((SELECT 1,1),ROW(1,ROW(2,3)));
|
||||
ERROR 21000: Operand should contain 2 column(s)
|
||||
SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0));
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2));
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
SELECT ROW(1,1,1) = ROW(1,1,1) as `1`, ROW(1,1,1) = ROW(1,2,1) as `0`, ROW(1,NULL,1) = ROW(2,2,1) as `0`, ROW(1,NULL,1) = ROW(1,2,2) as `0`, ROW(1,NULL,1) = ROW(1,2,1) as `null` ;
|
||||
1 0 0 0 null
|
||||
1 0 0 0 NULL
|
||||
|
@@ -3971,4 +3971,13 @@ t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265);
|
||||
faq_id
|
||||
265
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT, b INT, KEY inx (b,a));
|
||||
INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2
|
||||
ON ( f1.b=f2.b AND f1.a<f2.a )
|
||||
WHERE 1 AND f1.b NOT IN (100,2232,3343,51111);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE f1 index inx inx 10 NULL 7 Using where; Using index
|
||||
1 SIMPLE f2 ref inx inx 5 test.f1.b 1 Using where; Using index
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@@ -1386,4 +1386,9 @@ ERROR 01000: Data truncated for column 'a' at row 1
|
||||
insert into t1 values ('2E3x');
|
||||
ERROR 01000: Data truncated for column 'a' at row 1
|
||||
drop table t1;
|
||||
set sql_mode='traditional';
|
||||
create table t1 (f1 set('a','a'));
|
||||
ERROR HY000: Column 'f1' has duplicated value 'a' in SET
|
||||
create table t1 (f1 enum('a','a'));
|
||||
ERROR HY000: Column 'f1' has duplicated value 'a' in ENUM
|
||||
End of 5.0 tests
|
||||
|
@@ -540,3 +540,16 @@ EXPLAIN SELECT a FROM t1 GROUP BY a;
|
||||
SELECT a FROM t1 GROUP BY a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
#Bug #27659: SELECT DISTINCT returns incorrect result set when field is
|
||||
#repeated
|
||||
#
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES(1,1),(1,2),(1,3);
|
||||
SELECT DISTINCT a, b FROM t1;
|
||||
SELECT DISTINCT a, a, b FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@@ -85,6 +85,31 @@ drop table t1;
|
||||
SELECT ROW(2,10) <=> ROW(3,4);
|
||||
SELECT ROW(NULL,10) <=> ROW(3,NULL);
|
||||
|
||||
#
|
||||
# Bug #27484: nested row expressions in IN predicate
|
||||
#
|
||||
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1));
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,1),ROW(1,ROW(2,3)));
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),ROW(1,ROW(2,2,2)));
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3,4)) IN (ROW(1,ROW(2,3,4)),ROW(1,ROW(2,2)));
|
||||
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1));
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3)) IN (ROW(1,ROW(2,3)),(SELECT 1,1),ROW(1,ROW(2,4)));
|
||||
--error 1241
|
||||
SELECT ROW(1,ROW(2,3)) IN ((SELECT 1,1),ROW(1,ROW(2,3)));
|
||||
|
||||
--error 1241
|
||||
SELECT ROW(2,1) IN (ROW(21,2),ROW(ROW(1,1,3),0));
|
||||
--error 1241
|
||||
SELECT ROW(2,1) IN (ROW(ROW(1,1,3),0),ROW(21,2));
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
@@ -3346,4 +3346,17 @@ SELECT t2.faq_id
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
||||
#
|
||||
# Bug #19372: Optimizer does not use index anymore when WHERE index NOT IN
|
||||
# () is added
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT, KEY inx (b,a));
|
||||
|
||||
INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7);
|
||||
EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2
|
||||
ON ( f1.b=f2.b AND f1.a<f2.a )
|
||||
WHERE 1 AND f1.b NOT IN (100,2232,3343,51111);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@@ -1249,4 +1249,13 @@ insert into t1 values ('2000a');
|
||||
insert into t1 values ('2E3x');
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#27069 set with identical elements are created
|
||||
#
|
||||
set sql_mode='traditional';
|
||||
--error 1291
|
||||
create table t1 (f1 set('a','a'));
|
||||
--error 1291
|
||||
create table t1 (f1 enum('a','a'));
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user