Commit db203d74 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.0 into 10.1

parents 43305056 44ed2435
......@@ -199,3 +199,15 @@ i
2
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-13776: DELETE ... RETURNING with sql_mode='ONLY_FULL_GROUP_BY'
#
set @sql_mode_save= @@sql_mode;
set sql_mode='ONLY_FULL_GROUP_BY';
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUE(1),(2),(3);
DELETE FROM t1 WHERE id > 2 RETURNING *;
id
3
set sql_mode=@sql_mode_save;
DROP TABLE t1;
This diff is collapsed.
......@@ -331,9 +331,10 @@ CREATE INDEX t1e ON t1 (e(767));
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1f ON t1 (f(767));
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
ERROR HY000: Undo log record is too big.
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
......@@ -366,8 +367,9 @@ UPDATE t1 SET r=@e;
CREATE INDEX t1s ON t1 (s(767));
UPDATE t1 SET s=@e;
CREATE INDEX t1t ON t1 (t(767));
BEGIN;
UPDATE t1 SET t=@e;
ERROR HY000: Undo log record is too big.
ROLLBACK;
CREATE INDEX t1u ON t1 (u(767));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
CREATE INDEX t1ut ON t1 (u(767), t(767));
......@@ -546,11 +548,11 @@ PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
COMMIT;
BEGIN;
UPDATE bug12547647 SET c = REPEAT('b',16928);
ERROR HY000: Undo log record is too big.
SHOW WARNINGS;
Level Code Message
Error 1713 Undo log record is too big.
ROLLBACK;
DROP TABLE bug12547647;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
......
......@@ -228,13 +228,14 @@ aa=@c,ba=@c,ca=@c,da=@c,ea=@c,fa=@c,ga=@c,ha=@c,ia=@c,ja=@c,
ka=@c,la=@c,ma=@c,na=@c,oa=@c,pa=@c,qa=@c,ra=@c,sa=@c,ta=@c,ua=@c,
va=@c,wa=@c,xa=@c,ya=@c,za=@c;
CREATE INDEX t1f17 ON t1 (v(767));
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
v=@d,w=@d,x=@d,y=@d,z=@d,
aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
va=@d,wa=@d,xa=@d,ya=@d,za=@d;
ERROR HY000: Undo log record is too big.
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
......
......@@ -263,6 +263,7 @@ kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
COMMIT;
CREATE INDEX tg1f2 ON t1 (ia(767),ja(767));
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
v=@d,w=@d,x=@d,y=@d,z=@d,
......@@ -275,7 +276,7 @@ vb=@d,wb=@d,xb=@d,yb=@d,zb=@d,
ac=@d,bc=@d,cc=@d,dc=@d,ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d,
kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d,qc=@d,rc=@d,sc=@d,tc=@d,uc=@d,
vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
ERROR HY000: Undo log record is too big.
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d;
......
CREATE TABLE test_tab (
a_str_18 mediumtext,
b_str_3 varchar(32) DEFAULT NULL,
a_str_13 mediumtext,
b_str_5 varchar(40) DEFAULT NULL,
b_str_6 varchar(50) DEFAULT NULL,
b_str_7 char(32) DEFAULT NULL,
b_str_8 varchar(32) DEFAULT NULL,
b_str_9 varchar(255) DEFAULT NULL,
a_str_28 char(255) DEFAULT NULL,
a_str_27 varchar(255) DEFAULT NULL,
b_str_10 varchar(32) DEFAULT NULL,
a_str_26 varchar(255) DEFAULT NULL,
a_str_6 varchar(50) DEFAULT NULL,
b_str_11 varchar(32) DEFAULT NULL,
b_str_12 varchar(255) DEFAULT NULL,
b_str_13 char(32) DEFAULT NULL,
b_str_14 varchar(32) DEFAULT NULL,
b_str_15 char(32) DEFAULT NULL,
b_str_16 char(32) DEFAULT NULL,
b_str_17 varchar(32) DEFAULT NULL,
b_str_18 varchar(32) DEFAULT NULL,
a_str_25 varchar(40) DEFAULT NULL,
b_str_19 varchar(255) DEFAULT NULL,
a_str_23 varchar(40) DEFAULT NULL,
b_str_20 varchar(32) DEFAULT NULL,
a_str_21 varchar(255) DEFAULT NULL,
a_str_20 varchar(255) DEFAULT NULL,
a_str_39 varchar(255) DEFAULT NULL,
a_str_38 varchar(255) DEFAULT NULL,
a_str_37 varchar(255) DEFAULT NULL,
b_str_21 char(32) DEFAULT NULL,
b_str_23 varchar(80) DEFAULT NULL,
b_str_24 varchar(32) DEFAULT NULL,
b_str_25 varchar(32) DEFAULT NULL,
b_str_26 char(32) NOT NULL DEFAULT '',
b_str_27 varchar(255) DEFAULT NULL,
a_str_36 varchar(255) DEFAULT NULL,
a_str_33 varchar(100) DEFAULT NULL,
a_ref_10 char(32) DEFAULT NULL,
b_str_28 char(32) DEFAULT NULL,
b_str_29 char(32) DEFAULT NULL,
a_ref_6 char(32) DEFAULT NULL,
a_ref_12 varchar(32) DEFAULT NULL,
a_ref_11 varchar(32) DEFAULT NULL,
a_str_49 varchar(40) DEFAULT NULL,
b_str_30 varchar(32) DEFAULT NULL,
a_ref_3 varchar(32) DEFAULT NULL,
a_str_48 varchar(40) DEFAULT NULL,
a_ref_1 char(32) DEFAULT NULL,
b_str_31 varchar(32) DEFAULT NULL,
b_str_32 varchar(255) DEFAULT NULL,
b_str_33 char(32) DEFAULT NULL,
b_str_34 varchar(32) DEFAULT NULL,
a_str_47 varchar(40) DEFAULT NULL,
b_str_36 varchar(255) DEFAULT NULL,
a_str_46 varchar(40) DEFAULT NULL,
a_str_45 varchar(255) DEFAULT NULL,
b_str_38 varchar(32) DEFAULT NULL,
b_str_39 char(32) DEFAULT NULL,
b_str_40 varchar(32) DEFAULT NULL,
a_str_41 varchar(255) DEFAULT NULL,
b_str_41 varchar(32) DEFAULT NULL,
PRIMARY KEY (b_str_26),
UNIQUE KEY a_str_47 (a_str_47),
UNIQUE KEY a_str_49 (a_str_49),
UNIQUE KEY a_str_33 (a_str_33),
UNIQUE KEY a_str_46 (a_str_46),
UNIQUE KEY a_str_48 (a_str_48),
KEY b_str_18 (b_str_18),
KEY a_str_26 (a_str_26),
KEY b_str_27 (b_str_27,b_str_19),
KEY b_str_41 (b_str_41),
KEY b_str_15 (b_str_15),
KEY a_str_20 (a_str_20),
KEY b_str_17 (b_str_17),
KEY b_str_40 (b_str_40),
KEY b_str_24 (b_str_24),
KEY b_str_10 (b_str_10),
KEY b_str_16 (b_str_16),
KEY b_str_29 (b_str_29),
KEY a_str_41 (a_str_41),
KEY b_str_7 (b_str_7),
KEY a_str_45 (a_str_45),
KEY a_str_28 (a_str_28),
KEY a_str_37 (a_str_37),
KEY b_str_6 (b_str_6),
KEY a_ref_6 (a_ref_6),
KEY b_str_34 (b_str_34),
KEY b_str_38 (b_str_38),
KEY a_ref_10 (a_ref_10),
KEY b_str_21 (b_str_21),
KEY b_str_23 (b_str_23,b_str_19),
KEY b_str_33 (b_str_33),
KEY a_ref_12 (a_ref_12),
KEY a_str_18 (a_str_18(255)),
KEY a_str_39 (a_str_39),
KEY a_str_27 (a_str_27),
KEY a_str_25 (a_str_25),
KEY b_str_9 (b_str_9),
KEY a_str_23 (a_str_23),
KEY b_str_8 (b_str_8),
KEY a_str_21 (a_str_21),
KEY b_str_3 (b_str_3),
KEY b_str_30 (b_str_30),
KEY b_str_12 (b_str_12),
KEY b_str_25 (b_str_25),
KEY b_str_13 (b_str_13),
KEY a_str_38 (a_str_38),
KEY a_str_13 (a_str_13(255)),
KEY a_str_36 (a_str_36),
KEY b_str_28 (b_str_28),
KEY b_str_19 (b_str_19),
KEY b_str_11 (b_str_11),
KEY a_ref_1 (a_ref_1),
KEY b_str_20 (b_str_20),
KEY b_str_14 (b_str_14),
KEY a_ref_3 (a_ref_3),
KEY b_str_39 (b_str_39),
KEY b_str_32 (b_str_32),
KEY a_str_6 (a_str_6),
KEY b_str_5 (b_str_5),
KEY b_str_31 (b_str_31),
KEY a_ref_11 (a_ref_11)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
BEGIN;
INSERT INTO test_tab (b_str_26, a_str_13, a_str_18) VALUES
('a', REPEAT('f',4031), REPEAT('g', 4031));
UPDATE test_tab SET a_str_13=REPEAT('h',4032), a_str_18=REPEAT('i',4032);
SELECT 'Reducing length to 4030';
Reducing length to 4030
Reducing length to 4030
UPDATE test_tab SET a_str_13=REPEAT('j',4030), a_str_18=REPEAT('k',4030);
UPDATE test_tab SET a_str_13=REPEAT('l',4031), a_str_18=REPEAT('m',4031);
ROLLBACK;
SELECT COUNT(*) FROM test_tab;
COUNT(*)
0
CHECK TABLE test_tab;
Table Op Msg_type Msg_text
test.test_tab check status OK
DROP TABLE test_tab;
......@@ -328,10 +328,10 @@ UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
# because the UNDO records will be smaller.
CREATE INDEX t1f ON t1 (f(767));
--error 1713
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d,
......@@ -371,8 +371,9 @@ UPDATE t1 SET s=@e;
# that CANNOT be updated.
CREATE INDEX t1t ON t1 (t(767));
--error 1713
BEGIN;
UPDATE t1 SET t=@e;
ROLLBACK;
# The function dict_index_too_big_for_undo() prevents us from adding
# one more index. But it is too late. The record is already too big.
......@@ -515,9 +516,10 @@ INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751));
COMMIT;
# The following used to cause a hang while doing infinite undo log allocation.
--error 1713
BEGIN;
UPDATE bug12547647 SET c = REPEAT('b',16928);
SHOW WARNINGS;
ROLLBACK;
DROP TABLE bug12547647;
......
......@@ -294,13 +294,14 @@ UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
CREATE INDEX t1f17 ON t1 (v(767));
--error 1713
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
v=@d,w=@d,x=@d,y=@d,z=@d,
aa=@d,ba=@d,ca=@d,da=@d,ea=@d,fa=@d,ga=@d,ha=@d,ia=@d,ja=@d,
ka=@d,la=@d,ma=@d,na=@d,oa=@d,pa=@d,qa=@d,ra=@d,sa=@d,ta=@d,ua=@d,
va=@d,wa=@d,xa=@d,ya=@d,za=@d;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
......
......@@ -304,7 +304,7 @@ COMMIT;
CREATE INDEX tg1f2 ON t1 (ia(767),ja(767));
--error 1713
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d,
v=@d,w=@d,x=@d,y=@d,z=@d,
......@@ -317,6 +317,7 @@ UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d,
ac=@d,bc=@d,cc=@d,dc=@d,ec=@d,fc=@d,gc=@d,hc=@d,ic=@d,jc=@d,
kc=@d,lc=@d,mc=@d,nc=@d,oc=@d,pc=@d,qc=@d,rc=@d,sc=@d,tc=@d,uc=@d,
vc=@d,wc=@d,xc=@d,yc=@d,zc=@d;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d;
......
--source include/have_innodb.inc
CREATE TABLE test_tab (
a_str_18 mediumtext,
b_str_3 varchar(32) DEFAULT NULL,
a_str_13 mediumtext,
b_str_5 varchar(40) DEFAULT NULL,
b_str_6 varchar(50) DEFAULT NULL,
b_str_7 char(32) DEFAULT NULL,
b_str_8 varchar(32) DEFAULT NULL,
b_str_9 varchar(255) DEFAULT NULL,
a_str_28 char(255) DEFAULT NULL,
a_str_27 varchar(255) DEFAULT NULL,
b_str_10 varchar(32) DEFAULT NULL,
a_str_26 varchar(255) DEFAULT NULL,
a_str_6 varchar(50) DEFAULT NULL,
b_str_11 varchar(32) DEFAULT NULL,
b_str_12 varchar(255) DEFAULT NULL,
b_str_13 char(32) DEFAULT NULL,
b_str_14 varchar(32) DEFAULT NULL,
b_str_15 char(32) DEFAULT NULL,
b_str_16 char(32) DEFAULT NULL,
b_str_17 varchar(32) DEFAULT NULL,
b_str_18 varchar(32) DEFAULT NULL,
a_str_25 varchar(40) DEFAULT NULL,
b_str_19 varchar(255) DEFAULT NULL,
a_str_23 varchar(40) DEFAULT NULL,
b_str_20 varchar(32) DEFAULT NULL,
a_str_21 varchar(255) DEFAULT NULL,
a_str_20 varchar(255) DEFAULT NULL,
a_str_39 varchar(255) DEFAULT NULL,
a_str_38 varchar(255) DEFAULT NULL,
a_str_37 varchar(255) DEFAULT NULL,
b_str_21 char(32) DEFAULT NULL,
b_str_23 varchar(80) DEFAULT NULL,
b_str_24 varchar(32) DEFAULT NULL,
b_str_25 varchar(32) DEFAULT NULL,
b_str_26 char(32) NOT NULL DEFAULT '',
b_str_27 varchar(255) DEFAULT NULL,
a_str_36 varchar(255) DEFAULT NULL,
a_str_33 varchar(100) DEFAULT NULL,
a_ref_10 char(32) DEFAULT NULL,
b_str_28 char(32) DEFAULT NULL,
b_str_29 char(32) DEFAULT NULL,
a_ref_6 char(32) DEFAULT NULL,
a_ref_12 varchar(32) DEFAULT NULL,
a_ref_11 varchar(32) DEFAULT NULL,
a_str_49 varchar(40) DEFAULT NULL,
b_str_30 varchar(32) DEFAULT NULL,
a_ref_3 varchar(32) DEFAULT NULL,
a_str_48 varchar(40) DEFAULT NULL,
a_ref_1 char(32) DEFAULT NULL,
b_str_31 varchar(32) DEFAULT NULL,
b_str_32 varchar(255) DEFAULT NULL,
b_str_33 char(32) DEFAULT NULL,
b_str_34 varchar(32) DEFAULT NULL,
a_str_47 varchar(40) DEFAULT NULL,
b_str_36 varchar(255) DEFAULT NULL,
a_str_46 varchar(40) DEFAULT NULL,
a_str_45 varchar(255) DEFAULT NULL,
b_str_38 varchar(32) DEFAULT NULL,
b_str_39 char(32) DEFAULT NULL,
b_str_40 varchar(32) DEFAULT NULL,
a_str_41 varchar(255) DEFAULT NULL,
b_str_41 varchar(32) DEFAULT NULL,
PRIMARY KEY (b_str_26),
UNIQUE KEY a_str_47 (a_str_47),
UNIQUE KEY a_str_49 (a_str_49),
UNIQUE KEY a_str_33 (a_str_33),
UNIQUE KEY a_str_46 (a_str_46),
UNIQUE KEY a_str_48 (a_str_48),
KEY b_str_18 (b_str_18),
KEY a_str_26 (a_str_26),
KEY b_str_27 (b_str_27,b_str_19),
KEY b_str_41 (b_str_41),
KEY b_str_15 (b_str_15),
KEY a_str_20 (a_str_20),
KEY b_str_17 (b_str_17),
KEY b_str_40 (b_str_40),
KEY b_str_24 (b_str_24),
KEY b_str_10 (b_str_10),
KEY b_str_16 (b_str_16),
KEY b_str_29 (b_str_29),
KEY a_str_41 (a_str_41),
KEY b_str_7 (b_str_7),
KEY a_str_45 (a_str_45),
KEY a_str_28 (a_str_28),
KEY a_str_37 (a_str_37),
KEY b_str_6 (b_str_6),
KEY a_ref_6 (a_ref_6),
KEY b_str_34 (b_str_34),
KEY b_str_38 (b_str_38),
KEY a_ref_10 (a_ref_10),
KEY b_str_21 (b_str_21),
KEY b_str_23 (b_str_23,b_str_19),
KEY b_str_33 (b_str_33),
KEY a_ref_12 (a_ref_12),
KEY a_str_18 (a_str_18(255)),
KEY a_str_39 (a_str_39),
KEY a_str_27 (a_str_27),
KEY a_str_25 (a_str_25),
KEY b_str_9 (b_str_9),
KEY a_str_23 (a_str_23),
KEY b_str_8 (b_str_8),
KEY a_str_21 (a_str_21),
KEY b_str_3 (b_str_3),
KEY b_str_30 (b_str_30),
KEY b_str_12 (b_str_12),
KEY b_str_25 (b_str_25),
KEY b_str_13 (b_str_13),
KEY a_str_38 (a_str_38),
KEY a_str_13 (a_str_13(255)),
KEY a_str_36 (a_str_36),
KEY b_str_28 (b_str_28),
KEY b_str_19 (b_str_19),
KEY b_str_11 (b_str_11),
KEY a_ref_1 (a_ref_1),
KEY b_str_20 (b_str_20),
KEY b_str_14 (b_str_14),
KEY a_ref_3 (a_ref_3),
KEY b_str_39 (b_str_39),
KEY b_str_32 (b_str_32),
KEY a_str_6 (a_str_6),
KEY b_str_5 (b_str_5),
KEY b_str_31 (b_str_31),
KEY a_ref_11 (a_ref_11)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
BEGIN;
INSERT INTO test_tab (b_str_26, a_str_13, a_str_18) VALUES
('a', REPEAT('f',4031), REPEAT('g', 4031));
UPDATE test_tab SET a_str_13=REPEAT('h',4032), a_str_18=REPEAT('i',4032);
SELECT 'Reducing length to 4030';
UPDATE test_tab SET a_str_13=REPEAT('j',4030), a_str_18=REPEAT('k',4030);
UPDATE test_tab SET a_str_13=REPEAT('l',4031), a_str_18=REPEAT('m',4031);
ROLLBACK;
SELECT COUNT(*) FROM test_tab;
CHECK TABLE test_tab;
DROP TABLE test_tab;
......@@ -584,12 +584,12 @@ REPEAT("a", 4000) , REPEAT("a", 255)
CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072));
CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072));
CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072));
BEGIN;
UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
WHERE col_1_varbinary = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
ERROR HY000: Undo log record is too big.
SHOW WARNINGS;
Level Code Message
Error 1713 Undo log record is too big.
ROLLBACK;
DROP TABLE worklog5743;
CREATE TABLE worklog5743 (
col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) ,
......@@ -627,13 +627,13 @@ REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
REPEAT("a", 4000) , REPEAT("a", 255)
);
ROLLBACK;
BEGIN;
UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
WHERE col_1_varbinary = REPEAT("a", 4000)
AND col_2_varchar = REPEAT("o", 4000);
ERROR HY000: Undo log record is too big.
SHOW WARNINGS;
Level Code Message
Error 1713 Undo log record is too big.
ROLLBACK;
SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
col_1_varbinary = REPEAT("c", 4000)
......
......@@ -536,10 +536,11 @@ REPEAT("a", 4000) , REPEAT("a", 255)
CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072));
CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072));
CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072));
--error ER_UNDO_RECORD_TOO_BIG
BEGIN;
UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
WHERE col_1_varbinary = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
SHOW WARNINGS;
ROLLBACK;
DROP TABLE worklog5743;
#------------------------------------------------------------------------------
......@@ -585,13 +586,12 @@ REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
REPEAT("a", 4000) , REPEAT("a", 255)
);
ROLLBACK;
# Bug#12547647 - UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
# Instead of this error, it would hang before this fix.
--error ER_UNDO_RECORD_TOO_BIG
BEGIN;
UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
WHERE col_1_varbinary = REPEAT("a", 4000)
AND col_2_varchar = REPEAT("o", 4000);
SHOW WARNINGS;
ROLLBACK;
SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
......
......@@ -155,3 +155,18 @@ SELECT * FROM t1;
DROP PROCEDURE p1;
DROP TABLE t1;
--echo #
--echo # MDEV-13776: DELETE ... RETURNING with sql_mode='ONLY_FULL_GROUP_BY'
--echo #
set @sql_mode_save= @@sql_mode;
set sql_mode='ONLY_FULL_GROUP_BY';
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUE(1),(2),(3);
DELETE FROM t1 WHERE id > 2 RETURNING *;
set sql_mode=@sql_mode_save;
DROP TABLE t1;
--echo #
--echo # Bug mdev-13607: overflow of current_record_count
--echo #
--source include/have_innodb.inc
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),
(21),(22),(23),(24),(25),(26),(27),(28),(29),(30),
(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),
(41),(42),(43),(44),(45),(46),(47),(48),(49),(50);
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1),(2);
CREATE TABLE t3 (id INT) ENGINE=InnoDB;
INSERT INTO t3 VALUES (1),(2);
ANALYZE TABLE t1, t2, t3;
let $q=
SELECT * FROM
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_1
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_2
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_3
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_4
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_5
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_6
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_7
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_8
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_9
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_10
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_11
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_12
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_13
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_14
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_15
INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_16
;
eval explain $q;
DROP TABLE t1,t2,t3;
......@@ -7874,9 +7874,11 @@ best_extension_by_limited_search(JOIN *join,
best_access_path(join, s, remaining_tables, idx, disable_jbuf,
record_count, join->positions + idx, &loose_scan_pos);
/* Compute the cost of extending the plan with 's' */
current_record_count= record_count * position->records_read;
/* Compute the cost of extending the plan with 's', avoid overflow */
if (position->records_read < DBL_MAX / record_count)
current_record_count= record_count * position->records_read;
else
current_record_count= DBL_MAX;
current_read_time=read_time + position->read_time +
current_record_count / (double) TIME_FOR_COMPARE;
......
......@@ -5348,7 +5348,8 @@ Item *Field_iterator_table::create_item(THD *thd)
Item_field *item= new (thd->mem_root) Item_field(thd, &select->context, *ptr);
if (item && thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
!thd->lex->in_sum_func && select->cur_pos_in_select_list != UNDEF_POS)
!thd->lex->in_sum_func && select->cur_pos_in_select_list != UNDEF_POS &&
select->join)
{
select->join->non_agg_fields.push_back(item);
item->marker= select->cur_pos_in_select_list;
......
......@@ -772,7 +772,25 @@ trx_undo_page_report_modify(
const dict_col_t* col
= dict_table_get_nth_col(table, col_no);
if (col->ord_part) {
if (!col->ord_part) {
continue;
}
if (update) {
for (i = 0; i < update->n_fields; i++) {
const dict_field_t* f
= dict_index_get_nth_field(
index,
upd_get_nth_field(
update, i)
->field_no);
if (f->col == col) {
goto already_logged;
}
}
}
if (TRUE) {
ulint pos;
/* Write field number to undo log */
......@@ -823,6 +841,9 @@ trx_undo_page_report_modify(
ptr += flen;
}
}
already_logged:
continue;
}
mach_write_to_2(old_ptr, ptr - old_ptr);
......
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -771,7 +772,25 @@ trx_undo_page_report_modify(
const dict_col_t* col
= dict_table_get_nth_col(table, col_no);
if (col->ord_part) {
if (!col->ord_part) {
continue;
}
if (update) {
for (i = 0; i < update->n_fields; i++) {
const dict_field_t* f
= dict_index_get_nth_field(
index,
upd_get_nth_field(
update, i)
->field_no);
if (f->col == col) {
goto already_logged;
}
}
}
if (TRUE) {
ulint pos;
/* Write field number to undo log */
......@@ -822,6 +841,9 @@ trx_undo_page_report_modify(
ptr += flen;
}
}
already_logged:
continue;
}
mach_write_to_2(old_ptr, ptr - old_ptr);
......
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