1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Manual merge from mysql-5.1.

This commit is contained in:
Ramil Kalimullin
2011-08-09 11:42:07 +04:00
47 changed files with 832 additions and 210 deletions

View File

@ -23,7 +23,8 @@ main.query_cache_28249 # Bug#12584161 2009-03-25 main.query_ca
ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
rpl.rpl_innodb_bug28430 @solaris # Bug#11754425
rpl.rpl_innodb_bug28430 # Bug#11754425
rpl.rpl_insert # Sven: BUG#12764817
rpl.rpl_row_sp011 @solaris # Joro : Bug #11753919
rpl.rpl_stop_slave # Sven : BUG#12345981

View File

@ -1426,4 +1426,10 @@ NULL
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
NULL
#
# Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
#
DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
Warnings:
Warning 1292 Incorrect datetime value: '0'
End of 5.1 tests

View File

@ -7055,7 +7055,7 @@ DROP PROCEDURE p2;
DROP PROCEDURE p5;
#
# Bug#11840395 (formerly known as bug#60347):
# The string "versiondata" seems to be 'leaking' into the schema name space
# The string "versiondata" seems
# to be 'leaking' into the schema name space
#
DROP DATABASE IF EXISTS mixedCaseDbName;
@ -7068,6 +7068,25 @@ select mixedCaseDbName.tryMyFunc();
mixedCaseDbName.tryMyFunc()
IT WORKS
DROP DATABASE mixedCaseDbName;
#
# Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
#
CREATE TABLE t1 (a INT, b INT, KEY(b));
CREATE TABLE t2 (c INT, d INT, KEY(c));
INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
INSERT INTO t2 VALUES (1,1),(1,2);
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
BEGIN
DECLARE a int;
-- SQL statement inside
SELECT 1 INTO a;
RETURN a;
END $
SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1();
COUNT(DISTINCT d)
2
DROP FUNCTION f1;
DROP TABLE t1, t2;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------

View File

@ -1022,6 +1022,7 @@ v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
DELETE FROM t1;
DROP TABLE t1;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;

View File

@ -62,42 +62,42 @@ row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t0 Compact
test t00 Compact
test t1 Compact
test t10 Dynamic
test t11 Compressed
test t12 Compressed
test t13 Compressed
test t14 Compact
test t2 Redundant
test t3 Compact
test t4 Compact
test t5 Redundant
test t6 Redundant
test t7 Redundant
test t8 Compact
test t9 Compact
table_schema table_name row_format data_length index_length
test t0 Compact 16384 0
test t00 Compact 16384 0
test t1 Compact 16384 0
test t10 Dynamic 16384 0
test t11 Compressed 1024 0
test t12 Compressed 1024 0
test t13 Compressed 8192 0
test t14 Compact 16384 0
test t2 Redundant 16384 0
test t3 Compact 16384 0
test t4 Compact 16384 0
test t5 Redundant 16384 0
test t6 Redundant 16384 0
test t7 Redundant 16384 0
test t8 Compact 16384 0
test t9 Compact 16384 0
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Dynamic
table_schema table_name row_format data_length index_length
test t1 Dynamic 16384 0
alter table t1 row_format=compact;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compact
table_schema table_name row_format data_length index_length
test t1 Compact 16384 0
alter table t1 row_format=redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Redundant
table_schema table_name row_format data_length index_length
test t1 Redundant 16384 0
drop table t1;
create table t1(a int not null, b text, index(b(10))) engine=innodb
key_block_size=1;
@ -114,11 +114,11 @@ rollback;
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compressed
test t2 Compact
table_schema table_name row_format data_length index_length
test t1 Compressed 2048 1024
test t2 Compact 16384 0
drop table t1,t2;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
@ -206,19 +206,19 @@ create table t8 (id int primary key) engine = innodb row_format = compressed;
create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compact
test t10 Compact
test t11 Redundant
test t3 Compressed
test t4 Compressed
test t5 Compressed
test t6 Compressed
test t7 Compressed
test t8 Compressed
test t9 Dynamic
table_schema table_name row_format data_length index_length
test t1 Compact 16384 0
test t10 Compact 16384 0
test t11 Redundant 16384 0
test t3 Compressed 1024 0
test t4 Compressed 2048 0
test t5 Compressed 4096 0
test t6 Compressed 8192 0
test t7 Compressed 16384 0
test t8 Compressed 8192 0
test t9 Dynamic 16384 0
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed;
@ -245,11 +245,11 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compressed
test t5 Compressed
table_schema table_name row_format data_length index_length
test t1 Compressed 8192 0
test t5 Compressed 8192 0
drop table t1, t5;
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
@ -275,9 +275,9 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
@ -323,11 +323,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t8 Compact
test t9 Redundant
table_schema table_name row_format data_length index_length
test t8 Compact 16384 0
test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table = on;
set global innodb_file_format = `0`;
@ -375,11 +375,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t8 Compact
test t9 Redundant
table_schema table_name row_format data_length index_length
test t8 Compact 16384 0
test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;

View File

@ -475,6 +475,9 @@ CREATE TABLE t1(a INT,
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
DELETE FROM t1;
# Let the purge thread clean up this file.
-- sleep 10
DROP TABLE t1;
eval set global innodb_file_per_table=$per_table;

View File

@ -36,19 +36,19 @@ create table t13(a int primary key) engine=innodb
row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=compact;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1;
@ -81,7 +81,7 @@ connection default;
disconnect a;
disconnect b;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1,t2;
@ -192,7 +192,7 @@ create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
@ -218,7 +218,7 @@ show warnings;
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t5;
@ -238,7 +238,7 @@ create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
show warnings;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
#test valid values with innodb_file_per_table unset
@ -268,7 +268,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
@ -300,7 +300,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;

View File

@ -0,0 +1,49 @@
include/master-slave.inc
[connection master]
CREATE TABLE t1_11753004 (c1 INT);
CREATE TABLE t2_11753004 (c1 INT);
INSERT INTO t1_11753004 VALUES (1);
INSERT INTO t2_11753004 VALUES (2);
call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
include/stop_slave.inc
SET @save_debug= @@global.debug;
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
include/wait_for_slave_sql_error.inc [errno=1593 ]
include/stop_slave.inc
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
include/rpl_reset.inc
DROP TABLE t1_11753004, t2_11753004;
include/stop_slave.inc
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
include/rpl_reset.inc
CREATE TABLE t1_11753004 (c1 INT);
CREATE TABLE t2_11753004_ign (c1 INT);
INSERT INTO t1_11753004 VALUES (1);
INSERT INTO t2_11753004_ign VALUES (2);
UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2;
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
BINLOG '
SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
'/*!*/;
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
BINLOG '
SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
'/*!*/;
ERROR HY000: Fatal error: Found table map event mapping table id 0 which was already mapped but with different settings.
DROP TABLE t1,t2;
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
DROP TABLE t1_11753004;
DROP TABLE t2_11753004_ign;
SET GLOBAL debug= @save_debug;
include/rpl_end.inc

View File

@ -0,0 +1 @@
--replicate-ignore-table=test.t2_11753004_ign

View File

@ -0,0 +1,115 @@
#
--source include/master-slave.inc
--source include/have_debug.inc
--source include/have_binlog_format_row.inc
# BUG#11753004: 44360: REPLICATION FAILED
## assert that we get an error when checking the
## identifiers at the slave (instead of a crash or
## different table being updated)
--let $t1= t1_11753004
--let $t2= t2_11753004
--let $t2_ign= t2_11753004_ign
## test #1: assert that we get an error raised when multiple
## tables in the same RBR statement are mapped with the
## same identifier
--eval CREATE TABLE $t1 (c1 INT)
--eval CREATE TABLE $t2 (c1 INT)
--eval INSERT INTO $t1 VALUES (1)
--eval INSERT INTO $t2 VALUES (2)
--sync_slave_with_master
call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
# stop the slave and inject corruption
--source include/stop_slave.inc
SET @save_debug= @@global.debug;
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
--source include/start_slave.inc
--connection master
# both tables get mapped to 0 (in a way, simulating scenario
# originated by BUG#56226)
--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
--connection slave
# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
--let $slave_sql_errno=1593
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
# clean up
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
--source include/start_slave.inc
--connection master
--source include/rpl_reset.inc
--eval DROP TABLE $t1, $t2
--sync_slave_with_master
## test #2: assert that ignored tables that may have been mapped
## with the same identifier are skipped, thus no error
## is raised.
--connection slave
--source include/stop_slave.inc
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
--source include/start_slave.inc
--source include/rpl_reset.inc
--connection master
--eval CREATE TABLE $t1 (c1 INT)
--eval CREATE TABLE $t2_ign (c1 INT)
--eval INSERT INTO $t1 VALUES (1)
--eval INSERT INTO $t2_ign VALUES (2)
--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
# must not raise error as second table is filtered
--sync_slave_with_master
## test #3: check that BINLOG statements will also raise an
## error if containing table map events mapping different
## tables to same table identifier.
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
# FD event
BINLOG '
SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
'/*!*/;
#110708 12:21:44 server id 1 end_log_pos 774 Table_map: `test`.`t1` mapped to number 66
# at 774
#110708 12:21:44 server id 1 end_log_pos 815 Table_map: `test`.`t2` mapped to number 67
# at 815
#110708 12:21:44 server id 1 end_log_pos 855 Update_rows: table id 66
# at 855
#110708 12:21:44 server id 1 end_log_pos 895 Update_rows: table id 67 flags: STMT_END_F
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
--error ER_SLAVE_FATAL_ERROR
BINLOG '
SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
'/*!*/;
# clean up
DROP TABLE t1,t2;
--connection slave
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
--connection master
--eval DROP TABLE $t1
--eval DROP TABLE $t2_ign
--sync_slave_with_master
SET GLOBAL debug= @save_debug;
--source include/rpl_end.inc

View File

@ -928,4 +928,10 @@ SELECT DATE_FORMAT('0000-00-11', '%w');
SELECT MAKEDATE(11111111,1);
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
--echo #
--echo # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
--echo #
DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
--echo End of 5.1 tests

View File

@ -8350,9 +8350,10 @@ SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
--echo #
--echo # Bug#11840395 (formerly known as bug#60347):
--echo # The string "versiondata" seems to be 'leaking' into the schema name space
--echo # The string "versiondata" seems
--echo # to be 'leaking' into the schema name space
--echo #
--disable_warnings
@ -8368,6 +8369,34 @@ call mixedCaseDbName.tryMyProc();
select mixedCaseDbName.tryMyFunc();
DROP DATABASE mixedCaseDbName;
--echo #
--echo # Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
--echo #
CREATE TABLE t1 (a INT, b INT, KEY(b));
CREATE TABLE t2 (c INT, d INT, KEY(c));
INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
INSERT INTO t2 VALUES (1,1),(1,2);
DELIMITER $;
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
BEGIN
DECLARE a int;
-- SQL statement inside
SELECT 1 INTO a;
RETURN a;
END $
DELIMITER ;$
SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1();
DROP FUNCTION f1;
DROP TABLE t1, t2;
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------