1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This commit is contained in:
Sergei Golubchik
2012-06-16 09:03:07 +02:00
162 changed files with 4387 additions and 1702 deletions

View File

@ -1518,7 +1518,7 @@ sub command_line_setup {
# We make the path absolute, as the server will do a chdir() before usage
unless ( $opt_vardir =~ m,^/, or
(IS_WINDOWS and $opt_vardir =~ m,^[a-z]:/,i) )
(IS_WINDOWS and $opt_vardir =~ m,^[a-z]:[/\\],i) )
{
# Make absolute path, relative test dir
$opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
@ -2717,6 +2717,7 @@ sub setup_vardir() {
# hm, what paths work for debs and for rpms ?
for (<$bindir/lib64/mysql/plugin/*.so>,
<$bindir/lib/mysql/plugin/*.so>,
<$bindir/lib/plugin/*.so>, # bintar
<$bindir/lib/plugin/*.dll>)
{
my $pname=basename($_);
@ -3463,12 +3464,6 @@ sub mysql_install_db {
mtr_add_arg($args, "--lc-messages-dir=%s", $install_lang);
mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir);
# On some old linux kernels, aio on tmpfs is not supported
# Remove this if/when Bug #58421 fixes this in the server
if ($^O eq "linux" && $opt_mem) {
mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
}
# InnoDB arguments that affect file location and sizes may
# need to be given to the bootstrap process as well as the
# server process.
@ -4742,6 +4737,7 @@ sub extract_warning_lines ($$) {
qr|Access denied for user|,
qr|Aborted connection|,
qr|table.*is full|,
qr|Linux Native AIO|, # warning that aio does not work on /dev/shm
);
my $matched_lines= [];
@ -5245,13 +5241,6 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "--user=root");
}
# On some old linux kernels, aio on tmpfs is not supported
# Remove this if/when Bug #58421 fixes this in the server
if ($^O eq "linux" && $opt_mem)
{
mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
}
if (!using_extern() and !$opt_user_args)
{
# Turn on logging to file
@ -5292,6 +5281,7 @@ sub mysqld_arguments ($$$) {
}
elsif ($plugin = mtr_match_prefix($arg, "--plugin-load="))
{
next if $plugin =~ /=$/;
push @plugins, $plugin unless $seen{$plugin};
$seen{$plugin} = 1;
}

View File

@ -0,0 +1,56 @@
#
# Bug#12427262 : 60961: SHOW TABLES VERY SLOW WHEN NOT IN SYSTEM DISK CACHE.
#
create database show_table_lw_db;
use show_table_lw_db;
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
create table t4 (c1 int);
create table t5 (c1 int);
create table t6 (c1 int);
create table t7 (c1 int);
create table t8 (c1 int);
create table t9 (c1 int);
create table t10 (c1 int);
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_before;
show tables;
Tables_in_show_table_lw_db
t1
t10
t2
t3
t4
t5
t6
t7
t8
t9
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_after;
select @count_read_after-@count_read_before;
@count_read_after-@count_read_before
0.000000000000000000000000000000
show full tables;
Tables_in_show_table_lw_db Table_type
t1 BASE TABLE
t10 BASE TABLE
t2 BASE TABLE
t3 BASE TABLE
t4 BASE TABLE
t5 BASE TABLE
t6 BASE TABLE
t7 BASE TABLE
t8 BASE TABLE
t9 BASE TABLE
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_after;
select @count_read_after-@count_read_before;
@count_read_after-@count_read_before
10.000000000000000000000000000000
drop table t1;
drop database show_table_lw_db;

View File

@ -204,4 +204,30 @@ SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
BIT_XOR(t1.b)
0
DROP TABLE t1, t2;
#
# Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY
# COUNT(*) LIMIT.
#
CREATE TABLE t1 (
id BIGINT(20) ,
member_id_to INT(11) ,
r_date DATE ,
PRIMARY KEY (id,r_date),
KEY r_date_idx (r_date),
KEY t1_idx01 (member_id_to)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(107924526,518491,'2011-05-01'),
(107924527,518491,'2011-05-01'),
(107924534,518491,'2011-06-21'),
(107924535,518491,'2011-06-21'),
(107924542,1601319,'2011-06-21'),
(107924543,1601319,'2011-06-21'),
(107924544,1601319,'2011-06-21'),
(107924545,1601319,'2011-06-21');
SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
'2011-06-21' GROUP BY member_id_to ORDER BY 2 LIMIT 1;
member_id_to COUNT(*)
518491 2
DROP TABLE t1;
End of 5.5 tests

View File

@ -0,0 +1,7 @@
set names swe7;
select '' in ('',convert(0,time));
'' in ('',convert(0,time))
1
select case '' when '' then 1 when convert(0,time) then 2 end;
case '' when '' then 1 when convert(0,time) then 2 end
1

View File

@ -5222,3 +5222,48 @@ DROP DATABASE b12809202_db;
# Delete all existing binary logs.
#
RESET MASTER;
#
# Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM
#
SET @old_log_output_state= @@global.log_output;
SET @old_general_log_state= @@global.general_log;
SET @old_slow_query_log_state= @@global.slow_query_log;
call mtr.add_suppression("Failed to write to mysql.general_log");
SET @@global.log_output="TABLE";
SET @@global.general_log='OFF';
SET @@global.slow_query_log='OFF';
DROP DATABASE mysql;
Warnings:
Error 1146 Table 'mysql.proc' doesn't exist
Error 1146 Table 'mysql.event' doesn't exist
SHOW CREATE TABLE mysql.general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
SHOW CREATE TABLE mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state;
SET @@global.general_log= @old_general_log_state;
#
# End of 5.1 tests
#

View File

@ -22,3 +22,7 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
**** Clean up ****
set global binlog_format = @saved_binlog_format;
drop user mysqltest_1@localhost;
GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
SHOW MASTER LOGS;
SHOW BINARY LOGS;
DROP USER 'mysqltest_1'@'localhost';

View File

@ -54,3 +54,22 @@ disconnect root;
connection default;
set global binlog_format = @saved_binlog_format;
drop user mysqltest_1@localhost;
# Testing if REPLICATION CLIENT privilege is enough to execute
# SHOW MASTER LOGS and SHOW BINARY.
GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
--connect(rpl,localhost,mysqltest_1,,)
--connection rpl
# We are only interested if the following commands succeed and not on
# their output.
--disable_result_log
SHOW MASTER LOGS;
SHOW BINARY LOGS;
--enable_result_log
# clean up
--disconnect rpl
connection default;
DROP USER 'mysqltest_1'@'localhost';

View File

@ -0,0 +1,6 @@
create table t1 (f1 integer primary key) engine innodb;
alter table t1 add constraint c1 foreign key (f1) references t1(f1);
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
InnoDB: which are not compatible with the new table definition.
InnoDB: has or is referenced in foreign key constraints
drop table t1;

View File

@ -0,0 +1,56 @@
create table t1 (
rowid int,
f1 int,
f2 int,
key i1 (f1, f2),
key i2 (f2)) engine=innodb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`rowid` int(11) DEFAULT NULL,
`f1` int(11) DEFAULT NULL,
`f2` int(11) DEFAULT NULL,
KEY `i1` (`f1`,`f2`),
KEY `i2` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL);
start transaction with consistent snapshot;
start transaction;
update t1 set f2 = 4 where f1 = 1 and f2 is null;
(b) Number of rows updated:
select row_count();
row_count()
1
insert into t1 values (3, 1, null);
(b) After update and insert query.
select rowid, f1, f2 from t1;
rowid f1 f2
1 1 10
2 1 4
3 1 NULL
commit;
(a) Before the update statement is executed.
select rowid, f1, f2 from t1;
rowid f1 f2
1 1 10
2 1 NULL
SET SESSION debug_dbug="+d,bug14007649";
update t1 set f2 = 6 where f1 = 1 and f2 is null;
(a) Number of rows updated:
select row_count();
row_count()
1
(a) After the update statement is executed.
select rowid, f1, f2 from t1;
rowid f1 f2
1 1 10
2 1 NULL
3 1 6
commit;
"The trx with consistent snapshot ended."
select rowid, f1, f2 from t1;
rowid f1 f2
1 1 10
2 1 4
3 1 6
drop table t1;

View File

@ -4,11 +4,6 @@
--source include/have_innodb.inc
if (`select plugin_auth_version <= "1.1.8-24.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.1.8-24.1 or earlier
}
# DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc

View File

@ -1,10 +1,5 @@
-- source include/have_innodb.inc
if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.0.17-13.0 or earlier
}
let $MYSQLD_DATADIR= `select @@datadir`;
let $per_table=`select @@innodb_file_per_table`;

View File

@ -1,10 +1,5 @@
--source include/have_innodb.inc
if (`select plugin_auth_version <= "1.0.17-13.0" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.0.17-13.0 or earlier
}
#
# Check and select innodb lock type
#

View File

@ -0,0 +1,42 @@
# Bug 12902967: Creating self referencing fk on same index unhandled,
# confusing error
#
# Creating a self referencing foreign key on the same
# column/index is an unhandled exception, it should throw a sensible
# error but instead implies that your data dictionary may now be out
# of sync:
--source include/have_innodb.inc
--source include/not_embedded.inc
let error_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
--source include/restart_mysqld.inc
create table t1 (f1 integer primary key) engine innodb;
# The below statement should produce error message in error log.
# This error message should mention problem with foreign keys
# rather than with data dictionary.
--replace_regex /'\.\/test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_ERROR_ON_RENAME
alter table t1 add constraint c1 foreign key (f1) references t1(f1);
--source include/restart_mysqld.inc
perl;
$file = "$ENV{'error_log'}";
open ( FILE, $file) || die "can't open file! ($file)\n";
@lines = <FILE>;
close (FILE);
$count = 0;
foreach $line (reverse @lines) {
if ($line =~ "^InnoDB:") {
++$count;
print "$line";
if ($count == 2) {
last;
}
}
}
EOF
drop table t1;

View File

@ -2,11 +2,6 @@
--source include/have_debug_sync.inc
--source include/not_embedded.inc
if (`select plugin_auth_version <= "1.1.8-24.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.1.8-24.1 or earlier
}
SET DEBUG_SYNC='reset';
# Save the initial number of concurrent sessions

View File

@ -0,0 +1,63 @@
--source include/have_innodb.inc
--source include/have_debug.inc
if (`select plugin_auth_version <= "1.1.8-26.0" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB 1.1.8-26.0 or earlier
}
create table t1 (
rowid int,
f1 int,
f2 int,
key i1 (f1, f2),
key i2 (f2)) engine=innodb;
show create table t1;
insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL);
connect (a,localhost,root,,);
connect (b,localhost,root,,);
connection a;
start transaction with consistent snapshot;
connection b;
start transaction;
update t1 set f2 = 4 where f1 = 1 and f2 is null;
-- echo (b) Number of rows updated:
select row_count();
insert into t1 values (3, 1, null);
-- echo (b) After update and insert query.
select rowid, f1, f2 from t1;
commit;
connection a;
-- echo (a) Before the update statement is executed.
select rowid, f1, f2 from t1;
SET SESSION debug_dbug="+d,bug14007649";
update t1 set f2 = 6 where f1 = 1 and f2 is null;
-- echo (a) Number of rows updated:
select row_count();
-- echo (a) After the update statement is executed.
select rowid, f1, f2 from t1;
commit;
--echo "The trx with consistent snapshot ended."
select rowid, f1, f2 from t1;
connection default;
disconnect a;
disconnect b;
drop table t1;

View File

@ -1,3 +1,5 @@
percona_sync_flush: removed from XtraDB-26.0
percona_suppress_log_warning_1592: Feature not merged into MariaDB
percona_log_slow_slave_statements: Feature not merged into MariaDB
percona_log_slow_slave_statements-and-use_global_long_query_time: Feature not merged into MariaDB

View File

@ -0,0 +1,41 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
create table tm (b int auto_increment, a int, primary key (a,b)) engine= myisam;
create table ti (b int auto_increment, a int, primary key (a,b)) engine= innodb;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
create table ti (b int auto_increment, a int, primary key (b,a)) engine= innodb;
set @@binlog_format=statement;
*** autoincrement field is not the first in PK warning must be there: ***
insert into tm set b=null, a=1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.
show warnings;
Level Code Message
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.
*** no warning when autoincrement is the first in PK
insert into ti set b=null, a=1;
show warnings;
Level Code Message
create function multi_part_pk_with_autoinc (arg int)
returns int
begin
insert into tm set b=null, a=arg;
return arg;
end//
select multi_part_pk_with_autoinc (3);
multi_part_pk_with_autoinc (3)
3
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.
*** autoincrement field is not the first in PK warning must be there: ***
show warnings;
Level Code Message
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.
set @@binlog_format=mixed;
insert into tm set b=null, a=2;
drop table tm, ti;
drop function multi_part_pk_with_autoinc;
include/rpl_end.inc

View File

@ -114,4 +114,23 @@ id c
3 3
[on master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT);
CREATE TABLE test.t1 (a INT);
INSERT INTO test.t1 VALUES(1);
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c);
SET INSERT_ID=2;
SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c);
SELECT b into @b FROM test.t5;
UPDATE test.t1 SET a=2;
SELECT a AS 'ONE' into @a FROM test.t_slave;
SELECT c AS 'NULL' into @c FROM test.t_slave;
SELECT b into @b FROM test.t_slave;
drop table test.t5;
drop table test.t1;
drop table test.t_slave;
include/rpl_end.inc

View File

@ -0,0 +1,13 @@
include/master-slave.inc
[connection master]
[connection slave]
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
SHOW BINLOG EVENTS;
[connection slave1]
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL end';
SET DEBUG_SYNC= 'RESET';
[connection slave]
SET DEBUG_SYNC= 'RESET';
include/rpl_end.inc

View File

@ -3,8 +3,8 @@ include/master-slave.inc
include/rpl_restart_server.inc [server_number=2 parameters: --report-port=9000]
include/start_slave.inc
[Slave restarted with the report-port set to some value]
include/assert.inc [The value shown for the slave's port number is 9000 which is the value set for report-port.]
include/rpl_restart_server.inc [server_number=2 parameters: --report-port=]
include/assert.inc [The value shown for the slave's port number is user specified port number which is the value set for report-port.]
include/rpl_restart_server.inc [server_number=2]
include/start_slave.inc
[Slave restarted with the report-port set to the value of slave's port number]
include/assert.inc [The default value shown for the slave's port number is the actual port number of the slave.]

View File

@ -0,0 +1,62 @@
# Test of auto-increment.
#
# BUG#11754117-45670
# Multipart primary key with the autoincrement part not first in it
# is replication unsafe.
#
source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
source include/have_innodb.inc;
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
--connection master
create table tm (b int auto_increment, a int, primary key (a,b)) engine= myisam;
--error ER_WRONG_AUTO_KEY
create table ti (b int auto_increment, a int, primary key (a,b)) engine= innodb;
create table ti (b int auto_increment, a int, primary key (b,a)) engine= innodb;
set @@binlog_format=statement;
--echo *** autoincrement field is not the first in PK warning must be there: ***
insert into tm set b=null, a=1;
show warnings;
--echo *** no warning when autoincrement is the first in PK
insert into ti set b=null, a=1;
show warnings;
delimiter //;
create function multi_part_pk_with_autoinc (arg int)
returns int
begin
insert into tm set b=null, a=arg;
return arg;
end//
delimiter ;//
select multi_part_pk_with_autoinc (3);
--echo *** autoincrement field is not the first in PK warning must be there: ***
show warnings;
set @@binlog_format=mixed;
insert into tm set b=null, a=2;
sync_slave_with_master;
if (`select count(*) <> 3 from tm`)
{
--echo Wrong result from SELECT on the slave side.
select * from tm;
--die
}
# cleanup
--connection master
drop table tm, ti;
drop function multi_part_pk_with_autoinc;
sync_slave_with_master;
--source include/rpl_end.inc

View File

@ -206,4 +206,64 @@ SELECT * FROM t3;
connection master;
echo [on master];
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--sync_slave_with_master
#
# BUG#11754117 - 45670: INTVAR_EVENTS FOR FILTERED-OUT QUERY_LOG_EVENTS ARE EXECUTED
# Int-, Rand- and User- var events accompaning a filtered out Query-log-event should
# be filtered as well.
#
connection master;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # ignored on slave
CREATE TABLE test.t1 (a INT); # accepted on slave
INSERT INTO test.t1 VALUES(1);
--sync_slave_with_master
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c);
connection master;
SET INSERT_ID=2;
SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); # to be ignored
SELECT b into @b FROM test.t5;
--let $b_master=`select @b`
UPDATE test.t1 SET a=2; # to run trigger on slave
--sync_slave_with_master
# The proof:
SELECT a AS 'ONE' into @a FROM test.t_slave;
SELECT c AS 'NULL' into @c FROM test.t_slave;
let $count= 1;
let $table= test.t_slave;
source include/wait_until_rows_count.inc;
if (`SELECT @a != 2 and @c != NULL`)
{
SELECT * FROM test.t_slave;
--die Intvar or user var from replication events unexpetedly escaped out to screw a following query applying context.
}
SELECT b into @b FROM test.t_slave;
--let $b_slave=`select @b`
if (`SELECT $b_slave = $b_master`)
{
--echo Might be pure coincidence of two randoms from master and slave table. Don not panic yet.
}
# cleanup BUG#11754117
connection master;
drop table test.t5;
drop table test.t1;
--sync_slave_with_master
drop table test.t_slave;
--source include/rpl_end.inc

View File

@ -0,0 +1,35 @@
# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
#
# The function mysql_show_binlog_events has a local stack variable
# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
# this variable goes out of scope and is destroyed before clean
# thd->current_linfo.
#
# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
# that with the fix local variable linfo is valid along all
# mysql_show_binlog_events function scope.
#
--source include/have_debug_sync.inc
--source include/master-slave.inc
--echo [connection slave]
--connection slave
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
--send SHOW BINLOG EVENTS
--connection slave1
--echo [connection slave1]
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL end';
SET DEBUG_SYNC= 'RESET';
--echo [connection slave]
--connection slave
--disable_result_log
--reap
--enable_result_log
SET DEBUG_SYNC= 'RESET';
--connection master
--source include/rpl_end.inc

View File

@ -38,21 +38,23 @@ connection master;
# 9000 is the value of the port we should get.
--let $report_port= query_get_value(SHOW SLAVE HOSTS, Port, 1)
--let assert_text= The value shown for the slave's port number is 9000 which is the value set for report-port.
--let assert_text= The value shown for the slave's port number is user specified port number which is the value set for report-port.
--let assert_cond= $report_port = "9000"
--source include/assert.inc
# Start the server with the report-port being passed with no value. So on SHOW SLAVE HOSTS
# on the master the value of slave's port should be the actual value of the slave port.
connection master;
--let $rpl_server_number= 2
--let $rpl_server_parameters= --report-port=
--let $rpl_server_parameters=
--source include/rpl_restart_server.inc
connection slave;
--source include/start_slave.inc
connection master;
sync_slave_with_master;
--echo [Slave restarted with the report-port set to the value of slave's port number]
connection master;

View File

@ -11,4 +11,5 @@
##############################################################################
innodb_trx_rseg_n_slots_debug_basic: variable innodb_trx_rseg_n_slots_debug is removed in MariaDB
innodb_flush_checkpoint_debug_basic: removed from XtraDB-26.0

View File

@ -1,11 +1,6 @@
--source include/have_innodb.inc
--source include/have_debug.inc
if (`select plugin_auth_version <= "1.1.8-24.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not supported by XtraDB 1.1.8-24.1 or earlier
}
SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug;
SELECT @start_global_value;

View File

@ -0,0 +1,51 @@
--echo #
--echo # Bug#12427262 : 60961: SHOW TABLES VERY SLOW WHEN NOT IN SYSTEM DISK CACHE.
--echo #
--source include/not_embedded.inc
--source include/have_perfschema.inc
--disable_warnings
create database show_table_lw_db;
use show_table_lw_db;
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
create table t4 (c1 int);
create table t5 (c1 int);
create table t6 (c1 int);
create table t7 (c1 int);
create table t8 (c1 int);
create table t9 (c1 int);
create table t10 (c1 int);
--enable_warnings
# Query PS to know initial read count for frm file.
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_before;
show tables;
# Query PS to know read count for frm file after above query. It should
# not be changed as FRM file will not be opened for above query.
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_after;
select @count_read_after-@count_read_before;
show full tables;
# Query PS to know read count for frm file after above query. COUNT_READ
# will be incremented by 1 as FRM file will be opened for above query.
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_after;
select @count_read_after-@count_read_before;
--disable_warnings
drop table t1;
drop database show_table_lw_db;
--enable_warnings

View File

@ -144,5 +144,33 @@ SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
DROP TABLE t1, t2;
--echo #
--echo # Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY
--echo # COUNT(*) LIMIT.
--echo #
CREATE TABLE t1 (
id BIGINT(20) ,
member_id_to INT(11) ,
r_date DATE ,
PRIMARY KEY (id,r_date),
KEY r_date_idx (r_date),
KEY t1_idx01 (member_id_to)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(107924526,518491,'2011-05-01'),
(107924527,518491,'2011-05-01'),
(107924534,518491,'2011-06-21'),
(107924535,518491,'2011-06-21'),
(107924542,1601319,'2011-06-21'),
(107924543,1601319,'2011-06-21'),
(107924544,1601319,'2011-06-21'),
(107924545,1601319,'2011-06-21');
SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
'2011-06-21' GROUP BY member_id_to ORDER BY 2 LIMIT 1;
DROP TABLE t1;
--echo End of 5.5 tests

View File

@ -0,0 +1,6 @@
#
# MDEV-316 lp:1009085 Assertion failed: warn_item, file item_cmpfunc.cc, line 3613
#
set names swe7;
select '' in ('',convert(0,time));
select case '' when '' then 1 when convert(0,time) then 2 end;

View File

@ -2413,3 +2413,30 @@ RESET MASTER;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
--echo #
--echo # Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM
--echo #
SET @old_log_output_state= @@global.log_output;
SET @old_general_log_state= @@global.general_log;
SET @old_slow_query_log_state= @@global.slow_query_log;
call mtr.add_suppression("Failed to write to mysql.general_log");
--exec $MYSQL_DUMP -uroot --all-databases > $MYSQLTEST_VARDIR/tmp/bug45740.sql
# Make log_output as table and disabling general_log and slow_log
SET @@global.log_output="TABLE";
SET @@global.general_log='OFF';
SET @@global.slow_query_log='OFF';
DROP DATABASE mysql;
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug45740.sql
SHOW CREATE TABLE mysql.general_log;
SHOW CREATE TABLE mysql.slow_log;
--remove_file $MYSQLTEST_VARDIR/tmp/bug45740.sql
SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state;
SET @@global.general_log= @old_general_log_state;
--echo #
--echo # End of 5.1 tests
--echo #

View File

@ -4461,3 +4461,4 @@ SELECT * FROM t1, t2 WHERE a=3 AND a=b;
drop table t1,t2;
--echo End of 5.3 tests