mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge from 5.1
This commit is contained in:
@ -130,12 +130,12 @@ uninstall-local:
|
||||
# mtr - a shortcut for executing mysql-test-run.pl
|
||||
mtr:
|
||||
$(RM) -f mtr
|
||||
$(LN_S) mysql-test-run.pl mtr
|
||||
$(LN_S) $(srcdir)/mysql-test-run.pl mtr
|
||||
|
||||
# mysql-test-run - a shortcut for executing mysql-test-run.pl
|
||||
mysql-test-run:
|
||||
$(RM) -f mysql-test-run
|
||||
$(LN_S) mysql-test-run.pl mysql-test-run
|
||||
$(LN_S) $(srcdir)/mysql-test-run.pl mysql-test-run
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -219,6 +219,19 @@ connect (conn2,localhost,root,,*NO-ONE*);
|
||||
-- echo ### assertion: works without stating the default database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
# We cannot disconnect right away because when inserting
|
||||
# concurrently in a MyISAM table, the server is sending an OK
|
||||
# to the client before updating the table state (where the
|
||||
# number of records is kept). See: BUG#37521 and BUG#29334.
|
||||
# So we need to wait, otherwise we would be having sporadic
|
||||
# failures as reported here: BUG#50451.
|
||||
|
||||
# 12 = 3 rows per each LOAD DATA executed x 4
|
||||
-- let $count= 12
|
||||
-- let $table= $db1.t1
|
||||
--source include/wait_until_rows_count.inc
|
||||
|
||||
-- echo ### disconnect and switch back to master connection
|
||||
-- disconnect conn2
|
||||
-- connection master
|
||||
|
4
mysql-test/include/not_binlog_format_row.inc
Normal file
4
mysql-test/include/not_binlog_format_row.inc
Normal file
@ -0,0 +1,4 @@
|
||||
if (`SELECT @@binlog_format = 'ROW'`)
|
||||
{
|
||||
skip Test cannot run with binlog_format row;
|
||||
}
|
@ -357,11 +357,14 @@ sub post_check_client_group {
|
||||
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
# Shared memory base may or may not be defined (e.g not defined in embedded)
|
||||
my $shm = $group_to_copy_from->option("shared-memory-base-name");
|
||||
if (defined $shm)
|
||||
if (! $self->{ARGS}->{embedded})
|
||||
{
|
||||
$config->insert($client_group_name,"shared-memory-base-name", $shm->value());
|
||||
# Shared memory base may or may not be defined (e.g not defined in embedded)
|
||||
my $shm = $group_to_copy_from->option("shared-memory-base-name");
|
||||
if (defined $shm)
|
||||
{
|
||||
$config->insert($client_group_name,"shared-memory-base-name", $shm->value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12728,3 +12728,12 @@ Table Op Msg_type Msg_text
|
||||
test.t1 repair Error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
|
||||
test.t1 repair error Corrupt
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#48757 - missing .ARZ file causes server crash
|
||||
#
|
||||
CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
|
||||
FLUSH TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
ERROR HY000: Can't find file: 't1' (errno: 2)
|
||||
DROP TABLE t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
|
@ -4,23 +4,23 @@ create table t4(n int);
|
||||
backup table t4 to '../../bogus';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 backup error Failed copying .frm file (errno: X)
|
||||
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
|
||||
test.t4 backup status Operation failed
|
||||
backup table t4 to '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 backup status OK
|
||||
backup table t4 to '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 backup error Failed copying .frm file (errno: X)
|
||||
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
|
||||
test.t4 backup status Operation failed
|
||||
drop table t4;
|
||||
restore table t4 from '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t4 restore status OK
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
@ -29,18 +29,18 @@ create table t1(n int);
|
||||
insert into t1 values (23),(45),(67);
|
||||
backup table t1 to '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 backup status OK
|
||||
drop table t1;
|
||||
restore table t1 from '../../bogus';
|
||||
Table Op Msg_type Msg_text
|
||||
t1 restore error Failed copying .frm file
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
Warning 1287 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
|
||||
restore table t1 from '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore status OK
|
||||
select n from t1;
|
||||
n
|
||||
@ -53,13 +53,13 @@ insert into t2 values (123),(145),(167);
|
||||
insert into t3 values (223),(245),(267);
|
||||
backup table t2,t3 to '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t2 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t2 backup status OK
|
||||
test.t3 backup status OK
|
||||
drop table t1,t2,t3;
|
||||
restore table t1,t2,t3 from '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore status OK
|
||||
test.t2 restore status OK
|
||||
test.t3 restore status OK
|
||||
@ -81,14 +81,14 @@ k
|
||||
drop table t1,t2,t3,t4;
|
||||
restore table t1 from '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore status OK
|
||||
rename table t1 to t5;
|
||||
lock tables t5 write;
|
||||
backup table t5 to '../../tmp';
|
||||
unlock tables;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t5 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t5 backup status OK
|
||||
drop table t5;
|
||||
DROP TABLE IF EXISTS `t+1`;
|
||||
@ -96,12 +96,12 @@ CREATE TABLE `t+1` (c1 INT);
|
||||
INSERT INTO `t+1` VALUES (1), (2), (3);
|
||||
BACKUP TABLE `t+1` TO '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t+1 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t+1 backup status OK
|
||||
DROP TABLE `t+1`;
|
||||
RESTORE TABLE `t+1` FROM '../../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t+1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t+1 restore status OK
|
||||
SELECT * FROM `t+1`;
|
||||
c1
|
||||
|
@ -404,3 +404,37 @@ describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
bi decimal(19,0) NO 0
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #45360: wrong results
|
||||
#
|
||||
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
a BIGINT(20) UNSIGNED,
|
||||
b VARCHAR(20));
|
||||
INSERT INTO t1 (a) VALUES
|
||||
(0),
|
||||
(CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
|
||||
(CAST(0x8000000000000000 AS UNSIGNED)),
|
||||
(CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
|
||||
UPDATE t1 SET b = a;
|
||||
# FFFFFFFFFFFFFFFF
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 18446744073709551615 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 18446744073709551615) and ('18446744073709551615' = `test`.`t1`.`b`))
|
||||
# 8000000000000000
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775808 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775808) and ('9223372036854775808' = `test`.`t1`.`b`))
|
||||
# 7FFFFFFFFFFFFFFF
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 9223372036854775807 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 9223372036854775807) and ('9223372036854775807' = `test`.`t1`.`b`))
|
||||
# 0
|
||||
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = 0 AND TRIM(a) = b;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`))
|
||||
DROP TABLE t1;
|
||||
# End of 5.1 tests
|
||||
|
32
mysql-test/r/bug39022.result
Normal file
32
mysql-test/r/bug39022.result
Normal file
@ -0,0 +1,32 @@
|
||||
#
|
||||
# Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
|
||||
#
|
||||
CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
|
||||
CREATE TABLE t2(d TINYINT NOT NULL,UNIQUE KEY(d)) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
|
||||
(11,5),(11,6),(7,7),(7,8),(4,9),(6,10),(3,11),(11,12),
|
||||
(12,13),(7,14);
|
||||
INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
|
||||
(11),(12),(13),(14);
|
||||
# in thread1
|
||||
START TRANSACTION;
|
||||
# in thread2
|
||||
REPLACE INTO t2 VALUES (-17);
|
||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
|
||||
d
|
||||
# in thread1
|
||||
REPLACE INTO t1(a,b) VALUES (67,20);
|
||||
# in thread2
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
REPLACE INTO t1(a,b) VALUES (65,-50);
|
||||
REPLACE INTO t2 VALUES (-91);
|
||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
|
||||
# in thread1
|
||||
# should not crash
|
||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
# in thread2
|
||||
d
|
||||
# in thread1;
|
||||
DROP TABLE t1,t2;
|
@ -5394,17 +5394,24 @@ select * from t1;
|
||||
ERROR HY000: File 'MYSQLD_DATADIR/test/t1.CSV' not found (Errcode: 2)
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
create table t1(a enum ('a') not null) engine=csv;
|
||||
insert into t1 values (2);
|
||||
CREATE TABLE t1 (e enum('foo','bar') NOT NULL) ENGINE = CSV;
|
||||
INSERT INTO t1 VALUES();
|
||||
INSERT INTO t1 VALUES(default);
|
||||
INSERT INTO t1 VALUES(0);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1 limit 1;
|
||||
ERROR HY000: Table 't1' is marked as crashed and should be repaired
|
||||
repair table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair Warning Data truncated for column 'a' at row 1
|
||||
test.t1 repair status OK
|
||||
select * from t1 limit 1;
|
||||
a
|
||||
drop table t1;
|
||||
Warning 1265 Data truncated for column 'e' at row 1
|
||||
INSERT INTO t1 VALUES(3);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'e' at row 1
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'e' at row 1
|
||||
SELECT * FROM t1;
|
||||
e
|
||||
foo
|
||||
foo
|
||||
|
||||
|
||||
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -180,7 +180,6 @@ insert into bug20691 values (2, 3, 5, '0007-01-01', 11, 13, 17, '0019-01-01 00:0
|
||||
insert into bug20691 values (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 4);
|
||||
Warnings:
|
||||
Warning 1364 Field 'a' doesn't have a default value
|
||||
Warning 1364 Field 'b' doesn't have a default value
|
||||
Warning 1364 Field 'c' doesn't have a default value
|
||||
Warning 1364 Field 'd' doesn't have a default value
|
||||
Warning 1364 Field 'e' doesn't have a default value
|
||||
@ -193,7 +192,7 @@ a b c d e f g h i x
|
||||
two large 00:00:05 0007-01-01 11 13 17 0019-01-01 00:00:00 23 1
|
||||
small 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 2
|
||||
two large 00:00:05 0007-01-01 11 13 17 0019-01-01 00:00:00 23 3
|
||||
00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 4
|
||||
small 00:00:00 0000-00-00 0 0000-00-00 00:00:00 0 4
|
||||
drop table bug20691;
|
||||
create table t1 (id int not null);
|
||||
insert into t1 values(default);
|
||||
|
@ -278,6 +278,18 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
|
||||
ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
#
|
||||
# Bug #49552 : sql_buffer_result cause crash + not found records
|
||||
# in multitable delete/subquery
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SET SESSION SQL_BUFFER_RESULT=1;
|
||||
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
|
||||
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
|
||||
@ -337,16 +349,4 @@ END |
|
||||
DELETE IGNORE FROM t1;
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49552 : sql_buffer_result cause crash + not found records
|
||||
# in multitable delete/subquery
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SET SESSION SQL_BUFFER_RESULT=1;
|
||||
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
|
||||
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -603,6 +603,26 @@ WHERE t3.a=t1.a AND MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE)
|
||||
count(*)
|
||||
0
|
||||
DROP TABLE t1,t2,t3;
|
||||
CREATE TABLE t1 (a VARCHAR(4), FULLTEXT(a));
|
||||
INSERT INTO t1 VALUES
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('awrd'),('cwrd'),
|
||||
('awrd');
|
||||
SELECT COUNT(*) FROM t1 WHERE MATCH(a) AGAINST("+awrd bwrd* +cwrd*" IN BOOLEAN MODE);
|
||||
COUNT(*)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
|
||||
# fulltext search and row op
|
||||
|
@ -978,4 +978,21 @@ GROUP BY t1.a
|
||||
1
|
||||
1
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
INSERT INTO t1 VALUES (),();
|
||||
EXPLAIN EXTENDED SELECT 1 FROM
|
||||
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Distinct
|
||||
2 DERIVED td ALL NULL NULL NULL NULL 2 100.00 Distinct; Using join buffer
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from (select distinct group_concat(`test`.`td`.`f1` separator ',') AS `GROUP_CONCAT(td.f1)` from `test`.`t1` join `test`.`t1` `td` group by `test`.`td`.`f1`) `d` join `test`.`t1`
|
||||
SELECT 1 FROM
|
||||
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -682,7 +682,7 @@ select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1;
|
||||
timestampadd(SQL_TSI_FRAC_SECOND, 1, date)
|
||||
2003-01-02 00:00:00.000001
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 5.6. Please use MICROSECOND instead
|
||||
Warning 1287 'FRAC_SECOND' is deprecated and will be removed in a future release. Please use MICROSECOND instead
|
||||
select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a;
|
||||
a
|
||||
3
|
||||
@ -717,7 +717,7 @@ select timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05
|
||||
a
|
||||
7689538999999
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 5.6. Please use MICROSECOND instead
|
||||
Warning 1287 'FRAC_SECOND' is deprecated and will be removed in a future release. Please use MICROSECOND instead
|
||||
select timestampdiff(SQL_TSI_DAY, '1986-02-01', '1986-03-01') as a1,
|
||||
timestampdiff(SQL_TSI_DAY, '1900-02-01', '1900-03-01') as a2,
|
||||
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
|
||||
@ -1088,7 +1088,7 @@ timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 5.6. Please use MICROSECOND instead
|
||||
Warning 1287 'FRAC_SECOND' is deprecated and will be removed in a future release. Please use MICROSECOND instead
|
||||
Note 1003 select timestampdiff(WEEK,'2001-02-01','2001-05-01') AS `a1`,timestampdiff(SECOND_FRAC,'2001-02-01 12:59:59.120000','2001-05-01 12:58:58.119999') AS `a2`
|
||||
select time_format('100:00:00', '%H %k %h %I %l');
|
||||
time_format('100:00:00', '%H %k %h %I %l')
|
||||
@ -1287,12 +1287,12 @@ SELECT TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18');
|
||||
TIMESTAMPADD(FRAC_SECOND, 1, '2008-02-18')
|
||||
2008-02-18 00:00:00.000001
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 5.6. Please use MICROSECOND instead
|
||||
Warning 1287 'FRAC_SECOND' is deprecated and will be removed in a future release. Please use MICROSECOND instead
|
||||
SELECT TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18');
|
||||
TIMESTAMPDIFF(FRAC_SECOND, '2008-02-17', '2008-02-18')
|
||||
86400000000
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'FRAC_SECOND' is deprecated and will be removed in MySQL 5.6. Please use MICROSECOND instead
|
||||
Warning 1287 'FRAC_SECOND' is deprecated and will be removed in a future release. Please use MICROSECOND instead
|
||||
SELECT DATE_ADD('2008-02-18', INTERVAL 1 FRAC_SECOND);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FRAC_SECOND)' at line 1
|
||||
SELECT DATE_SUB('2008-02-18', INTERVAL 1 FRAC_SECOND);
|
||||
|
@ -1703,3 +1703,91 @@ COUNT(i)
|
||||
1
|
||||
DROP TABLE t1;
|
||||
SET @@sql_mode = @old_sql_mode;
|
||||
#
|
||||
# Bug #45640: optimizer bug produces wrong results
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (4, 40), (1, 10), (2, 20), (2, 20), (3, 30);
|
||||
# should return 4 ordered records:
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
|
||||
aa COUNT(DISTINCT b)
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
4 1
|
||||
SELECT (SELECT (SELECT t1.a)) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
|
||||
aa COUNT(DISTINCT b)
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
4 1
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
|
||||
aa COUNT(DISTINCT b)
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
4 1
|
||||
# should return the same result in a reverse order:
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
|
||||
aa COUNT(DISTINCT b)
|
||||
4 1
|
||||
3 1
|
||||
2 1
|
||||
1 1
|
||||
# execution plan should not use temporary table:
|
||||
EXPLAIN EXTENDED
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using filesort
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select (select `test`.`t1`.`a` AS `a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by ((select `test`.`t1`.`a` AS `a`) + 0)
|
||||
EXPLAIN EXTENDED
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using filesort
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select (select `test`.`t1`.`a` AS `a`) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by -((select `test`.`t1`.`a` AS `a`))
|
||||
# should return only one record
|
||||
SELECT (SELECT tt.a FROM t1 tt LIMIT 1) aa, COUNT(DISTINCT b) FROM t1
|
||||
GROUP BY aa;
|
||||
aa COUNT(DISTINCT b)
|
||||
4 4
|
||||
CREATE TABLE t2 SELECT DISTINCT a FROM t1;
|
||||
# originally reported queries (1st two columns of next two query
|
||||
# results should be same):
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
|
||||
FROM t1 GROUP BY aa, b;
|
||||
aa b COUNT(DISTINCT b)
|
||||
1 10 1
|
||||
2 20 1
|
||||
3 30 1
|
||||
4 40 1
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
|
||||
FROM t1 GROUP BY aa, b;
|
||||
aa b COUNT( b)
|
||||
1 10 1
|
||||
2 20 2
|
||||
3 30 1
|
||||
4 40 1
|
||||
# ORDER BY for sure:
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
|
||||
FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
|
||||
aa b COUNT(DISTINCT b)
|
||||
4 40 1
|
||||
3 30 1
|
||||
2 20 1
|
||||
1 10 1
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
|
||||
FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
|
||||
aa b COUNT( b)
|
||||
4 40 1
|
||||
3 30 1
|
||||
2 20 2
|
||||
1 10 1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# End of 5.1 tests
|
||||
|
@ -2524,4 +2524,17 @@ SELECT a, MAX(b) FROM t WHERE b GROUP BY a;
|
||||
a MAX(b)
|
||||
2 1
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, KEY (b));
|
||||
INSERT INTO t1 VALUES(1,1),(2,1);
|
||||
ANALYZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
SELECT 1 AS c, b FROM t1 WHERE b IN (1,2) GROUP BY c, b;
|
||||
c b
|
||||
1 1
|
||||
SELECT a FROM t1 WHERE b=1;
|
||||
a
|
||||
1
|
||||
2
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -430,4 +430,24 @@ SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
|
||||
b COUNT(DISTINCT a)
|
||||
NULL 1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#50995 Having clause on subquery result produces incorrect results.
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id1 INT,
|
||||
id2 INT NOT NULL,
|
||||
INDEX id1(id2)
|
||||
);
|
||||
INSERT INTO t1 SET id1=1, id2=1;
|
||||
INSERT INTO t1 SET id1=2, id2=1;
|
||||
INSERT INTO t1 SET id1=3, id2=1;
|
||||
SELECT t1.id1,
|
||||
(SELECT 0 FROM DUAL
|
||||
WHERE t1.id1=t1.id1) AS amount FROM t1
|
||||
WHERE t1.id2 = 1
|
||||
HAVING amount > 0
|
||||
ORDER BY t1.id1;
|
||||
id1 amount
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1161,3 +1161,86 @@ t1 CREATE TABLE `t1` (
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
3
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
2
|
||||
3
|
||||
4
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
|
||||
INSERT INTO t1 VALUES (4), (5), (6), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
5
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-685113344
|
||||
1
|
||||
2
|
||||
3
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
|
@ -2273,4 +2273,26 @@ END|
|
||||
DROP PROCEDURE p1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug #49324: more valgrind errors in test_if_skip_sort_order
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
|
||||
#should not cause valgrind warnings
|
||||
SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#50843: Filesort used instead of clustered index led to
|
||||
# performance degradation.
|
||||
#
|
||||
create table t1(f1 int not null primary key, f2 int) engine=innodb;
|
||||
create table t2(f1 int not null, key (f1)) engine=innodb;
|
||||
insert into t1 values (1,1),(2,2),(3,3);
|
||||
insert into t2 values (1),(2),(3);
|
||||
explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 3
|
||||
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 1 Using index
|
||||
drop table t1,t2;
|
||||
#
|
||||
End of 5.1 tests
|
||||
|
@ -1128,3 +1128,31 @@ EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
|
||||
CREATE TABLE t2(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES ('1',null),(null,null);
|
||||
INSERT INTO t2 VALUES ('1',null),(null,null);
|
||||
CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
|
||||
ENGINE=MERGE UNION=(t1,t2);
|
||||
SELECT t1.a FROM mm1,t1;
|
||||
a
|
||||
NULL
|
||||
1
|
||||
NULL
|
||||
1
|
||||
NULL
|
||||
1
|
||||
NULL
|
||||
1
|
||||
DROP TABLE t1, t2, mm1;
|
||||
#
|
||||
# Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
|
||||
#
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
|
||||
INSERT INTO t1 VALUES (0,0), (1,1);
|
||||
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
|
||||
a b a b
|
||||
0 0 0 0
|
||||
1 1 1 1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -199,7 +199,7 @@ SELECT @@general_log, @@log;
|
||||
1 1
|
||||
SET GLOBAL log = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
|
||||
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
|
||||
SHOW VARIABLES LIKE 'general_log';
|
||||
Variable_name Value
|
||||
general_log OFF
|
||||
@ -230,7 +230,7 @@ SELECT @@slow_query_log, @@log_slow_queries;
|
||||
0 0
|
||||
SET GLOBAL log_slow_queries = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
|
||||
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
|
||||
SHOW VARIABLES LIKE 'slow_query_log';
|
||||
Variable_name Value
|
||||
slow_query_log OFF
|
||||
@ -283,16 +283,16 @@ SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
|
||||
deprecated:
|
||||
SET GLOBAL log = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
|
||||
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
|
||||
SET GLOBAL log_slow_queries = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
|
||||
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
|
||||
SET GLOBAL log = DEFAULT;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
|
||||
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
|
||||
SET GLOBAL log_slow_queries = DEFAULT;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '@@slow_query_log' instead
|
||||
Warning 1287 '@@log_slow_queries' is deprecated and will be removed in a future release. Please use '@@slow_query_log' instead
|
||||
not deprecated:
|
||||
SELECT @@global.general_log_file INTO @my_glf;
|
||||
SELECT @@global.slow_query_log_file INTO @my_sqlf;
|
||||
|
@ -634,4 +634,15 @@ select count(*) from t3 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
drop table t1, t2, t3;
|
||||
#
|
||||
# Bug#49534: multitable IGNORE update with sql_safe_updates error
|
||||
# causes debug assertion
|
||||
#
|
||||
CREATE TABLE t1( a INT, KEY( a ) );
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
SET SESSION sql_safe_updates = 1;
|
||||
# Must not cause failed assertion
|
||||
UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
|
||||
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
|
||||
DROP TABLE t1;
|
||||
end of tests
|
||||
|
@ -1868,6 +1868,19 @@ CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 467455460
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#48438 - crash with error in unioned query against merge table and view...
|
||||
#
|
||||
SET GLOBAL table_open_cache=3;
|
||||
CREATE TABLE t1(a INT);
|
||||
SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
|
||||
1
|
||||
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
|
||||
TABLE_ROWS DATA_LENGTH
|
||||
0 0
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL table_open_cache=DEFAULT;
|
||||
End of 5.0 tests
|
||||
create table t1 (a int not null, key `a` (a) key_block_size=1024);
|
||||
show create table t1;
|
||||
@ -2313,4 +2326,17 @@ CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#49628 - corrupt table after legal SQL, LONGTEXT column
|
||||
#
|
||||
CREATE TABLE t1(a INT, b LONGTEXT, UNIQUE(a));
|
||||
REPLACE INTO t1 VALUES
|
||||
(1, REPEAT('a', 129015)),(1, NULL),
|
||||
(2, NULL),(3, NULL),(4, NULL),(5, NULL),(6, NULL),(7, NULL),
|
||||
(1, REPEAT('b', 129016)),(1, NULL),
|
||||
(1, REPEAT('c', 129015)),(1, REPEAT('d', 129015));
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
2
mysql-test/r/no_binlog.result
Normal file
2
mysql-test/r/no_binlog.result
Normal file
@ -0,0 +1,2 @@
|
||||
SHOW BINARY LOGS;
|
||||
ERROR HY000: You are not using binary logging
|
57
mysql-test/r/partition_debug_sync.result
Normal file
57
mysql-test/r/partition_debug_sync.result
Normal file
@ -0,0 +1,57 @@
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
#
|
||||
# Bug#42438: Crash ha_partition::change_table_ptr
|
||||
# Test when remove partitioning is done while drop table is waiting
|
||||
# for the table.
|
||||
# Con 1
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
CREATE TABLE t1
|
||||
(a INTEGER,
|
||||
b INTEGER NOT NULL,
|
||||
KEY (b))
|
||||
ENGINE = MYISAM
|
||||
/*!50100 PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (2),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (100),
|
||||
PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
|
||||
SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed';
|
||||
ALTER TABLE t1 REMOVE PARTITIONING;
|
||||
# Con default
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
|
||||
SET DEBUG_SYNC= 'waiting_for_table SIGNAL waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed';
|
||||
DROP TABLE IF EXISTS t1;
|
||||
# Con 1
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
#
|
||||
# Bug#42438: Crash ha_partition::change_table_ptr
|
||||
# Test when remove partitioning is failing due to drop table is already
|
||||
# in progress.
|
||||
CREATE TABLE t2
|
||||
(a INTEGER,
|
||||
b INTEGER NOT NULL,
|
||||
KEY (b))
|
||||
ENGINE = MYISAM
|
||||
/*!50100 PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (2),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (100),
|
||||
PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
|
||||
SET DEBUG_SYNC= 'before_lock_tables_takes_lock SIGNAL removing_partitions WAIT_FOR waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
|
||||
ALTER TABLE t2 REMOVE PARTITIONING;
|
||||
# Con default
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
|
||||
SET DEBUG_SYNC= 'waiting_for_table SIGNAL waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done';
|
||||
DROP TABLE IF EXISTS t2;
|
||||
# Con 1
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
# Con default
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
End of 5.1 tests
|
@ -1295,7 +1295,7 @@ drop database mysqltest;
|
||||
show full plugin;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW PLUGINS' instead
|
||||
Warning 1287 'SHOW PLUGIN' is deprecated and will be removed in a future release. Please use 'SHOW PLUGINS' instead
|
||||
show plugin;
|
||||
show plugins;
|
||||
create database `mysqlttest\1`;
|
||||
|
@ -44,4 +44,33 @@ SELECT f2 ();
|
||||
f2 ()
|
||||
NULL
|
||||
DROP SCHEMA testdb;
|
||||
USE test;
|
||||
#
|
||||
# Bug#50423: Crash on second call of a procedure dropping a trigger
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
|
||||
CREATE PROCEDURE p1 () DROP TRIGGER tr1;
|
||||
CALL p1 ();
|
||||
CALL p1 ();
|
||||
ERROR HY000: Trigger does not exist
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
#
|
||||
# Bug#50423: Crash on second call of a procedure dropping a trigger
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
|
||||
CREATE PROCEDURE p1 () DROP TRIGGER tr1;
|
||||
CALL p1 ();
|
||||
CALL p1 ();
|
||||
ERROR HY000: Trigger does not exist
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
End of 5.1 tests
|
||||
|
@ -1643,7 +1643,7 @@ create table t1 (a int) type=MyISAM;
|
||||
drop table t1;
|
||||
end|
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 6.0. Please use 'ENGINE=storage_engine' instead
|
||||
Warning 1287 'TYPE=storage_engine' is deprecated and will be removed in a future release. Please use 'ENGINE=storage_engine' instead
|
||||
call p1();
|
||||
call p1();
|
||||
drop procedure p1;
|
||||
|
@ -4304,10 +4304,10 @@ call bug13012()|
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 backup Warning 'BACKUP TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 backup status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore Warning 'RESTORE TABLE' is deprecated and will be removed in a future release. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
test.t1 restore status OK
|
||||
drop procedure bug13012|
|
||||
create view v1 as select * from t1|
|
||||
|
@ -268,6 +268,17 @@ SELECT RELEASE_LOCK('Bug44521');
|
||||
RELEASE_LOCK('Bug44521')
|
||||
1
|
||||
DROP PROCEDURE p;
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
|
||||
CREATE VIEW v1 AS SELECT f1('a') FROM t1;
|
||||
SELECT * FROM v1;;
|
||||
SELECT * FROM v1;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
ERROR 70100: Query execution was interrupted
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
# ------------------------------------------------------------------
|
||||
# -- End of 5.1 tests
|
||||
# ------------------------------------------------------------------
|
||||
|
@ -535,7 +535,7 @@ use db_bug7787|
|
||||
CREATE PROCEDURE p1()
|
||||
SHOW INNODB STATUS; |
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW ENGINE INNODB STATUS' instead
|
||||
Warning 1287 'SHOW INNODB STATUS' is deprecated and will be removed in a future release. Please use 'SHOW ENGINE INNODB STATUS' instead
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
|
||||
DROP DATABASE db_bug7787|
|
||||
drop user user_bug7787@localhost|
|
||||
|
@ -4615,4 +4615,16 @@ FROM t1,t1 a
|
||||
);
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #45989 take 2 : memory leak after explain encounters an
|
||||
# error in the query
|
||||
#
|
||||
CREATE TABLE t1(a LONGTEXT);
|
||||
INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
|
||||
INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
|
||||
EXPLAIN EXTENDED SELECT DISTINCT 1 FROM t1,
|
||||
(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) AS d1
|
||||
WHERE t1.a = d1.a;
|
||||
ERROR 42S22: Unknown column 'd1.a' in 'where clause'
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests.
|
||||
|
@ -785,4 +785,19 @@ t1 CREATE TABLE `t1` (
|
||||
KEY `a` (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
#
|
||||
# Bug#50591 bit(31) causes Duplicate entry '1-NULL' for key 'group_key'
|
||||
#
|
||||
CREATE TABLE t1(a INT, b BIT(7) NOT NULL);
|
||||
INSERT INTO t1 VALUES (NULL, 0),(NULL, 0);
|
||||
SELECT SUM(a) FROM t1 GROUP BY b, a;
|
||||
SUM(a)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a INT, b BIT(7) NOT NULL, c BIT(8) NOT NULL);
|
||||
INSERT INTO t1 VALUES (NULL, 0, 0),(NULL, 0, 0);
|
||||
SELECT SUM(a) FROM t1 GROUP BY c, b, a;
|
||||
SUM(a)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -891,11 +891,11 @@ CREATE TABLE b15776 (a year(-2));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2))' at line 1
|
||||
CREATE TABLE b15776 (a timestamp(4294967294));
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(4294967294)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
DROP TABLE b15776;
|
||||
CREATE TABLE b15776 (a timestamp(4294967295));
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(4294967295)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
DROP TABLE b15776;
|
||||
CREATE TABLE b15776 (a timestamp(4294967296));
|
||||
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
|
||||
|
@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
|
||||
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
|
||||
t14 timestamp(14));
|
||||
Warnings:
|
||||
Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(2)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(4)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(6)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(8)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(10)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(12)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
Warning 1287 'TIMESTAMP(14)' is deprecated and will be removed in a future release. Please use 'TIMESTAMP' instead
|
||||
insert t1 values (0,0,0,0,0,0,0),
|
||||
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
|
@ -3844,6 +3844,36 @@ CREATE VIEW v1 AS SELECT a FROM t1;
|
||||
ALTER TABLE v1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#48449: hang on show create view after upgrading when
|
||||
# view contains function of view
|
||||
#
|
||||
DROP VIEW IF EXISTS v1,v2;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
CREATE FUNCTION f1() RETURNS INT
|
||||
BEGIN
|
||||
SELECT a FROM v2 INTO @a;
|
||||
RETURN @a;
|
||||
END//
|
||||
# Trigger pre-locking when opening v2.
|
||||
CREATE VIEW v1 AS SELECT f1() FROM t1;
|
||||
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 `f1`() AS `f1()` from `t1` latin1 latin1_swedish_ci
|
||||
Warnings:
|
||||
Note 1599 View `test`.`v2` has no creation context
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2;
|
||||
DROP FUNCTION f1;
|
||||
CREATE TABLE t1(f1 INT);
|
||||
INSERT INTO t1 VALUES ();
|
||||
CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE
|
||||
ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' )));
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.1 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
@ -1237,3 +1237,14 @@ SELECT a FROM v2;
|
||||
a
|
||||
DROP USER mysqluser1;
|
||||
DROP DATABASE mysqltest1;
|
||||
USE test;
|
||||
#
|
||||
# Bug#47734: Assertion failed: ! is_set() when locking a view with non-existing definer
|
||||
#
|
||||
DROP VIEW IF EXISTS v1;
|
||||
CREATE DEFINER=`unknown`@`unknown` SQL SECURITY DEFINER VIEW v1 AS SELECT 1;
|
||||
Warnings:
|
||||
Note 1449 The user specified as a definer ('unknown'@'unknown') does not exist
|
||||
LOCK TABLES v1 READ;
|
||||
ERROR HY000: The user specified as a definer ('unknown'@'unknown') does not exist
|
||||
DROP VIEW v1;
|
||||
|
@ -168,7 +168,7 @@ max_error_count 10
|
||||
drop table t1;
|
||||
set table_type=MYISAM;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 6.0. Please use '@@storage_engine' instead
|
||||
Warning 1287 '@@table_type' is deprecated and will be removed in a future release. Please use '@@storage_engine' instead
|
||||
create table t1 (a int);
|
||||
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
update t1 set a='abc';
|
||||
|
12
mysql-test/std_data/bug48449.frm
Normal file
12
mysql-test/std_data/bug48449.frm
Normal file
@ -0,0 +1,12 @@
|
||||
TYPE=VIEW
|
||||
query=select `test`.`t2`.`a` AS `a` from `test`.`t2`
|
||||
md5=5e6eaf216e7b016fcedfd4e1113517af
|
||||
updatable=1
|
||||
algorithm=0
|
||||
definer_user=root
|
||||
definer_host=localhost
|
||||
suid=2
|
||||
with_check_option=0
|
||||
timestamp=2010-01-01 15:00:00
|
||||
create-version=1
|
||||
source=select * from t2
|
91
mysql-test/suite/rpl/r/rpl_slow_query_log.result
Normal file
91
mysql-test/suite/rpl/r/rpl_slow_query_log.result
Normal file
@ -0,0 +1,91 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
include/stop_slave.inc
|
||||
SET @old_log_output= @@log_output;
|
||||
SET GLOBAL log_output= 'TABLE';
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET GLOBAL long_query_time= 2;
|
||||
TRUNCATE mysql.slow_log;
|
||||
include/start_slave.inc
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
INSERT INTO t1 values(1, 1);
|
||||
INSERT INTO t1 values(1, sleep(3));
|
||||
TRUNCATE mysql.slow_log;
|
||||
SELECT 1, sleep(3);
|
||||
1 sleep(3)
|
||||
1 0
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
||||
TRUNCATE mysql.slow_log;
|
||||
SET TIMESTAMP= 1;
|
||||
SELECT 2, sleep(3);
|
||||
2 sleep(3)
|
||||
2 0
|
||||
SELECT 2;
|
||||
2
|
||||
2
|
||||
TRUNCATE mysql.slow_log;
|
||||
SET @old_slow_query_log= @@slow_query_log;
|
||||
SET GLOBAL slow_query_log= 'OFF';
|
||||
SELECT 3, sleep(3);
|
||||
3 sleep(3)
|
||||
3 0
|
||||
SELECT 3;
|
||||
3
|
||||
3
|
||||
TRUNCATE mysql.slow_log;
|
||||
SET GLOBAL slow_query_log= @old_slow_query_log;
|
||||
DROP TABLE t1;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL long_query_time= @old_long_query_time;
|
||||
SET GLOBAL log_output= @old_log_output;
|
||||
include/start_slave.inc
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
SET @old_log_output= @@log_output;
|
||||
SET GLOBAL log_output= 'TABLE';
|
||||
SET GLOBAL long_query_time= 2;
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET SESSION long_query_time= 2;
|
||||
TRUNCATE mysql.slow_log;
|
||||
include/stop_slave.inc
|
||||
SET @old_log_output= @@log_output;
|
||||
SET GLOBAL log_output= 'TABLE';
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET GLOBAL long_query_time= 2;
|
||||
TRUNCATE mysql.slow_log;
|
||||
include/start_slave.inc
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
********************************************************************
|
||||
**** INSERT one row that exceeds long_query_time
|
||||
**** Outcome: query ends up in both master and slave slow log
|
||||
********************************************************************
|
||||
INSERT INTO t1 values(1, sleep(3));
|
||||
### Assertion is good. Both Master and Slave exhibit the
|
||||
### same number of queries in slow log: 1
|
||||
TRUNCATE mysql.slow_log;
|
||||
TRUNCATE mysql.slow_log;
|
||||
********************************************************************
|
||||
**** Now do inserts again, but first add an index to the table.
|
||||
**** Outcome: Note that the slave contains the same one entry (as
|
||||
**** the master does) whereas before the patch it did not.
|
||||
********************************************************************
|
||||
ALTER TABLE t1 ADD INDEX id1(a);
|
||||
INSERT INTO t1 values(1, sleep(3));
|
||||
### Assertion is good. Both Master and Slave exhibit the
|
||||
### same number of queries in slow log: 1
|
||||
SET @@global.log_output= @old_log_output;
|
||||
SET @@global.long_query_time= @old_long_query_time;
|
||||
DROP TABLE t1;
|
||||
SET @@global.log_output= @old_log_output;
|
||||
SET @@global.long_query_time= @old_long_query_time;
|
@ -195,7 +195,7 @@ set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators
|
||||
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
|
||||
set global log_bin_trust_routine_creators=1;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.6. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
set global log_bin_trust_function_creators=0;
|
||||
set global log_bin_trust_function_creators=1;
|
||||
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
|
||||
@ -559,11 +559,11 @@ end
|
||||
master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
|
||||
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.6. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
|
||||
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.6. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
|
||||
drop database mysqltest;
|
||||
drop database mysqltest2;
|
||||
|
@ -4,6 +4,7 @@
|
||||
# if the path of the load data file is a symbolic link.
|
||||
#
|
||||
--source include/master-slave.inc
|
||||
--source include/not_windows.inc
|
||||
--source include/have_binlog_format_statement.inc
|
||||
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
|
1
mysql-test/suite/rpl/t/rpl_slow_query_log-slave.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_slow_query_log-slave.opt
Normal file
@ -0,0 +1 @@
|
||||
--force-restart --log-slow-slave-statements --log-slow-queries
|
308
mysql-test/suite/rpl/t/rpl_slow_query_log.test
Normal file
308
mysql-test/suite/rpl/t/rpl_slow_query_log.test
Normal file
@ -0,0 +1,308 @@
|
||||
#
|
||||
# BUG#23300: Slow query log on slave does not log slow replicated statements
|
||||
#
|
||||
# Description:
|
||||
# The slave should log slow queries replicated from master when
|
||||
# --log-slow-slave-statements is used.
|
||||
#
|
||||
# Test is implemented as follows:
|
||||
# i) stop slave
|
||||
# ii) On slave, set long_query_time to a small value.
|
||||
# ii) start slave so that long_query_time variable is picked by sql thread
|
||||
# iii) On master, do one short time query and one long time query, on slave
|
||||
# and check that slow query is logged to slow query log but fast query
|
||||
# is not.
|
||||
# iv) On slave, check that slow queries go into the slow log and fast dont,
|
||||
# when issued through a regular client connection
|
||||
# v) On slave, check that slow queries go into the slow log and fast dont
|
||||
# when we use SET TIMESTAMP= 1 on a regular client connection.
|
||||
# vi) check that when setting slow_query_log= OFF in a connection 'extra2'
|
||||
# prevents logging slow queries in a connection 'extra'
|
||||
#
|
||||
# OBS:
|
||||
# This test only runs for statement binlogging format because on row format
|
||||
# slow queries do not get slow query logged.
|
||||
# Note that due to the sleep() command the insert is written to the binary
|
||||
# log in row format.
|
||||
|
||||
source include/master-slave.inc;
|
||||
source include/have_binlog_format_statement.inc;
|
||||
|
||||
CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
|
||||
|
||||
|
||||
# Prepare slave for different long_query_time we need to stop the slave
|
||||
# and restart it as long_query_time variable is dynamic and, after
|
||||
# setting it, it only takes effect on new connections.
|
||||
#
|
||||
# Reference:
|
||||
# http://dev.mysql.com/doc/refman/6.0/en/set-option.html
|
||||
connection slave;
|
||||
|
||||
source include/stop_slave.inc;
|
||||
|
||||
SET @old_log_output= @@log_output;
|
||||
SET GLOBAL log_output= 'TABLE';
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET GLOBAL long_query_time= 2;
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
|
||||
# test:
|
||||
# check that slave logs the slow query to the slow log, but not the fast one.
|
||||
|
||||
let $slow_query= INSERT INTO t1 values(1, sleep(3));
|
||||
let $fast_query= INSERT INTO t1 values(1, 1);
|
||||
|
||||
eval $fast_query;
|
||||
--disable_warnings
|
||||
eval $slow_query;
|
||||
--enable_warnings
|
||||
sync_slave_with_master;
|
||||
|
||||
let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
|
||||
let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
|
||||
if ($found_fast_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Fast query FOUND in slow query log. Bailing out!";
|
||||
}
|
||||
|
||||
if (!$found_slow_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
|
||||
}
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
# regular checks for slow query log (using a new connection - 'extra' - to slave)
|
||||
|
||||
# test:
|
||||
# when using direct connections to the slave, check that slow query is logged
|
||||
# but not the fast one.
|
||||
|
||||
connect(extra,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
||||
connection extra;
|
||||
|
||||
let $fast_query= SELECT 1;
|
||||
let $slow_query= SELECT 1, sleep(3);
|
||||
|
||||
eval $slow_query;
|
||||
eval $fast_query;
|
||||
|
||||
let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
|
||||
let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
|
||||
if ($found_fast_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Fast query FOUND in slow query log. Bailing out!";
|
||||
}
|
||||
|
||||
if (!$found_slow_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
|
||||
}
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
# test:
|
||||
# when using direct connections to the slave, check that when setting timestamp to 1 the
|
||||
# slow query is logged but the fast one is not.
|
||||
|
||||
let $fast_query= SELECT 2;
|
||||
let $slow_query= SELECT 2, sleep(3);
|
||||
|
||||
SET TIMESTAMP= 1;
|
||||
eval $slow_query;
|
||||
eval $fast_query;
|
||||
|
||||
let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
|
||||
let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
|
||||
if ($found_fast_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Fast query FOUND in slow query log. Bailing out!";
|
||||
}
|
||||
|
||||
if (!$found_slow_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
|
||||
}
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
# test:
|
||||
# check that when setting the slow_query_log= OFF on connection 'extra2'
|
||||
# prevents connection 'extra' from logging to slow query log.
|
||||
|
||||
let $fast_query= SELECT 3;
|
||||
let $slow_query= SELECT 3, sleep(3);
|
||||
|
||||
connect(extra2,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
||||
connection extra2;
|
||||
|
||||
SET @old_slow_query_log= @@slow_query_log;
|
||||
SET GLOBAL slow_query_log= 'OFF';
|
||||
|
||||
connection extra;
|
||||
|
||||
eval $slow_query;
|
||||
eval $fast_query;
|
||||
|
||||
let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`;
|
||||
let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
|
||||
if ($found_fast_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Fast query FOUND in slow query log when slow_query_log= OFF. Bailing out!";
|
||||
}
|
||||
|
||||
if ($found_slow_query)
|
||||
{
|
||||
SELECT * FROM mysql.slow_log;
|
||||
die "Assertion failed! Slow query FOUND in slow query log when slow_query_log= OFF. Bailing out!";
|
||||
}
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
# clean up: drop tables, reset the variables back to the previous value,
|
||||
# disconnect extra connections
|
||||
connection extra2;
|
||||
SET GLOBAL slow_query_log= @old_slow_query_log;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
source include/stop_slave.inc;
|
||||
|
||||
SET GLOBAL long_query_time= @old_long_query_time;
|
||||
SET GLOBAL log_output= @old_log_output;
|
||||
|
||||
source include/start_slave.inc;
|
||||
|
||||
disconnect extra;
|
||||
disconnect extra2;
|
||||
|
||||
#
|
||||
# BUG#50620: Adding an index to a table prevents slave from logging into slow log
|
||||
#
|
||||
|
||||
-- source include/master-slave-reset.inc
|
||||
|
||||
-- connection master
|
||||
SET @old_log_output= @@log_output;
|
||||
SET GLOBAL log_output= 'TABLE';
|
||||
SET GLOBAL long_query_time= 2;
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET SESSION long_query_time= 2;
|
||||
TRUNCATE mysql.slow_log;
|
||||
-- connection slave
|
||||
|
||||
-- source include/stop_slave.inc
|
||||
SET @old_log_output= @@log_output;
|
||||
SET GLOBAL log_output= 'TABLE';
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET GLOBAL long_query_time= 2;
|
||||
TRUNCATE mysql.slow_log;
|
||||
-- source include/start_slave.inc
|
||||
|
||||
let $slow_query= INSERT INTO t1 values(1, sleep(3));
|
||||
|
||||
-- connection master
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
|
||||
-- echo ********************************************************************
|
||||
-- echo **** INSERT one row that exceeds long_query_time
|
||||
-- echo **** Outcome: query ends up in both master and slave slow log
|
||||
-- echo ********************************************************************
|
||||
|
||||
-- disable_warnings
|
||||
-- eval $slow_query
|
||||
-- enable_warnings
|
||||
|
||||
let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
-- sync_slave_with_master
|
||||
let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
|
||||
if (`SELECT $master_slow_query != $slave_slow_query`)
|
||||
{
|
||||
-- connection master
|
||||
-- echo ***********************************************
|
||||
-- echo ** DUMPING MASTER SLOW LOG CONTENTS
|
||||
-- echo ***********************************************
|
||||
SELECT * FROM mysql.slow_log;
|
||||
|
||||
-- connection slave
|
||||
-- echo ***********************************************
|
||||
-- echo ** DUMPING SLAVE SLOW LOG CONTENTS
|
||||
-- echo ***********************************************
|
||||
SELECT * FROM mysql.slow_log;
|
||||
|
||||
-- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
|
||||
}
|
||||
|
||||
if (`SELECT $master_slow_query = $slave_slow_query`)
|
||||
{
|
||||
-- echo ### Assertion is good. Both Master and Slave exhibit the
|
||||
-- echo ### same number of queries in slow log: $master_slow_query
|
||||
}
|
||||
|
||||
TRUNCATE mysql.slow_log;
|
||||
-- connection master
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
-- echo ********************************************************************
|
||||
-- echo **** Now do inserts again, but first add an index to the table.
|
||||
-- echo **** Outcome: Note that the slave contains the same one entry (as
|
||||
-- echo **** the master does) whereas before the patch it did not.
|
||||
-- echo ********************************************************************
|
||||
|
||||
ALTER TABLE t1 ADD INDEX id1(a);
|
||||
|
||||
-- disable_warnings
|
||||
-- eval $slow_query
|
||||
-- enable_warnings
|
||||
|
||||
let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
-- sync_slave_with_master
|
||||
let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
|
||||
|
||||
if (`SELECT $master_slow_query != $slave_slow_query`)
|
||||
{
|
||||
-- connection master
|
||||
-- echo ***********************************************
|
||||
-- echo ** DUMPING MASTER SLOW LOG CONTENTS
|
||||
-- echo ***********************************************
|
||||
SELECT * FROM mysql.slow_log;
|
||||
|
||||
-- connection slave
|
||||
-- echo ***********************************************
|
||||
-- echo ** DUMPING SLAVE SLOW LOG CONTENTS
|
||||
-- echo ***********************************************
|
||||
SELECT * FROM mysql.slow_log;
|
||||
|
||||
-- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
|
||||
}
|
||||
|
||||
if (`SELECT $master_slow_query = $slave_slow_query`)
|
||||
{
|
||||
-- echo ### Assertion is good. Both Master and Slave exhibit the
|
||||
-- echo ### same number of queries in slow log: $master_slow_query
|
||||
}
|
||||
|
||||
-- connection master
|
||||
SET @@global.log_output= @old_log_output;
|
||||
SET @@global.long_query_time= @old_long_query_time;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- sync_slave_with_master
|
||||
SET @@global.log_output= @old_log_output;
|
||||
SET @@global.long_query_time= @old_long_query_time;
|
@ -18,4 +18,4 @@ VARIABLE_VALUE
|
||||
OFF
|
||||
SET @@global.log= @start_log;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead
|
||||
Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
|
||||
|
@ -5,17 +5,17 @@ SELECT @start_global_value;
|
||||
'#--------------------FN_DYNVARS_064_01-------------------------#'
|
||||
SET @@global.log_bin_trust_routine_creators = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SET @@global.log_bin_trust_routine_creators = DEFAULT;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
0
|
||||
'#--------------------FN_DYNVARS_064_02-------------------------#'
|
||||
SET @@global.log_bin_trust_routine_creators = DEFAULT;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators = 'FALSE';
|
||||
@@global.log_bin_trust_routine_creators = 'FALSE'
|
||||
1
|
||||
@ -24,37 +24,37 @@ Warning 1292 Truncated incorrect DOUBLE value: 'FALSE'
|
||||
'#--------------------FN_DYNVARS_064_03-------------------------#'
|
||||
SET @@global.log_bin_trust_routine_creators = ON;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
1
|
||||
SET @@global.log_bin_trust_routine_creators = OFF;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
0
|
||||
SET @@global.log_bin_trust_routine_creators = 0;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
0
|
||||
SET @@global.log_bin_trust_routine_creators = 1;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
1
|
||||
SET @@global.log_bin_trust_routine_creators = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
1
|
||||
SET @@global.log_bin_trust_routine_creators = FALSE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
0
|
||||
@ -70,7 +70,7 @@ SET @@global.log_bin_trust_routine_creators = "OFFF";
|
||||
ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'OFFF'
|
||||
SET @@global.log_bin_trust_routine_creators = OF;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
0
|
||||
@ -96,14 +96,14 @@ ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable
|
||||
'#---------------------FN_DYNVARS_064_07----------------------#'
|
||||
SET @@global.log_bin_trust_routine_creators = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators;
|
||||
@@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators
|
||||
1
|
||||
'#---------------------FN_DYNVARS_064_08----------------------#'
|
||||
SET @@global.log_bin_trust_routine_creators = TRUE;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@log_bin_trust_routine_creators;
|
||||
@@log_bin_trust_routine_creators
|
||||
1
|
||||
@ -115,7 +115,7 @@ SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators
|
||||
ERROR 42S22: Unknown column 'log_bin_trust_routine_creators' in 'field list'
|
||||
SET @@global.log_bin_trust_routine_creators = @start_global_value;
|
||||
Warnings:
|
||||
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead
|
||||
Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
|
||||
SELECT @@global.log_bin_trust_routine_creators;
|
||||
@@global.log_bin_trust_routine_creators
|
||||
1
|
||||
|
@ -20,5 +20,21 @@ sleep(2)
|
||||
SELECT count(*) > 0 FROM mysql.slow_log;
|
||||
count(*) > 0
|
||||
1
|
||||
'Bug#47905 stored procedures not logged correctly to slow query log'
|
||||
TRUNCATE mysql.slow_log;
|
||||
CREATE PROCEDURE p_test()
|
||||
BEGIN
|
||||
select sleep(2);
|
||||
select 1;
|
||||
END//
|
||||
CALL p_test();
|
||||
sleep(2)
|
||||
0
|
||||
1
|
||||
1
|
||||
SELECT count(*) > 0 FROM mysql.slow_log;
|
||||
count(*) > 0
|
||||
1
|
||||
DROP PROCEDURE p_test;
|
||||
SET @@global.log_output = @global_log_output;
|
||||
SET @global.slow_query_log = @global_slow_query_log;
|
||||
|
@ -31,6 +31,27 @@ SELECT sleep(2);
|
||||
|
||||
SELECT count(*) > 0 FROM mysql.slow_log;
|
||||
|
||||
|
||||
#==========================================================================
|
||||
--echo 'Bug#47905 stored procedures not logged correctly to slow query log'
|
||||
#==========================================================================
|
||||
# assumes logging to table turned on with long_query_time=1 as above
|
||||
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
DELIMITER //;
|
||||
CREATE PROCEDURE p_test()
|
||||
BEGIN
|
||||
select sleep(2);
|
||||
select 1;
|
||||
END//
|
||||
DELIMITER ;//
|
||||
|
||||
CALL p_test();
|
||||
SELECT count(*) > 0 FROM mysql.slow_log;
|
||||
DROP PROCEDURE p_test;
|
||||
|
||||
|
||||
#restore
|
||||
SET @@global.log_output = @global_log_output;
|
||||
SET @global.slow_query_log = @global_slow_query_log;
|
||||
|
@ -1644,3 +1644,14 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value");
|
||||
REPAIR TABLE t1;
|
||||
DROP TABLE t1;
|
||||
remove_file $MYSQLD_DATADIR/test/t1.ARM;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#48757 - missing .ARZ file causes server crash
|
||||
--echo #
|
||||
CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
|
||||
FLUSH TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.ARZ
|
||||
--error ER_FILE_NOT_FOUND
|
||||
SELECT * FROM t1;
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
DROP TABLE t1;
|
||||
|
@ -327,3 +327,38 @@ drop table t1;
|
||||
create table t1 select -9223372036854775809 bi;
|
||||
describe t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #45360: wrong results
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
a BIGINT(20) UNSIGNED,
|
||||
b VARCHAR(20));
|
||||
|
||||
INSERT INTO t1 (a) VALUES
|
||||
(0),
|
||||
(CAST(0x7FFFFFFFFFFFFFFF AS UNSIGNED)),
|
||||
(CAST(0x8000000000000000 AS UNSIGNED)),
|
||||
(CAST(0xFFFFFFFFFFFFFFFF AS UNSIGNED));
|
||||
|
||||
UPDATE t1 SET b = a;
|
||||
|
||||
let $n = `SELECT MAX(id) FROM t1`;
|
||||
while($n) {
|
||||
let $x = `SELECT a FROM t1 WHERE id = $n`;
|
||||
dec $n;
|
||||
let $hex = `SELECT HEX($x)`;
|
||||
echo # $hex;
|
||||
|
||||
--disable_result_log
|
||||
eval EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE a = $x AND TRIM(a) = b;
|
||||
--enable_result_log
|
||||
SHOW WARNINGS;
|
||||
}
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 5.1 tests
|
||||
|
||||
|
||||
|
63
mysql-test/t/bug39022.test
Normal file
63
mysql-test/t/bug39022.test
Normal file
@ -0,0 +1,63 @@
|
||||
-- source include/have_log_bin.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/not_binlog_format_row.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
|
||||
CREATE TABLE t2(d TINYINT NOT NULL,UNIQUE KEY(d)) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
|
||||
(11,5),(11,6),(7,7),(7,8),(4,9),(6,10),(3,11),(11,12),
|
||||
(12,13),(7,14);
|
||||
INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
|
||||
(11),(12),(13),(14);
|
||||
|
||||
connect (thread1, localhost, root,,);
|
||||
connect (thread2, localhost, root,,);
|
||||
|
||||
connection thread1;
|
||||
--echo # in thread1
|
||||
START TRANSACTION;
|
||||
|
||||
connection thread2;
|
||||
--echo # in thread2
|
||||
REPLACE INTO t2 VALUES (-17);
|
||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
|
||||
|
||||
connection thread1;
|
||||
--echo # in thread1
|
||||
REPLACE INTO t1(a,b) VALUES (67,20);
|
||||
|
||||
connection thread2;
|
||||
--echo # in thread2
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
REPLACE INTO t1(a,b) VALUES (65,-50);
|
||||
REPLACE INTO t2 VALUES (-91);
|
||||
send;
|
||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); #waits
|
||||
|
||||
connection thread1;
|
||||
--echo # in thread1
|
||||
|
||||
--echo # should not crash
|
||||
--error ER_LOCK_DEADLOCK
|
||||
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d); #crashes
|
||||
|
||||
connection thread2;
|
||||
--echo # in thread2
|
||||
REAP;
|
||||
|
||||
disconnect thread2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
connection thread1;
|
||||
--echo # in thread1;
|
||||
disconnect thread1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
connection default;
|
||||
|
||||
DROP TABLE t1,t2;
|
@ -1807,16 +1807,16 @@ unlock tables;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#41441 repair csv table crashes debug server
|
||||
# Bug#33717 INSERT...(default) fails for enum. Crashes CSV tables, loads spaces for MyISAM
|
||||
#
|
||||
# Note: The test should be removed after Bug#33717 is fixed
|
||||
CREATE TABLE t1 (e enum('foo','bar') NOT NULL) ENGINE = CSV;
|
||||
INSERT INTO t1 VALUES();
|
||||
INSERT INTO t1 VALUES(default);
|
||||
INSERT INTO t1 VALUES(0);
|
||||
INSERT INTO t1 VALUES(3);
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
create table t1(a enum ('a') not null) engine=csv;
|
||||
insert into t1 values (2);
|
||||
--error ER_CRASHED_ON_USAGE
|
||||
select * from t1 limit 1;
|
||||
repair table t1;
|
||||
select * from t1 limit 1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -291,6 +291,21 @@ DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49552 : sql_buffer_result cause crash + not found records
|
||||
--echo # in multitable delete/subquery
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SET SESSION SQL_BUFFER_RESULT=1;
|
||||
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
|
||||
|
||||
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
--echo #
|
||||
@ -360,18 +375,4 @@ DELETE IGNORE FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49552 : sql_buffer_result cause crash + not found records
|
||||
--echo # in multitable delete/subquery
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SET SESSION SQL_BUFFER_RESULT=1;
|
||||
DELETE t1 FROM (SELECT SUM(a) a FROM t1) x,t1;
|
||||
|
||||
SET SESSION SQL_BUFFER_RESULT=DEFAULT;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -544,6 +544,27 @@ SELECT count(*) FROM t1 WHERE
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# BUG#50351 - ft_min_word_len=2 Causes query to hang
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(4), FULLTEXT(a));
|
||||
INSERT INTO t1 VALUES
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),
|
||||
('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('cwrd'),('awrd'),('cwrd'),
|
||||
('awrd');
|
||||
SELECT COUNT(*) FROM t1 WHERE MATCH(a) AGAINST("+awrd bwrd* +cwrd*" IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
|
||||
|
@ -693,4 +693,19 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug #49487: crash with explain extended and group_concat in a derived table
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
INSERT INTO t1 VALUES (),();
|
||||
|
||||
EXPLAIN EXTENDED SELECT 1 FROM
|
||||
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
|
||||
|
||||
SELECT 1 FROM
|
||||
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1158,3 +1158,53 @@ SELECT COUNT(i) FROM t1 WHERE i > 1;
|
||||
DROP TABLE t1;
|
||||
SET @@sql_mode = @old_sql_mode;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #45640: optimizer bug produces wrong results
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (4, 40), (1, 10), (2, 20), (2, 20), (3, 30);
|
||||
|
||||
--echo # should return 4 ordered records:
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
|
||||
|
||||
SELECT (SELECT (SELECT t1.a)) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa;
|
||||
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
|
||||
|
||||
--echo # should return the same result in a reverse order:
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
|
||||
|
||||
--echo # execution plan should not use temporary table:
|
||||
EXPLAIN EXTENDED
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY aa+0;
|
||||
|
||||
EXPLAIN EXTENDED
|
||||
SELECT (SELECT t1.a) aa, COUNT(DISTINCT b) FROM t1 GROUP BY -aa;
|
||||
|
||||
--echo # should return only one record
|
||||
SELECT (SELECT tt.a FROM t1 tt LIMIT 1) aa, COUNT(DISTINCT b) FROM t1
|
||||
GROUP BY aa;
|
||||
|
||||
CREATE TABLE t2 SELECT DISTINCT a FROM t1;
|
||||
|
||||
--echo # originally reported queries (1st two columns of next two query
|
||||
--echo # results should be same):
|
||||
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
|
||||
FROM t1 GROUP BY aa, b;
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
|
||||
FROM t1 GROUP BY aa, b;
|
||||
|
||||
--echo # ORDER BY for sure:
|
||||
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(DISTINCT b)
|
||||
FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
|
||||
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
|
||||
FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
|
||||
--echo # End of 5.1 tests
|
||||
|
@ -1044,4 +1044,14 @@ SELECT a, MAX(b) FROM t WHERE b GROUP BY a;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
#
|
||||
# BUG#49902 - SELECT returns incorrect results
|
||||
#
|
||||
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, KEY (b));
|
||||
INSERT INTO t1 VALUES(1,1),(2,1);
|
||||
ANALYZE TABLE t1;
|
||||
SELECT 1 AS c, b FROM t1 WHERE b IN (1,2) GROUP BY c, b;
|
||||
SELECT a FROM t1 WHERE b=1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -442,4 +442,30 @@ INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
|
||||
SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50995 Having clause on subquery result produces incorrect results.
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
id1 INT,
|
||||
id2 INT NOT NULL,
|
||||
INDEX id1(id2)
|
||||
);
|
||||
|
||||
INSERT INTO t1 SET id1=1, id2=1;
|
||||
INSERT INTO t1 SET id1=2, id2=1;
|
||||
INSERT INTO t1 SET id1=3, id2=1;
|
||||
|
||||
SELECT t1.id1,
|
||||
(SELECT 0 FROM DUAL
|
||||
WHERE t1.id1=t1.id1) AS amount FROM t1
|
||||
WHERE t1.id2 = 1
|
||||
HAVING amount > 0
|
||||
ORDER BY t1.id1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -631,3 +631,34 @@ REPLACE INTO t1 VALUES (-1);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
##
|
||||
# 49497: Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
|
||||
INSERT INTO t1 VALUES (4), (5), (6), (NULL);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -536,4 +536,26 @@ DROP PROCEDURE p1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49324: more valgrind errors in test_if_skip_sort_order
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb ;
|
||||
--echo #should not cause valgrind warnings
|
||||
SELECT 1 FROM t1 JOIN t1 a USING(a) GROUP BY t1.a,t1.a;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50843: Filesort used instead of clustered index led to
|
||||
--echo # performance degradation.
|
||||
--echo #
|
||||
create table t1(f1 int not null primary key, f2 int) engine=innodb;
|
||||
create table t2(f1 int not null, key (f1)) engine=innodb;
|
||||
insert into t1 values (1,1),(2,2),(3,3);
|
||||
insert into t2 values (1),(2),(3);
|
||||
explain select t1.* from t1 left join t2 using(f1) group by t1.f1;
|
||||
drop table t1,t2;
|
||||
--echo #
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -804,3 +804,28 @@ DEALLOCATE PREPARE stmt;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug#45195 valgrind warnings about uninitialized values in store_record_in_cache()
|
||||
#
|
||||
CREATE TABLE t1(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
|
||||
CREATE TABLE t2(a CHAR(9),b INT,KEY(b),KEY(a)) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES ('1',null),(null,null);
|
||||
INSERT INTO t2 VALUES ('1',null),(null,null);
|
||||
CREATE TABLE mm1(a CHAR(9),b INT,KEY(b),KEY(a))
|
||||
ENGINE=MERGE UNION=(t1,t2);
|
||||
SELECT t1.a FROM mm1,t1;
|
||||
DROP TABLE t1, t2, mm1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #50335: Assertion `!(order->used & map)' in eq_ref_table
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b));
|
||||
INSERT INTO t1 VALUES (0,0), (1,1);
|
||||
|
||||
SELECT * FROM t1 STRAIGHT_JOIN t1 t2 ON t1.a=t2.a AND t1.a=t2.b ORDER BY t2.a, t1.a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -637,5 +637,17 @@ drop table t1, t2, t3;
|
||||
# Add further tests from here
|
||||
#
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49534: multitable IGNORE update with sql_safe_updates error
|
||||
--echo # causes debug assertion
|
||||
--echo #
|
||||
CREATE TABLE t1( a INT, KEY( a ) );
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
SET SESSION sql_safe_updates = 1;
|
||||
--echo # Must not cause failed assertion
|
||||
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
|
||||
UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo end of tests
|
||||
|
@ -1198,6 +1198,17 @@ CHECKSUM TABLE t1 EXTENDED;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # BUG#48438 - crash with error in unioned query against merge table and view...
|
||||
--echo #
|
||||
SET GLOBAL table_open_cache=3;
|
||||
CREATE TABLE t1(a INT);
|
||||
SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
|
||||
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL table_open_cache=DEFAULT;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
@ -1563,5 +1574,18 @@ SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # BUG#49628 - corrupt table after legal SQL, LONGTEXT column
|
||||
--echo #
|
||||
CREATE TABLE t1(a INT, b LONGTEXT, UNIQUE(a));
|
||||
REPLACE INTO t1 VALUES
|
||||
(1, REPEAT('a', 129015)),(1, NULL),
|
||||
(2, NULL),(3, NULL),(4, NULL),(5, NULL),(6, NULL),(7, NULL),
|
||||
(1, REPEAT('b', 129016)),(1, NULL),
|
||||
(1, REPEAT('c', 129015)),(1, REPEAT('d', 129015));
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
6
mysql-test/t/no_binlog.test
Normal file
6
mysql-test/t/no_binlog.test
Normal file
@ -0,0 +1,6 @@
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# BUG#50780: 'show binary logs' debug assertion when binary logging is disabled
|
||||
|
||||
-- error ER_NO_BINARY_LOGGING
|
||||
SHOW BINARY LOGS;
|
81
mysql-test/t/partition_debug_sync.test
Normal file
81
mysql-test/t/partition_debug_sync.test
Normal file
@ -0,0 +1,81 @@
|
||||
#--disable_abort_on_error
|
||||
#
|
||||
# Test for the partition storage engine which require DEBUG_SYNC feature to
|
||||
# Created by Mattias Jonsson
|
||||
#
|
||||
--source include/have_partition.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
--enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # Bug#42438: Crash ha_partition::change_table_ptr
|
||||
--echo # Test when remove partitioning is done while drop table is waiting
|
||||
--echo # for the table.
|
||||
connect(con1, localhost, root,,);
|
||||
--echo # Con 1
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
CREATE TABLE t1
|
||||
(a INTEGER,
|
||||
b INTEGER NOT NULL,
|
||||
KEY (b))
|
||||
ENGINE = MYISAM
|
||||
/*!50100 PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (2),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (100),
|
||||
PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
|
||||
SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL partitioning_removed';
|
||||
--send ALTER TABLE t1 REMOVE PARTITIONING
|
||||
connection default;
|
||||
--echo # Con default
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
|
||||
SET DEBUG_SYNC= 'waiting_for_table SIGNAL waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed';
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--echo # Con 1
|
||||
connection con1;
|
||||
--reap
|
||||
connection default;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
--echo #
|
||||
--echo # Bug#42438: Crash ha_partition::change_table_ptr
|
||||
--echo # Test when remove partitioning is failing due to drop table is already
|
||||
--echo # in progress.
|
||||
CREATE TABLE t2
|
||||
(a INTEGER,
|
||||
b INTEGER NOT NULL,
|
||||
KEY (b))
|
||||
ENGINE = MYISAM
|
||||
/*!50100 PARTITION BY RANGE (a)
|
||||
(PARTITION p0 VALUES LESS THAN (2),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (100),
|
||||
PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
|
||||
SET DEBUG_SYNC= 'before_lock_tables_takes_lock SIGNAL removing_partitions WAIT_FOR waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
|
||||
--send ALTER TABLE t2 REMOVE PARTITIONING
|
||||
connection default;
|
||||
--echo # Con default
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
|
||||
SET DEBUG_SYNC= 'waiting_for_table SIGNAL waiting_for_alter';
|
||||
SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done';
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--echo # Con 1
|
||||
connection con1;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
--reap
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
disconnect con1;
|
||||
connection default;
|
||||
--echo # Con default
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
--echo End of 5.1 tests
|
@ -57,5 +57,48 @@ SELECT f2 ();
|
||||
|
||||
DROP SCHEMA testdb;
|
||||
|
||||
USE test;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50423: Crash on second call of a procedure dropping a trigger
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
|
||||
CREATE PROCEDURE p1 () DROP TRIGGER tr1;
|
||||
|
||||
CALL p1 ();
|
||||
--error ER_TRG_DOES_NOT_EXIST
|
||||
CALL p1 ();
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50423: Crash on second call of a procedure dropping a trigger
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TRIGGER IF EXISTS tr1;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
|
||||
CREATE PROCEDURE p1 () DROP TRIGGER tr1;
|
||||
|
||||
CALL p1 ();
|
||||
--error ER_TRG_DOES_NOT_EXIST
|
||||
CALL p1 ();
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -413,6 +413,43 @@ let $wait_condition=
|
||||
--source include/wait_condition.inc
|
||||
DROP PROCEDURE p;
|
||||
|
||||
#
|
||||
# Bug#47736 killing a select from a view when the view is processing a function, asserts
|
||||
#
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
|
||||
CREATE VIEW v1 AS SELECT f1('a') FROM t1;
|
||||
|
||||
--connect (con1, localhost, root,,)
|
||||
--let $ID_1= `SELECT connection_id()`
|
||||
--send SELECT * FROM v1;
|
||||
|
||||
--connect (con2, localhost, root,,)
|
||||
--let $ID_2= `SELECT connection_id()`
|
||||
--send SELECT * FROM v1
|
||||
|
||||
--connection default
|
||||
--disable_query_log
|
||||
--eval KILL QUERY $ID_2
|
||||
--eval KILL QUERY $ID_1
|
||||
--enable_query_log
|
||||
|
||||
--connection con1
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
--reap
|
||||
--connection con2
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
--reap
|
||||
|
||||
--connection default
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
|
||||
|
||||
--echo # ------------------------------------------------------------------
|
||||
--echo # -- End of 5.1 tests
|
||||
--echo # ------------------------------------------------------------------
|
||||
|
@ -3600,4 +3600,21 @@ SELECT 1 FROM t1 WHERE a <> SOME
|
||||
);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #45989 take 2 : memory leak after explain encounters an
|
||||
--echo # error in the query
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a LONGTEXT);
|
||||
INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet));
|
||||
INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet));
|
||||
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
EXPLAIN EXTENDED SELECT DISTINCT 1 FROM t1,
|
||||
(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) AS d1
|
||||
WHERE t1.a = d1.a;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests.
|
||||
|
@ -425,4 +425,17 @@ select hex(a) from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50591 bit(31) causes Duplicate entry '1-NULL' for key 'group_key'
|
||||
--echo #
|
||||
CREATE TABLE t1(a INT, b BIT(7) NOT NULL);
|
||||
INSERT INTO t1 VALUES (NULL, 0),(NULL, 0);
|
||||
SELECT SUM(a) FROM t1 GROUP BY b, a;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(a INT, b BIT(7) NOT NULL, c BIT(8) NOT NULL);
|
||||
INSERT INTO t1 VALUES (NULL, 0, 0),(NULL, 0, 0);
|
||||
SELECT SUM(a) FROM t1 GROUP BY c, b, a;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -3869,6 +3869,52 @@ ALTER TABLE v1;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#48449: hang on show create view after upgrading when
|
||||
--echo # view contains function of view
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP VIEW IF EXISTS v1,v2;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
|
||||
delimiter //;
|
||||
CREATE FUNCTION f1() RETURNS INT
|
||||
BEGIN
|
||||
SELECT a FROM v2 INTO @a;
|
||||
RETURN @a;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
--echo # Trigger pre-locking when opening v2.
|
||||
CREATE VIEW v1 AS SELECT f1() FROM t1;
|
||||
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
copy_file std_data/bug48449.frm $MYSQLD_DATADIR/test/v2.frm;
|
||||
|
||||
SHOW CREATE VIEW v1;
|
||||
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
|
||||
#
|
||||
# Bug#48294 assertion when creating a view based on some row() construct in select query
|
||||
#
|
||||
CREATE TABLE t1(f1 INT);
|
||||
INSERT INTO t1 VALUES ();
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE
|
||||
ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' )));
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- End of 5.1 tests.
|
||||
|
@ -1532,3 +1532,17 @@ SELECT a FROM v2;
|
||||
--disconnect mysqluser1
|
||||
DROP USER mysqluser1;
|
||||
DROP DATABASE mysqltest1;
|
||||
USE test;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#47734: Assertion failed: ! is_set() when locking a view with non-existing definer
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP VIEW IF EXISTS v1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DEFINER=`unknown`@`unknown` SQL SECURITY DEFINER VIEW v1 AS SELECT 1;
|
||||
--error ER_NO_SUCH_USER
|
||||
LOCK TABLES v1 READ;
|
||||
DROP VIEW v1;
|
||||
|
Reference in New Issue
Block a user