Merge 10.1 into 10.2
This commit is contained in:
commit
620ea816ad
@ -6,11 +6,11 @@ FUNCTION(MY_CHECK_AND_SET_LINKER_FLAG flag_to_set)
|
|||||||
RETURN()
|
RETURN()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
STRING(REGEX REPLACE "[-,= +]" "_" result "HAVE_LINK_FLAG_${flag_to_set}")
|
STRING(REGEX REPLACE "[-,= +]" "_" result "HAVE_LINK_FLAG_${flag_to_set}")
|
||||||
SET(SAVE_CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_REQUIRED_LINK_OPTIONS}")
|
SET(SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
STRING(REGEX REPLACE "^-Wno-" "-W" flag_to_check ${flag_to_set})
|
STRING(REGEX REPLACE "^-Wno-" "-W" flag_to_check ${flag_to_set})
|
||||||
SET(CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS} ${flag_to_check})
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${flag_to_check})
|
||||||
CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result})
|
CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result})
|
||||||
SET(CMAKE_REQUIRED_LINK_OPTIONS "${SAVE_CMAKE_REQUIRED_LINK_OPTIONS}")
|
SET(CMAKE_REQUIRED_LIBRARIES "${SAVE_CMAKE_REQUIRED_LIBRARIES}")
|
||||||
IF (${result})
|
IF (${result})
|
||||||
FOREACH(linktype SHARED MODULE EXE)
|
FOREACH(linktype SHARED MODULE EXE)
|
||||||
IF(ARGN)
|
IF(ARGN)
|
||||||
|
@ -57,13 +57,13 @@ all would be imported into a table named
|
|||||||
patient\&.
|
patient\&.
|
||||||
.PP
|
.PP
|
||||||
.PP
|
.PP
|
||||||
\fBmysqldump\fR
|
\fBmysqlimport\fR
|
||||||
supports the following options, which can be specified on the command line or in the
|
supports the following options, which can be specified on the command line or in the
|
||||||
[mysqldump]
|
[mysqlimport]
|
||||||
and
|
and
|
||||||
[client]
|
[client]
|
||||||
option file groups\&.
|
option file groups\&.
|
||||||
\fBmysqldump\fR
|
\fBmysqlimport\fR
|
||||||
also supports the options for processing option files\&.
|
also supports the options for processing option files\&.
|
||||||
.sp
|
.sp
|
||||||
.RS 4
|
.RS 4
|
||||||
@ -267,17 +267,17 @@ Empty the table before importing the text file\&.
|
|||||||
.sp -1
|
.sp -1
|
||||||
.IP \(bu 2.3
|
.IP \(bu 2.3
|
||||||
.\}
|
.\}
|
||||||
.\" mysqldump: fields-terminated-by option
|
.\" mysqlimport: fields-terminated-by option
|
||||||
.\" fields-terminated-by option: mysqldump
|
.\" fields-terminated-by option: mysqlimport
|
||||||
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
|
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
|
||||||
.\" mysqldump: fields-enclosed-by option
|
.\" mysqlimport: fields-enclosed-by option
|
||||||
.\" fields-enclosed-by option: mysqldump
|
.\" fields-enclosed-by option: mysqlimport
|
||||||
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
|
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
|
||||||
.\" mysqldump: fields-optionally-enclosed-by option
|
.\" mysqlimport: fields-optionally-enclosed-by option
|
||||||
.\" fields-optionally-enclosed-by option: mysqldump
|
.\" fields-optionally-enclosed-by option: mysqlimport
|
||||||
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
|
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
|
||||||
.\" mysqldump: fields-escaped-by option
|
.\" mysqlimport: fields-escaped-by option
|
||||||
.\" fields-escaped-by option: mysqldump
|
.\" fields-escaped-by option: mysqlimport
|
||||||
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
|
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
|
||||||
.sp
|
.sp
|
||||||
These options have the same meaning as the corresponding clauses for
|
These options have the same meaning as the corresponding clauses for
|
||||||
@ -379,8 +379,8 @@ lines of the data file\&.
|
|||||||
.sp -1
|
.sp -1
|
||||||
.IP \(bu 2.3
|
.IP \(bu 2.3
|
||||||
.\}
|
.\}
|
||||||
.\" mysqldump: lines-terminated-by option
|
.\" mysqlimport: lines-terminated-by option
|
||||||
.\" lines-terminated-by option: mysqldump
|
.\" lines-terminated-by option: mysqlimport
|
||||||
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
|
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
|
||||||
.sp
|
.sp
|
||||||
This option has the same meaning as the corresponding clause for
|
This option has the same meaning as the corresponding clause for
|
||||||
|
50
mysql-test/include/icp_debug_kill.inc
Normal file
50
mysql-test/include/icp_debug_kill.inc
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
--source include/have_debug.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
--source include/count_sessions.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t0,t1,t2;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
create table t0(a int primary key);
|
||||||
|
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||||
|
|
||||||
|
create table t1(a int primary key);
|
||||||
|
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
|
||||||
|
|
||||||
|
create table t2 (
|
||||||
|
kp1 int,
|
||||||
|
kp2 int,
|
||||||
|
col char(100),
|
||||||
|
key(kp1, kp2)
|
||||||
|
);
|
||||||
|
insert into t2 select a, a, a from t1;
|
||||||
|
|
||||||
|
select engine from information_schema.tables
|
||||||
|
where table_schema=database() and table_name='t2';
|
||||||
|
|
||||||
|
explain
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
|
||||||
|
let $target_id= `select connection_id()`;
|
||||||
|
|
||||||
|
set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
|
||||||
|
send
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
|
||||||
|
connect (con1, localhost, root,,);
|
||||||
|
connection con1;
|
||||||
|
set debug_sync='now WAIT_FOR at_icp_check';
|
||||||
|
evalp kill query $target_id;
|
||||||
|
set debug_sync='now SIGNAL go';
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
|
||||||
|
--error ER_QUERY_INTERRUPTED
|
||||||
|
reap;
|
||||||
|
set debug_sync='RESET';
|
||||||
|
|
||||||
|
disconnect con1;
|
||||||
|
drop table t0,t1,t2;
|
||||||
|
--source include/wait_until_count_sessions.inc
|
||||||
|
|
@ -6546,7 +6546,7 @@ Options for debugging the product
|
|||||||
debug-server Use debug version of server, but without turning on
|
debug-server Use debug version of server, but without turning on
|
||||||
tracing
|
tracing
|
||||||
debugger=NAME Start mysqld in the selected debugger
|
debugger=NAME Start mysqld in the selected debugger
|
||||||
gdb Start the mysqld(s) in gdb
|
gdb[=gdb_arguments] Start the mysqld(s) in gdb
|
||||||
manual-debug Let user manually start mysqld in debugger, before
|
manual-debug Let user manually start mysqld in debugger, before
|
||||||
running test(s)
|
running test(s)
|
||||||
manual-gdb Let user manually start mysqld in gdb, before running
|
manual-gdb Let user manually start mysqld in gdb, before running
|
||||||
|
@ -861,3 +861,18 @@ Warnings:
|
|||||||
Warning 1931 Query execution was interrupted. The query examined at least 22 rows, which exceeds LIMIT ROWS EXAMINED (21). The query result may be incomplete
|
Warning 1931 Query execution was interrupted. The query examined at least 22 rows, which exceeds LIMIT ROWS EXAMINED (21). The query result may be incomplete
|
||||||
drop view v;
|
drop view v;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
#
|
||||||
|
# 10.1 Test
|
||||||
|
#
|
||||||
|
# MDEV-17729: Assertion `! is_set() || m_can_overwrite_status'
|
||||||
|
# failed in Diagnostics_area::set_error_status
|
||||||
|
#
|
||||||
|
set @old_mode= @@sql_mode;
|
||||||
|
CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT, c CHAR(20));
|
||||||
|
INSERT INTO t1 (k,c) VALUES(0,'0'), (0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0');
|
||||||
|
SET @@sql_mode='STRICT_TRANS_TABLES';
|
||||||
|
INSERT INTO t1 (c) SELECT k FROM t1 LIMIT ROWS EXAMINED 2;
|
||||||
|
Warnings:
|
||||||
|
Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete
|
||||||
|
SET @@sql_mode=@old_mode;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -380,6 +380,14 @@ slow_log
|
|||||||
slow_log_new
|
slow_log_new
|
||||||
drop table slow_log_new, general_log_new;
|
drop table slow_log_new, general_log_new;
|
||||||
use test;
|
use test;
|
||||||
|
SET GLOBAL LOG_OUTPUT = 'FILE';
|
||||||
|
SET GLOBAL slow_query_log = 1;
|
||||||
|
SET GLOBAL general_log = 1;
|
||||||
|
ALTER TABLE mysql.slow_log ADD COLUMN comment_text TEXT NOT NULL;
|
||||||
|
ALTER TABLE mysql.general_log ADD COLUMN comment_text TEXT NOT NULL;
|
||||||
|
SET GLOBAL LOG_OUTPUT = 'NONE';
|
||||||
|
ALTER TABLE mysql.slow_log DROP COLUMN comment_text;
|
||||||
|
ALTER TABLE mysql.general_log DROP COLUMN comment_text;
|
||||||
SET GLOBAL LOG_OUTPUT = 'TABLE';
|
SET GLOBAL LOG_OUTPUT = 'TABLE';
|
||||||
SET GLOBAL general_log = 0;
|
SET GLOBAL general_log = 0;
|
||||||
FLUSH LOGS;
|
FLUSH LOGS;
|
||||||
|
@ -2796,5 +2796,16 @@ id
|
|||||||
16
|
16
|
||||||
drop table t1;
|
drop table t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-5628: Assertion `! is_set()' or `!is_set() ||
|
||||||
|
# (m_status == DA_OK_BULK && is_bulk_op())' fails on UPDATE on a
|
||||||
|
# partitioned table with subquery (MySQL:71630)
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT) PARTITION BY HASH(a) PARTITIONS 2;
|
||||||
|
CREATE TABLE t2 (b INT);
|
||||||
|
INSERT INTO t2 VALUES (1),(2);
|
||||||
|
UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6;
|
||||||
|
ERROR 21000: Subquery returns more than 1 row
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
#
|
||||||
# End of 10.1 tests
|
# End of 10.1 tests
|
||||||
#
|
#
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
set @@global.binlog_checksum = CRC32;
|
||||||
|
call mtr.add_suppression("Replication event checksum verification failed");
|
||||||
|
call mtr.add_suppression("Error in Log_event::read_log_event");
|
||||||
|
set @@global.debug_dbug = VALUE;
|
||||||
|
set @@global.master_verify_checksum = DO_CHECKSUM;
|
||||||
|
set @@global.binlog_checksum = BINLOG_CHECKSUM;
|
||||||
|
# EOF the test
|
37
mysql-test/suite/binlog/t/binlog_recover_checksum_error.test
Normal file
37
mysql-test/suite/binlog/t/binlog_recover_checksum_error.test
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# The test verifies server binlog-based recovery.
|
||||||
|
#
|
||||||
|
# MDEV-23832 checksum error at server binlog recovery should not crash
|
||||||
|
|
||||||
|
# The test logic really requires --log-bin.
|
||||||
|
--source include/have_binlog_format_mixed.inc
|
||||||
|
--source include/have_debug.inc
|
||||||
|
|
||||||
|
--let $do_checksum = `SELECT @@global.master_verify_checksum`
|
||||||
|
--let $debug_dbug_saved = `SELECT @@global.debug_dbug`
|
||||||
|
--let $binlog_checksum = `SELECT @@global.binlog_checksum`
|
||||||
|
set @@global.binlog_checksum = CRC32;
|
||||||
|
|
||||||
|
call mtr.add_suppression("Replication event checksum verification failed");
|
||||||
|
call mtr.add_suppression("Error in Log_event::read_log_event");
|
||||||
|
|
||||||
|
# Proof of no crash follows.
|
||||||
|
# There's no need for actual bin-loggable queries to the server
|
||||||
|
--let $restart_parameters= --master_verify_checksum=ON --debug_dbug="+d,corrupt_read_log_event_char"
|
||||||
|
--let $shutdown_timeout=0
|
||||||
|
--source include/restart_mysqld.inc
|
||||||
|
--let $restart_parameters=
|
||||||
|
--let $shutdown_timeout=
|
||||||
|
|
||||||
|
#
|
||||||
|
# Cleanup
|
||||||
|
|
||||||
|
--replace_regex /= .*/= VALUE/
|
||||||
|
--eval set @@global.debug_dbug = "$debug_dbug_saved"
|
||||||
|
|
||||||
|
--replace_result $do_checksum DO_CHECKSUM
|
||||||
|
--eval set @@global.master_verify_checksum = $do_checksum
|
||||||
|
--replace_result $binlog_checksum BINLOG_CHECKSUM
|
||||||
|
--eval set @@global.binlog_checksum = $binlog_checksum
|
||||||
|
#
|
||||||
|
--echo # EOF the test
|
||||||
|
#
|
@ -420,6 +420,41 @@ connection default;
|
|||||||
XA END 'xid';
|
XA END 'xid';
|
||||||
XA ROLLBACK 'xid';
|
XA ROLLBACK 'xid';
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY,
|
||||||
|
f1 VARCHAR(10), f2 VARCHAR(10),
|
||||||
|
f3 VARCHAR(10), f4 VARCHAR(10),
|
||||||
|
f5 VARCHAR(10), f6 VARCHAR(10),
|
||||||
|
f7 VARCHAR(10), f8 VARCHAR(10),
|
||||||
|
INDEX(f1), INDEX(f2), INDEX(f3), INDEX(f4),
|
||||||
|
INDEX(f5), INDEX(f6), INDEX(f7), INDEX(f8)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(2, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(3, 'innodb', 'innodb', 'innodb', 'innodb',
|
||||||
|
'innodb', 'innodb', 'innodb', 'innodb');
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t1 (f2) ON DELETE SET NULL;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f1='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk f1 f2 f3 f4 f5 f6 f7 f8
|
||||||
|
2 NULL mariadb mariadb mariadb mariadb mariadb mariadb mariadb
|
||||||
|
3 innodb innodb innodb innodb innodb innodb innodb innodb
|
||||||
|
ROLLBACK;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f4) ON DELETE CASCADE;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f3='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk f1 f2 f3 f4 f5 f6 f7 f8
|
||||||
|
3 innodb innodb innodb innodb innodb innodb innodb innodb
|
||||||
|
ROLLBACK;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f5) REFERENCES t1 (f6) ON UPDATE SET NULL;
|
||||||
|
UPDATE t1 SET f6='update';
|
||||||
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_3` FOREIGN KEY (`f5`) REFERENCES `t1` (`f6`) ON UPDATE SET NULL)
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f7) REFERENCES t1 (f8) ON UPDATE CASCADE;
|
||||||
|
UPDATE t1 SET f6='cascade';
|
||||||
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_3` FOREIGN KEY (`f5`) REFERENCES `t1` (`f6`) ON UPDATE SET NULL)
|
||||||
|
DROP TABLE t1;
|
||||||
# Start of 10.2 tests
|
# Start of 10.2 tests
|
||||||
#
|
#
|
||||||
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
|
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
|
||||||
|
@ -47,3 +47,5 @@ innodb_stats_drop_locked
|
|||||||
innodb_stats_drop_locked
|
innodb_stats_drop_locked
|
||||||
innodb_stats_drop_locked
|
innodb_stats_drop_locked
|
||||||
innodb_stats_drop_locked
|
innodb_stats_drop_locked
|
||||||
|
DELETE FROM mysql.innodb_index_stats WHERE database_name='test' AND table_name='innodb_stats_drop_locked';
|
||||||
|
DELETE FROM mysql.innodb_table_stats WHERE database_name='test' AND table_name='innodb_stats_drop_locked';
|
||||||
|
@ -421,6 +421,41 @@ ALTER TABLE t1 ADD FOREIGN KEY f (a) REFERENCES t1 (pk), LOCK=EXCLUSIVE;# Cleanu
|
|||||||
XA END 'xid';
|
XA END 'xid';
|
||||||
XA ROLLBACK 'xid';
|
XA ROLLBACK 'xid';
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY,
|
||||||
|
f1 VARCHAR(10), f2 VARCHAR(10),
|
||||||
|
f3 VARCHAR(10), f4 VARCHAR(10),
|
||||||
|
f5 VARCHAR(10), f6 VARCHAR(10),
|
||||||
|
f7 VARCHAR(10), f8 VARCHAR(10),
|
||||||
|
INDEX(f1), INDEX(f2), INDEX(f3), INDEX(f4),
|
||||||
|
INDEX(f5), INDEX(f6), INDEX(f7), INDEX(f8)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(2, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(3, 'innodb', 'innodb', 'innodb', 'innodb',
|
||||||
|
'innodb', 'innodb', 'innodb', 'innodb');
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t1 (f2) ON DELETE SET NULL;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f1='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ROLLBACK;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f4) ON DELETE CASCADE;
|
||||||
|
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f3='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ROLLBACK;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f5) REFERENCES t1 (f6) ON UPDATE SET NULL;
|
||||||
|
--error ER_ROW_IS_REFERENCED_2
|
||||||
|
UPDATE t1 SET f6='update';
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f7) REFERENCES t1 (f8) ON UPDATE CASCADE;
|
||||||
|
--error ER_ROW_IS_REFERENCED_2
|
||||||
|
UPDATE t1 SET f6='cascade';
|
||||||
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
# End of 10.1 tests
|
# End of 10.1 tests
|
||||||
#
|
#
|
||||||
|
@ -56,6 +56,8 @@ WHERE table_name='innodb_stats_drop_locked';
|
|||||||
SELECT table_name FROM mysql.innodb_index_stats
|
SELECT table_name FROM mysql.innodb_index_stats
|
||||||
WHERE table_name='innodb_stats_drop_locked';
|
WHERE table_name='innodb_stats_drop_locked';
|
||||||
|
|
||||||
|
DELETE FROM mysql.innodb_index_stats WHERE database_name='test' AND table_name='innodb_stats_drop_locked';
|
||||||
|
DELETE FROM mysql.innodb_table_stats WHERE database_name='test' AND table_name='innodb_stats_drop_locked';
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
call mtr.add_suppression("Unable to delete statistics for table test.innodb_stats_drop_locked: Lock wait timeout. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name");
|
call mtr.add_suppression("Unable to delete statistics for table test.innodb_stats_drop_locked: Lock wait timeout. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name");
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
@ -132,6 +132,27 @@ id title body
|
|||||||
3 Optimizing MySQL In this tutorial we will show ...
|
3 Optimizing MySQL In this tutorial we will show ...
|
||||||
4 1001 MySQL Tricks 1. Never run mysqld as root. 2. ...
|
4 1001 MySQL Tricks 1. Never run mysqld as root. 2. ...
|
||||||
5 MySQL vs. YourSQL In the following database comparison ...
|
5 MySQL vs. YourSQL In the following database comparison ...
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('(((((((((((((((((((((((((((((((((Security)))))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
ERROR HY000: Table handler out of memory
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('((((((((((((((((((((((((((((((((Security))))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
id title body
|
||||||
|
6 MySQL Security When configured properly, MySQL ...
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('(((((((((((((((((((((((((((((((vs))))))))))))))))))))))))))))))),(((to)))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
id title body
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('((((((((((((((((((((((((((((((((Security)))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
ERROR 42000: syntax error, unexpected $end
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('(((((((((((((((((((((((((((((((((Security))))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
ERROR 42000: syntax error, unexpected $end
|
||||||
SELECT * FROM articles WHERE MATCH (title,body)
|
SELECT * FROM articles WHERE MATCH (title,body)
|
||||||
AGAINST ('+ MySQL + (>Well < stands)' IN BOOLEAN MODE);
|
AGAINST ('+ MySQL + (>Well < stands)' IN BOOLEAN MODE);
|
||||||
id title body
|
id title body
|
||||||
|
@ -919,4 +919,46 @@ DROP TABLE t1;
|
|||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
DROP TABLE t4;
|
DROP TABLE t4;
|
||||||
|
#
|
||||||
|
# InnoDB: Failing assertion: result != FTS_INVALID in
|
||||||
|
# fts_trx_row_get_new_state
|
||||||
|
#
|
||||||
|
SET FOREIGN_KEY_CHECKS=1;
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY,
|
||||||
|
f1 VARCHAR(10), f2 VARCHAR(10),
|
||||||
|
f3 VARCHAR(10), f4 VARCHAR(10),
|
||||||
|
f5 VARCHAR(10), f6 VARCHAR(10),
|
||||||
|
f7 VARCHAR(10), f8 VARCHAR(10),
|
||||||
|
FULLTEXT(f1), FULLTEXT(f2), FULLTEXT(f3), FULLTEXT(f4),
|
||||||
|
FULLTEXT(f5), FULLTEXT(f6), FULLTEXT(f7), FULLTEXT(f8),
|
||||||
|
INDEX(f1), INDEX(f2), INDEX(f3), INDEX(f4),
|
||||||
|
INDEX(f5), INDEX(f6), INDEX(f7), INDEX(f8)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(2, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(3, 'innodb', 'innodb', 'innodb', 'innodb',
|
||||||
|
'innodb', 'innodb', 'innodb', 'innodb');
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t1 (f2) ON DELETE SET NULL;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f1='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk f1 f2 f3 f4 f5 f6 f7 f8
|
||||||
|
2 NULL mariadb mariadb mariadb mariadb mariadb mariadb mariadb
|
||||||
|
3 innodb innodb innodb innodb innodb innodb innodb innodb
|
||||||
|
ROLLBACK;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f4) ON DELETE CASCADE;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f3='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk f1 f2 f3 f4 f5 f6 f7 f8
|
||||||
|
3 innodb innodb innodb innodb innodb innodb innodb innodb
|
||||||
|
ROLLBACK;
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f5) REFERENCES t1 (f6) ON UPDATE SET NULL;
|
||||||
|
UPDATE t1 SET f6='update';
|
||||||
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_3` FOREIGN KEY (`f5`) REFERENCES `t1` (`f6`) ON UPDATE SET NULL)
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f7) REFERENCES t1 (f8) ON UPDATE CASCADE;
|
||||||
|
UPDATE t1 SET f6='cascade';
|
||||||
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_3` FOREIGN KEY (`f5`) REFERENCES `t1` (`f6`) ON UPDATE SET NULL)
|
||||||
|
DROP TABLE t1;
|
||||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||||
|
@ -107,6 +107,26 @@ SELECT * FROM articles WHERE MATCH (title,body)
|
|||||||
SELECT * FROM articles WHERE MATCH (title,body)
|
SELECT * FROM articles WHERE MATCH (title,body)
|
||||||
AGAINST ('+ MySQL - (Well stands)' IN BOOLEAN MODE);
|
AGAINST ('+ MySQL - (Well stands)' IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
--error 128
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('(((((((((((((((((((((((((((((((((Security)))))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('((((((((((((((((((((((((((((((((Security))))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('(((((((((((((((((((((((((((((((vs))))))))))))))))))))))))))))))),(((to)))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
|
||||||
|
--error ER_PARSE_ERROR
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('((((((((((((((((((((((((((((((((Security)))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
--error ER_PARSE_ERROR
|
||||||
|
SELECT * FROM articles WHERE MATCH (title,body) AGAINST
|
||||||
|
('(((((((((((((((((((((((((((((((((Security))))))))))))))))))))))))))))))))'
|
||||||
|
IN BOOLEAN MODE);
|
||||||
|
|
||||||
# Test sub-expression boolean search. Find rows contain
|
# Test sub-expression boolean search. Find rows contain
|
||||||
# "MySQL" and "Well" or "MySQL" and "stands". But rank the
|
# "MySQL" and "Well" or "MySQL" and "stands". But rank the
|
||||||
# doc with "Well" higher, and doc with "stands" lower.
|
# doc with "Well" higher, and doc with "stands" lower.
|
||||||
|
@ -889,4 +889,46 @@ DROP TABLE t2;
|
|||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
DROP TABLE t4;
|
DROP TABLE t4;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # InnoDB: Failing assertion: result != FTS_INVALID in
|
||||||
|
--echo # fts_trx_row_get_new_state
|
||||||
|
--echo #
|
||||||
|
SET FOREIGN_KEY_CHECKS=1;
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY,
|
||||||
|
f1 VARCHAR(10), f2 VARCHAR(10),
|
||||||
|
f3 VARCHAR(10), f4 VARCHAR(10),
|
||||||
|
f5 VARCHAR(10), f6 VARCHAR(10),
|
||||||
|
f7 VARCHAR(10), f8 VARCHAR(10),
|
||||||
|
FULLTEXT(f1), FULLTEXT(f2), FULLTEXT(f3), FULLTEXT(f4),
|
||||||
|
FULLTEXT(f5), FULLTEXT(f6), FULLTEXT(f7), FULLTEXT(f8),
|
||||||
|
INDEX(f1), INDEX(f2), INDEX(f3), INDEX(f4),
|
||||||
|
INDEX(f5), INDEX(f6), INDEX(f7), INDEX(f8)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (1, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(2, 'mariadb', 'mariadb', 'mariadb', 'mariadb',
|
||||||
|
'mariadb', 'mariadb', 'mariadb', 'mariadb'),
|
||||||
|
(3, 'innodb', 'innodb', 'innodb', 'innodb',
|
||||||
|
'innodb', 'innodb', 'innodb', 'innodb');
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t1 (f2) ON DELETE SET NULL;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f1='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ROLLBACK;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f4) ON DELETE CASCADE;
|
||||||
|
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM t1 where f3='mariadb';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ROLLBACK;
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f5) REFERENCES t1 (f6) ON UPDATE SET NULL;
|
||||||
|
--error ER_ROW_IS_REFERENCED_2
|
||||||
|
UPDATE t1 SET f6='update';
|
||||||
|
|
||||||
|
ALTER TABLE t1 ADD FOREIGN KEY (f7) REFERENCES t1 (f8) ON UPDATE CASCADE;
|
||||||
|
--error ER_ROW_IS_REFERENCED_2
|
||||||
|
UPDATE t1 SET f6='cascade';
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||||
|
@ -3,20 +3,66 @@ include/master-slave.inc
|
|||||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||||
call mtr.add_suppression("table or database name 'mysqltest-1'");
|
call mtr.add_suppression("table or database name 'mysqltest-1'");
|
||||||
connection master;
|
connection master;
|
||||||
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
|
CREATE DATABASE `mysqltest-1`;
|
||||||
CREATE DATABASE `#mysql50#mysqltest-1`;
|
|
||||||
connection slave;
|
connection slave;
|
||||||
connection master;
|
connection master;
|
||||||
connection slave;
|
connection slave;
|
||||||
connection master;
|
connection master;
|
||||||
Master position is not changed
|
Master position is not changed
|
||||||
connection slave;
|
connection slave;
|
||||||
STOP SLAVE SQL_THREAD;
|
SET @old_general_log_state = @@global.general_log;
|
||||||
include/wait_for_slave_sql_to_stop.inc
|
SET @old_slow_log_state = @@global.slow_query_log;
|
||||||
|
SET @old_log_output = @@global.log_output;
|
||||||
|
SET GLOBAL general_log = 'ON';
|
||||||
|
SET GLOBAL slow_query_log = 'ON';
|
||||||
|
SET GLOBAL log_output = 'FILE';
|
||||||
|
connection master;
|
||||||
|
ALTER TABLE mysql.slow_log DROP COLUMN thread_id, DROP COLUMN rows_affected;
|
||||||
|
DROP DATABASE `mysqltest-1`;
|
||||||
|
connection slave;
|
||||||
|
connection slave;
|
||||||
|
SHOW CREATE TABLE mysql.slow_log;
|
||||||
|
Table Create Table
|
||||||
|
slow_log CREATE TABLE `slow_log` (
|
||||||
|
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||||
|
`user_host` mediumtext NOT NULL,
|
||||||
|
`query_time` time(6) NOT NULL,
|
||||||
|
`lock_time` time(6) NOT NULL,
|
||||||
|
`rows_sent` int(11) NOT NULL,
|
||||||
|
`rows_examined` int(11) NOT NULL,
|
||||||
|
`db` varchar(512) NOT NULL,
|
||||||
|
`last_insert_id` int(11) NOT NULL,
|
||||||
|
`insert_id` int(11) NOT NULL,
|
||||||
|
`server_id` int(10) unsigned NOT NULL,
|
||||||
|
`sql_text` mediumtext NOT NULL
|
||||||
|
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
|
||||||
connection master;
|
connection master;
|
||||||
connection master;
|
connection master;
|
||||||
Master position has been changed
|
Master position has been changed
|
||||||
DROP DATABASE `mysqltest-1`;
|
|
||||||
connection slave;
|
connection slave;
|
||||||
DROP DATABASE `#mysql50#mysqltest-1`;
|
connection slave;
|
||||||
|
SHOW CREATE TABLE mysql.slow_log;
|
||||||
|
Table Create Table
|
||||||
|
slow_log CREATE TABLE `slow_log` (
|
||||||
|
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
|
||||||
|
`user_host` mediumtext NOT NULL,
|
||||||
|
`query_time` time(6) NOT NULL,
|
||||||
|
`lock_time` time(6) NOT NULL,
|
||||||
|
`rows_sent` int(11) NOT NULL,
|
||||||
|
`rows_examined` int(11) NOT NULL,
|
||||||
|
`db` varchar(512) NOT NULL,
|
||||||
|
`last_insert_id` int(11) NOT NULL,
|
||||||
|
`insert_id` int(11) NOT NULL,
|
||||||
|
`server_id` int(10) unsigned NOT NULL,
|
||||||
|
`sql_text` mediumtext NOT NULL,
|
||||||
|
`thread_id` bigint(21) unsigned NOT NULL,
|
||||||
|
`rows_affected` int(11) NOT NULL
|
||||||
|
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
|
||||||
|
SET GLOBAL general_log = 'OFF';
|
||||||
|
SET GLOBAL slow_query_log = 'OFF';
|
||||||
|
truncate mysql.slow_log;
|
||||||
|
truncate mysql.general_log;
|
||||||
|
SET GLOBAL general_log = @old_general_log_state;
|
||||||
|
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||||
|
SET GLOBAL log_output = @old_log_output;
|
||||||
include/rpl_end.inc
|
include/rpl_end.inc
|
||||||
|
@ -14,8 +14,7 @@ call mtr.add_suppression("table or database name 'mysqltest-1'");
|
|||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
|
CREATE DATABASE `mysqltest-1`;
|
||||||
CREATE DATABASE `#mysql50#mysqltest-1`;
|
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
|
||||||
@ -34,13 +33,25 @@ if ($before_position == $after_position)
|
|||||||
echo Master position is not changed;
|
echo Master position is not changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Some log events of the mysql_upgrade's will cause errors on slave.
|
# Some log events of the mysql_upgrade previously caused errors on slave,
|
||||||
|
# however with MDEV-4851 this should be ok, so we test it:
|
||||||
connection slave;
|
connection slave;
|
||||||
STOP SLAVE SQL_THREAD;
|
SET @old_general_log_state = @@global.general_log;
|
||||||
source include/wait_for_slave_sql_to_stop.inc;
|
SET @old_slow_log_state = @@global.slow_query_log;
|
||||||
|
SET @old_log_output = @@global.log_output;
|
||||||
|
SET GLOBAL general_log = 'ON';
|
||||||
|
SET GLOBAL slow_query_log = 'ON';
|
||||||
|
SET GLOBAL log_output = 'FILE';
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
|
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
|
||||||
|
ALTER TABLE mysql.slow_log DROP COLUMN thread_id, DROP COLUMN rows_affected;
|
||||||
|
DROP DATABASE `mysqltest-1`;
|
||||||
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
connection slave;
|
||||||
|
SHOW CREATE TABLE mysql.slow_log;
|
||||||
|
connection master;
|
||||||
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
|
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
|
||||||
|
|
||||||
let $datadir= `select @@datadir`;
|
let $datadir= `select @@datadir`;
|
||||||
@ -55,8 +66,15 @@ if ($before_position != $after_position)
|
|||||||
echo Master position has been changed;
|
echo Master position has been changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
DROP DATABASE `mysqltest-1`;
|
sync_slave_with_master;
|
||||||
connection slave;
|
connection slave;
|
||||||
DROP DATABASE `#mysql50#mysqltest-1`;
|
SHOW CREATE TABLE mysql.slow_log;
|
||||||
--let $rpl_only_running_threads= 1
|
SET GLOBAL general_log = 'OFF';
|
||||||
|
SET GLOBAL slow_query_log = 'OFF';
|
||||||
|
truncate mysql.slow_log;
|
||||||
|
truncate mysql.general_log;
|
||||||
|
SET GLOBAL general_log = @old_general_log_state;
|
||||||
|
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||||
|
SET GLOBAL log_output = @old_log_output;
|
||||||
|
|
||||||
--source include/rpl_end.inc
|
--source include/rpl_end.inc
|
||||||
|
@ -1214,7 +1214,7 @@
|
|||||||
COMMAND_LINE_ARGUMENT OPTIONAL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME INNODB_VERSION
|
VARIABLE_NAME INNODB_VERSION
|
||||||
SESSION_VALUE NULL
|
SESSION_VALUE NULL
|
||||||
-GLOBAL_VALUE 5.6.49
|
-GLOBAL_VALUE 5.6.50
|
||||||
+GLOBAL_VALUE 5.6.49-89.0
|
+GLOBAL_VALUE 5.6.49-89.0
|
||||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||||
DEFAULT_VALUE NULL
|
DEFAULT_VALUE NULL
|
||||||
|
@ -684,7 +684,7 @@
|
|||||||
COMMAND_LINE_ARGUMENT OPTIONAL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME INNODB_VERSION
|
VARIABLE_NAME INNODB_VERSION
|
||||||
SESSION_VALUE NULL
|
SESSION_VALUE NULL
|
||||||
-GLOBAL_VALUE 5.6.49
|
-GLOBAL_VALUE 5.6.50
|
||||||
+GLOBAL_VALUE 5.6.49-89.0
|
+GLOBAL_VALUE 5.6.49-89.0
|
||||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||||
DEFAULT_VALUE NULL
|
DEFAULT_VALUE NULL
|
||||||
|
34
mysql-test/t/aria_icp_debug.result
Normal file
34
mysql-test/t/aria_icp_debug.result
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
set default_storage_engine=aria;
|
||||||
|
drop table if exists t0,t1,t2;
|
||||||
|
create table t0(a int primary key);
|
||||||
|
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||||
|
create table t1(a int primary key);
|
||||||
|
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
|
||||||
|
create table t2 (
|
||||||
|
kp1 int,
|
||||||
|
kp2 int,
|
||||||
|
col char(100),
|
||||||
|
key(kp1, kp2)
|
||||||
|
);
|
||||||
|
insert into t2 select a, a, a from t1;
|
||||||
|
select engine from information_schema.tables
|
||||||
|
where table_schema=database() and table_name='t2';
|
||||||
|
engine
|
||||||
|
Aria
|
||||||
|
explain
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t2 range kp1 kp1 5 NULL 10 Using index condition
|
||||||
|
set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
connect con1, localhost, root,,;
|
||||||
|
connection con1;
|
||||||
|
set debug_sync='now WAIT_FOR at_icp_check';
|
||||||
|
kill query $target_id;
|
||||||
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
|
set debug_sync='RESET';
|
||||||
|
disconnect con1;
|
||||||
|
drop table t0,t1,t2;
|
||||||
|
set default_storage_engine=default;
|
5
mysql-test/t/aria_icp_debug.test
Normal file
5
mysql-test/t/aria_icp_debug.test
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
set default_storage_engine=aria;
|
||||||
|
--source include/icp_debug_kill.inc
|
||||||
|
set default_storage_engine=default;
|
||||||
|
|
34
mysql-test/t/innodb_icp_debug.result
Normal file
34
mysql-test/t/innodb_icp_debug.result
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
set default_storage_engine=innodb;
|
||||||
|
drop table if exists t0,t1,t2;
|
||||||
|
create table t0(a int primary key);
|
||||||
|
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||||
|
create table t1(a int primary key);
|
||||||
|
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
|
||||||
|
create table t2 (
|
||||||
|
kp1 int,
|
||||||
|
kp2 int,
|
||||||
|
col char(100),
|
||||||
|
key(kp1, kp2)
|
||||||
|
);
|
||||||
|
insert into t2 select a, a, a from t1;
|
||||||
|
select engine from information_schema.tables
|
||||||
|
where table_schema=database() and table_name='t2';
|
||||||
|
engine
|
||||||
|
InnoDB
|
||||||
|
explain
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t2 range kp1 kp1 5 NULL 11 Using index condition
|
||||||
|
set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
connect con1, localhost, root,,;
|
||||||
|
connection con1;
|
||||||
|
set debug_sync='now WAIT_FOR at_icp_check';
|
||||||
|
kill query $target_id;
|
||||||
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
|
set debug_sync='RESET';
|
||||||
|
disconnect con1;
|
||||||
|
drop table t0,t1,t2;
|
||||||
|
set default_storage_engine=default;
|
6
mysql-test/t/innodb_icp_debug.test
Normal file
6
mysql-test/t/innodb_icp_debug.test
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
set default_storage_engine=innodb;
|
||||||
|
--source include/icp_debug_kill.inc
|
||||||
|
set default_storage_engine=default;
|
||||||
|
|
@ -577,3 +577,20 @@ EXECUTE ps;
|
|||||||
|
|
||||||
drop view v;
|
drop view v;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # 10.1 Test
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-17729: Assertion `! is_set() || m_can_overwrite_status'
|
||||||
|
--echo # failed in Diagnostics_area::set_error_status
|
||||||
|
--echo #
|
||||||
|
set @old_mode= @@sql_mode;
|
||||||
|
|
||||||
|
CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT, c CHAR(20));
|
||||||
|
INSERT INTO t1 (k,c) VALUES(0,'0'), (0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0');
|
||||||
|
|
||||||
|
SET @@sql_mode='STRICT_TRANS_TABLES';
|
||||||
|
INSERT INTO t1 (c) SELECT k FROM t1 LIMIT ROWS EXAMINED 2;
|
||||||
|
|
||||||
|
SET @@sql_mode=@old_mode;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -54,7 +54,7 @@ select * from general_log where argument like '%general_log%';
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Check some basic queries interfering with the log tables.
|
# Check some basic queries interfering with the log tables.
|
||||||
# In our test we'll use a tbale with verbose comments to the short
|
# In our test we'll use a table with verbose comments to the short
|
||||||
# command type names, used in the tables
|
# command type names, used in the tables
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -474,6 +474,24 @@ show tables like "%log%";
|
|||||||
drop table slow_log_new, general_log_new;
|
drop table slow_log_new, general_log_new;
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#69953 / MDEV-4851
|
||||||
|
# Log tables should be modifable on LOG_OUTPUT != TABLE
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
SET GLOBAL LOG_OUTPUT = 'FILE';
|
||||||
|
SET GLOBAL slow_query_log = 1;
|
||||||
|
SET GLOBAL general_log = 1;
|
||||||
|
|
||||||
|
ALTER TABLE mysql.slow_log ADD COLUMN comment_text TEXT NOT NULL;
|
||||||
|
ALTER TABLE mysql.general_log ADD COLUMN comment_text TEXT NOT NULL;
|
||||||
|
|
||||||
|
SET GLOBAL LOG_OUTPUT = 'NONE';
|
||||||
|
ALTER TABLE mysql.slow_log DROP COLUMN comment_text;
|
||||||
|
ALTER TABLE mysql.general_log DROP COLUMN comment_text;
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#27857 (Log tables supplies the wrong value for generating
|
# Bug#27857 (Log tables supplies the wrong value for generating
|
||||||
# AUTO_INCREMENT numbers)
|
# AUTO_INCREMENT numbers)
|
||||||
|
32
mysql-test/t/myisam_icp_debug.result
Normal file
32
mysql-test/t/myisam_icp_debug.result
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
drop table if exists t0,t1,t2;
|
||||||
|
create table t0(a int primary key);
|
||||||
|
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||||
|
create table t1(a int primary key);
|
||||||
|
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
|
||||||
|
create table t2 (
|
||||||
|
kp1 int,
|
||||||
|
kp2 int,
|
||||||
|
col char(100),
|
||||||
|
key(kp1, kp2)
|
||||||
|
);
|
||||||
|
insert into t2 select a, a, a from t1;
|
||||||
|
select engine from information_schema.tables
|
||||||
|
where table_schema=database() and table_name='t2';
|
||||||
|
engine
|
||||||
|
MyISAM
|
||||||
|
explain
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t2 range kp1 kp1 5 NULL 11 Using index condition
|
||||||
|
set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go';
|
||||||
|
select * from t2 where kp1 between 10 and 20 and kp2 +1 >100;
|
||||||
|
connect con1, localhost, root,,;
|
||||||
|
connection con1;
|
||||||
|
set debug_sync='now WAIT_FOR at_icp_check';
|
||||||
|
kill query $target_id;
|
||||||
|
set debug_sync='now SIGNAL go';
|
||||||
|
connection default;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
|
set debug_sync='RESET';
|
||||||
|
disconnect con1;
|
||||||
|
drop table t0,t1,t2;
|
1
mysql-test/t/myisam_icp_debug.test
Normal file
1
mysql-test/t/myisam_icp_debug.test
Normal file
@ -0,0 +1 @@
|
|||||||
|
--source include/icp_debug_kill.inc
|
@ -2998,6 +2998,22 @@ insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, '
|
|||||||
select id from t1 where data = 'ab' order by id;
|
select id from t1 where data = 'ab' order by id;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-5628: Assertion `! is_set()' or `!is_set() ||
|
||||||
|
--echo # (m_status == DA_OK_BULK && is_bulk_op())' fails on UPDATE on a
|
||||||
|
--echo # partitioned table with subquery (MySQL:71630)
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT) PARTITION BY HASH(a) PARTITIONS 2;
|
||||||
|
|
||||||
|
CREATE TABLE t2 (b INT);
|
||||||
|
INSERT INTO t2 VALUES (1),(2);
|
||||||
|
|
||||||
|
--error ER_SUBQUERY_NO_1_ROW
|
||||||
|
UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6;
|
||||||
|
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.1 tests
|
--echo # End of 10.1 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env perl -i
|
#!/usr/bin/perl -i
|
||||||
#
|
#
|
||||||
# This script converts all numbers that look like addresses or memory sizes,
|
# This script converts all numbers that look like addresses or memory sizes,
|
||||||
# in a debug files generated by --debug (like mysqld --debug-dbug), to #.
|
# in a debug files generated by --debug (like mysqld --debug-dbug), to #.
|
||||||
|
@ -5608,6 +5608,7 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg)
|
|||||||
THD *thd= h->table->in_use;
|
THD *thd= h->table->in_use;
|
||||||
enum icp_result res;
|
enum icp_result res;
|
||||||
|
|
||||||
|
DEBUG_SYNC(thd, "handler_index_cond_check");
|
||||||
enum thd_kill_levels abort_at= h->has_transactions() ?
|
enum thd_kill_levels abort_at= h->has_transactions() ?
|
||||||
THD_ABORT_SOFTLY : THD_ABORT_ASAP;
|
THD_ABORT_SOFTLY : THD_ABORT_ASAP;
|
||||||
if (thd_kill_level(thd) > abort_at)
|
if (thd_kill_level(thd) > abort_at)
|
||||||
|
@ -543,9 +543,11 @@ bool LOGGER::is_log_table_enabled(uint log_table_type)
|
|||||||
{
|
{
|
||||||
switch (log_table_type) {
|
switch (log_table_type) {
|
||||||
case QUERY_LOG_SLOW:
|
case QUERY_LOG_SLOW:
|
||||||
return (table_log_handler != NULL) && global_system_variables.sql_log_slow;
|
return (table_log_handler != NULL) && global_system_variables.sql_log_slow
|
||||||
|
&& (log_output_options & LOG_TABLE);
|
||||||
case QUERY_LOG_GENERAL:
|
case QUERY_LOG_GENERAL:
|
||||||
return (table_log_handler != NULL) && opt_log ;
|
return (table_log_handler != NULL) && opt_log
|
||||||
|
&& (log_output_options & LOG_TABLE);
|
||||||
default:
|
default:
|
||||||
DBUG_ASSERT(0);
|
DBUG_ASSERT(0);
|
||||||
return FALSE; /* make compiler happy */
|
return FALSE; /* make compiler happy */
|
||||||
|
@ -2037,7 +2037,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
|
|||||||
else
|
else
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
#else
|
#else
|
||||||
*error= ER(ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE);
|
*error= ER_THD_OR_DEFAULT(current_thd, ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE);
|
||||||
sql_print_error("%s", *error);
|
sql_print_error("%s", *error);
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -383,11 +383,14 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
|
|||||||
If LIMIT ROWS EXAMINED interrupted query execution, issue a warning,
|
If LIMIT ROWS EXAMINED interrupted query execution, issue a warning,
|
||||||
continue with normal processing and produce an incomplete query result.
|
continue with normal processing and produce an incomplete query result.
|
||||||
*/
|
*/
|
||||||
|
bool saved_abort_on_warning= thd->abort_on_warning;
|
||||||
|
thd->abort_on_warning= false;
|
||||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT,
|
ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT,
|
||||||
ER_THD(thd, ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT),
|
ER_THD(thd, ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT),
|
||||||
thd->accessed_rows_and_keys,
|
thd->accessed_rows_and_keys,
|
||||||
thd->lex->limit_rows_examined->val_uint());
|
thd->lex->limit_rows_examined->val_uint());
|
||||||
|
thd->abort_on_warning= saved_abort_on_warning;
|
||||||
thd->reset_killed();
|
thd->reset_killed();
|
||||||
}
|
}
|
||||||
/* Disable LIMIT ROWS EXAMINED after query execution. */
|
/* Disable LIMIT ROWS EXAMINED after query execution. */
|
||||||
|
@ -417,6 +417,8 @@ int mysql_update(THD *thd,
|
|||||||
query_plan.set_no_partitions();
|
query_plan.set_no_partitions();
|
||||||
if (thd->lex->describe || thd->lex->analyze_stmt)
|
if (thd->lex->describe || thd->lex->analyze_stmt)
|
||||||
goto produce_explain_and_leave;
|
goto produce_explain_and_leave;
|
||||||
|
if (thd->is_error())
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
my_ok(thd); // No matching records
|
my_ok(thd); // No matching records
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
@ -96,6 +96,28 @@ operator<<(
|
|||||||
return(s << ut_get_name(NULL, table_name.m_name));
|
return(s << ut_get_name(NULL, table_name.m_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return whether a table belongs to a system database */
|
||||||
|
static bool dict_mem_table_is_system(char *name)
|
||||||
|
{
|
||||||
|
/* table has the following format: database/table
|
||||||
|
and some system table are of the form SYS_* */
|
||||||
|
if (strchr(name, '/')) {
|
||||||
|
size_t table_len = strlen(name);
|
||||||
|
const char *system_db;
|
||||||
|
int i = 0;
|
||||||
|
while ((system_db = innobase_system_databases[i++])
|
||||||
|
&& (system_db != NullS)) {
|
||||||
|
size_t len = strlen(system_db);
|
||||||
|
if (table_len > len && !strncmp(name, system_db, len)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************//**
|
/**********************************************************************//**
|
||||||
Creates a table memory object.
|
Creates a table memory object.
|
||||||
@return own: table object */
|
@return own: table object */
|
||||||
@ -1195,31 +1217,20 @@ operator<< (std::ostream& out, const dict_foreign_set& fk_set)
|
|||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************//**
|
/** Check whether fulltext index gets affected by foreign
|
||||||
Determines if a table belongs to a system database
|
key constraint. */
|
||||||
@return */
|
bool dict_foreign_t::affects_fulltext() const
|
||||||
bool
|
|
||||||
dict_mem_table_is_system(
|
|
||||||
/*================*/
|
|
||||||
char *name) /*!< in: table name */
|
|
||||||
{
|
{
|
||||||
ut_ad(name);
|
if (foreign_table == referenced_table || !foreign_table->fts)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* table has the following format: database/table
|
for (ulint i= 0; i < n_fields; i++)
|
||||||
and some system table are of the form SYS_* */
|
{
|
||||||
if (strchr(name, '/')) {
|
const dict_col_t *col= dict_index_get_nth_col(foreign_index, i);
|
||||||
size_t table_len = strlen(name);
|
if (dict_table_is_fts_column(foreign_table->fts->indexes, col->ind,
|
||||||
const char *system_db;
|
col->is_virtual()) != ULINT_UNDEFINED)
|
||||||
int i = 0;
|
return true;
|
||||||
while ((system_db = innobase_system_databases[i++])
|
}
|
||||||
&& (system_db != NullS)) {
|
|
||||||
size_t len = strlen(system_db);
|
return false;
|
||||||
if (table_len > len && !strncmp(name, system_db, len)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2007, 2020, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2017, 2020, MariaDB Corporation.
|
Copyright (c) 2017, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
@ -144,6 +144,8 @@ struct fts_query_t {
|
|||||||
ib_rbt_t* wildcard_words; /*!< words with wildcard */
|
ib_rbt_t* wildcard_words; /*!< words with wildcard */
|
||||||
|
|
||||||
bool multi_exist; /*!< multiple FTS_EXIST oper */
|
bool multi_exist; /*!< multiple FTS_EXIST oper */
|
||||||
|
byte visiting_sub_exp; /*!< count of nested
|
||||||
|
fts_ast_visit_sub_exp() */
|
||||||
|
|
||||||
st_mysql_ftparser* parser; /*!< fts plugin parser */
|
st_mysql_ftparser* parser; /*!< fts plugin parser */
|
||||||
};
|
};
|
||||||
@ -2963,6 +2965,8 @@ fts_query_get_token(
|
|||||||
return(new_ptr);
|
return(new_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static dberr_t fts_ast_visit_sub_exp(fts_ast_node_t*, fts_ast_callback, void*);
|
||||||
|
|
||||||
/*****************************************************************//**
|
/*****************************************************************//**
|
||||||
Visit every node of the AST. */
|
Visit every node of the AST. */
|
||||||
static
|
static
|
||||||
@ -3087,6 +3091,14 @@ fts_ast_visit_sub_exp(
|
|||||||
|
|
||||||
ut_a(node->type == FTS_AST_SUBEXP_LIST);
|
ut_a(node->type == FTS_AST_SUBEXP_LIST);
|
||||||
|
|
||||||
|
/* To avoid stack overflow, we limit the mutual recursion
|
||||||
|
depth between fts_ast_visit(), fts_query_visitor() and
|
||||||
|
fts_ast_visit_sub_exp(). */
|
||||||
|
if (query->visiting_sub_exp++ > 31) {
|
||||||
|
query->error = DB_OUT_OF_MEMORY;
|
||||||
|
DBUG_RETURN(query->error);
|
||||||
|
}
|
||||||
|
|
||||||
cur_oper = query->oper;
|
cur_oper = query->oper;
|
||||||
|
|
||||||
/* Save current result set */
|
/* Save current result set */
|
||||||
@ -3109,6 +3121,7 @@ fts_ast_visit_sub_exp(
|
|||||||
/* Reinstate parent node state */
|
/* Reinstate parent node state */
|
||||||
query->multi_exist = multi_exist;
|
query->multi_exist = multi_exist;
|
||||||
query->oper = cur_oper;
|
query->oper = cur_oper;
|
||||||
|
query->visiting_sub_exp--;
|
||||||
|
|
||||||
/* Merge the sub-expression result with the parent result set. */
|
/* Merge the sub-expression result with the parent result set. */
|
||||||
subexpr_doc_ids = query->doc_ids;
|
subexpr_doc_ids = query->doc_ids;
|
||||||
|
@ -314,14 +314,6 @@ dict_mem_table_create(
|
|||||||
ulint n_v_cols, /*!< in: number of virtual columns */
|
ulint n_v_cols, /*!< in: number of virtual columns */
|
||||||
ulint flags, /*!< in: table flags */
|
ulint flags, /*!< in: table flags */
|
||||||
ulint flags2); /*!< in: table flags2 */
|
ulint flags2); /*!< in: table flags2 */
|
||||||
/**********************************************************************//**
|
|
||||||
Determines if a table belongs to a system database
|
|
||||||
@return */
|
|
||||||
UNIV_INTERN
|
|
||||||
bool
|
|
||||||
dict_mem_table_is_system(
|
|
||||||
/*==================*/
|
|
||||||
char *name); /*!< in: table name */
|
|
||||||
/****************************************************************//**
|
/****************************************************************//**
|
||||||
Free a table memory object. */
|
Free a table memory object. */
|
||||||
void
|
void
|
||||||
@ -1214,6 +1206,10 @@ struct dict_foreign_t{
|
|||||||
|
|
||||||
dict_vcol_set* v_cols; /*!< set of virtual columns affected
|
dict_vcol_set* v_cols; /*!< set of virtual columns affected
|
||||||
by foreign key constraint. */
|
by foreign key constraint. */
|
||||||
|
|
||||||
|
/** Check whether the fulltext index gets affected by
|
||||||
|
foreign key constraint */
|
||||||
|
bool affects_fulltext() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2016, 2018, MariaDB Corporation.
|
Copyright (c) 2016, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
|
@ -496,7 +496,7 @@ row_ins_cascade_calc_update_vec(
|
|||||||
|
|
||||||
n_fields_updated = 0;
|
n_fields_updated = 0;
|
||||||
|
|
||||||
bool affects_fulltext = false;
|
bool affects_fulltext = foreign->affects_fulltext();
|
||||||
|
|
||||||
if (table->fts) {
|
if (table->fts) {
|
||||||
doc_id_pos = dict_table_get_nth_col_pos(
|
doc_id_pos = dict_table_get_nth_col_pos(
|
||||||
@ -617,17 +617,6 @@ row_ins_cascade_calc_update_vec(
|
|||||||
padded_data, min_size);
|
padded_data, min_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether the current column has
|
|
||||||
FTS index on it */
|
|
||||||
if (table->fts
|
|
||||||
&& dict_table_is_fts_column(
|
|
||||||
table->fts->indexes,
|
|
||||||
dict_col_get_no(col),
|
|
||||||
dict_col_is_virtual(col))
|
|
||||||
!= ULINT_UNDEFINED) {
|
|
||||||
affects_fulltext = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If Doc ID is updated, check whether the
|
/* If Doc ID is updated, check whether the
|
||||||
Doc ID is valid */
|
Doc ID is valid */
|
||||||
if (table->fts
|
if (table->fts
|
||||||
@ -1257,8 +1246,6 @@ row_ins_foreign_check_on_constraint(
|
|||||||
update->n_fields * sizeof *update->fields);
|
update->n_fields * sizeof *update->fields);
|
||||||
#endif /* HAVE_valgrind_or_MSAN */
|
#endif /* HAVE_valgrind_or_MSAN */
|
||||||
|
|
||||||
bool affects_fulltext = false;
|
|
||||||
|
|
||||||
for (ulint i = 0; i < foreign->n_fields; i++) {
|
for (ulint i = 0; i < foreign->n_fields; i++) {
|
||||||
upd_field_t* ufield = &update->fields[i];
|
upd_field_t* ufield = &update->fields[i];
|
||||||
ulint col_no = dict_index_get_nth_col_no(
|
ulint col_no = dict_index_get_nth_col_no(
|
||||||
@ -1274,19 +1261,9 @@ row_ins_foreign_check_on_constraint(
|
|||||||
ufield->orig_len = 0;
|
ufield->orig_len = 0;
|
||||||
ufield->exp = NULL;
|
ufield->exp = NULL;
|
||||||
dfield_set_null(&ufield->new_val);
|
dfield_set_null(&ufield->new_val);
|
||||||
|
|
||||||
if (!affects_fulltext
|
|
||||||
&& table->fts && dict_table_is_fts_column(
|
|
||||||
table->fts->indexes,
|
|
||||||
dict_index_get_nth_col_no(index, i),
|
|
||||||
dict_col_is_virtual(
|
|
||||||
dict_index_get_nth_col(index, i)))
|
|
||||||
!= ULINT_UNDEFINED) {
|
|
||||||
affects_fulltext = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (affects_fulltext) {
|
if (foreign->affects_fulltext()) {
|
||||||
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1300,25 +1277,9 @@ row_ins_foreign_check_on_constraint(
|
|||||||
goto nonstandard_exit_func;
|
goto nonstandard_exit_func;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (table->fts && cascade->is_delete) {
|
} else if (table->fts && cascade->is_delete
|
||||||
/* DICT_FOREIGN_ON_DELETE_CASCADE case */
|
&& foreign->affects_fulltext()) {
|
||||||
bool affects_fulltext = false;
|
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
||||||
|
|
||||||
for (ulint i = 0; i < foreign->n_fields; i++) {
|
|
||||||
if (dict_table_is_fts_column(
|
|
||||||
table->fts->indexes,
|
|
||||||
dict_index_get_nth_col_no(index, i),
|
|
||||||
dict_col_is_virtual(
|
|
||||||
dict_index_get_nth_col(index, i)))
|
|
||||||
!= ULINT_UNDEFINED) {
|
|
||||||
affects_fulltext = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (affects_fulltext) {
|
|
||||||
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!node->is_delete
|
if (!node->is_delete
|
||||||
|
@ -4024,7 +4024,7 @@ row_sel_try_search_shortcut_for_mysql(
|
|||||||
|
|
||||||
/*********************************************************************//**
|
/*********************************************************************//**
|
||||||
Check a pushed-down index condition.
|
Check a pushed-down index condition.
|
||||||
@return ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE */
|
@return ICP_ABORTED_BY_USER, ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE */
|
||||||
static
|
static
|
||||||
ICP_RESULT
|
ICP_RESULT
|
||||||
row_search_idx_cond_check(
|
row_search_idx_cond_check(
|
||||||
@ -4551,10 +4551,13 @@ row_search_mvcc(
|
|||||||
switch (row_search_idx_cond_check(
|
switch (row_search_idx_cond_check(
|
||||||
buf, prebuilt,
|
buf, prebuilt,
|
||||||
rec, offsets)) {
|
rec, offsets)) {
|
||||||
|
case ICP_ABORTED_BY_USER:
|
||||||
|
mtr_commit(&mtr);
|
||||||
|
err = DB_INTERRUPTED;
|
||||||
|
goto unlock_and_exit;
|
||||||
|
case ICP_ERROR:
|
||||||
case ICP_NO_MATCH:
|
case ICP_NO_MATCH:
|
||||||
case ICP_OUT_OF_RANGE:
|
case ICP_OUT_OF_RANGE:
|
||||||
case ICP_ABORTED_BY_USER:
|
|
||||||
case ICP_ERROR:
|
|
||||||
goto shortcut_mismatch;
|
goto shortcut_mismatch;
|
||||||
case ICP_MATCH:
|
case ICP_MATCH:
|
||||||
goto shortcut_match;
|
goto shortcut_match;
|
||||||
@ -4582,14 +4585,11 @@ row_search_mvcc(
|
|||||||
|
|
||||||
shortcut_match:
|
shortcut_match:
|
||||||
mtr.commit();
|
mtr.commit();
|
||||||
|
err = DB_SUCCESS;
|
||||||
|
unlock_and_exit:
|
||||||
/* NOTE that we do NOT store the cursor
|
/* NOTE that we do NOT store the cursor
|
||||||
position */
|
position */
|
||||||
|
|
||||||
err = DB_SUCCESS;
|
|
||||||
|
|
||||||
rw_lock_s_unlock(latch);
|
rw_lock_s_unlock(latch);
|
||||||
|
|
||||||
goto func_exit;
|
goto func_exit;
|
||||||
|
|
||||||
case SEL_EXHAUSTED:
|
case SEL_EXHAUSTED:
|
||||||
@ -4597,13 +4597,7 @@ row_search_mvcc(
|
|||||||
mtr.commit();
|
mtr.commit();
|
||||||
|
|
||||||
err = DB_RECORD_NOT_FOUND;
|
err = DB_RECORD_NOT_FOUND;
|
||||||
|
goto unlock_and_exit;
|
||||||
rw_lock_s_unlock(latch);
|
|
||||||
|
|
||||||
/* NOTE that we do NOT store the cursor
|
|
||||||
position */
|
|
||||||
|
|
||||||
goto func_exit;
|
|
||||||
|
|
||||||
case SEL_RETRY:
|
case SEL_RETRY:
|
||||||
break;
|
break;
|
||||||
@ -5336,8 +5330,10 @@ no_gap_lock:
|
|||||||
buf, prebuilt, rec, offsets)) {
|
buf, prebuilt, rec, offsets)) {
|
||||||
case ICP_NO_MATCH:
|
case ICP_NO_MATCH:
|
||||||
goto next_rec;
|
goto next_rec;
|
||||||
case ICP_OUT_OF_RANGE:
|
|
||||||
case ICP_ABORTED_BY_USER:
|
case ICP_ABORTED_BY_USER:
|
||||||
|
err = DB_INTERRUPTED;
|
||||||
|
goto idx_cond_failed;
|
||||||
|
case ICP_OUT_OF_RANGE:
|
||||||
case ICP_ERROR:
|
case ICP_ERROR:
|
||||||
err = DB_RECORD_NOT_FOUND;
|
err = DB_RECORD_NOT_FOUND;
|
||||||
goto idx_cond_failed;
|
goto idx_cond_failed;
|
||||||
@ -5396,9 +5392,11 @@ locks_ok_del_marked:
|
|||||||
row_unlock_for_mysql(prebuilt, TRUE);
|
row_unlock_for_mysql(prebuilt, TRUE);
|
||||||
}
|
}
|
||||||
goto next_rec;
|
goto next_rec;
|
||||||
|
case ICP_ABORTED_BY_USER:
|
||||||
|
err = DB_INTERRUPTED;
|
||||||
|
goto idx_cond_failed;
|
||||||
case ICP_OUT_OF_RANGE:
|
case ICP_OUT_OF_RANGE:
|
||||||
case ICP_ABORTED_BY_USER:
|
case ICP_ERROR:
|
||||||
case ICP_ERROR:
|
|
||||||
err = DB_RECORD_NOT_FOUND;
|
err = DB_RECORD_NOT_FOUND;
|
||||||
goto idx_cond_failed;
|
goto idx_cond_failed;
|
||||||
case ICP_MATCH:
|
case ICP_MATCH:
|
||||||
|
@ -853,3 +853,22 @@ operator<< (std::ostream& out, const dict_foreign_set& fk_set)
|
|||||||
return(out);
|
return(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Check whether fulltext index gets affected by foreign
|
||||||
|
key constraint. */
|
||||||
|
bool dict_foreign_t::affects_fulltext() const
|
||||||
|
{
|
||||||
|
if (foreign_table == referenced_table || !foreign_table->fts)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (ulint i = 0; i < n_fields; i++)
|
||||||
|
{
|
||||||
|
if (dict_table_is_fts_column(
|
||||||
|
foreign_table->fts->indexes,
|
||||||
|
dict_index_get_nth_col_no(foreign_index, i))
|
||||||
|
!= ULINT_UNDEFINED)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2007, 2020, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2017, 2019, MariaDB Corporation.
|
Copyright (c) 2017, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@ -146,6 +146,8 @@ struct fts_query_t {
|
|||||||
fts_word_freq_t */
|
fts_word_freq_t */
|
||||||
|
|
||||||
bool multi_exist; /*!< multiple FTS_EXIST oper */
|
bool multi_exist; /*!< multiple FTS_EXIST oper */
|
||||||
|
byte visiting_sub_exp; /*!< count of nested
|
||||||
|
fts_ast_visit_sub_exp() */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** For phrase matching, first we collect the documents and the positions
|
/** For phrase matching, first we collect the documents and the positions
|
||||||
@ -2856,6 +2858,8 @@ fts_query_get_token(
|
|||||||
return(new_ptr);
|
return(new_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static dberr_t fts_ast_visit_sub_exp(fts_ast_node_t*, fts_ast_callback, void*);
|
||||||
|
|
||||||
/*****************************************************************//**
|
/*****************************************************************//**
|
||||||
Visit every node of the AST. */
|
Visit every node of the AST. */
|
||||||
static
|
static
|
||||||
@ -2945,7 +2949,7 @@ Process (nested) sub-expression, create a new result set to store the
|
|||||||
sub-expression result by processing nodes under current sub-expression
|
sub-expression result by processing nodes under current sub-expression
|
||||||
list. Merge the sub-expression result with that of parent expression list.
|
list. Merge the sub-expression result with that of parent expression list.
|
||||||
@return DB_SUCCESS if all well */
|
@return DB_SUCCESS if all well */
|
||||||
UNIV_INTERN
|
static
|
||||||
dberr_t
|
dberr_t
|
||||||
fts_ast_visit_sub_exp(
|
fts_ast_visit_sub_exp(
|
||||||
/*==================*/
|
/*==================*/
|
||||||
@ -2965,6 +2969,14 @@ fts_ast_visit_sub_exp(
|
|||||||
|
|
||||||
ut_a(node->type == FTS_AST_SUBEXP_LIST);
|
ut_a(node->type == FTS_AST_SUBEXP_LIST);
|
||||||
|
|
||||||
|
/* To avoid stack overflow, we limit the mutual recursion
|
||||||
|
depth between fts_ast_visit(), fts_query_visitor() and
|
||||||
|
fts_ast_visit_sub_exp(). */
|
||||||
|
if (query->visiting_sub_exp++ > 31) {
|
||||||
|
query->error = DB_OUT_OF_MEMORY;
|
||||||
|
DBUG_RETURN(query->error);
|
||||||
|
}
|
||||||
|
|
||||||
cur_oper = query->oper;
|
cur_oper = query->oper;
|
||||||
|
|
||||||
/* Save current result set */
|
/* Save current result set */
|
||||||
@ -2987,6 +2999,7 @@ fts_ast_visit_sub_exp(
|
|||||||
/* Reinstate parent node state */
|
/* Reinstate parent node state */
|
||||||
query->multi_exist = multi_exist;
|
query->multi_exist = multi_exist;
|
||||||
query->oper = cur_oper;
|
query->oper = cur_oper;
|
||||||
|
query->visiting_sub_exp--;
|
||||||
|
|
||||||
/* Merge the sub-expression result with the parent result set. */
|
/* Merge the sub-expression result with the parent result set. */
|
||||||
subexpr_doc_ids = query->doc_ids;
|
subexpr_doc_ids = query->doc_ids;
|
||||||
|
@ -864,6 +864,10 @@ struct dict_foreign_t{
|
|||||||
does not generate new indexes
|
does not generate new indexes
|
||||||
implicitly */
|
implicitly */
|
||||||
dict_index_t* referenced_index;/*!< referenced index */
|
dict_index_t* referenced_index;/*!< referenced index */
|
||||||
|
|
||||||
|
/** Check whether the fulltext index gets affected by
|
||||||
|
foreign key constraint */
|
||||||
|
bool affects_fulltext() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2016, 2018, MariaDB Corporation.
|
Copyright (c) 2016, 2020, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@ -204,19 +204,6 @@ fts_ast_visit(
|
|||||||
operator, currently we only
|
operator, currently we only
|
||||||
ignore FTS_IGNORE operator */
|
ignore FTS_IGNORE operator */
|
||||||
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
||||||
/*****************************************************************//**
|
|
||||||
Process (nested) sub-expression, create a new result set to store the
|
|
||||||
sub-expression result by processing nodes under current sub-expression
|
|
||||||
list. Merge the sub-expression result with that of parent expression list.
|
|
||||||
@return DB_SUCCESS if all went well */
|
|
||||||
UNIV_INTERN
|
|
||||||
dberr_t
|
|
||||||
fts_ast_visit_sub_exp(
|
|
||||||
/*==================*/
|
|
||||||
fts_ast_node_t* node, /*!< in: instance to traverse*/
|
|
||||||
fts_ast_callback visitor, /*!< in: callback */
|
|
||||||
void* arg) /*!< in: callback arg */
|
|
||||||
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
Create a lex instance.*/
|
Create a lex instance.*/
|
||||||
UNIV_INTERN
|
UNIV_INTERN
|
||||||
|
@ -516,7 +516,7 @@ row_ins_cascade_calc_update_vec(
|
|||||||
|
|
||||||
n_fields_updated = 0;
|
n_fields_updated = 0;
|
||||||
|
|
||||||
*fts_col_affected = FALSE;
|
*fts_col_affected = foreign->affects_fulltext();
|
||||||
|
|
||||||
if (table->fts) {
|
if (table->fts) {
|
||||||
doc_id_pos = dict_table_get_nth_col_pos(
|
doc_id_pos = dict_table_get_nth_col_pos(
|
||||||
@ -637,16 +637,6 @@ row_ins_cascade_calc_update_vec(
|
|||||||
padded_data, min_size);
|
padded_data, min_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether the current column has
|
|
||||||
FTS index on it */
|
|
||||||
if (table->fts
|
|
||||||
&& dict_table_is_fts_column(
|
|
||||||
table->fts->indexes,
|
|
||||||
dict_col_get_no(col))
|
|
||||||
!= ULINT_UNDEFINED) {
|
|
||||||
*fts_col_affected = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If Doc ID is updated, check whether the
|
/* If Doc ID is updated, check whether the
|
||||||
Doc ID is valid */
|
Doc ID is valid */
|
||||||
if (table->fts
|
if (table->fts
|
||||||
@ -983,7 +973,6 @@ row_ins_foreign_check_on_constraint(
|
|||||||
upd_t* update;
|
upd_t* update;
|
||||||
ulint n_to_update;
|
ulint n_to_update;
|
||||||
dberr_t err;
|
dberr_t err;
|
||||||
ulint i;
|
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
mem_heap_t* tmp_heap = NULL;
|
mem_heap_t* tmp_heap = NULL;
|
||||||
doc_id_t doc_id = FTS_NULL_DOC_ID;
|
doc_id_t doc_id = FTS_NULL_DOC_ID;
|
||||||
@ -1197,7 +1186,7 @@ row_ins_foreign_check_on_constraint(
|
|||||||
UNIV_MEM_INVALID(update->fields,
|
UNIV_MEM_INVALID(update->fields,
|
||||||
update->n_fields * sizeof *update->fields);
|
update->n_fields * sizeof *update->fields);
|
||||||
|
|
||||||
for (i = 0; i < foreign->n_fields; i++) {
|
for (ulint i = 0; i < foreign->n_fields; i++) {
|
||||||
upd_field_t* ufield = &update->fields[i];
|
upd_field_t* ufield = &update->fields[i];
|
||||||
|
|
||||||
ufield->field_no = dict_table_get_nth_col_pos(
|
ufield->field_no = dict_table_get_nth_col_pos(
|
||||||
@ -1206,32 +1195,14 @@ row_ins_foreign_check_on_constraint(
|
|||||||
ufield->orig_len = 0;
|
ufield->orig_len = 0;
|
||||||
ufield->exp = NULL;
|
ufield->exp = NULL;
|
||||||
dfield_set_null(&ufield->new_val);
|
dfield_set_null(&ufield->new_val);
|
||||||
|
|
||||||
if (table->fts && dict_table_is_fts_column(
|
|
||||||
table->fts->indexes,
|
|
||||||
dict_index_get_nth_col_no(index, i))
|
|
||||||
!= ULINT_UNDEFINED) {
|
|
||||||
fts_col_affacted = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fts_col_affacted) {
|
if (foreign->affects_fulltext()) {
|
||||||
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
|
||||||
}
|
|
||||||
} else if (table->fts && cascade->is_delete) {
|
|
||||||
/* DICT_FOREIGN_ON_DELETE_CASCADE case */
|
|
||||||
for (i = 0; i < foreign->n_fields; i++) {
|
|
||||||
if (table->fts && dict_table_is_fts_column(
|
|
||||||
table->fts->indexes,
|
|
||||||
dict_index_get_nth_col_no(index, i))
|
|
||||||
!= ULINT_UNDEFINED) {
|
|
||||||
fts_col_affacted = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fts_col_affacted) {
|
|
||||||
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
||||||
}
|
}
|
||||||
|
} else if (table->fts && cascade->is_delete
|
||||||
|
&& foreign->affects_fulltext()) {
|
||||||
|
fts_trx_add_op(trx, table, doc_id, FTS_DELETE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!node->is_delete
|
if (!node->is_delete
|
||||||
|
Loading…
x
Reference in New Issue
Block a user