Commit 7e7729f6 authored by df@pippilotta.erinye.com's avatar df@pippilotta.erinye.com
Browse files

Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-4.1-build

into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-4.1-build-work
parents d7690722 395d8751
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -803,3 +803,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
alter table table_24562 order by no_such_col;
ERROR 42S22: Unknown column 'no_such_col' in 'order clause'
drop table table_24562;
CREATE TABLE t1 (c1 CHAR(255));
INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255));
ALTER TABLE t1 ADD UNIQUE (c1);
ERROR 23000: Duplicate entry 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' for key 1
DROP TABLE t1;
+1 −1
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ drop table t1;
create table t1 (c char(255), primary key(c(90)));
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
drop table t1;
CREATE TABLE t1 (a int, key(a)) engine=heap;
insert into t1 values (0);
+33 −0
Original line number Diff line number Diff line
@@ -128,4 +128,37 @@ show /*!50002 GLOBAL */ status like 'Handler_rollback';
Variable_name	Value
Handler_rollback	0
drop table t1;
CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1)
ENGINE=INNODB CHARACTER SET UTF8;
INSERT INTO t1 (c1) VALUES ('1a');
SELECT * FROM t1;
c1	cnt
1a	1
INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
SELECT * FROM t1;
c1	cnt
1a	2
DROP TABLE t1;
CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
ENGINE=INNODB CHARACTER SET UTF8;
INSERT INTO t1 (c1) VALUES ('1a');
SELECT * FROM t1;
c1	cnt
1a	1
INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
SELECT * FROM t1;
c1	cnt
1a	2
DROP TABLE t1;
CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
ENGINE=INNODB CHARACTER SET UTF8;
INSERT INTO t1 (c1) VALUES ('1a');
SELECT * FROM t1;
c1	cnt
1a	1
INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
SELECT * FROM t1;
c1	cnt
1a	2
DROP TABLE t1;
End of 4.1 tests
+61 −0
Original line number Diff line number Diff line
@@ -556,3 +556,64 @@ x a sum(b)
2006-07-01	NULL	11
NULL	NULL	11
drop table t1;
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 
VALUES (2,10),(3,30),(2,40),(1,10),(2,30),(1,20),(2,10);
SELECT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
a	SUM(b)
1	30
2	90
3	30
NULL	150
SELECT DISTINCT a, SUM(b) FROM t1 GROUP BY a WITH ROLLUP;
a	SUM(b)
1	30
2	90
3	30
NULL	150
SELECT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
a	b	COUNT(*)
1	10	1
1	20	1
1	NULL	2
2	10	2
2	30	1
2	40	1
2	NULL	4
3	30	1
3	NULL	1
NULL	NULL	7
SELECT DISTINCT a, b, COUNT(*) FROM t1 GROUP BY a,b WITH ROLLUP;
a	b	COUNT(*)
1	10	1
1	20	1
1	NULL	2
2	10	2
2	30	1
2	40	1
2	NULL	4
3	30	1
3	NULL	1
NULL	NULL	7
SELECT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
x	a	SUM(b)
x	1	30
x	2	90
x	3	30
x	NULL	150
NULL	NULL	150
SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
x	a	SUM(b)
x	1	30
x	2	90
x	3	30
x	NULL	150
NULL	NULL	150
SELECT DISTINCT 'x', a, SUM(b) FROM t1 GROUP BY 1,2 WITH ROLLUP;
x	a	SUM(b)
x	1	30
x	2	90
x	3	30
x	NULL	150
NULL	NULL	150
DROP TABLE t1;
+11 −0
Original line number Diff line number Diff line
@@ -583,5 +583,16 @@ alter table table_24562 order by no_such_col;

drop table table_24562;

#
# Bug #20710: adding unique index of column with duplicated
# long values to reproduce error message with truncated key value.
#

CREATE TABLE t1 (c1 CHAR(255));
INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255));
--error 1062
ALTER TABLE t1 ADD UNIQUE (c1);
DROP TABLE t1;

# End of 4.1 tests
Loading