summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujatha <sujatha.sivakumar@mariadb.com>2020-09-29 16:59:36 +0530
committerSujatha <sujatha.sivakumar@mariadb.com>2020-09-29 16:59:36 +0530
commit25ede13611b3c1f736be22fc581a0c371d212f61 (patch)
tree0a930e742c1f80786b573067bfed9014c8c54ce8
parent080522dcd7177a0008824802cd58a36ee8048d8f (diff)
parent79e32e47a11150839ac4ab44ac02d4019c0e0019 (diff)
downloadmariadb-git-25ede13611b3c1f736be22fc581a0c371d212f61.tar.gz
Merge branch '10.4' into 10.5
-rw-r--r--client/mysql_upgrade.c2
-rwxr-xr-xdebian/additions/mariadb-report2
-rw-r--r--mysql-test/main/mysql_upgrade.result4
-rw-r--r--mysql-test/main/type_blob.result15
-rw-r--r--mysql-test/main/type_blob.test20
-rwxr-xr-xmysql-test/mysql-test-run.pl3
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result94
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test14
-rw-r--r--mysql-test/suite/federated/federatedx_create_handlers.result44
-rw-r--r--mysql-test/suite/federated/federatedx_create_handlers.test57
-rw-r--r--mysql-test/suite/galera_3nodes/disabled.def5
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result13
-rw-r--r--mysql-test/suite/innodb/t/foreign_key.test14
-rw-r--r--mysql-test/suite/maria/alter.result80
-rw-r--r--mysql-test/suite/maria/alter.test102
-rw-r--r--mysql-test/suite/maria/maria-no-logging.result6
-rw-r--r--mysql-test/suite/maria/maria-no-logging.test2
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_retry.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_retry.test4
-rw-r--r--mysql-test/suite/sql_sequence/next.result9
-rw-r--r--mysql-test/suite/sql_sequence/next.test10
-rw-r--r--mysql-test/suite/wsrep/r/variables.result6
-rw-r--r--mysql-test/suite/wsrep/t/variables.test1
-rw-r--r--sql-common/client.c4
-rw-r--r--sql/derived_handler.cc4
-rw-r--r--sql/handler.cc96
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item_geofunc.cc16
-rw-r--r--sql/log.cc56
-rw-r--r--sql/log_event_client.cc10
-rw-r--r--sql/mysqld.cc9
-rw-r--r--sql/opt_subselect.cc13
-rw-r--r--sql/protocol.cc8
-rw-r--r--sql/share/errmsg-utf8.txt10
-rw-r--r--sql/sql_base.cc26
-rw-r--r--sql/sql_class.cc28
-rw-r--r--sql/sql_class.h9
-rw-r--r--sql/sql_string.cc2
-rw-r--r--sql/sql_table.cc8
-rw-r--r--sql/table.cc24
-rw-r--r--sql/xa.cc2
-rw-r--r--storage/innobase/btr/btr0sea.cc7
-rw-r--r--storage/innobase/row/row0ins.cc10
-rw-r--r--storage/maria/ha_maria.cc8
-rw-r--r--storage/maria/ma_check.c3
-rw-r--r--storage/myisam/ha_myisam.cc23
-rw-r--r--strings/ctype-mb.c4
-rwxr-xr-xtests/drop_test.pl2
-rwxr-xr-xtests/fork2_test.pl2
-rwxr-xr-xtests/fork_big.pl2
-rw-r--r--tests/fork_big2.pl2
-rwxr-xr-xtests/index_corrupt.pl2
-rwxr-xr-xtests/insert_and_repair.pl2
-rwxr-xr-xtests/mail_to_db.pl2
-rw-r--r--tests/mysql_client_test.c5
-rwxr-xr-xtests/pmail.pl2
-rwxr-xr-xtests/rename_test.pl2
-rwxr-xr-xtests/test_delayed_insert.pl2
-rwxr-xr-xtests/truncate.pl2
59 files changed, 777 insertions, 141 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 63fec217433..c262b7d80bd 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -1182,7 +1182,7 @@ static int check_version_match(void)
extract_variable_from_show(&ds_version, version_str))
{
print_error("Version check failed. Got the following error when calling "
- "the 'mysql_upgrade' command line client", &ds_version);
+ "the 'mysql' command line client", &ds_version);
dynstr_free(&ds_version);
return 1; /* Query failed */
}
diff --git a/debian/additions/mariadb-report b/debian/additions/mariadb-report
index cf5f4ae2d6b..48ee7bf8f53 100755
--- a/debian/additions/mariadb-report
+++ b/debian/additions/mariadb-report
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/perl
# mariadb-report v4.0 Oct 23 2015
# renamed to from mysqlreport in 2020
diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result
index d41df55b113..f6b9770a190 100644
--- a/mysql-test/main/mysql_upgrade.result
+++ b/mysql-test/main/mysql_upgrade.result
@@ -145,7 +145,7 @@ test
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
DROP USER mysqltest1@'%';
-Version check failed. Got the following error when calling the 'mysql_upgrade' command line client
+Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'mysqltest1'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed
Run mysql_upgrade with a non existing server socket
@@ -412,7 +412,7 @@ OK
# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
#
Run mysql_upgrade with unauthorized access
-Version check failed. Got the following error when calling the 'mysql_upgrade' command line client
+Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed
#
diff --git a/mysql-test/main/type_blob.result b/mysql-test/main/type_blob.result
index f514f2169dd..28f5d8fb868 100644
--- a/mysql-test/main/type_blob.result
+++ b/mysql-test/main/type_blob.result
@@ -1125,5 +1125,20 @@ LENGTH(a) LENGTH(DEFAULT(a))
256 256
DROP TABLE t1;
#
+# ASAN heap-use-after-free in my_hash_sort_bin or ER_KEY_NOT_FOUND
+# upon INSERT into table with long unique blob
+#
+SET @save_sql_mode=@@sql_mode;
+SET SQL_MODE='STRICT_ALL_TABLES';
+CREATE TABLE t1 (a INT, b BLOB) ENGINE=innodb;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+CREATE TABLE t2 (c BIT, d BLOB, UNIQUE(d)) ENGINE=innodb;
+INSERT INTO t2 SELECT * FROM t1;
+ERROR 22001: Data too long for column 'c' at row 2
+select * from t2;
+c d
+DROP TABLE t1, t2;
+SET @@sql_mode=@save_sql_mode;
+#
# End of 10.4 test
#
diff --git a/mysql-test/main/type_blob.test b/mysql-test/main/type_blob.test
index dc483f036cd..38c8b9a83ca 100644
--- a/mysql-test/main/type_blob.test
+++ b/mysql-test/main/type_blob.test
@@ -1,6 +1,7 @@
# This test can't be run with running server (--extern) as this uses
# load_file() on a file in the tree.
#
+--source include/have_innodb.inc
#
# Basic cleanup
@@ -735,6 +736,25 @@ INSERT INTO t1 VALUES ();
SELECT LENGTH(a), LENGTH(DEFAULT(a)) FROM t1;
DROP TABLE t1;
+--echo #
+--echo # ASAN heap-use-after-free in my_hash_sort_bin or ER_KEY_NOT_FOUND
+--echo # upon INSERT into table with long unique blob
+--echo #
+
+# Note that this test worked with myisam as it caches blobs differently than
+# InnoDB
+
+SET @save_sql_mode=@@sql_mode;
+SET SQL_MODE='STRICT_ALL_TABLES';
+
+CREATE TABLE t1 (a INT, b BLOB) ENGINE=innodb;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+CREATE TABLE t2 (c BIT, d BLOB, UNIQUE(d)) ENGINE=innodb;
+--error ER_DATA_TOO_LONG
+INSERT INTO t2 SELECT * FROM t1;
+select * from t2;
+DROP TABLE t1, t2;
+SET @@sql_mode=@save_sql_mode;
--echo #
--echo # End of 10.4 test
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index f3f50fdb2d0..7deff1f68f5 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2356,7 +2356,8 @@ sub environment_setup {
$ENV{'MARIADB_CONV'}= $exe_mariadb_conv;
if(IS_WINDOWS)
{
- $ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$opt_vs_config/mysql_install_db");
+ $ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$opt_vs_config/mysql_install_db",
+ "$bindir/bin/mysql_install_db");
}
my $client_config_exe=
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 3e400d4f272..1cfb6bce801 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -349,6 +349,11 @@ a
999.99
DROP TABLE t1dec102;
flush logs;
+CREATE TABLE t1 (a GEOMETRY DEFAULT NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (POINT(10,10));
+DROP TABLE t1;
+FLUSH LOGS;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
@@ -5358,3 +5363,92 @@ START TRANSACTION
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
Error: Found Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value.
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 010909 4:46:40
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Gtid list [0-1-323]
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-324 ddl
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
+/*!100001 SET @@session.server_id=1*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=324*//*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+use `test`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=#/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.sql_mode=1411383296/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (a GEOMETRY DEFAULT NULL)
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-325
+/*!100001 SET @@session.gtid_seq_no=325*//*!*/;
+START TRANSACTION
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
+#Q> INSERT INTO t1 VALUES (NULL)
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test`.`t1`
+### SET
+### @1=NULL /* GEOMETRY meta=4 nullable=1 is_null=1 */
+# Number of rows: 1
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-326
+/*!100001 SET @@session.gtid_seq_no=326*//*!*/;
+START TRANSACTION
+/*!*/;
+# at #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
+#Q> INSERT INTO t1 VALUES (POINT(10,10))
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
+### INSERT INTO `test`.`t1`
+### SET
+### @1='\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00$@\x00\x00\x00\x00\x00\x00$@' /* GEOMETRY meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-327 ddl
+/*!100001 SET @@session.gtid_seq_no=327*//*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000004 pos: 4
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
index add977bf07a..b366578f3cd 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
@@ -465,6 +465,17 @@ SELECT * FROM t1dec102 ORDER BY a;
DROP TABLE t1dec102;
flush logs;
+#
+# MDEV-22330: mysqlbinlog stops with an error Don't know how to handle column
+# type: 255 meta: 4 (0004)
+# Check support for GEOMETRY type with verbose mode.
+#
+CREATE TABLE t1 (a GEOMETRY DEFAULT NULL);
+
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (POINT(10,10));
+DROP TABLE t1;
+FLUSH LOGS;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
@@ -475,3 +486,6 @@ flush logs;
--error 1
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000002 2>&1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000003
diff --git a/mysql-test/suite/federated/federatedx_create_handlers.result b/mysql-test/suite/federated/federatedx_create_handlers.result
index 7a407d8aeef..28736515327 100644
--- a/mysql-test/suite/federated/federatedx_create_handlers.result
+++ b/mysql-test/suite/federated/federatedx_create_handlers.result
@@ -378,6 +378,50 @@ DROP TABLE federated.t1, federated.t2, federated.t3, federated.t4;
connection slave;
DROP TABLE federated.t1, federated.t2;
connection default;
+#
+# MDEV-23778: Derived handler used for big derived tables
+#
+connection slave;
+CREATE TABLE federated.t1 (
+a varchar(100) NOT NULL default '123'
+)
+DEFAULT CHARSET=latin1;
+CREATE TABLE federated.t2 LIKE federated.t1;
+BEGIN NOT ATOMIC
+DECLARE i INT DEFAULT 0;
+START TRANSACTION;
+WHILE i < 70000 DO
+INSERT INTO federated.t1 VALUES (i);
+SET i = i + 1;
+END WHILE;
+COMMIT;
+END
+$$
+connection master;
+CREATE TABLE federated.t1 (
+a varchar(100) NOT NULL default '123'
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+CREATE TABLE federated.t2 (
+a varchar(100) NOT NULL default '123'
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t2';
+SELECT COUNT(DISTINCT a) FROM federated.t1;
+COUNT(DISTINCT a)
+70000
+INSERT INTO federated.t2
+SELECT * FROM (SELECT * FROM federated.t1 LIMIT 100) dt;
+SELECT COUNT(DISTINCT a) FROM federated.t2;
+COUNT(DISTINCT a)
+100
+TRUNCATE TABLE federated.t2;
+INSERT INTO federated.t2
+SELECT * FROM (SELECT * FROM federated.t1 LIMIT 70000) dt;
+SELECT COUNT(DISTINCT a) FROM federated.t2;
+COUNT(DISTINCT a)
+70000
set global federated_pushdown=0;
connection master;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/suite/federated/federatedx_create_handlers.test b/mysql-test/suite/federated/federatedx_create_handlers.test
index d765588b79b..4b5789e1d96 100644
--- a/mysql-test/suite/federated/federatedx_create_handlers.test
+++ b/mysql-test/suite/federated/federatedx_create_handlers.test
@@ -208,6 +208,63 @@ DROP TABLE federated.t1, federated.t2;
connection default;
+--echo #
+--echo # MDEV-23778: Derived handler used for big derived tables
+--echo #
+
+connection slave;
+
+CREATE TABLE federated.t1 (
+ a varchar(100) NOT NULL default '123'
+)
+DEFAULT CHARSET=latin1;
+
+CREATE TABLE federated.t2 LIKE federated.t1;
+
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE i INT DEFAULT 0;
+ START TRANSACTION;
+ WHILE i < 70000 DO
+ INSERT INTO federated.t1 VALUES (i);
+ SET i = i + 1;
+ END WHILE;
+ COMMIT;
+END
+$$
+
+DELIMITER ;$$
+
+connection master;
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t1 (
+ a varchar(100) NOT NULL default '123'
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t2 (
+ a varchar(100) NOT NULL default '123'
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
+
+SELECT COUNT(DISTINCT a) FROM federated.t1;
+
+INSERT INTO federated.t2
+ SELECT * FROM (SELECT * FROM federated.t1 LIMIT 100) dt;
+SELECT COUNT(DISTINCT a) FROM federated.t2;
+
+TRUNCATE TABLE federated.t2;
+INSERT INTO federated.t2
+ SELECT * FROM (SELECT * FROM federated.t1 LIMIT 70000) dt;
+SELECT COUNT(DISTINCT a) FROM federated.t2;
+
set global federated_pushdown=0;
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def
index 0e2706f2dc3..ff7262947a0 100644
--- a/mysql-test/suite/galera_3nodes/disabled.def
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -11,6 +11,11 @@
##############################################################################
galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_gtid_2_cluster
+galera_ipv6_mariabackup : MDEV-21770 galera_3nodes.galera_ipv6_mariabackup fails
+galera_ipv6_mariabackup_section : MDEV-21770 galera_3nodes.galera_ipv6_mariabackup fails
+galera_ipv6_mysqldump : MDEV-23576 galera_3nodes.galera_ipv6_mysqldump MTR failed: WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
+galera_ipv6_rsync : MDEV-23581 galera_3nodes.galera_ipv6_rsync MTR failed: WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
+galera_ipv6_rsync_section : MDEV-23580 galera_3nodes.galera_ipv6_rsync_section MTR failed: WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
index aadfc338501..847641e70ea 100644
--- a/mysql-test/suite/innodb/r/foreign_key.result
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -751,6 +751,19 @@ DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
+#
+# MDEV-23675 Assertion `pos < table->n_def' in dict_table_get_nth_col
+#
+CREATE TABLE t1 (pk int PRIMARY KEY, a INT, b INT, c INT, KEY(c),
+FOREIGN KEY fx (b) REFERENCES t1 (c))
+ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,0,10,10);
+ALTER TABLE t1 DROP a, ALGORITHM=INSTANT;
+SET FOREIGN_KEY_CHECKS= 0;
+DROP INDEX fx ON t1;
+INSERT INTO t1 VALUES (2,11,11);
+DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS=DEFAULT;
# End of 10.4 tests
#
# MDEV-20729 Fix REFERENCES constraint in column definition
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
index c1713cb9742..0068a7b87f4 100644
--- a/mysql-test/suite/innodb/t/foreign_key.test
+++ b/mysql-test/suite/innodb/t/foreign_key.test
@@ -741,6 +741,20 @@ DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
+--echo #
+--echo # MDEV-23675 Assertion `pos < table->n_def' in dict_table_get_nth_col
+--echo #
+CREATE TABLE t1 (pk int PRIMARY KEY, a INT, b INT, c INT, KEY(c),
+FOREIGN KEY fx (b) REFERENCES t1 (c))
+ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,0,10,10);
+ALTER TABLE t1 DROP a, ALGORITHM=INSTANT;
+SET FOREIGN_KEY_CHECKS= 0;
+DROP INDEX fx ON t1;
+INSERT INTO t1 VALUES (2,11,11);
+DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS=DEFAULT;
+
-- echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/suite/maria/alter.result b/mysql-test/suite/maria/alter.result
index 4e6f21b70a7..e1a57ed654f 100644
--- a/mysql-test/suite/maria/alter.result
+++ b/mysql-test/suite/maria/alter.result
@@ -104,3 +104,83 @@ DROP TABLE t1;
#
# End of 10.2 test
#
+#
+# MDEV-17665 Assertion `!share || share->page_type == PAGECACHE_LSN_PAGE',
+# `type != PAGECACHE_READ_UNKNOWN_PAGE' and similar ones upon concurrent
+# Aria operations
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, KEY(a)) ENGINE=Aria;
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
+connect con1,localhost,root,,test;
+connect con2,localhost,root,,test;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
+connection con1;
+FLUSH TABLES;
+connection default;
+INSERT INTO t1 SELECT 1;
+ERROR 21S01: Column count doesn't match value count at row 1
+connection con2;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+disconnect con2;
+connection con1;
+disconnect con1;
+connection default;
+DROP TABLE t1;
+#
+# MDEV-22674 Server crash in compare_bin, ASAN heap-buffer-overflow in
+# _ma_dpointer, Assertion `!info->s->have_versioning ||
+# info->s->lock_key_trees' failed in restore_table_state_after_repair
+#
+CREATE TABLE t1 (id INT, d DATETIME, PRIMARY KEY(d,id),INDEX(d)) ENGINE=Aria;
+INSERT INTO t1 SELECT seq, NOW() FROM seq_1_to_500;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+connect con1,localhost,root,,test;
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 (id) SELECT b FROM t2;
+connection default;
+INSERT INTO t1 SELECT a FROM t2;
+ERROR 21S01: Column count doesn't match value count at row 1
+connection con1;
+ERROR 42S22: Unknown column 'b' in 'field list'
+disconnect con1;
+connection default;
+drop table t1, t2;
+# This is also in MDEV-22674
+CREATE TABLE t1 (id INT, d DATETIME, PRIMARY KEY(d,id),INDEX(d)) ENGINE=Aria;
+INSERT INTO t1 SELECT seq, NOW() FROM seq_1_to_500;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 (id) SELECT b FROM t2;
+ERROR 42S22: Unknown column 'b' in 'field list'
+INSERT INTO t1 SELECT a FROM t2;
+ERROR 21S01: Column count doesn't match value count at row 1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+500
+DROP TABLE t1,t2;
+#
+# MDEV-23296 Assertion `block->type == PAGECACHE_EMPTY_PAGE ||
+# block->type == PAGECACHE_READ_UNKNOWN_PAGE || block->type == type ||
+# (block->type == PAGECACHE_PLAIN_PAGE && type == PAGECACHE_LSN_PAGE)'
+# with aria_max_sort_file_size
+#
+SET @max_size.save= @@aria_max_sort_file_size;
+SET GLOBAL aria_max_sort_file_size= 0;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a CHAR(255), KEY(a)) ENGINE=Aria;
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+ALTER TABLE t1 ENABLE KEYS;
+INSERT INTO t1 VALUES (3,'nice try');
+SELECT * FROM t1;
+pk a
+1 foo
+2 bar
+3 nice try
+DROP TABLE t1;
+SET GLOBAL aria_max_sort_file_size= @max_size.save;
+#
+# End of 10.4 test
+#
diff --git a/mysql-test/suite/maria/alter.test b/mysql-test/suite/maria/alter.test
index 31eeac1df87..f2950f0a6d3 100644
--- a/mysql-test/suite/maria/alter.test
+++ b/mysql-test/suite/maria/alter.test
@@ -1,6 +1,8 @@
# Testing of potential problems in Aria and alter table
-- source include/have_maria.inc
+-- source include/have_innodb.inc
+-- source include/have_sequence.inc
drop table if exists t1;
@@ -90,3 +92,103 @@ DROP TABLE t1;
--echo #
--echo # End of 10.2 test
--echo #
+
+--echo #
+--echo # MDEV-17665 Assertion `!share || share->page_type == PAGECACHE_LSN_PAGE',
+--echo # `type != PAGECACHE_READ_UNKNOWN_PAGE' and similar ones upon concurrent
+--echo # Aria operations
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, a INT, KEY(a)) ENGINE=Aria;
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
+
+--connect (con1,localhost,root,,test)
+--connect (con2,localhost,root,,test)
+--send
+ INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100;
+
+--connection con1
+--send
+ FLUSH TABLES;
+
+--connection default
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 SELECT 1;
+
+# Cleanup
+--connection con2
+--error ER_DUP_ENTRY
+--reap
+--disconnect con2
+--connection con1
+--reap
+--disconnect con1
+--connection default
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-22674 Server crash in compare_bin, ASAN heap-buffer-overflow in
+--echo # _ma_dpointer, Assertion `!info->s->have_versioning ||
+--echo # info->s->lock_key_trees' failed in restore_table_state_after_repair
+--echo #
+
+CREATE TABLE t1 (id INT, d DATETIME, PRIMARY KEY(d,id),INDEX(d)) ENGINE=Aria;
+INSERT INTO t1 SELECT seq, NOW() FROM seq_1_to_500;
+
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+
+--connect (con1,localhost,root,,test)
+ALTER TABLE t1 DISABLE KEYS;
+--send
+ INSERT INTO t1 (id) SELECT b FROM t2;
+
+--connection default
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 SELECT a FROM t2;
+
+# Cleanup
+--connection con1
+--error ER_BAD_FIELD_ERROR
+--reap
+--disconnect con1
+
+--connection default
+drop table t1, t2;
+
+--echo # This is also in MDEV-22674
+
+CREATE TABLE t1 (id INT, d DATETIME, PRIMARY KEY(d,id),INDEX(d)) ENGINE=Aria;
+INSERT INTO t1 SELECT seq, NOW() FROM seq_1_to_500;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+ALTER TABLE t1 DISABLE KEYS;
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 (id) SELECT b FROM t2;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 SELECT a FROM t2;
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-23296 Assertion `block->type == PAGECACHE_EMPTY_PAGE ||
+--echo # block->type == PAGECACHE_READ_UNKNOWN_PAGE || block->type == type ||
+--echo # (block->type == PAGECACHE_PLAIN_PAGE && type == PAGECACHE_LSN_PAGE)'
+--echo # with aria_max_sort_file_size
+--echo #
+
+SET @max_size.save= @@aria_max_sort_file_size;
+SET GLOBAL aria_max_sort_file_size= 0;
+CREATE TABLE t1 (pk INT PRIMARY KEY, a CHAR(255), KEY(a)) ENGINE=Aria;
+ALTER TABLE t1 DISABLE KEYS;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+ALTER TABLE t1 ENABLE KEYS;
+INSERT INTO t1 VALUES (3,'nice try');
+SELECT * FROM t1;
+DROP TABLE t1;
+SET GLOBAL aria_max_sort_file_size= @max_size.save;
+
+--echo #
+--echo # End of 10.4 test
+--echo #
diff --git a/mysql-test/suite/maria/maria-no-logging.result b/mysql-test/suite/maria/maria-no-logging.result
index fb175d0e326..e79686c4731 100644
--- a/mysql-test/suite/maria/maria-no-logging.result
+++ b/mysql-test/suite/maria/maria-no-logging.result
@@ -31,6 +31,9 @@ insert into t1 select * from t2;
show engine aria logs;
Type Name Status
Aria Size 24576 aria_log.00000001 unknown
+select count(*) from t1;
+count(*)
+65
connection default;
connection admin;
* shut down mysqld, removed logs, restarted it
@@ -40,6 +43,9 @@ insert into t1 select * from t2;
show engine aria logs;
Type Name Status
Aria Size 16384 aria_log.00000001 unknown
+select count(*) from t1;
+count(*)
+64
drop table t1;
connection default;
connection admin;
diff --git a/mysql-test/suite/maria/maria-no-logging.test b/mysql-test/suite/maria/maria-no-logging.test
index fb2f34f7708..5d8029156ed 100644
--- a/mysql-test/suite/maria/maria-no-logging.test
+++ b/mysql-test/suite/maria/maria-no-logging.test
@@ -48,6 +48,7 @@ insert into t1 values('a');
insert into t1 select * from t2;
--replace_regex /; .+aria_log/aria_log/
show engine aria logs;
+select count(*) from t1;
# optimization because table is empty
-- source include/maria_empty_logs.inc
@@ -55,6 +56,7 @@ truncate table t1;
insert into t1 select * from t2;
--replace_regex /; .+aria_log/aria_log/
show engine aria logs;
+select count(*) from t1;
drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_retry.result b/mysql-test/suite/rpl/r/rpl_parallel_retry.result
index 66428c94086..b43556815d1 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_retry.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_retry.result
@@ -372,7 +372,7 @@ connection server_2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="+d,rpl_parallel_simulate_wait_at_retry";
include/start_slave.inc
-# Make sure the 2nd seqno_1001 worker has gotten to waiting
+# Make sure both workers are waiting at their sync points
# Signal to the 1st to proceed after it has reached termination state
SET @@DEBUG_SYNC='now SIGNAL proceed_by_1000';
connection spoiler_21;
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_retry.test b/mysql-test/suite/rpl/t/rpl_parallel_retry.test
index 96863f9021d..55da54e3c8c 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_retry.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_retry.test
@@ -426,8 +426,8 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="+d,rpl_parallel_simulate_wait_at_retry";
--source include/start_slave.inc
---echo # Make sure the 2nd seqno_1001 worker has gotten to waiting
---let $wait_condition= SELECT count(*) FROM information_schema.processlist WHERE state LIKE '%debug sync point: now%';
+--echo # Make sure both workers are waiting at their sync points
+--let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE '%debug sync point%';
--source include/wait_condition.inc
diff --git a/mysql-test/suite/sql_sequence/next.result b/mysql-test/suite/sql_sequence/next.result
index b1b1bb69306..fe761baa032 100644
--- a/mysql-test/suite/sql_sequence/next.result
+++ b/mysql-test/suite/sql_sequence/next.result
@@ -534,3 +534,12 @@ select next value for s;
next value for s
-999
drop sequence s;
+#
+# MDEV-23823 NEXT VALUE crash on locked view
+#
+CREATE VIEW v AS SELECT 1;
+LOCK TABLE v READ;
+SELECT NEXT VALUE FOR v;
+ERROR 42S02: 'test.v' is not a SEQUENCE
+UNLOCK TABLES;
+DROP VIEW v;
diff --git a/mysql-test/suite/sql_sequence/next.test b/mysql-test/suite/sql_sequence/next.test
index a1f91bd7823..5eac3b668ba 100644
--- a/mysql-test/suite/sql_sequence/next.test
+++ b/mysql-test/suite/sql_sequence/next.test
@@ -280,3 +280,13 @@ select next value for s;
flush tables;
select next value for s;
drop sequence s;
+
+--echo #
+--echo # MDEV-23823 NEXT VALUE crash on locked view
+--echo #
+CREATE VIEW v AS SELECT 1;
+LOCK TABLE v READ;
+--error ER_NOT_SEQUENCE
+SELECT NEXT VALUE FOR v;
+UNLOCK TABLES;
+DROP VIEW v;
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 1ff221f1459..87a385ec9a6 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -48,6 +48,8 @@ wsrep_flow_control_paused_ns #
wsrep_flow_control_paused #
wsrep_flow_control_sent #
wsrep_flow_control_recv #
+wsrep_flow_control_active #
+wsrep_flow_control_requested #
wsrep_cert_deps_distance #
wsrep_apply_oooe #
wsrep_apply_oool #
@@ -63,6 +65,7 @@ wsrep_cert_interval #
wsrep_open_transactions #
wsrep_open_connections #
wsrep_incoming_addresses #
+wsrep_debug_sync_waiters #
wsrep_applier_thread_count #
wsrep_cluster_capabilities #
wsrep_cluster_conf_id #
@@ -109,6 +112,8 @@ wsrep_flow_control_paused_ns #
wsrep_flow_control_paused #
wsrep_flow_control_sent #
wsrep_flow_control_recv #
+wsrep_flow_control_active #
+wsrep_flow_control_requested #
wsrep_cert_deps_distance #
wsrep_apply_oooe #
wsrep_apply_oool #
@@ -124,6 +129,7 @@ wsrep_cert_interval #
wsrep_open_transactions #
wsrep_open_connections #
wsrep_incoming_addresses #
+wsrep_debug_sync_waiters #
wsrep_applier_thread_count #
wsrep_cluster_capabilities #
wsrep_cluster_conf_id #
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
index 89b1ff99012..93aa31b9c93 100644
--- a/mysql-test/suite/wsrep/t/variables.test
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -1,6 +1,7 @@
--source include/have_wsrep.inc
--source include/force_restart.inc
--source include/have_innodb.inc
+--source include/galera_have_debug_sync.inc
SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
diff --git a/sql-common/client.c b/sql-common/client.c
index ecc3b821395..0de1d8c1208 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2019, MariaDB
+ Copyright (c) 2009, 2020, MariaDB
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
@@ -3034,7 +3034,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* New protocol with 16 bytes to describe server characteristics */
mysql->server_language=end[2];
mysql->server_status=uint2korr(end+3);
- mysql->server_capabilities|= uint2korr(end+5) << 16;
+ mysql->server_capabilities|= ((unsigned) uint2korr(end+5)) << 16;
pkt_scramble_len= end[7];
if (pkt_scramble_len < 0)
{
diff --git a/sql/derived_handler.cc b/sql/derived_handler.cc
index 76fd736de2b..f48b95cbf76 100644
--- a/sql/derived_handler.cc
+++ b/sql/derived_handler.cc
@@ -120,8 +120,6 @@ void derived_handler::set_derived(TABLE_LIST *tbl)
table= tbl->table;
unit= tbl->derived;
select= unit->first_select();
- tmp_table_param= select->next_select() ?
- ((select_unit *)(unit->result))->get_tmp_table_param() :
- &select->join->tmp_table_param;
+ tmp_table_param= ((select_unit *)(unit->result))->get_tmp_table_param();
}
diff --git a/sql/handler.cc b/sql/handler.cc
index 64d13d1601f..e9972a42b64 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -188,7 +188,7 @@ private:
static int commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans,
- bool is_real_trans, bool rw_trans);
+ bool is_real_trans);
static plugin_ref ha_default_plugin(THD *thd)
@@ -1621,9 +1621,37 @@ int ha_commit_trans(THD *thd, bool all)
/* rw_trans is TRUE when we in a transaction changing data */
bool rw_trans= is_real_trans &&
(rw_ha_count > (thd->is_current_stmt_binlog_disabled()?0U:1U));
+ MDL_request mdl_backup;
DBUG_PRINT("info", ("is_real_trans: %d rw_trans: %d rw_ha_count: %d",
is_real_trans, rw_trans, rw_ha_count));
+ if (rw_trans)
+ {
+ /*
+ Acquire a metadata lock which will ensure that COMMIT is blocked
+ by an active FLUSH TABLES WITH READ LOCK (and vice versa:
+ COMMIT in progress blocks FTWRL).
+
+ We allow the owner of FTWRL to COMMIT; we assume that it knows
+ what it does.
+ */
+ MDL_REQUEST_INIT(&mdl_backup, MDL_key::BACKUP, "", "", MDL_BACKUP_COMMIT,
+ MDL_EXPLICIT);
+
+ if (!WSREP(thd))
+ {
+ if (thd->mdl_context.acquire_lock(&mdl_backup,
+ thd->variables.lock_wait_timeout))
+ {
+ my_error(ER_ERROR_DURING_COMMIT, MYF(0), 1);
+ ha_rollback_trans(thd, all);
+ DBUG_RETURN(1);
+ }
+ thd->backup_commit_lock= &mdl_backup;
+ }
+ DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
+ }
+
if (rw_trans &&
opt_readonly &&
!(thd->security_ctx->master_access & PRIV_IGNORE_READ_ONLY) &&
@@ -1663,7 +1691,7 @@ int ha_commit_trans(THD *thd, bool all)
// Here, the call will not commit inside InnoDB. It is only working
// around closing thd->transaction.stmt open by TR_table::open().
if (all)
- commit_one_phase_2(thd, false, &thd->transaction->stmt, false, false);
+ commit_one_phase_2(thd, false, &thd->transaction->stmt, false);
}
}
#endif
@@ -1683,7 +1711,7 @@ int ha_commit_trans(THD *thd, bool all)
goto wsrep_err;
}
#endif /* WITH_WSREP */
- error= ha_commit_one_phase(thd, all, rw_trans);
+ error= ha_commit_one_phase(thd, all);
#ifdef WITH_WSREP
// Here in case of error we must return 2 for inconsistency
if (run_wsrep_hooks && !error)
@@ -1720,7 +1748,7 @@ int ha_commit_trans(THD *thd, bool all)
if (!is_real_trans)
{
- error= commit_one_phase_2(thd, all, trans, is_real_trans, rw_trans);
+ error= commit_one_phase_2(thd, all, trans, is_real_trans);
goto done;
}
@@ -1754,7 +1782,7 @@ int ha_commit_trans(THD *thd, bool all)
DEBUG_SYNC(thd, "ha_commit_trans_after_log_and_order");
DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_SUICIDE(););
- error= commit_one_phase_2(thd, all, trans, is_real_trans, rw_trans) ? 2 : 0;
+ error= commit_one_phase_2(thd, all, trans, is_real_trans) ? 2 : 0;
#ifdef WITH_WSREP
if (run_wsrep_hooks &&
(error || (error = wsrep_after_commit(thd, all))))
@@ -1828,6 +1856,17 @@ err:
thd->rgi_slave->is_parallel_exec);
}
end:
+ if (mdl_backup.ticket)
+ {
+ /*
+ We do not always immediately release transactional locks
+ after ha_commit_trans() (see uses of ha_enable_transaction()),
+ thus we release the commit blocker lock as soon as it's
+ not needed.
+ */
+ thd->mdl_context.release_lock(mdl_backup.ticket);
+ }
+ thd->backup_commit_lock= 0;
#ifdef WITH_WSREP
if (wsrep_is_active(thd) && is_real_trans && !error &&
(rw_ha_count == 0 || all) &&
@@ -1842,8 +1881,8 @@ end:
/**
@note
- This function does not care about global read lock. A caller should.
- However backup locks are handled in commit_one_phase_2.
+ This function does not care about global read lock or backup locks,
+ the caller should.
@param[in] all Is set in case of explicit commit
(COMMIT statement), or implicit commit
@@ -1852,7 +1891,7 @@ end:
autocommit=1.
*/
-int ha_commit_one_phase(THD *thd, bool all, bool rw_trans)
+int ha_commit_one_phase(THD *thd, bool all)
{
THD_TRANS *trans=all ? &thd->transaction->all : &thd->transaction->stmt;
/*
@@ -1878,48 +1917,21 @@ int ha_commit_one_phase(THD *thd, bool all, bool rw_trans)
if ((res= thd->wait_for_prior_commit()))
DBUG_RETURN(res);
}
- res= commit_one_phase_2(thd, all, trans, is_real_trans, rw_trans);
+ res= commit_one_phase_2(thd, all, trans, is_real_trans);
DBUG_RETURN(res);
}
static int
-commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans,
- bool rw_trans)
+commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans)
{
int error= 0;
uint count= 0;
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next;
- MDL_request mdl_request;
- mdl_request.ticket= 0;
DBUG_ENTER("commit_one_phase_2");
if (is_real_trans)
DEBUG_SYNC(thd, "commit_one_phase_2");
- if (rw_trans)
- {
- /*
- Acquire a metadata lock which will ensure that COMMIT is blocked
- by an active FLUSH TABLES WITH READ LOCK (and vice versa:
- COMMIT in progress blocks FTWRL).
-
- We allow the owner of FTWRL to COMMIT; we assume that it knows
- what it does.
- */
- MDL_REQUEST_INIT(&mdl_request, MDL_key::BACKUP, "", "", MDL_BACKUP_COMMIT,
- MDL_EXPLICIT);
-
- if (!WSREP(thd) &&
- thd->mdl_context.acquire_lock(&mdl_request,
- thd->variables.lock_wait_timeout))
- {
- my_error(ER_ERROR_DURING_COMMIT, MYF(0), 1);
- ha_rollback_trans(thd, all);
- DBUG_RETURN(1);
- }
- DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
- }
-
if (ha_info)
{
for (; ha_info; ha_info= ha_info_next)
@@ -1948,16 +1960,6 @@ commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans,
#endif
}
}
- if (mdl_request.ticket)
- {
- /*
- We do not always immediately release transactional locks
- after ha_commit_trans() (see uses of ha_enable_transaction()),
- thus we release the commit blocker lock as soon as it's
- not needed.
- */
- thd->mdl_context.release_lock(mdl_request.ticket);
- }
/* Free resources and perform other cleanup even for 'empty' transactions. */
if (is_real_trans)
diff --git a/sql/handler.h b/sql/handler.h
index ada5fbf40d4..e06b6a7aa43 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -5179,7 +5179,7 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
/* transactions: interface to handlerton functions */
int ha_start_consistent_snapshot(THD *thd);
int ha_commit_or_rollback_by_xid(XID *xid, bool commit);
-int ha_commit_one_phase(THD *thd, bool all, bool rw_trans);
+int ha_commit_one_phase(THD *thd, bool all);
int ha_commit_trans(THD *thd, bool all);
int ha_rollback_trans(THD *thd, bool all);
int ha_prepare(THD *thd);
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 4acf1c6525b..f1a4ac4ef8a 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB
+ Copyright (c) 2011, 2020, MariaDB
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
@@ -443,16 +443,18 @@ String *Item_func_boundary::val_str(String *str_value)
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
+
+ if ((null_value= args[0]->null_value))
+ DBUG_RETURN(0);
+
Geometry_buffer buffer;
- Geometry *g;
uint32 srid= 0;
Transporter trn(&res_receiver);
-
- if ((null_value=
- args[0]->null_value ||
- !(g= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
+
+ Geometry *g= Geometry::construct(&buffer, swkb->ptr(), swkb->length());
+ if (!g)
DBUG_RETURN(0);
-
+
if (g->store_shapes(&trn))
goto mem_error;
diff --git a/sql/log.cc b/sql/log.cc
index 2a887a68606..921d68b9feb 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -6574,11 +6574,26 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
if (direct)
{
+ /* We come here only for incident events */
int res;
uint64 commit_id= 0;
+ MDL_request mdl_request;
DBUG_PRINT("info", ("direct is set"));
+ DBUG_ASSERT(!thd->backup_commit_lock);
+
+ MDL_REQUEST_INIT(&mdl_request, MDL_key::BACKUP, "", "", MDL_BACKUP_COMMIT,
+ MDL_EXPLICIT);
+ thd->mdl_context.acquire_lock(&mdl_request,
+ thd->variables.lock_wait_timeout);
+ thd->backup_commit_lock= &mdl_request;
+
if ((res= thd->wait_for_prior_commit()))
+ {
+ if (mdl_request.ticket)
+ thd->mdl_context.release_lock(mdl_request.ticket);
+ thd->backup_commit_lock= 0;
DBUG_RETURN(res);
+ }
file= &log_file;
my_org_b_tell= my_b_tell(file);
mysql_mutex_lock(&LOCK_log);
@@ -6593,7 +6608,11 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
commit_name.length);
commit_id= entry->val_int(&null_value);
});
- if (write_gtid_event(thd, true, using_trans, commit_id))
+ res= write_gtid_event(thd, true, using_trans, commit_id);
+ if (mdl_request.ticket)
+ thd->mdl_context.release_lock(mdl_request.ticket);
+ thd->backup_commit_lock= 0;
+ if (res)
goto err;
}
else
@@ -7657,7 +7676,11 @@ MYSQL_BIN_LOG::queue_for_group_commit(group_commit_entry *orig_entry)
group_commit_entry *entry, *orig_queue, *last;
wait_for_commit *cur;
wait_for_commit *wfc;
+ bool backup_lock_released= 0;
+ int result= 0;
+ THD *thd= orig_entry->thd;
DBUG_ENTER("MYSQL_BIN_LOG::queue_for_group_commit");
+ DBUG_ASSERT(thd == current_thd);
/*
Check if we need to wait for another transaction to commit before us.
@@ -7689,6 +7712,21 @@ MYSQL_BIN_LOG::queue_for_group_commit(group_commit_entry *orig_entry)
{
PSI_stage_info old_stage;
+ /*
+ Release MDL_BACKUP_COMMIT LOCK while waiting for other threads to
+ commit.
+ This is needed to avoid deadlock between the other threads (which not
+ yet have the MDL_BACKUP_COMMIT_LOCK) and any threads using
+ BACKUP LOCK BLOCK_COMMIT.
+ */
+ if (thd->backup_commit_lock && thd->backup_commit_lock->ticket &&
+ !backup_lock_released)
+ {
+ backup_lock_released= 1;
+ thd->mdl_context.release_lock(thd->backup_commit_lock->ticket);
+ thd->backup_commit_lock->ticket= 0;
+ }
+
/*
By setting wfc->opaque_pointer to our own entry, we mark that we are
ready to commit, but waiting for another transaction to commit before
@@ -7749,7 +7787,8 @@ MYSQL_BIN_LOG::queue_for_group_commit(group_commit_entry *orig_entry)
wfc->wakeup_error= ER_QUERY_INTERRUPTED;
my_message(wfc->wakeup_error,
ER_THD(orig_entry->thd, wfc->wakeup_error), MYF(0));
- DBUG_RETURN(-1);
+ result= -1;
+ goto end;
}
}
orig_entry->thd->EXIT_COND(&old_stage);
@@ -7763,12 +7802,13 @@ MYSQL_BIN_LOG::queue_for_group_commit(group_commit_entry *orig_entry)
then there is nothing else to do.
*/
if (orig_entry->queued_by_other)
- DBUG_RETURN(0);
+ goto end;
if (wfc && wfc->wakeup_error)
{
my_error(ER_PRIOR_COMMIT_FAILED, MYF(0));
- DBUG_RETURN(-1);
+ result= -1;
+ goto end;
}
/* Now enqueue ourselves in the group commit queue. */
@@ -7929,7 +7969,13 @@ MYSQL_BIN_LOG::queue_for_group_commit(group_commit_entry *orig_entry)
DBUG_PRINT("info", ("Queued for group commit as %s",
(orig_queue == NULL) ? "leader" : "participant"));
- DBUG_RETURN(orig_queue == NULL);
+ result= orig_queue == NULL;
+
+end:
+ if (backup_lock_released)
+ thd->mdl_context.acquire_lock(thd->backup_commit_lock,
+ thd->variables.lock_wait_timeout);
+ DBUG_RETURN(result);
}
bool
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index 4c26acd2cc1..0480a8fa59f 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -899,6 +899,16 @@ log_event_print_value(IO_CACHE *file, PRINT_EVENT_INFO *print_event_info,
fprintf(stderr, "\nError: Found Old DECIMAL (mysql-4.1 or earlier). "
"Not enough metadata to display the value.\n");
break;
+
+ case MYSQL_TYPE_GEOMETRY:
+ strmake(typestr, "GEOMETRY", typestr_length);
+ if (!ptr)
+ goto return_null;
+
+ length= uint4korr(ptr);
+ my_b_write_quoted(file, ptr + meta, length);
+ return length + meta;
+
default:
print_event_info->flush_for_error();
fprintf(stderr,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7e5f7934f75..6b103c69a69 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1893,13 +1893,10 @@ extern "C" void unireg_abort(int exit_code)
WSREP_INFO("Some threads may fail to exit.");
}
- if (WSREP_ON)
+ if (WSREP_ON && wsrep_inited)
{
- /* In bootstrap mode we deinitialize wsrep here. */
- if (opt_bootstrap || wsrep_recovery)
- {
- if (wsrep_inited) wsrep_deinit(true);
- }
+ wsrep_deinit(true);
+ wsrep_deinit_server();
}
#endif // WITH_WSREP
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 4e391f5c4c1..41dcf6442a1 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, 2019, MariaDB
+ Copyright (c) 2010, 2020, MariaDB
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
@@ -2681,16 +2681,11 @@ bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables)
do
{
uint key= keyuse->key;
- KEY *keyinfo;
key_part_map bound_parts= 0;
- bool is_excluded_key= keyuse->is_for_hash_join();
- if (!is_excluded_key)
- {
- keyinfo= table->key_info + key;
- is_excluded_key= !MY_TEST(keyinfo->flags & HA_NOSAME);
- }
- if (!is_excluded_key)
+ if (!keyuse->is_for_hash_join() &&
+ (table->key_info[key].flags & HA_NOSAME))
{
+ KEY *keyinfo= table->key_info + key;
do /* For all equalities on all key parts */
{
/*
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 65066111238..dfab9e50ac9 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2008, 2012, Monty Program Ab
+ Copyright (c) 2008, 2020, MariaDB Corporation.
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
@@ -57,7 +57,8 @@ bool Protocol_binary::net_store_data(const uchar *from, size_t length)
packet->realloc(packet_length+9+length))
return 1;
uchar *to= net_store_length((uchar*) packet->ptr()+packet_length, length);
- memcpy(to,from,length);
+ if (length)
+ memcpy(to,from,length);
packet->length((uint) (to+length-(uchar*) packet->ptr()));
return 0;
}
@@ -733,7 +734,8 @@ void net_send_progress_packet(THD *thd)
uchar *net_store_data(uchar *to, const uchar *from, size_t length)
{
to=net_store_length_fast(to,length);
- memcpy(to,from,length);
+ if (length)
+ memcpy(to,from,length);
return to+length;
}
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 95dcbf157d3..8a60ad707f5 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -1800,9 +1800,10 @@ ER_WRONG_AUTO_KEY 42000 S1009
slo "Môžete mať iba jedno AUTO pole a to musí byť definované ako kľúč"
spa "Puede ser solamente un campo automatico y este debe ser definido como una clave"
swe "Det får finnas endast ett AUTO_INCREMENT-fält och detta måste vara en nyckel"
- ukr "Невірне визначення таблиці; Може бути лише один автоматичний стовбець, що повинен бути визначений як ключ"
+ ukr "Хибне визначення таблиці; Може бути лише один автоматичний стовбець, що повинен бути визначений як ключ"
ER_BINLOG_CANT_DELETE_GTID_DOMAIN
eng "Could not delete gtid domain. Reason: %s."
+ ukr "Не можу видалити домен gtid. Причина: %s."
ER_NORMAL_SHUTDOWN
cze "%s (%s): normální ukončení"
dan "%s (%s): Normal nedlukning"
@@ -2203,6 +2204,7 @@ ER_INSERT_INFO
ER_UPDATE_TABLE_USED
eng "Table '%-.192s' is specified twice, both as a target for '%s' and as a separate source for data"
swe "Table '%-.192s' är använd två gånger. Både för '%s' och för att hämta data"
+ ukr "Таблиця '%-.192s' вказується двічі, як цільова для '%s', так і як окреме джерело даних"
ER_NO_SUCH_THREAD
cze "Neznámá identifikace threadu: %lu"
dan "Ukendt tråd id: %lu"
@@ -2824,6 +2826,7 @@ ER_WRONG_OUTER_JOIN 42000
ER_NULL_COLUMN_IN_INDEX 42000
eng "Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler"
swe "Tabell hanteraren kan inte indexera NULL kolumner för den givna index typen. Ändra '%-.192s' till NOT NULL eller använd en annan hanterare"
+ ukr "Вказівник таблиці не підтримує NULL у зазначенному індексі. Будь ласка, зменіть стовпчик '%-.192s' на NOT NULL або використайте інший вказівник таблиці."
ER_CANT_FIND_UDF
cze "Nemohu načíst funkci '%-.192s'"
dan "Kan ikke læse funktionen '%-.192s'"
@@ -4314,6 +4317,7 @@ ER_MASTER_INFO
jpn "'master info '%.*s''構造体の初期化ができませんでした。MariaDBエラーログでエラーメッセージを確認してください。"
serbian "Nisam mogao da inicijalizujem informacionu strukturu glavnog servera, proverite da li imam privilegije potrebne za pristup file-u 'master.info' '%.*s'"
swe "Kunde inte initialisera replikationsstrukturerna för '%.*s'. See MariaDB fel fil för mera information"
+ ukr "Інформаційна структура з'єднання головного і підлеглого (master.info) для '%.*s' не може бути ініціалізована"
ER_SLAVE_THREAD
dan "Kunne ikke danne en slave-tråd; check systemressourcerne"
nla "Kon slave thread niet aanmaken, controleer systeem resources"
@@ -4478,6 +4482,7 @@ ER_UNION_TABLES_IN_DIFFERENT_DIR
serbian "Pogrešna definicija tabele; sve 'MERGE' tabele moraju biti u istoj bazi podataka"
spa "Incorrecta definición de la tabla; Todas las tablas MERGE deben estar en el mismo banco de datos"
swe "Felaktig tabelldefinition; alla tabeller i en MERGE-tabell måste vara i samma databas"
+ ukr "Хибне визначення таблиці; всі MERGE-таблиці повинні належити до однієї бази ланних."
ER_LOCK_DEADLOCK 40001
nla "Deadlock gevonden tijdens lock-aanvraag poging; Probeer herstart van de transactie"
eng "Deadlock found when trying to get lock; try restarting transaction"
@@ -4491,6 +4496,7 @@ ER_LOCK_DEADLOCK 40001
serbian "Unakrsno zaključavanje pronađeno kada sam pokušao da dobijem pravo na zaključavanje; Probajte da restartujete transakciju"
spa "Encontrado deadlock cuando tentando obtener el bloqueo; Tente recomenzar la transición"
swe "Fick 'DEADLOCK' vid låsförsök av block/rad. Försök att starta om transaktionen"
+ ukr "Взаємне блокування знайдено під час спроби отримати блокування; спробуйте перезапустити транзакцію."
ER_TABLE_CANT_HANDLE_FT
nla "Het gebruikte tabel type (%s) ondersteund geen FULLTEXT indexen"
eng "The storage engine %s doesn't support FULLTEXT indexes"
@@ -4517,6 +4523,7 @@ ER_CANNOT_ADD_FOREIGN
serbian "Ne mogu da dodam proveru spoljnog ključa na `%s`"
spa "No puede adicionar clave extranjera constraint para `%s`"
swe "Kan inte lägga till 'FOREIGN KEY constraint' för `%s`'"
+ ukr "Не можу додати обмеження зовнішнього ключа Ha `%s`"
ER_NO_REFERENCED_ROW 23000
nla "Kan onderliggende rij niet toevoegen: foreign key beperking gefaald"
eng "Cannot add or update a child row: a foreign key constraint fails"
@@ -4531,6 +4538,7 @@ ER_NO_REFERENCED_ROW 23000
rus "Невозможно добавить или обновить дочернюю строку: проверка ограничений внешнего ключа не выполняется"
spa "No puede adicionar una línea hijo: falla de clave extranjera constraint"
swe "FOREIGN KEY-konflikt: Kan inte skriva barn"
+ ukr "Не вдається додати або оновити дочірній рядок: невдала перевірка обмеження зовнішнього ключа"
ER_ROW_IS_REFERENCED 23000
eng "Cannot delete or update a parent row: a foreign key constraint fails"
fre "Impossible de supprimer un enregistrement père : une constrainte externe l'empèche"
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6a313616025..e6d0ab13e75 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1777,7 +1777,14 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
}
if (is_locked_view(thd, table_list))
+ {
+ if (table_list->sequence)
+ {
+ my_error(ER_NOT_SEQUENCE, MYF(0), table_list->db.str, table_list->alias.str);
+ DBUG_RETURN(true);
+ }
DBUG_RETURN(FALSE); // VIEW
+ }
/*
No table in the locked tables list. In case of explicit LOCK TABLES
@@ -8734,14 +8741,17 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
goto err;
field->set_has_explicit_value();
}
- /* Update virtual fields */
- thd->abort_on_warning= FALSE;
- if (table->versioned())
- table->vers_update_fields();
- if (table->vfield &&
- table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_WRITE))
- goto err;
- thd->abort_on_warning= abort_on_warning_saved;
+ /* Update virtual fields if there wasn't any errors */
+ if (!thd->is_error())
+ {
+ thd->abort_on_warning= FALSE;
+ if (table->versioned())
+ table->vers_update_fields();
+ if (table->vfield &&
+ table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_WRITE))
+ goto err;
+ thd->abort_on_warning= abort_on_warning_saved;
+ }
DBUG_RETURN(thd->is_error());
err:
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index f4cbda5490c..d27d0c678e4 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1298,6 +1298,7 @@ void THD::init()
first_successful_insert_id_in_prev_stmt_for_binlog= 0;
first_successful_insert_id_in_cur_stmt= 0;
current_backup_stage= BACKUP_FINISHED;
+ backup_commit_lock= 0;
#ifdef WITH_WSREP
wsrep_last_query_id= 0;
wsrep_xid.null();
@@ -7651,16 +7652,33 @@ wait_for_commit::register_wait_for_prior_commit(wait_for_commit *waitee)
}
-/*
- Wait for commit of another transaction to complete, as already registered
+/**
+ Waits for commit of another transaction to complete, as already registered
with register_wait_for_prior_commit(). If the commit already completed,
returns immediately.
+
+ If thd->backup_commit_lock is set, release it while waiting for other threads
*/
+
int
wait_for_commit::wait_for_prior_commit2(THD *thd)
{
PSI_stage_info old_stage;
wait_for_commit *loc_waitee;
+ bool backup_lock_released= 0;
+
+ /*
+ Release MDL_BACKUP_COMMIT LOCK while waiting for other threads to commit
+ This is needed to avoid deadlock between the other threads (which not
+ yet have the MDL_BACKUP_COMMIT_LOCK) and any threads using
+ BACKUP LOCK BLOCK_COMMIT.
+ */
+ if (thd->backup_commit_lock && thd->backup_commit_lock->ticket)
+ {
+ backup_lock_released= 1;
+ thd->mdl_context.release_lock(thd->backup_commit_lock->ticket);
+ thd->backup_commit_lock->ticket= 0;
+ }
mysql_mutex_lock(&LOCK_wait_commit);
DEBUG_SYNC(thd, "wait_for_prior_commit_waiting");
@@ -7710,10 +7728,16 @@ wait_for_commit::wait_for_prior_commit2(THD *thd)
use within enter_cond/exit_cond.
*/
DEBUG_SYNC(thd, "wait_for_prior_commit_killed");
+ if (backup_lock_released)
+ thd->mdl_context.acquire_lock(thd->backup_commit_lock,
+ thd->variables.lock_wait_timeout);
return wakeup_error;
end:
thd->EXIT_COND(&old_stage);
+ if (backup_lock_released)
+ thd->mdl_context.acquire_lock(thd->backup_commit_lock,
+ thd->variables.lock_wait_timeout);
return wakeup_error;
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 6bc01119508..994fb9dd6ad 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2312,7 +2312,10 @@ public:
rpl_io_thread_info *rpl_io_info;
rpl_sql_thread_info *rpl_sql_info;
} system_thread_info;
+ /* Used for BACKUP LOCK */
MDL_ticket *mdl_backup_ticket, *mdl_backup_lock;
+ /* Used to register that thread has a MDL_BACKUP_WAIT_COMMIT lock */
+ MDL_request *backup_commit_lock;
void reset_for_next_command(bool do_clear_errors= 1);
/*
@@ -2759,10 +2762,14 @@ public:
{
free_root(&mem_root,MYF(0));
}
- my_bool is_active()
+ bool is_active()
{
return (all.ha_list != NULL);
}
+ bool is_empty()
+ {
+ return all.is_empty() && stmt.is_empty();
+ }
st_transactions()
{
bzero((char*)this, sizeof(*this));
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index e2defba434d..0e62b5b9c2e 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -858,7 +858,7 @@ int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
int stringcmp(const String *s,const String *t)
{
uint32 s_len=s->length(),t_len=t->length(),len=MY_MIN(s_len,t_len);
- int cmp= memcmp(s->ptr(), t->ptr(), len);
+ int cmp= len ? memcmp(s->ptr(), t->ptr(), len) : 0;
return (cmp) ? cmp : (int) (s_len - t_len);
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 15d190c3139..345edf4d75c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -11110,6 +11110,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
bool make_versioned= !from->versioned() && to->versioned();
bool make_unversioned= from->versioned() && !to->versioned();
bool keep_versioned= from->versioned() && to->versioned();
+ bool bulk_insert_started= 0;
Field *to_row_start= NULL, *to_row_end= NULL, *from_row_end= NULL;
MYSQL_TIME query_start;
DBUG_ENTER("copy_data_between_tables");
@@ -11148,6 +11149,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
to->file->extra(HA_EXTRA_PREPARE_FOR_ALTER_TABLE);
to->file->ha_start_bulk_insert(from->file->stats.records,
ignore ? 0 : HA_CREATE_UNIQUE_INDEX_BY_SORT);
+ bulk_insert_started= 1;
mysql_stage_set_work_estimated(thd->m_stage_progress_psi, from->file->stats.records);
List_iterator<Create_field> it(create);
@@ -11416,6 +11418,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
to->file->print_error(my_errno,MYF(0));
error= 1;
}
+ bulk_insert_started= 0;
if (!ignore)
to->file->extra(HA_EXTRA_END_ALTER_COPY);
@@ -11429,7 +11432,10 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
error= 1;
err:
- /* Free resources */
+ if (bulk_insert_started)
+ (void) to->file->ha_end_bulk_insert();
+
+/* Free resources */
if (init_read_record_done)
end_read_record(&info);
delete [] copy;
diff --git a/sql/table.cc b/sql/table.cc
index 779ce768eee..3d5e2343d2e 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -8498,28 +8498,39 @@ public:
@details
The function computes the values of the virtual columns of the table and
stores them in the table record buffer.
+ This will be done even if is_error() is set either when function was called
+ or by calculating the virtual function, as most calls to this
+ function doesn't check the result. We also want to ensure that as many
+ fields as possible has the right value so that we can optionally
+ return the partly-faulty-row from a storage engine with a virtual
+ field that gives an error on storage for an existing row.
+
+ @todo
+ Ensure that all caller checks the value of this function and
+ either properly ignores it (and resets the error) or sends the
+ error forward to the caller.
@retval
0 Success
@retval
- >0 Error occurred when storing a virtual field value
+ >0 Error occurred when storing a virtual field value or potentially
+ is_error() was set when function was called.
*/
int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
{
DBUG_ENTER("TABLE::update_virtual_fields");
- DBUG_PRINT("enter", ("update_mode: %d", update_mode));
+ DBUG_PRINT("enter", ("update_mode: %d is_error: %d", update_mode,
+ in_use->is_error()));
Field **vfield_ptr, *vf;
Query_arena backup_arena;
Turn_errors_to_warnings_handler Suppress_errors;
- int error;
bool handler_pushed= 0, update_all_columns= 1;
DBUG_ASSERT(vfield);
if (h->keyread_enabled())
DBUG_RETURN(0);
- error= 0;
in_use->set_n_backup_active_arena(expr_arena, &backup_arena);
/* When reading or deleting row, ignore errors from virtual columns */
@@ -8542,7 +8553,7 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
}
/* Iterate over virtual fields in the table */
- for (vfield_ptr= vfield; *vfield_ptr; vfield_ptr++)
+ for (vfield_ptr= vfield; *vfield_ptr ; vfield_ptr++)
{
vf= (*vfield_ptr);
Virtual_column_info *vcol_info= vf->vcol_info;
@@ -8593,8 +8604,7 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
int field_error __attribute__((unused)) = 0;
/* Compute the actual value of the virtual fields */
DBUG_FIX_WRITE_SET(vf);
- if (vcol_info->expr->save_in_field(vf, 0))
- field_error= error= 1;
+ field_error= vcol_info->expr->save_in_field(vf, 0);
DBUG_RESTORE_WRITE_SET(vf);
DBUG_PRINT("info", ("field '%s' - updated error: %d",
vf->field_name.str, field_error));
diff --git a/sql/xa.cc b/sql/xa.cc
index e8e6dc43c56..15833377fb6 100644
--- a/sql/xa.cc
+++ b/sql/xa.cc
@@ -689,7 +689,7 @@ bool trans_xa_commit(THD *thd)
{
DEBUG_SYNC(thd, "trans_xa_commit_after_acquire_commit_lock");
- res= MY_TEST(ha_commit_one_phase(thd, 1, 1));
+ res= MY_TEST(ha_commit_one_phase(thd, 1));
if (res)
my_error(ER_XAER_RMERR, MYF(0));
else
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 3b28724c948..9ee2342420b 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -1913,7 +1913,6 @@ func_exit:
void
btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch)
{
- btr_search_sys_t::partition* part;
buf_block_t* block;
dict_index_t* index;
const rec_t* rec;
@@ -1982,6 +1981,8 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch)
n_bytes, index->id);
}
+ btr_search_sys_t::partition* const part
+ = btr_search_sys.get_part(*index);
bool locked = false;
if (!page_rec_is_infimum(rec) && !rec_is_metadata(rec, *index)) {
@@ -1998,7 +1999,6 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch)
goto function_exit;
}
- part = btr_search_sys.get_part(*index);
ha_insert_for_fold(&part->table, part->heap,
ins_fold, block, ins_rec);
MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED);
@@ -2016,7 +2016,6 @@ btr_search_update_hash_on_insert(btr_cur_t* cursor, rw_lock_t* ahi_latch)
if (!btr_search_enabled || !block->index) {
goto function_exit;
}
- part = btr_search_sys.get_part(*index);
}
if (!left_side) {
@@ -2040,7 +2039,6 @@ check_next_rec:
if (!btr_search_enabled || !block->index) {
goto function_exit;
}
- part = btr_search_sys.get_part(*index);
}
ha_insert_for_fold(&part->table, part->heap,
@@ -2059,7 +2057,6 @@ check_next_rec:
if (!btr_search_enabled || !block->index) {
goto function_exit;
}
- part = btr_search_sys.get_part(*index);
}
if (!left_side) {
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 75a7238c1df..649051da305 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1907,8 +1907,14 @@ bool row_ins_foreign_index_entry(dict_foreign_t *foreign,
{
for (ulint j= 0; j < index->n_fields; j++)
{
- const char *col_name= dict_table_get_col_name(
- index->table, dict_index_get_nth_col_no(index, j));
+ const dict_col_t *col= dict_index_get_nth_col(index, j);
+
+ /* A clustered index may contain instantly dropped columns,
+ which must be skipped. */
+ if (col->is_dropped())
+ continue;
+
+ const char *col_name= dict_table_get_col_name(index->table, col->ind);
if (0 == innobase_strcasecmp(col_name, foreign->foreign_col_names[i]))
{
dfield_copy(&ref_entry->fields[i], &entry->fields[j]);
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 3c43595533f..5f195a9eb8e 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -1025,7 +1025,7 @@ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_CAN_VIRTUAL_COLUMNS | HA_CAN_EXPORT |
HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT |
HA_CAN_TABLES_WITHOUT_ROLLBACK),
-can_enable_indexes(1), bulk_insert_single_undo(BULK_INSERT_NONE)
+can_enable_indexes(0), bulk_insert_single_undo(BULK_INSERT_NONE)
{}
@@ -2103,6 +2103,7 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
DBUG_ENTER("ha_maria::start_bulk_insert");
THD *thd= table->in_use;
MARIA_SHARE *share= file->s;
+ bool index_disabled= 0;
DBUG_PRINT("info", ("start_bulk_insert: rows %lu", (ulong) rows));
/* don't enable row cache if too few rows */
@@ -2166,6 +2167,7 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
{
/* Internal table; If we get a duplicate something is very wrong */
file->update|= HA_STATE_CHANGED;
+ index_disabled= share->base.keys > 0;
maria_clear_all_keys_active(file->s->state.key_map);
}
else
@@ -2193,6 +2195,7 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
table->key_info[i].algorithm != HA_KEY_ALG_LONG_HASH)
{
maria_clear_key_active(share->state.key_map, i);
+ index_disabled= 1;
file->update|= HA_STATE_CHANGED;
file->create_unique_index_by_sort= all_keys;
}
@@ -2222,6 +2225,7 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
rows);
}
}
+ can_enable_indexes= index_disabled;
DBUG_VOID_RETURN;
}
@@ -2260,7 +2264,6 @@ int ha_maria::end_bulk_insert()
if (bulk_insert_single_undo != BULK_INSERT_NONE)
{
- DBUG_ASSERT(can_enable_indexes);
/*
Table was transactional just before start_bulk_insert().
No need to flush pages if we did a repair (which already flushed).
@@ -2271,6 +2274,7 @@ int ha_maria::end_bulk_insert()
first_error= first_error ? first_error : error;
bulk_insert_single_undo= BULK_INSERT_NONE; // Safety
}
+ can_enable_indexes= 0;
DBUG_RETURN(first_error);
}
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 45865709cd3..2b390c6c267 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -2560,6 +2560,9 @@ static int maria_drop_all_indexes(HA_CHECK *param, MARIA_HA *info,
DBUG_PRINT("repair", ("declared all indexes disabled"));
}
+ /* Flush obsolete index data from key cache */
+ _ma_flush_table_files(info, MARIA_FLUSH_INDEX,
+ FLUSH_IGNORE_CHANGED, FLUSH_IGNORE_CHANGED);
/* Clear index root block pointers. */
for (i= 0; i < share->base.keys; i++)
state->key_root[i]= HA_OFFSET_ERROR;
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 92fb49bea8d..b3f84f5eefa 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -688,6 +688,8 @@ my_bool mi_killed_in_mariadb(MI_INFO *info)
static int compute_vcols(MI_INFO *info, uchar *record, int keynum)
{
+ /* This mutex is needed for parallel repair */
+ mysql_mutex_lock(&info->s->intern_lock);
TABLE *table= (TABLE*)(info->external_ref);
table->move_fields(table->field, record, table->field[0]->record_ptr());
if (keynum == -1) // update all vcols
@@ -695,6 +697,7 @@ static int compute_vcols(MI_INFO *info, uchar *record, int keynum)
int error= table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_READ);
if (table->update_virtual_fields(table->file, VCOL_UPDATE_INDEXED))
error= 1;
+ mysql_mutex_unlock(&info->s->intern_lock);
return error;
}
// update only one key
@@ -703,9 +706,10 @@ static int compute_vcols(MI_INFO *info, uchar *record, int keynum)
for (; kp < end; kp++)
{
Field *f= table->field[kp->fieldnr - 1];
- if (f->vcol_info)
+ if (f->vcol_info && !f->vcol_info->stored_in_db)
table->update_virtual_field(f);
}
+ mysql_mutex_unlock(&info->s->intern_lock);
return 0;
}
@@ -722,7 +726,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_REPAIR |
HA_CAN_TABLES_WITHOUT_ROLLBACK),
- can_enable_indexes(1)
+ can_enable_indexes(0)
{}
handler *ha_myisam::clone(const char *name __attribute__((unused)),
@@ -956,7 +960,7 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
if (!table->vfield)
return;
- if (file->s->base.reclength == file->s->vreclength)
+ if (file->s->base.reclength == file->s->vreclength)
{
bool indexed_vcols= false;
ulong new_vreclength= file->s->vreclength;
@@ -964,7 +968,8 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
{
if (!(*vf)->stored_in_db())
{
- uint vf_end= (*vf)->offset(table->record[0]) + (*vf)->pack_length_in_rec();
+ uint vf_end= ((*vf)->offset(table->record[0]) +
+ (*vf)->pack_length_in_rec());
set_if_bigger(new_vreclength, vf_end);
indexed_vcols|= ((*vf)->flags & PART_KEY_FLAG) != 0;
}
@@ -982,7 +987,8 @@ void ha_myisam::restore_vcos_after_repair()
{
if (file->s->base.reclength < file->s->vreclength)
{
- table->move_fields(table->field, table->record[0], table->field[0]->record_ptr());
+ table->move_fields(table->field, table->record[0],
+ table->field[0]->record_ptr());
table->default_column_bitmaps();
}
}
@@ -1723,6 +1729,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows, uint flags)
THD *thd= table->in_use;
ulong size= MY_MIN(thd->variables.read_buff_size,
(ulong) (table->s->avg_row_length*rows));
+ bool index_disabled= 0;
DBUG_PRINT("info",("start_bulk_insert: rows %lu size %lu",
(ulong) rows, size));
@@ -1746,6 +1753,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows, uint flags)
if (file->open_flag & HA_OPEN_INTERNAL_TABLE)
{
file->update|= HA_STATE_CHANGED;
+ index_disabled= file->s->base.keys > 0;
mi_clear_all_keys_active(file->s->state.key_map);
}
else
@@ -1776,6 +1784,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows, uint flags)
table->key_info[i].algorithm != HA_KEY_ALG_LONG_HASH)
{
mi_clear_key_active(share->state.key_map, i);
+ index_disabled= 1;
file->update|= HA_STATE_CHANGED;
file->create_unique_index_by_sort= all_keys;
}
@@ -1783,12 +1792,15 @@ void ha_myisam::start_bulk_insert(ha_rows rows, uint flags)
}
}
else
+ {
if (!file->bulk_insert &&
(!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
{
mi_init_bulk_insert(file, (size_t) thd->variables.bulk_insert_buff_size,
rows);
}
+ }
+ can_enable_indexes= index_disabled;
DBUG_VOID_RETURN;
}
@@ -1840,6 +1852,7 @@ int ha_myisam::end_bulk_insert()
file->s->state.changed&= ~(STATE_CRASHED|STATE_CRASHED_ON_REPAIR);
}
}
+ can_enable_indexes= 0;
}
DBUG_PRINT("exit", ("first_error: %d", first_error));
DBUG_RETURN(first_error);
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index e7a218bdc47..b84c91efe5f 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -406,7 +406,9 @@ my_copy_fix_mb(CHARSET_INFO *cs,
well_formed_nchars= my_ci_well_formed_char_length(cs, src, src + src_length,
nchars, status);
DBUG_ASSERT(well_formed_nchars <= nchars);
- memmove(dst, src, (well_formed_length= status->m_source_end_pos - src));
+ well_formed_length= status->m_source_end_pos - src;
+ if (well_formed_length)
+ memmove(dst, src, well_formed_length);
if (!status->m_well_formed_error_pos)
return well_formed_length;
diff --git a/tests/drop_test.pl b/tests/drop_test.pl
index c132c207811..e9b796bd4e5 100755
--- a/tests/drop_test.pl
+++ b/tests/drop_test.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2000 MySQL AB
# Use is subject to license terms
diff --git a/tests/fork2_test.pl b/tests/fork2_test.pl
index a05a9b96679..55e494dcedc 100755
--- a/tests/fork2_test.pl
+++ b/tests/fork2_test.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2000, 2001 MySQL AB
# Use is subject to license terms
diff --git a/tests/fork_big.pl b/tests/fork_big.pl
index a08044efbd8..157ffc35aef 100755
--- a/tests/fork_big.pl
+++ b/tests/fork_big.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
use strict;
# Copyright (c) 2001, 2006 MySQL AB
diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl
index a90af381376..bb98b8c8577 100644
--- a/tests/fork_big2.pl
+++ b/tests/fork_big2.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (c) 2002, 2003, 2005, 2006 MySQL AB
# Use is subject to license terms
diff --git a/tests/index_corrupt.pl b/tests/index_corrupt.pl
index dad288d71de..275747d86f8 100755
--- a/tests/index_corrupt.pl
+++ b/tests/index_corrupt.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2005 MySQL AB
# Use is subject to license terms
diff --git a/tests/insert_and_repair.pl b/tests/insert_and_repair.pl
index f70bc75fb9a..35ecd52aa2c 100755
--- a/tests/insert_and_repair.pl
+++ b/tests/insert_and_repair.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2000, 2001 MySQL AB
# Use is subject to license terms
diff --git a/tests/mail_to_db.pl b/tests/mail_to_db.pl
index 0dd0fe751aa..b160582d4be 100755
--- a/tests/mail_to_db.pl
+++ b/tests/mail_to_db.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright Abandoned 1998 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
#
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 6a6f626ae8c..99ae72b2417 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -8615,7 +8615,8 @@ static void test_mem_overun()
char buffer[10000], field[10];
MYSQL_STMT *stmt;
MYSQL_RES *field_res;
- int rc, i, length;
+ int rc, length;
+ unsigned i;
myheader("test_mem_overun");
@@ -8629,7 +8630,7 @@ static void test_mem_overun()
strxmov(buffer, "create table t_mem_overun(", NullS);
for (i= 0; i < 1000; i++)
{
- sprintf(field, "c%d int", i);
+ sprintf(field, "c%u int", i);
strxmov(buffer, buffer, field, ", ", NullS);
}
length= strlen(buffer);
diff --git a/tests/pmail.pl b/tests/pmail.pl
index ef654d99770..441051dee05 100755
--- a/tests/pmail.pl
+++ b/tests/pmail.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2000, 2005 MySQL AB
# Use is subject to license terms
diff --git a/tests/rename_test.pl b/tests/rename_test.pl
index eef8af642ab..25bc2a3e6aa 100755
--- a/tests/rename_test.pl
+++ b/tests/rename_test.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2000, 2001 MySQL AB
# Use is subject to license terms
diff --git a/tests/test_delayed_insert.pl b/tests/test_delayed_insert.pl
index 8a8028be7ef..fdcd10e8468 100755
--- a/tests/test_delayed_insert.pl
+++ b/tests/test_delayed_insert.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2000, 2001 MySQL AB
# Use is subject to license terms
diff --git a/tests/truncate.pl b/tests/truncate.pl
index 84381187aa7..d79167dd1b2 100755
--- a/tests/truncate.pl
+++ b/tests/truncate.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# Copyright (C) 2002 MySQL AB
# Use is subject to license terms