Commit 9521abc5 authored by unknown's avatar unknown

Post-merge fix.

parent 7b7b720c
This diff is collapsed.
......@@ -457,7 +457,7 @@ master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
`1` varbinary(36) NOT NULL DEFAULT ''
`1` varbinary(108) NOT NULL DEFAULT ''
)
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
......@@ -761,7 +761,7 @@ master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
`1` varbinary(36) NOT NULL DEFAULT ''
`1` varbinary(108) NOT NULL DEFAULT ''
)
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
......
......@@ -4106,6 +4106,39 @@ d1
1
1
DROP TABLE t1,t2;
CREATE TABLE t1 (a INTEGER, b INTEGER);
CREATE TABLE t2 (x INTEGER);
INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
INSERT INTO t2 VALUES (1), (2);
SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
ERROR 21000: Subquery returns more than 1 row
SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a;
ERROR 21000: Subquery returns more than 1 row
SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1;
(SELECT SUM(t1.a)/AVG(t2.x) FROM t2)
3.3333
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1
AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a)
GROUP BY a1.a;
a COUNT(*)
1 3
DROP TABLE t1;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1;
(SELECT SUM(t1.a) FROM t2 WHERE a=0)
NULL
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
ERROR 21000: Subquery returns more than 1 row
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
(SELECT SUM(t1.a) FROM t2 WHERE a=1)
3
DROP TABLE t1,t2;
End of 5.0 tests.
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
......
......@@ -1753,14 +1753,6 @@ t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL,
`f2` enum('') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
End of 4.1 tests
create table t1(f1 set('a','b'), index(f1));
insert into t1 values(''),(''),('a'),('b');
select * from t1 where f1='';
f1
drop table t1;
create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
show create table t1;
......@@ -1786,4 +1778,35 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
ERROR 42000: Field separator argument is not what is expected; check the manual
CREATE TABLE t1 (
id INT AUTO_INCREMENT PRIMARY KEY,
c1 ENUM('a', '', 'b')
);
INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
Warnings:
Warning 1265 Data truncated for column 'c1' at row 1
SELECT id, c1 + 0, c1 FROM t1;
id c1 + 0 c1
1 0
2 1 a
3 2
4 3 b
ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
Warnings:
Warning 1265 Data truncated for column 'c1' at row 4
SELECT id, c1 + 0, c1 FROM t1;
id c1 + 0 c1
1 0
2 1 a
3 2
4 0
DROP TABLE t1;
End of 4.1 tests
create table t1(f1 set('a','b'), index(f1));
insert into t1 values(''),(''),('a'),('b');
select * from t1 where f1='';
f1
drop table t1;
End of 5.1 tests
......
......@@ -136,16 +136,6 @@ alter table t1 add f2 enum(0xFFFF);
show create table t1;
drop table t1;
--echo End of 4.1 tests
#
# Bug#28729: Field_enum wrongly reported an error while storing an empty string.
#
create table t1(f1 set('a','b'), index(f1));
insert into t1 values(''),(''),('a'),('b');
select * from t1 where f1='';
drop table t1;
#
# Bug#24660 "enum" field type definition problem
#
......@@ -166,4 +156,31 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
#
# Bug #29251: MySQL coerces special 0 enum values to normal '' value
# when ALTERing the column
#
CREATE TABLE t1 (
id INT AUTO_INCREMENT PRIMARY KEY,
c1 ENUM('a', '', 'b')
);
INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
SELECT id, c1 + 0, c1 FROM t1;
ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
SELECT id, c1 + 0, c1 FROM t1;
DROP TABLE t1;
--echo End of 4.1 tests
#
# Bug#28729: Field_enum wrongly reported an error while storing an empty string.
#
create table t1(f1 set('a','b'), index(f1));
insert into t1 values(''),(''),('a'),('b');
select * from t1 where f1='';
drop table t1;
--echo End of 5.1 tests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment