1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Merge revisions from maria/5.5 (5.5.41)

bzr merge -r4393 lp:maria/5.5
This commit is contained in:
Nirbhay Choubey
2014-12-22 20:09:25 -05:00
68 changed files with 1796 additions and 256 deletions

View File

@@ -79,4 +79,5 @@ z
31
32
drop table corrupt_bit_test_ā;
DROP DATABASE pad;
SET GLOBAL innodb_change_buffering_debug = 0;

View File

@@ -0,0 +1,11 @@
#
# Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1
# CAUSES INFINITE PAGE SPLIT
#
SET GLOBAL innodb_change_buffering_debug=1;
SET GLOBAL innodb_limit_optimistic_insert_debug=1;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB
PARTITION BY HASH (c1) PARTITIONS 15;
DROP TABLE t1;
SET GLOBAL innodb_change_buffering_debug=0;
SET GLOBAL innodb_limit_optimistic_insert_debug=0;

View File

@@ -0,0 +1,253 @@
#
# Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
# CALLED FROM A FUNCTION
#
call mtr.add_suppression("MySQL is trying to drop table");
CREATE PROCEDURE cachedata(
IN obj_id BIGINT UNSIGNED,
IN start DATETIME,
IN end DATETIME
)
cachedata:BEGIN
DECLARE cache_count BIGINT;
SET @timestamp := NOW();
CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
timestamp DATETIME,
object_id BIGINT UNSIGNED NOT NULL,
start DATETIME,
end DATETIME,
seqno BIGINT AUTO_INCREMENT,
value FLOAT,
PRIMARY KEY (seqno),
INDEX (timestamp),
INDEX (object_id, start, end)
) ENGINE=INNODB;
DELETE FROM cachedata WHERE
timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);
SELECT count(*) INTO cache_count FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
IF cache_count > 0 THEN LEAVE cachedata;
END IF;
INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345);
END$$
CREATE FUNCTION get_cache(
obj_id BIGINT UNSIGNED,
start DATETIME,
end DATETIME
)
RETURNS FLOAT
READS SQL DATA
BEGIN
DECLARE result FLOAT;
CALL cachedata(obj_id, start, end);
SELECT SUM(value) INTO result FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
RETURN result;
END$$
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
SELECT get_cache(1, '2014-01-01', '2014-02-01');
get_cache(1, '2014-01-01', '2014-02-01')
95247
select sleep(1);
sleep(1)
0
DROP FUNCTION get_cache;
DROP PROCEDURE cachedata;

View File

@@ -0,0 +1,242 @@
#
# Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
# INNODB_STRICT_MODE = 1
#
set innodb_strict_mode = 0;
create table t1 (id int auto_increment primary key,
v varchar(32),
col1 text,
col2 text,
col3 text,
col4 text,
col5 text,
col6 text,
col7 text,
col8 text,
col9 text,
col10 text,
col11 text,
col12 text,
col13 text,
col14 text,
col15 text,
col16 text,
col17 text,
col18 text,
col19 text,
col20 text,
col21 text,
col22 text,
col23 text,
col24 text,
col25 text,
col26 text,
col27 text,
col28 text,
col29 text,
col30 text,
col31 text,
col32 text,
col33 text,
col34 text,
col35 text,
col36 text,
col37 text,
col38 text,
col39 text,
col40 text,
col41 text,
col42 text,
col43 text,
col44 text,
col45 text ,
col46 text,
col47 text,
col48 text,
col49 text,
col50 text,
col51 text,
col52 text,
col53 text,
col54 text,
col55 text,
col56 text,
col57 text,
col58 text,
col59 text,
col60 text,
col61 text,
col62 text,
col63 text,
col64 text,
col65 text,
col66 text,
col67 text,
col68 text ,
col69 text,
col70 text,
col71 text,
col72 text,
col73 text,
col74 text,
col75 text,
col76 text,
col77 text,
col78 text,
col79 text,
col80 text,
col81 text,
col82 text,
col83 text,
col84 text,
col85 text,
col86 text,
col87 text,
col88 text,
col89 text,
col90 text,
col91 text,
col92 text,
col93 text,
col94 text,
col95 text,
col96 text,
col97 text,
col98 text,
col99 text,
col100 text,
col101 text,
col102 text,
col103 text,
col104 text,
col105 text,
col106 text,
col107 text,
col108 text,
col109 text,
col110 text,
col111 text,
col112 text,
col113 text,
col114 text,
col115 text,
col116 text,
col117 text,
col118 text,
col119 text,
col120 text,
col121 text,
col122 text,
col123 text,
col124 text,
col125 text,
col126 text ,
col127 text,
col128 text,
col129 text,
col130 text,
col131 text,
col132 text,
col133 text,
col134 text,
col135 text,
col136 text,
col137 text,
col138 text,
col139 text,
col140 text,
col141 text,
col142 text,
col143 text,
col144 text,
col145 text,
col146 text,
col147 text ,
col148 text,
col149 text,
col150 text,
col151 text,
col152 text,
col153 text,
col154 text,
col155 text,
col156 text,
col157 text,
col158 text,
col159 text,
col160 text,
col161 text,
col162 text,
col163 text,
col164 text,
col165 text,
col166 text,
col167 text,
col168 text,
col169 text,
col170 text,
col171 text,
col172 text ,
col173 text,
col174 text,
col175 text,
col176 text,
col177 text,
col178 text,
col179 text,
col180 text,
col181 text,
col182 text,
col183 text,
col184 text,
col185 text,
col186 text,
col187 text,
col188 text,
col189 text,
col190 text,
col191 text,
col192 text,
col193 text,
col194 text,
col195 text,
col196 text,
col197 text,
col198 text,
col199 text,
col200 text,
col201 text,
col202 text,
col203 text,
col204 text,
col205 text,
col206 text,
col207 text,
col208 text,
col209 text,
col210 text,
col211 text,
col212 text,
col213 text,
col214 text,
col215 text,
col216 text,
col217 text,
col218 text,
col219 text,
col220 text,
col221 text,
col222 text,
col223 text,
col224 text,
col225 text,
col226 text,
col227 text,
col228 text
) ENGINE=InnoDB;
Warnings:
Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
set innodb_strict_mode = 1;
alter table t1 engine=InnoDB;
ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
drop table t1;

View File

@@ -3,6 +3,11 @@
#
-- source include/have_innodb.inc
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
}
# Issues with innodb_change_buffering_debug on Windows, so the test scenario
# cannot be created on windows
--source include/not_windows.inc
@@ -16,14 +21,20 @@
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
# whenever possible.
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 1;
# Turn off Unique Check to create corrupted index with dup key
SET UNIQUE_CHECKS=0;
CREATE DATABASE pad;
let $i=345;
while ($i)
{
--eval CREATE TABLE pad.t$i (a INT PRIMARY KEY) ENGINE=InnoDB;
dec $i;
}
-- enable_query_log
set names utf8;
@@ -119,6 +130,6 @@ select z from corrupt_bit_test_ā limit 10;
# Drop table
drop table corrupt_bit_test_ā;
DROP DATABASE pad;
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 0;

View File

@@ -0,0 +1,22 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_partition.inc
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
}
--echo #
--echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1
--echo # CAUSES INFINITE PAGE SPLIT
--echo #
SET GLOBAL innodb_change_buffering_debug=1;
SET GLOBAL innodb_limit_optimistic_insert_debug=1;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB
PARTITION BY HASH (c1) PARTITIONS 15;
DROP TABLE t1;
SET GLOBAL innodb_change_buffering_debug=0;
SET GLOBAL innodb_limit_optimistic_insert_debug=0;

View File

@@ -0,0 +1,108 @@
--source include/have_innodb.inc
--source include/big_test.inc
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
}
--echo #
--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
--echo # CALLED FROM A FUNCTION
--echo #
call mtr.add_suppression("MySQL is trying to drop table");
DELIMITER $$;
CREATE PROCEDURE cachedata(
IN obj_id BIGINT UNSIGNED,
IN start DATETIME,
IN end DATETIME
)
cachedata:BEGIN
DECLARE cache_count BIGINT;
SET @timestamp := NOW();
CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
timestamp DATETIME,
object_id BIGINT UNSIGNED NOT NULL,
start DATETIME,
end DATETIME,
seqno BIGINT AUTO_INCREMENT,
value FLOAT,
PRIMARY KEY (seqno),
INDEX (timestamp),
INDEX (object_id, start, end)
) ENGINE=INNODB;
DELETE FROM cachedata WHERE
timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);
SELECT count(*) INTO cache_count FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
IF cache_count > 0 THEN LEAVE cachedata;
END IF;
INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345),
(@timestamp, obj_id, start, end, 1234),
(@timestamp, obj_id, start, end, 4567),
(@timestamp, obj_id, start, end, 8901),
(@timestamp, obj_id, start, end, 2345);
END$$
CREATE FUNCTION get_cache(
obj_id BIGINT UNSIGNED,
start DATETIME,
end DATETIME
)
RETURNS FLOAT
READS SQL DATA
BEGIN
DECLARE result FLOAT;
CALL cachedata(obj_id, start, end);
SELECT SUM(value) INTO result FROM cachedata WHERE
object_id = obj_id
AND start = start
AND end = end;
RETURN result;
END$$
DELIMITER ;$$
let $i = 30;
while ($i)
{
SELECT get_cache(1, '2014-01-01', '2014-02-01');
select sleep(1);
dec $i;
}
DROP FUNCTION get_cache;
DROP PROCEDURE cachedata;

View File

@@ -0,0 +1,251 @@
--source include/have_innodb.inc
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
}
--echo #
--echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
--echo # INNODB_STRICT_MODE = 1
--echo #
set innodb_strict_mode = 0;
create table t1 (id int auto_increment primary key,
v varchar(32),
col1 text,
col2 text,
col3 text,
col4 text,
col5 text,
col6 text,
col7 text,
col8 text,
col9 text,
col10 text,
col11 text,
col12 text,
col13 text,
col14 text,
col15 text,
col16 text,
col17 text,
col18 text,
col19 text,
col20 text,
col21 text,
col22 text,
col23 text,
col24 text,
col25 text,
col26 text,
col27 text,
col28 text,
col29 text,
col30 text,
col31 text,
col32 text,
col33 text,
col34 text,
col35 text,
col36 text,
col37 text,
col38 text,
col39 text,
col40 text,
col41 text,
col42 text,
col43 text,
col44 text,
col45 text ,
col46 text,
col47 text,
col48 text,
col49 text,
col50 text,
col51 text,
col52 text,
col53 text,
col54 text,
col55 text,
col56 text,
col57 text,
col58 text,
col59 text,
col60 text,
col61 text,
col62 text,
col63 text,
col64 text,
col65 text,
col66 text,
col67 text,
col68 text ,
col69 text,
col70 text,
col71 text,
col72 text,
col73 text,
col74 text,
col75 text,
col76 text,
col77 text,
col78 text,
col79 text,
col80 text,
col81 text,
col82 text,
col83 text,
col84 text,
col85 text,
col86 text,
col87 text,
col88 text,
col89 text,
col90 text,
col91 text,
col92 text,
col93 text,
col94 text,
col95 text,
col96 text,
col97 text,
col98 text,
col99 text,
col100 text,
col101 text,
col102 text,
col103 text,
col104 text,
col105 text,
col106 text,
col107 text,
col108 text,
col109 text,
col110 text,
col111 text,
col112 text,
col113 text,
col114 text,
col115 text,
col116 text,
col117 text,
col118 text,
col119 text,
col120 text,
col121 text,
col122 text,
col123 text,
col124 text,
col125 text,
col126 text ,
col127 text,
col128 text,
col129 text,
col130 text,
col131 text,
col132 text,
col133 text,
col134 text,
col135 text,
col136 text,
col137 text,
col138 text,
col139 text,
col140 text,
col141 text,
col142 text,
col143 text,
col144 text,
col145 text,
col146 text,
col147 text ,
col148 text,
col149 text,
col150 text,
col151 text,
col152 text,
col153 text,
col154 text,
col155 text,
col156 text,
col157 text,
col158 text,
col159 text,
col160 text,
col161 text,
col162 text,
col163 text,
col164 text,
col165 text,
col166 text,
col167 text,
col168 text,
col169 text,
col170 text,
col171 text,
col172 text ,
col173 text,
col174 text,
col175 text,
col176 text,
col177 text,
col178 text,
col179 text,
col180 text,
col181 text,
col182 text,
col183 text,
col184 text,
col185 text,
col186 text,
col187 text,
col188 text,
col189 text,
col190 text,
col191 text,
col192 text,
col193 text,
col194 text,
col195 text,
col196 text,
col197 text,
col198 text,
col199 text,
col200 text,
col201 text,
col202 text,
col203 text,
col204 text,
col205 text,
col206 text,
col207 text,
col208 text,
col209 text,
col210 text,
col211 text,
col212 text,
col213 text,
col214 text,
col215 text,
col216 text,
col217 text,
col218 text,
col219 text,
col220 text,
col221 text,
col222 text,
col223 text,
col224 text,
col225 text,
col226 text,
col227 text,
col228 text
) ENGINE=InnoDB;
set innodb_strict_mode = 1;
--error ER_TOO_BIG_ROWSIZE
alter table t1 engine=InnoDB;
drop table t1;