Commit 050dd45b authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

New upstream version 5.5.59

parent f06c422f
......@@ -2061,4 +2061,50 @@ ORDER BY NULL, @a0 := 3, @a1 := 3, @a2 := 3, @a3 := 3, @a4 := 3,
1
1
2
#
# mdev-6706: semi-join with duplicate weedout + ORDER BY
#
CREATE TABLE t1 (f1 VARCHAR(3)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('foo');
CREATE TABLE t2 (f2 VARCHAR(3)) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('bar'),('baz');
CREATE TABLE t3
(i3_key INT, f3_key VARCHAR(3), f3 VARCHAR(3), KEY(f3_key,i3_key))
ENGINE=MyISAM;
INSERT INTO t3 VALUES (0,'qux','qux'),(8,'bar','bar');
SELECT CONCAT( f1, f2 ) AS field FROM t1, t2
WHERE f1 = ANY ( SELECT f1
FROM t1
LEFT JOIN ( t3 AS t3a, t3 AS t3b )
ON ( t3b.f3_key = t3a.f3 )
WHERE t3a.f3 < f1 OR t3b.f3 != f1 );
field
foobar
foobaz
SELECT CONCAT( f1, f2 ) AS field FROM t1, t2
WHERE f1 = ANY ( SELECT f1
FROM t1
LEFT JOIN ( t3 AS t3a, t3 AS t3b )
ON ( t3b.f3_key = t3a.f3 )
WHERE t3a.f3 < f1 OR t3b.f3 != f1 )
ORDER BY field;
field
foobar
foobaz
EXPLAIN EXTENDED SELECT CONCAT( f1, f2 ) AS field FROM t1, t2
WHERE f1 = ANY ( SELECT f1
FROM t1
LEFT JOIN ( t3 AS t3a, t3 AS t3b )
ON ( t3b.f3_key = t3a.f3 )
WHERE t3a.f3 < f1 OR t3b.f3 != f1 )
ORDER BY field;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 Using temporary; Using filesort
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
1 PRIMARY t3a ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
1 PRIMARY t3b ref f3_key f3_key 6 test.t3a.f3 1 100.00 Using where; End temporary
Warnings:
Note 1003 select concat('foo',`test`.`t2`.`f2`) AS `field` from `test`.`t2` semi join ((`test`.`t3` `t3a` join `test`.`t3` `t3b`)) where ((`test`.`t3a`.`f3` < 'foo') or (`test`.`t3b`.`f3` <> 'foo')) order by concat('foo',`test`.`t2`.`f2`)
DROP TABLE t1,t2,t3;
End of 5.5 tests
......@@ -4316,4 +4316,22 @@ set join_cache_level=@join_cache_level_save;
deallocate prepare stmt;
drop view v1,v2,v3;
drop table t1,t2,t3;
#
# MDEV-10657: incorrect result returned with binary protocol
# (prepared statements)
#
create table t1 (code varchar(10) primary key);
INSERT INTO t1(code) VALUES ('LINE1'), ('LINE2'), ('LINE3');
SELECT X.*
FROM
(SELECT CODE, RN
FROM
(SELECT A.CODE, @cnt := @cnt + 1 AS RN
FROM t1 A, (SELECT @cnt := 0) C) T
) X;
CODE RN
LINE1 1
LINE2 2
LINE3 3
drop table t1;
# End of 5.5 tests
......@@ -220,3 +220,29 @@ RESET QUERY CACHE;
DROP TABLE t1;
SET GLOBAL query_cache_size= DEFAULT;
SET GLOBAL query_cache_type= DEFAULT;
#
# MDEV-14526: MariaDB keeps crashing under load when
# query_cache_type is changed
#
CREATE TABLE t1 (
`id` int(10) NOT NULL AUTO_INCREMENT,
`k` int(10) default '0',
PRIMARY KEY (`id`))
ENGINE=MyISAM;
INSERT IGNORE INTO t1 VALUES
(NULL,1),(NULL,8),(NULL,NULL),(NULL,NULL),(NULL,4),(NULL,9),(NULL,7),
(NULL,3),(NULL,NULL),(NULL,2),(NULL,3),(NULL,NULL),(NULL,2),(NULL,7),
(NULL,1),(NULL,2),(NULL,4),(NULL,NULL),(NULL,1),(NULL,1),(NULL,4);
SET GLOBAL query_cache_size= 1024*1024;
SET GLOBAL query_cache_type= 1;
set debug_sync="wait_in_query_cache_store_query SIGNAL parked WAIT_FOR go";
SELECT DISTINCT id FROM t1 WHERE id BETWEEN 5603 AND 16218 ORDER BY k;
set debug_sync="now WAIT_FOR parked";
SET GLOBAL query_cache_type= 0;
set debug_sync="now SIGNAL go";
id
set debug_sync= 'RESET';
DROP TABLE t1;
SEt GLOBAL query_cache_size= DEFAULT;
SEt GLOBAL query_cache_type= DEFAULT;
# End of 5.5 tests
......@@ -7146,3 +7146,29 @@ SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
......@@ -7143,6 +7143,32 @@ SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'
......
......@@ -7141,4 +7141,30 @@ SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
set @optimizer_switch_for_subselect_test=null;
......@@ -7152,6 +7152,32 @@ SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%';
@@optimizer_switch like '%subquery_cache=on%'
......
......@@ -7141,5 +7141,31 @@ SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
......@@ -5629,6 +5629,20 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop table t3;
#
# MDEV-14619: VIEW and GROUP_CONCAT
#
CREATE TABLE t1 (str text);
INSERT INTO t1 VALUES ("My"),("SQL");
CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '\\') FROM t1;
SELECT * FROM v1;
GROUP_CONCAT(str SEPARATOR '\\')
My\SQL
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
......
......@@ -200,6 +200,17 @@ a
1
DROP TABLE t1;
#
# MDEV-14609 XA Transction unable to ROLLBACK TO SAVEPOINT
#
CREATE TABLE t1 (c1 INT) ENGINE=INNODB;
XA START 'xa1';
SAVEPOINT savepoint1;
INSERT INTO t1 (c1) VALUES (1),(2),(3),(4);
ROLLBACK TO SAVEPOINT savepoint1;
XA END 'xa1';
XA ROLLBACK 'xa1';
DROP TABLE t1;
#
# Bug#12352846 - TRANS_XA_START(THD*):
# ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL()
# FAILED
......
......@@ -1046,8 +1046,9 @@ 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.
ROLLBACK;
DROP TABLE bug12547647;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
......
#
# Bug#17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX
#
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34);
select * from t1;
f1 f2 f3
14 25 34
drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout';
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;
......@@ -532,9 +532,10 @@ PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
COMMIT;
BEGIN;
# The following used to cause infinite undo log allocation.
--error ER_UNDO_RECORD_TOO_BIG
UPDATE bug12547647 SET c = REPEAT('b',16928);
ROLLBACK;
DROP TABLE bug12547647;
eval set global innodb_file_per_table=$per_table;
......
......@@ -2,3 +2,5 @@
--default-storage-engine=MyISAM
--innodb-strict-mode=0
--innodb-file-per-table=0
--loose-innodb-track-changed-pages
--loose-innodb-log-archive
--source include/have_innodb.inc
--source include/have_debug.inc
--echo #
--echo # Bug#17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX
--echo #
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34);
select * from t1;
drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout';
--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;
......@@ -30,3 +30,72 @@ drop table t1;
CREATE TABLE t1 (i INT) ENGINE=Aria;
LOCK TABLES t1 WRITE, t1 AS t1a WRITE;
DROP TABLE t1;
#
# MDEV-8200 aria bug with insert select when select is a aria table
# (wrong result or assertion failure:
# `table->file->stats.records > 0 || error')
#
CREATE TABLE t1 (f1 INT) ENGINE=Aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT) engine=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1 FROM t1;
INSERT INTO t2 SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
f2
1
unlock tables;
DROP TABLE t1,t2,tmp;
#
# Same without transactional
#
CREATE TABLE t1 (f1 INT) transactional=0 ENGINE=Aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=0
INSERT INTO t1 VALUES (2);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT) transactional=0 engine=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1 FROM t1;
INSERT INTO t2 SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
f2
2
unlock tables;
DROP TABLE t1,t2,tmp;
#
# Using spatical keys (disables versioning)
#
CREATE TABLE t1 (f1 INT, c1 geometry NOT NULL, SPATIAL KEY i1 (c1)) transactional=1 ENGINE=Aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL,
`c1` geometry NOT NULL,
SPATIAL KEY `i1` (`c1`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
INSERT INTO t1 VALUES (3,
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT, c1 geometry NOT NULL, SPATIAL KEY i1 (c1)) transactional=1 ENGINE=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1,c1 FROM t1;
INSERT INTO t2 (f2) SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
f2
3
unlock tables;
DROP TABLE t1,t2,tmp;
......@@ -50,3 +50,58 @@ drop table t1;
CREATE TABLE t1 (i INT) ENGINE=Aria;
LOCK TABLES t1 WRITE, t1 AS t1a WRITE;
DROP TABLE t1;
--echo #
--echo # MDEV-8200 aria bug with insert select when select is a aria table
--echo # (wrong result or assertion failure:
--echo # `table->file->stats.records > 0 || error')
--echo #
CREATE TABLE t1 (f1 INT) ENGINE=Aria;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT) engine=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1 FROM t1;
INSERT INTO t2 SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
unlock tables;
DROP TABLE t1,t2,tmp;
--echo #
--echo # Same without transactional
--echo #
CREATE TABLE t1 (f1 INT) transactional=0 ENGINE=Aria;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (2);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT) transactional=0 engine=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1 FROM t1;
INSERT INTO t2 SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
unlock tables;
DROP TABLE t1,t2,tmp;
--echo #
--echo # Using spatical keys (disables versioning)
--echo #
CREATE TABLE t1 (f1 INT, c1 geometry NOT NULL, SPATIAL KEY i1 (c1)) transactional=1 ENGINE=Aria;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (3,
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT, c1 geometry NOT NULL, SPATIAL KEY i1 (c1)) transactional=1 ENGINE=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1,c1 FROM t1;
INSERT INTO t2 (f2) SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
unlock tables;
DROP TABLE t1,t2,tmp;
......@@ -2686,3 +2686,14 @@ select count(*) from t1;
count(*)
13
drop table t1;
#
# MDEV-14690: Assertion `page_link == &fake_link' failed in
# pagecache_write_part
#
CREATE TABLE t1 (a CHAR(8), b CHAR(8), c CHAR(8) NOT NULL DEFAULT '', f FLOAT, KEY(f)) ENGINE=Aria;
INSERT INTO t1 (a) VALUES ('foo');
DELETE FROM t1 WHERE c < 'bar';
ALTER TABLE t1 DISABLE KEYS;
INSERT INTO t1 (b) VALUES ('');
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
Supports Markdown
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