mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge 10.9 into 10.10
This commit is contained in:
6
debian/autobake-deb.sh
vendored
6
debian/autobake-deb.sh
vendored
@@ -241,7 +241,11 @@ then
|
|||||||
for package in *.deb
|
for package in *.deb
|
||||||
do
|
do
|
||||||
echo "$package" | cut -d '_' -f 1
|
echo "$package" | cut -d '_' -f 1
|
||||||
dpkg-deb -c "$package" | awk '{print $1 " " $2 " " $6 " " $7 " " $8}' | sort -k 3
|
# shellcheck disable=SC2034
|
||||||
|
dpkg-deb -c "$package" | while IFS=" " read -r col1 col2 col3 col4 col5 col6 col7 col8
|
||||||
|
do
|
||||||
|
echo "$col1 $col2 $col6 $col7 $col8" | sort -k 3
|
||||||
|
done
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
5
debian/mariadb-server.mariadb.init
vendored
5
debian/mariadb-server.mariadb.init
vendored
@@ -84,7 +84,10 @@ sanity_checks() {
|
|||||||
|
|
||||||
# check for diskspace shortage
|
# check for diskspace shortage
|
||||||
datadir=`mariadbd_get_param datadir`
|
datadir=`mariadbd_get_param datadir`
|
||||||
if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
|
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
|
||||||
|
# 4096 blocks is then lower than 4 MB
|
||||||
|
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
|
||||||
|
if [ "$df_available_blocks" -lt "4096" ]; then
|
||||||
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
|
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
|
||||||
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
|
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
|
||||||
exit 1
|
exit 1
|
||||||
|
6
debian/mariadb-server.preinst
vendored
6
debian/mariadb-server.preinst
vendored
@@ -208,8 +208,10 @@ if [ ! -d $mysql_datadir ] && [ ! -L $mysql_datadir ]; then
|
|||||||
mkdir -Z $mysql_datadir
|
mkdir -Z $mysql_datadir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# checking disc space
|
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
|
||||||
if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
|
# 4096 blocks is then lower than 4 MB
|
||||||
|
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
|
||||||
|
if [ "$df_available_blocks" -lt "4096" ]; then
|
||||||
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
|
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
|
||||||
db_stop
|
db_stop
|
||||||
exit 1
|
exit 1
|
||||||
|
4
debian/mariadb-test.install
vendored
4
debian/mariadb-test.install
vendored
@@ -41,7 +41,11 @@ usr/share/mysql/mysql-test/README.stress
|
|||||||
usr/share/mysql/mysql-test/dgcov.pl
|
usr/share/mysql/mysql-test/dgcov.pl
|
||||||
usr/share/mysql/mysql-test/lib
|
usr/share/mysql/mysql-test/lib
|
||||||
usr/share/mysql/mysql-test/mariadb-stress-test.pl
|
usr/share/mysql/mysql-test/mariadb-stress-test.pl
|
||||||
|
usr/share/mysql/mysql-test/mariadb-test-run
|
||||||
usr/share/mysql/mysql-test/mariadb-test-run.pl
|
usr/share/mysql/mysql-test/mariadb-test-run.pl
|
||||||
|
usr/share/mysql/mysql-test/mtr
|
||||||
|
usr/share/mysql/mysql-test/mysql-test-run
|
||||||
|
usr/share/mysql/mysql-test/mysql-test-run.pl
|
||||||
usr/share/mysql/mysql-test/purify.supp
|
usr/share/mysql/mysql-test/purify.supp
|
||||||
usr/share/mysql/mysql-test/suite.pm
|
usr/share/mysql/mysql-test/suite.pm
|
||||||
usr/share/mysql/mysql-test/valgrind.supp
|
usr/share/mysql/mysql-test/valgrind.supp
|
||||||
|
1
debian/mariadb-test.links
vendored
1
debian/mariadb-test.links
vendored
@@ -1 +0,0 @@
|
|||||||
usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl
|
|
@@ -575,6 +575,8 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
|||||||
if (ho_error != 0)
|
if (ho_error != 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
my_timer_init(&sys_timer_info);
|
||||||
|
|
||||||
if (init_common_variables())
|
if (init_common_variables())
|
||||||
{
|
{
|
||||||
mysql_server_end();
|
mysql_server_end();
|
||||||
|
11
mysql-test/main/analyze_format_json_emb.result
Normal file
11
mysql-test/main/analyze_format_json_emb.result
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve
|
||||||
|
#
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 values (0),(0);
|
||||||
|
set @js='$out';
|
||||||
|
set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms'));
|
||||||
|
select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
|
||||||
|
cast(json_extract(@out,'$[0]') as DOUBLE) > 0
|
||||||
|
1
|
||||||
|
drop table t1;
|
18
mysql-test/main/analyze_format_json_emb.test
Normal file
18
mysql-test/main/analyze_format_json_emb.test
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
--source include/is_embedded.inc
|
||||||
|
--source include/big_test.inc
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve
|
||||||
|
--echo #
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 values (0),(0);
|
||||||
|
let $out=`
|
||||||
|
analyze format=json select sleep(1+a) from t1
|
||||||
|
`;
|
||||||
|
|
||||||
|
evalp set @js='$out';
|
||||||
|
set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms'));
|
||||||
|
select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
@@ -20696,6 +20696,97 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary
|
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-31102: execution of PS for query where pushdown of condition
|
||||||
|
# into view defined as union is applied
|
||||||
|
#
|
||||||
|
create table t1 (
|
||||||
|
n int,
|
||||||
|
lv varchar(31) charset latin1,
|
||||||
|
mv varchar(31) charset utf8mb3
|
||||||
|
) engine=myisam;
|
||||||
|
insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz');
|
||||||
|
create view v1 as
|
||||||
|
select case when n=1 then lv when n=2 then mv else NULL end as r from t1
|
||||||
|
union
|
||||||
|
select 'a';
|
||||||
|
select * from v1 where r < 'x';
|
||||||
|
r
|
||||||
|
aa
|
||||||
|
a
|
||||||
|
explain extended select * from v1 where r < 'x';
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||||
|
2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||||
|
3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
|
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
|
||||||
|
Warnings:
|
||||||
|
Note 1003 /* select#1 */ select `v1`.`r` AS `r` from `test`.`v1` where `v1`.`r` < 'x'
|
||||||
|
explain format=json select * from v1 where r < 'x';
|
||||||
|
EXPLAIN
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 1,
|
||||||
|
"nested_loop": [
|
||||||
|
{
|
||||||
|
"table": {
|
||||||
|
"table_name": "<derived2>",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 3,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "v1.r < 'x'",
|
||||||
|
"materialized": {
|
||||||
|
"query_block": {
|
||||||
|
"union_result": {
|
||||||
|
"table_name": "<union2,3>",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"query_specifications": [
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 2,
|
||||||
|
"nested_loop": [
|
||||||
|
{
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 3,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8mb3) when t1.n = 2 then t1.mv else NULL end < 'x'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 3,
|
||||||
|
"operation": "UNION",
|
||||||
|
"table": {
|
||||||
|
"message": "No tables used"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prepare stmt from "select * from v1 where r < 'x'";
|
||||||
|
execute stmt;
|
||||||
|
r
|
||||||
|
aa
|
||||||
|
a
|
||||||
|
execute stmt;
|
||||||
|
r
|
||||||
|
aa
|
||||||
|
a
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
# End of 10.4 tests
|
# End of 10.4 tests
|
||||||
#
|
#
|
||||||
# MDEV-28958: condition pushable into view after simplification
|
# MDEV-28958: condition pushable into view after simplification
|
||||||
|
@@ -3943,6 +3943,36 @@ explain select * from v1;
|
|||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-31102: execution of PS for query where pushdown of condition
|
||||||
|
--echo # into view defined as union is applied
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
create table t1 (
|
||||||
|
n int,
|
||||||
|
lv varchar(31) charset latin1,
|
||||||
|
mv varchar(31) charset utf8mb3
|
||||||
|
) engine=myisam;
|
||||||
|
insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz');
|
||||||
|
create view v1 as
|
||||||
|
select case when n=1 then lv when n=2 then mv else NULL end as r from t1
|
||||||
|
union
|
||||||
|
select 'a';
|
||||||
|
|
||||||
|
let $q=
|
||||||
|
select * from v1 where r < 'x';
|
||||||
|
|
||||||
|
eval $q;
|
||||||
|
eval explain extended $q;
|
||||||
|
eval explain format=json $q;
|
||||||
|
eval prepare stmt from "$q";
|
||||||
|
execute stmt;
|
||||||
|
execute stmt;
|
||||||
|
deallocate prepare stmt;
|
||||||
|
|
||||||
|
drop view v1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo # End of 10.4 tests
|
--echo # End of 10.4 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
--- a/mysql-test/r/mysqld--help.result
|
@@ -180,6 +180,7 @@
|
||||||
+++ b/mysql-test/r/mysqld--help.result
|
--console Write error output on screen; don't remove the console
|
||||||
@@ -647,6 +646,7 @@
|
window on windows.
|
||||||
|
--core-file Write core on crashes
|
||||||
|
+ (Defaults to on; use --skip-core-file to disable.)
|
||||||
|
-h, --datadir=name Path to the database root directory
|
||||||
|
--date-format=name The DATE format (ignored)
|
||||||
|
--datetime-format=name
|
||||||
|
@@ -650,6 +651,7 @@
|
||||||
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
|
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
|
||||||
DATETIME, TIMESTAMP columns.
|
DATETIME, TIMESTAMP columns.
|
||||||
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
|
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
|
||||||
@@ -8,7 +14,7 @@
|
|||||||
--net-buffer-length=#
|
--net-buffer-length=#
|
||||||
Buffer length for TCP/IP and socket communication
|
Buffer length for TCP/IP and socket communication
|
||||||
--net-read-timeout=#
|
--net-read-timeout=#
|
||||||
@@ -1236,6 +1236,10 @@
|
@@ -1281,6 +1283,10 @@
|
||||||
Log slow queries to given log file. Defaults logging to
|
Log slow queries to given log file. Defaults logging to
|
||||||
'hostname'-slow.log. Must be enabled to activate other
|
'hostname'-slow.log. Must be enabled to activate other
|
||||||
slow log options
|
slow log options
|
||||||
@@ -19,7 +25,7 @@
|
|||||||
--socket=name Socket file to use for connection
|
--socket=name Socket file to use for connection
|
||||||
--sort-buffer-size=#
|
--sort-buffer-size=#
|
||||||
Each thread that needs to do a sort allocates a buffer of
|
Each thread that needs to do a sort allocates a buffer of
|
||||||
@@ -1260,6 +1264,7 @@
|
@@ -1305,6 +1311,7 @@
|
||||||
deleting or updating every row in a table.
|
deleting or updating every row in a table.
|
||||||
--stack-trace Print a symbolic stack trace on failure
|
--stack-trace Print a symbolic stack trace on failure
|
||||||
(Defaults to on; use --skip-stack-trace to disable.)
|
(Defaults to on; use --skip-stack-trace to disable.)
|
||||||
@@ -27,7 +33,7 @@
|
|||||||
--standard-compliant-cte
|
--standard-compliant-cte
|
||||||
Allow only CTEs compliant to SQL standard
|
Allow only CTEs compliant to SQL standard
|
||||||
(Defaults to on; use --skip-standard-compliant-cte to disable.)
|
(Defaults to on; use --skip-standard-compliant-cte to disable.)
|
||||||
@@ -1330,6 +1335,11 @@
|
@@ -1380,6 +1387,11 @@
|
||||||
--thread-pool-max-threads=#
|
--thread-pool-max-threads=#
|
||||||
Maximum allowed number of worker threads in the thread
|
Maximum allowed number of worker threads in the thread
|
||||||
pool
|
pool
|
||||||
@@ -39,7 +45,7 @@
|
|||||||
--thread-pool-oversubscribe=#
|
--thread-pool-oversubscribe=#
|
||||||
How many additional active worker threads in a group are
|
How many additional active worker threads in a group are
|
||||||
allowed.
|
allowed.
|
||||||
@@ -1370,8 +1380,8 @@
|
@@ -1418,8 +1430,8 @@
|
||||||
automatically convert it to an on-disk MyISAM or Aria
|
automatically convert it to an on-disk MyISAM or Aria
|
||||||
table.
|
table.
|
||||||
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
|
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
|
||||||
@@ -50,7 +56,7 @@
|
|||||||
--transaction-alloc-block-size=#
|
--transaction-alloc-block-size=#
|
||||||
Allocation block size for transactions to be stored in
|
Allocation block size for transactions to be stored in
|
||||||
binary log
|
binary log
|
||||||
@@ -1587,6 +1596,7 @@
|
@@ -1634,6 +1646,7 @@
|
||||||
myisam-stats-method NULLS_UNEQUAL
|
myisam-stats-method NULLS_UNEQUAL
|
||||||
myisam-use-mmap FALSE
|
myisam-use-mmap FALSE
|
||||||
mysql56-temporal-format TRUE
|
mysql56-temporal-format TRUE
|
||||||
@@ -58,7 +64,7 @@
|
|||||||
net-buffer-length 16384
|
net-buffer-length 16384
|
||||||
net-read-timeout 30
|
net-read-timeout 30
|
||||||
net-retry-count 10
|
net-retry-count 10
|
||||||
@@ -1726,6 +1736,7 @@
|
@@ -1788,6 +1801,7 @@
|
||||||
slave-type-conversions
|
slave-type-conversions
|
||||||
slow-launch-time 2
|
slow-launch-time 2
|
||||||
slow-query-log FALSE
|
slow-query-log FALSE
|
||||||
@@ -66,8 +72,8 @@
|
|||||||
sort-buffer-size 2097152
|
sort-buffer-size 2097152
|
||||||
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||||
sql-safe-updates FALSE
|
sql-safe-updates FALSE
|
||||||
@@ -1753,6 +1764,8 @@
|
@@ -1814,6 +1828,8 @@
|
||||||
thread-cache-size 151
|
thread-pool-exact-stats FALSE
|
||||||
thread-pool-idle-timeout 60
|
thread-pool-idle-timeout 60
|
||||||
thread-pool-max-threads 65536
|
thread-pool-max-threads 65536
|
||||||
+thread-pool-min-threads 1
|
+thread-pool-min-threads 1
|
||||||
|
@@ -189,7 +189,7 @@ The following specify which files/extra groups are read (specified before remain
|
|||||||
ALWAYS
|
ALWAYS
|
||||||
--console Write error output on screen; don't remove the console
|
--console Write error output on screen; don't remove the console
|
||||||
window on windows.
|
window on windows.
|
||||||
--core-file Write core on errors.
|
--core-file Write core on crashes
|
||||||
-h, --datadir=name Path to the database root directory
|
-h, --datadir=name Path to the database root directory
|
||||||
--date-format=name The DATE format (ignored)
|
--date-format=name The DATE format (ignored)
|
||||||
--datetime-format=name
|
--datetime-format=name
|
||||||
@@ -1523,6 +1523,7 @@ column-compression-zlib-wrap FALSE
|
|||||||
completion-type NO_CHAIN
|
completion-type NO_CHAIN
|
||||||
concurrent-insert AUTO
|
concurrent-insert AUTO
|
||||||
console TRUE
|
console TRUE
|
||||||
|
core-file TRUE
|
||||||
date-format %Y-%m-%d
|
date-format %Y-%m-%d
|
||||||
datetime-format %Y-%m-%d %H:%i:%s
|
datetime-format %Y-%m-%d %H:%i:%s
|
||||||
deadlock-search-depth-long 15
|
deadlock-search-depth-long 15
|
||||||
|
@@ -9,6 +9,7 @@ include/start_slave.inc
|
|||||||
connection server_1;
|
connection server_1;
|
||||||
connection server_2;
|
connection server_2;
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
|
CHANGE MASTER TO MASTER_USE_GTID=NO;
|
||||||
#####################################################
|
#####################################################
|
||||||
# Part 1: unencrypted master
|
# Part 1: unencrypted master
|
||||||
#####################################################
|
#####################################################
|
@@ -1,14 +1,19 @@
|
|||||||
#
|
#
|
||||||
# TODO: write here what the test checks after MDEV-11288 is fixed
|
# The test starts with unencrypted master.
|
||||||
#
|
|
||||||
# The test starts with unencrypted master.
|
|
||||||
# It stops replication, generates a few statement and row events
|
# It stops replication, generates a few statement and row events
|
||||||
# on the master, then restarts the server with encrypted binlog,
|
# on the master, then restarts the server with encrypted binlog,
|
||||||
# generates some more events and restarts it back without encryption
|
# generates some more events and restarts it back without encryption
|
||||||
# (no encryption plugin).
|
# (no encryption plugin).
|
||||||
# Then it resumes replication and checks what happens when the server
|
# Then it resumes replication and should error with
|
||||||
# tries to feed the binary logs (included the encrypted ones)
|
# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is
|
||||||
# to the slave.
|
# sent and unable to be decrypted.
|
||||||
|
#
|
||||||
|
# Note this variation of encrypted_master_switch_to_unencrypted tests
|
||||||
|
# using MASTER_USE_GTID=NO. In contrast to the GTID variant of this
|
||||||
|
# test, at part 3 (the error case), the master will scan binlogs
|
||||||
|
# starting from the first one (which is unencrypted initially, so
|
||||||
|
# replication is okay) and continue until the slave encounters the
|
||||||
|
# first encrypted event, which causes the slave to error.
|
||||||
#
|
#
|
||||||
|
|
||||||
--source include/have_binlog_format_mixed.inc
|
--source include/have_binlog_format_mixed.inc
|
||||||
@@ -34,6 +39,7 @@ CHANGE MASTER TO MASTER_USE_GTID=NO;
|
|||||||
--connection server_2
|
--connection server_2
|
||||||
--disable_connect_log
|
--disable_connect_log
|
||||||
--source include/stop_slave.inc
|
--source include/stop_slave.inc
|
||||||
|
CHANGE MASTER TO MASTER_USE_GTID=NO;
|
||||||
--enable_connect_log
|
--enable_connect_log
|
||||||
|
|
||||||
--echo #####################################################
|
--echo #####################################################
|
||||||
@@ -48,7 +54,7 @@ CREATE TABLE table1_no_encryption (
|
|||||||
pk INT AUTO_INCREMENT PRIMARY KEY,
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
ts TIMESTAMP NULL,
|
ts TIMESTAMP NULL,
|
||||||
b BLOB
|
b BLOB
|
||||||
) ENGINE=MyISAM;
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
||||||
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
@@ -81,7 +87,7 @@ CREATE TABLE table2_to_encrypt (
|
|||||||
pk INT AUTO_INCREMENT PRIMARY KEY,
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
ts TIMESTAMP NULL,
|
ts TIMESTAMP NULL,
|
||||||
b BLOB
|
b BLOB
|
||||||
) ENGINE=MyISAM;
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
|
INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
|
||||||
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
@@ -108,7 +114,7 @@ CREATE TABLE table3_no_encryption (
|
|||||||
pk INT AUTO_INCREMENT PRIMARY KEY,
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
ts TIMESTAMP NULL,
|
ts TIMESTAMP NULL,
|
||||||
b BLOB
|
b BLOB
|
||||||
) ENGINE=MyISAM;
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
||||||
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
||||||
@@ -120,7 +126,7 @@ INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
|||||||
|
|
||||||
--connection server_2
|
--connection server_2
|
||||||
start slave;
|
start slave;
|
||||||
# The slave should be able to synchronize with master up to
|
# The slave should be able to synchronize with master up to
|
||||||
# the previously saved position (when the log was still unencrypted)
|
# the previously saved position (when the log was still unencrypted)
|
||||||
--sync_with_master
|
--sync_with_master
|
||||||
|
|
@@ -0,0 +1,8 @@
|
|||||||
|
!include my.cnf
|
||||||
|
|
||||||
|
[mysqld.1]
|
||||||
|
encrypt-binlog=0
|
||||||
|
skip-file-key-management
|
||||||
|
|
||||||
|
[mysqld.2]
|
||||||
|
gtid-domain-id=1
|
@@ -0,0 +1,84 @@
|
|||||||
|
#################
|
||||||
|
# Initialization
|
||||||
|
#################
|
||||||
|
include/rpl_init.inc [topology=1->2]
|
||||||
|
connection server_2;
|
||||||
|
include/stop_slave.inc
|
||||||
|
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
|
||||||
|
call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
|
||||||
|
#####################################################
|
||||||
|
# Part 1: unencrypted master
|
||||||
|
#####################################################
|
||||||
|
connection server_1;
|
||||||
|
CREATE TABLE table1_no_encryption (
|
||||||
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
ts TIMESTAMP NULL,
|
||||||
|
b BLOB
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
||||||
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
|
FLUSH BINARY LOGS;
|
||||||
|
SET binlog_format=ROW;
|
||||||
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
|
NOT FOUND /table1_no_encryption/ in master-bin.0*
|
||||||
|
#####################################################
|
||||||
|
# Part 2: restart master, now with binlog encryption
|
||||||
|
#####################################################
|
||||||
|
connection default;
|
||||||
|
connection server_1;
|
||||||
|
CREATE TABLE table2_to_encrypt (
|
||||||
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
ts TIMESTAMP NULL,
|
||||||
|
b BLOB
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
|
||||||
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
|
FLUSH BINARY LOGS;
|
||||||
|
SET binlog_format=ROW;
|
||||||
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
|
NOT FOUND /table2_to_encrypt/ in master-bin.0*
|
||||||
|
#####################################################
|
||||||
|
# Part 3: restart master again without encryption
|
||||||
|
#####################################################
|
||||||
|
connection default;
|
||||||
|
connection server_1;
|
||||||
|
CREATE TABLE table3_no_encryption (
|
||||||
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
ts TIMESTAMP NULL,
|
||||||
|
b BLOB
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
||||||
|
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
||||||
|
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
||||||
|
#####################################################
|
||||||
|
# Check: resume replication and check how it goes
|
||||||
|
#####################################################
|
||||||
|
connection server_2;
|
||||||
|
start slave;
|
||||||
|
include/wait_for_slave_io_error.inc [errno=1236]
|
||||||
|
# Ensuring slave was unable to replicate any transactions..
|
||||||
|
# ..success
|
||||||
|
SHOW TABLES;
|
||||||
|
Tables_in_test
|
||||||
|
include/stop_slave.inc
|
||||||
|
reset slave;
|
||||||
|
##########
|
||||||
|
# Cleanup
|
||||||
|
##########
|
||||||
|
connection server_1;
|
||||||
|
reset master;
|
||||||
|
SELECT COUNT(*) FROM table1_no_encryption;
|
||||||
|
COUNT(*)
|
||||||
|
8
|
||||||
|
SELECT COUNT(*) FROM table2_to_encrypt;
|
||||||
|
COUNT(*)
|
||||||
|
8
|
||||||
|
SELECT COUNT(*) FROM table3_no_encryption;
|
||||||
|
COUNT(*)
|
||||||
|
4
|
||||||
|
DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
|
||||||
|
connection server_2;
|
||||||
|
include/start_slave.inc
|
||||||
|
include/rpl_end.inc
|
@@ -0,0 +1,154 @@
|
|||||||
|
#
|
||||||
|
# The test starts with unencrypted master.
|
||||||
|
# It stops replication, generates a few statement and row events
|
||||||
|
# on the master, then restarts the server with encrypted binlog,
|
||||||
|
# generates some more events and restarts it back without encryption
|
||||||
|
# (no encryption plugin).
|
||||||
|
# Then it resumes replication and should error with
|
||||||
|
# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is
|
||||||
|
# sent and unable to be decrypted.
|
||||||
|
#
|
||||||
|
# Note this variation of encrypted_master_switch_to_unencrypted tests
|
||||||
|
# using MASTER_USE_GTID=SLAVE_POS. encrypted_master_switch_to_unencrypted
|
||||||
|
# was the original test which only used binlog coordinates. When tested
|
||||||
|
# using MASTER_USE_GTID=Slave_Pos, the master optimizes the detection of
|
||||||
|
# an undecryptable binlog. I.e, the master will initially look for a
|
||||||
|
# Gtid_list_log_event, but fail to decrypt it and fail immediately in
|
||||||
|
# part 3.
|
||||||
|
#
|
||||||
|
|
||||||
|
--source include/have_binlog_format_mixed.inc
|
||||||
|
|
||||||
|
--echo #################
|
||||||
|
--echo # Initialization
|
||||||
|
--echo #################
|
||||||
|
|
||||||
|
--let $rpl_topology= 1->2
|
||||||
|
--source include/rpl_init.inc
|
||||||
|
|
||||||
|
--enable_connect_log
|
||||||
|
|
||||||
|
# We stop replication because we want it to happen after the switch
|
||||||
|
|
||||||
|
--connection server_2
|
||||||
|
--disable_connect_log
|
||||||
|
--source include/stop_slave.inc
|
||||||
|
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
|
||||||
|
--enable_connect_log
|
||||||
|
call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
|
||||||
|
|
||||||
|
--echo #####################################################
|
||||||
|
--echo # Part 1: unencrypted master
|
||||||
|
--echo #####################################################
|
||||||
|
|
||||||
|
--connection server_1
|
||||||
|
|
||||||
|
CREATE TABLE table1_no_encryption (
|
||||||
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
ts TIMESTAMP NULL,
|
||||||
|
b BLOB
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
|
INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
||||||
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
|
FLUSH BINARY LOGS;
|
||||||
|
SET binlog_format=ROW;
|
||||||
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
|
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
|
||||||
|
|
||||||
|
# Make sure that binary logs are not encrypted
|
||||||
|
|
||||||
|
--let SEARCH_RANGE = 500000
|
||||||
|
--let SEARCH_FILE= master-bin.0*
|
||||||
|
--let SEARCH_PATTERN= table1_no_encryption
|
||||||
|
--source include/search_pattern_in_file.inc
|
||||||
|
|
||||||
|
--echo #####################################################
|
||||||
|
--echo # Part 2: restart master, now with binlog encryption
|
||||||
|
--echo #####################################################
|
||||||
|
|
||||||
|
--let $rpl_server_parameters= --encrypt-binlog=1 --plugin-load-add=$FILE_KEY_MANAGEMENT_SO --file-key-management --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
|
||||||
|
|
||||||
|
--let $rpl_server_number= 1
|
||||||
|
--source restart_server.inc
|
||||||
|
|
||||||
|
CREATE TABLE table2_to_encrypt (
|
||||||
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
ts TIMESTAMP NULL,
|
||||||
|
b BLOB
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
|
INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
|
||||||
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
|
FLUSH BINARY LOGS;
|
||||||
|
SET binlog_format=ROW;
|
||||||
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
|
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
|
||||||
|
|
||||||
|
# Make sure that binary logs are encrypted
|
||||||
|
|
||||||
|
--let SEARCH_FILE= master-bin.0*
|
||||||
|
--let SEARCH_PATTERN= table2_to_encrypt
|
||||||
|
--source include/search_pattern_in_file.inc
|
||||||
|
|
||||||
|
--echo #####################################################
|
||||||
|
--echo # Part 3: restart master again without encryption
|
||||||
|
--echo #####################################################
|
||||||
|
|
||||||
|
--let $rpl_server_parameters= --encrypt-binlog=0
|
||||||
|
--let $rpl_server_number= 1
|
||||||
|
--source restart_server.inc
|
||||||
|
|
||||||
|
CREATE TABLE table3_no_encryption (
|
||||||
|
pk INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
ts TIMESTAMP NULL,
|
||||||
|
b BLOB
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
|
INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
|
||||||
|
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
||||||
|
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
|
||||||
|
|
||||||
|
--echo #####################################################
|
||||||
|
--echo # Check: resume replication and check how it goes
|
||||||
|
--echo #####################################################
|
||||||
|
|
||||||
|
--connection server_2
|
||||||
|
start slave;
|
||||||
|
# Make slave to try to synchronize. It shouldn't work, the slave IO thread is
|
||||||
|
# expected to abort with an error
|
||||||
|
--let $slave_io_errno= 1236
|
||||||
|
--source include/wait_for_slave_io_error.inc
|
||||||
|
|
||||||
|
--echo # Ensuring slave was unable to replicate any transactions..
|
||||||
|
--let $gsp= `SELECT @@global.gtid_slave_pos`
|
||||||
|
if (`SELECT strcmp("$gsp","")`)
|
||||||
|
{
|
||||||
|
die Slave without encryption configured should fail to read encrypted binlog;
|
||||||
|
}
|
||||||
|
--echo # ..success
|
||||||
|
|
||||||
|
--sorted_result
|
||||||
|
SHOW TABLES;
|
||||||
|
|
||||||
|
--disable_connect_log
|
||||||
|
--source include/stop_slave.inc
|
||||||
|
--enable_connect_log
|
||||||
|
reset slave;
|
||||||
|
|
||||||
|
--echo ##########
|
||||||
|
--echo # Cleanup
|
||||||
|
--echo ##########
|
||||||
|
|
||||||
|
--connection server_1
|
||||||
|
reset master;
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM table1_no_encryption;
|
||||||
|
SELECT COUNT(*) FROM table2_to_encrypt;
|
||||||
|
SELECT COUNT(*) FROM table3_no_encryption;
|
||||||
|
DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
|
||||||
|
|
||||||
|
--connection server_2
|
||||||
|
--disable_connect_log
|
||||||
|
--source include/start_slave.inc
|
||||||
|
--source include/rpl_end.inc
|
@@ -675,13 +675,13 @@ COMMAND_LINE_ARGUMENT REQUIRED
|
|||||||
VARIABLE_NAME CORE_FILE
|
VARIABLE_NAME CORE_FILE
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
VARIABLE_TYPE BOOLEAN
|
VARIABLE_TYPE BOOLEAN
|
||||||
VARIABLE_COMMENT write a core-file on crashes
|
VARIABLE_COMMENT Write core on crashes
|
||||||
NUMERIC_MIN_VALUE NULL
|
NUMERIC_MIN_VALUE NULL
|
||||||
NUMERIC_MAX_VALUE NULL
|
NUMERIC_MAX_VALUE NULL
|
||||||
NUMERIC_BLOCK_SIZE NULL
|
NUMERIC_BLOCK_SIZE NULL
|
||||||
ENUM_VALUE_LIST OFF,ON
|
ENUM_VALUE_LIST OFF,ON
|
||||||
READ_ONLY YES
|
READ_ONLY YES
|
||||||
COMMAND_LINE_ARGUMENT NULL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME DATADIR
|
VARIABLE_NAME DATADIR
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
VARIABLE_TYPE VARCHAR
|
VARIABLE_TYPE VARCHAR
|
||||||
|
@@ -685,13 +685,13 @@ COMMAND_LINE_ARGUMENT REQUIRED
|
|||||||
VARIABLE_NAME CORE_FILE
|
VARIABLE_NAME CORE_FILE
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
VARIABLE_TYPE BOOLEAN
|
VARIABLE_TYPE BOOLEAN
|
||||||
VARIABLE_COMMENT write a core-file on crashes
|
VARIABLE_COMMENT Write core on crashes
|
||||||
NUMERIC_MIN_VALUE NULL
|
NUMERIC_MIN_VALUE NULL
|
||||||
NUMERIC_MAX_VALUE NULL
|
NUMERIC_MAX_VALUE NULL
|
||||||
NUMERIC_BLOCK_SIZE NULL
|
NUMERIC_BLOCK_SIZE NULL
|
||||||
ENUM_VALUE_LIST OFF,ON
|
ENUM_VALUE_LIST OFF,ON
|
||||||
READ_ONLY YES
|
READ_ONLY YES
|
||||||
COMMAND_LINE_ARGUMENT NULL
|
COMMAND_LINE_ARGUMENT OPTIONAL
|
||||||
VARIABLE_NAME DATADIR
|
VARIABLE_NAME DATADIR
|
||||||
VARIABLE_SCOPE GLOBAL
|
VARIABLE_SCOPE GLOBAL
|
||||||
VARIABLE_TYPE VARCHAR
|
VARIABLE_TYPE VARCHAR
|
||||||
|
@@ -164,6 +164,30 @@ update t1 set i = 0;
|
|||||||
connection slave;
|
connection slave;
|
||||||
connection master;
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
# check versioned -> versioned replication without any keys on duplicate records
|
||||||
|
connection master;
|
||||||
|
create table t1 (a INT) with system versioning;
|
||||||
|
insert into t1 values (1);
|
||||||
|
insert into t1 values (1);
|
||||||
|
delete from t1;
|
||||||
|
connection slave;
|
||||||
|
include/diff_tables.inc [master:test.t1,slave:test.t1]
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
|
connection slave;
|
||||||
|
# check unversioned -> versioned replication with non-unique keys on duplicate records
|
||||||
|
connection master;
|
||||||
|
set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b));
|
||||||
|
connection slave;
|
||||||
|
set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)) with system versioning;
|
||||||
|
connection master;
|
||||||
|
insert into t1 values (1,1);
|
||||||
|
insert into t1 values (1,1);
|
||||||
|
delete from t1;
|
||||||
|
connection slave;
|
||||||
|
include/diff_tables.inc [master:test.t1,slave:test.t1]
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
#
|
#
|
||||||
# MDEV-17554 Auto-create new partition for system versioned tables
|
# MDEV-17554 Auto-create new partition for system versioned tables
|
||||||
# with history partitioned by INTERVAL/LIMIT
|
# with history partitioned by INTERVAL/LIMIT
|
||||||
|
@@ -133,6 +133,40 @@ sync_slave_with_master;
|
|||||||
connection master;
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-30430: Enabling system versioning on tables without primary key breaks replication
|
||||||
|
# Note that bugs are only present with row binlog format
|
||||||
|
#
|
||||||
|
--echo # check versioned -> versioned replication without any keys on duplicate records
|
||||||
|
connection master;
|
||||||
|
create table t1 (a INT) with system versioning;
|
||||||
|
insert into t1 values (1);
|
||||||
|
insert into t1 values (1);
|
||||||
|
delete from t1;
|
||||||
|
sync_slave_with_master;
|
||||||
|
--let $diff_tables= master:test.t1,slave:test.t1
|
||||||
|
--source include/diff_tables.inc
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
--echo # check unversioned -> versioned replication with non-unique keys on duplicate records
|
||||||
|
connection master;
|
||||||
|
set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b));
|
||||||
|
connection slave;
|
||||||
|
set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)) with system versioning;
|
||||||
|
connection master;
|
||||||
|
insert into t1 values (1,1);
|
||||||
|
insert into t1 values (1,1);
|
||||||
|
delete from t1;
|
||||||
|
sync_slave_with_master;
|
||||||
|
--let $diff_tables= master:test.t1,slave:test.t1
|
||||||
|
--source include/diff_tables.inc
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # MDEV-17554 Auto-create new partition for system versioned tables
|
--echo # MDEV-17554 Auto-create new partition for system versioned tables
|
||||||
--echo # with history partitioned by INTERVAL/LIMIT
|
--echo # with history partitioned by INTERVAL/LIMIT
|
||||||
|
17
sql/item.h
17
sql/item.h
@@ -7827,7 +7827,7 @@ public:
|
|||||||
Item *get_tmp_table_item(THD *thd)
|
Item *get_tmp_table_item(THD *thd)
|
||||||
{ return m_item->get_tmp_table_item(thd); }
|
{ return m_item->get_tmp_table_item(thd); }
|
||||||
Item *get_copy(THD *thd)
|
Item *get_copy(THD *thd)
|
||||||
{ return m_item->get_copy(thd); }
|
{ return get_item_copy<Item_direct_ref_to_item>(thd, this); }
|
||||||
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
|
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
|
||||||
bool link_item_fields,
|
bool link_item_fields,
|
||||||
COND_EQUAL **cond_equal_ref)
|
COND_EQUAL **cond_equal_ref)
|
||||||
@@ -7895,7 +7895,20 @@ public:
|
|||||||
bool excl_dep_on_grouping_fields(st_select_lex *sel)
|
bool excl_dep_on_grouping_fields(st_select_lex *sel)
|
||||||
{ return m_item->excl_dep_on_grouping_fields(sel); }
|
{ return m_item->excl_dep_on_grouping_fields(sel); }
|
||||||
bool is_expensive() { return m_item->is_expensive(); }
|
bool is_expensive() { return m_item->is_expensive(); }
|
||||||
Item* build_clone(THD *thd) { return get_copy(thd); }
|
void set_item(Item *item) { m_item= item; }
|
||||||
|
Item *build_clone(THD *thd)
|
||||||
|
{
|
||||||
|
Item *clone_item= m_item->build_clone(thd);
|
||||||
|
if (clone_item)
|
||||||
|
{
|
||||||
|
Item_direct_ref_to_item *copy= (Item_direct_ref_to_item *) get_copy(thd);
|
||||||
|
if (!copy)
|
||||||
|
return 0;
|
||||||
|
copy->set_item(clone_item);
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
|
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
|
||||||
List<Item> &fields, uint flags)
|
List<Item> &fields, uint flags)
|
||||||
|
@@ -11980,7 +11980,10 @@ get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list)
|
|||||||
if (typ == START_ENCRYPTION_EVENT)
|
if (typ == START_ENCRYPTION_EVENT)
|
||||||
{
|
{
|
||||||
if (fdle->start_decryption((Start_encryption_log_event*) ev))
|
if (fdle->start_decryption((Start_encryption_log_event*) ev))
|
||||||
|
{
|
||||||
errormsg= "Could not set up decryption for binlog.";
|
errormsg= "Could not set up decryption for binlog.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delete ev;
|
delete ev;
|
||||||
if (typ == ROTATE_EVENT || typ == STOP_EVENT ||
|
if (typ == ROTATE_EVENT || typ == STOP_EVENT ||
|
||||||
|
@@ -7989,7 +7989,7 @@ uint8 Write_rows_log_event::get_trg_event_map()
|
|||||||
|
|
||||||
Returns TRUE if different.
|
Returns TRUE if different.
|
||||||
*/
|
*/
|
||||||
static bool record_compare(TABLE *table)
|
static bool record_compare(TABLE *table, bool vers_from_plain= false)
|
||||||
{
|
{
|
||||||
bool result= FALSE;
|
bool result= FALSE;
|
||||||
/**
|
/**
|
||||||
@@ -8022,10 +8022,19 @@ static bool record_compare(TABLE *table)
|
|||||||
/* Compare fields */
|
/* Compare fields */
|
||||||
for (Field **ptr=table->field ; *ptr ; ptr++)
|
for (Field **ptr=table->field ; *ptr ; ptr++)
|
||||||
{
|
{
|
||||||
if (table->versioned() && (*ptr)->vers_sys_field())
|
/*
|
||||||
{
|
If the table is versioned, don't compare using the version if there is a
|
||||||
|
primary key. If there isn't a primary key, we need the version to
|
||||||
|
identify the correct record if there are duplicate rows in the data set.
|
||||||
|
However, if the primary server is unversioned (vers_from_plain is true),
|
||||||
|
then we implicitly use row_end as the primary key on our side. This is
|
||||||
|
because the implicit row_end value will be set to the maximum value for
|
||||||
|
the latest row update (which is what we care about).
|
||||||
|
*/
|
||||||
|
if (table->versioned() && (*ptr)->vers_sys_field() &&
|
||||||
|
(table->s->primary_key < MAX_KEY ||
|
||||||
|
(vers_from_plain && table->vers_start_field() == (*ptr))))
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
We only compare field contents that are not null.
|
We only compare field contents that are not null.
|
||||||
NULL fields (i.e., their null bits) were compared
|
NULL fields (i.e., their null bits) were compared
|
||||||
@@ -8422,7 +8431,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
|
|||||||
/* We use this to test that the correct key is used in test cases. */
|
/* We use this to test that the correct key is used in test cases. */
|
||||||
DBUG_EXECUTE_IF("slave_crash_if_index_scan", abort(););
|
DBUG_EXECUTE_IF("slave_crash_if_index_scan", abort(););
|
||||||
|
|
||||||
while (record_compare(table))
|
while (record_compare(table, m_vers_from_plain))
|
||||||
{
|
{
|
||||||
while ((error= table->file->ha_index_next(table->record[0])))
|
while ((error= table->file->ha_index_next(table->record[0])))
|
||||||
{
|
{
|
||||||
@@ -8475,7 +8484,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (record_compare(table));
|
while (record_compare(table, m_vers_from_plain));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Note: above record_compare will take into accout all record fields
|
Note: above record_compare will take into accout all record fields
|
||||||
|
@@ -6413,8 +6413,6 @@ struct my_option my_long_options[]=
|
|||||||
{"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.",
|
{"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.",
|
||||||
&opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
&opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||||
0, 0, 0},
|
0, 0, 0},
|
||||||
{"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
|
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
#ifdef DBUG_OFF
|
#ifdef DBUG_OFF
|
||||||
{"debug", '#', "Built in DBUG debugger. Disabled in this build.",
|
{"debug", '#', "Built in DBUG debugger. Disabled in this build.",
|
||||||
¤t_dbug_option, ¤t_dbug_option, 0, GET_STR, OPT_ARG,
|
¤t_dbug_option, ¤t_dbug_option, 0, GET_STR, OPT_ARG,
|
||||||
@@ -8196,9 +8194,6 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
|
|||||||
case (int) OPT_SKIP_HOST_CACHE:
|
case (int) OPT_SKIP_HOST_CACHE:
|
||||||
opt_specialflag|= SPECIAL_NO_HOST_CACHE;
|
opt_specialflag|= SPECIAL_NO_HOST_CACHE;
|
||||||
break;
|
break;
|
||||||
case (int) OPT_WANT_CORE:
|
|
||||||
test_flags |= TEST_CORE_ON_SIGNAL;
|
|
||||||
break;
|
|
||||||
case OPT_CONSOLE:
|
case OPT_CONSOLE:
|
||||||
if (opt_console)
|
if (opt_console)
|
||||||
opt_error_log= 0; // Force logs to stdout
|
opt_error_log= 0; // Force logs to stdout
|
||||||
|
@@ -2583,14 +2583,16 @@ rpl_parallel::find(uint32 domain_id, Relay_log_info *rli)
|
|||||||
e->pause_sub_id= (uint64)ULONGLONG_MAX;
|
e->pause_sub_id= (uint64)ULONGLONG_MAX;
|
||||||
e->pending_start_alters= 0;
|
e->pending_start_alters= 0;
|
||||||
e->rli= rli;
|
e->rli= rli;
|
||||||
if (my_hash_insert(&domain_hash, (uchar *)e))
|
|
||||||
{
|
|
||||||
my_free(e);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
mysql_mutex_init(key_LOCK_parallel_entry, &e->LOCK_parallel_entry,
|
mysql_mutex_init(key_LOCK_parallel_entry, &e->LOCK_parallel_entry,
|
||||||
MY_MUTEX_INIT_FAST);
|
MY_MUTEX_INIT_FAST);
|
||||||
mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL);
|
mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL);
|
||||||
|
if (my_hash_insert(&domain_hash, (uchar *)e))
|
||||||
|
{
|
||||||
|
mysql_cond_destroy(&e->COND_parallel_entry);
|
||||||
|
mysql_mutex_destroy(&e->LOCK_parallel_entry);
|
||||||
|
my_free(e);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -602,10 +602,9 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Sys_var_bit Sys_core_file("core_file", "write a core-file on crashes",
|
static Sys_var_bit Sys_core_file("core_file", "Write core on crashes",
|
||||||
READ_ONLY GLOBAL_VAR(test_flags), NO_CMD_LINE,
|
READ_ONLY GLOBAL_VAR(test_flags), CMD_LINE(OPT_ARG),
|
||||||
TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)), NO_MUTEX_GUARD, NOT_IN_BINLOG,
|
TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)));
|
||||||
0,0,0);
|
|
||||||
|
|
||||||
static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
|
static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
|
||||||
{
|
{
|
||||||
|
@@ -12,9 +12,9 @@ alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
|
|||||||
select * from t0;
|
select * from t0;
|
||||||
ERROR HY000: An infinite loop is detected when opening table test.t0
|
ERROR HY000: An infinite loop is detected when opening table test.t0
|
||||||
select * from t1;
|
select * from t1;
|
||||||
ERROR HY000: An infinite loop is detected when opening table test.t1
|
ERROR HY000: An infinite loop is detected when opening table test.t0
|
||||||
select * from t2;
|
select * from t2;
|
||||||
ERROR HY000: An infinite loop is detected when opening table test.t2
|
ERROR HY000: An infinite loop is detected when opening table test.t0
|
||||||
drop table t0, t1, t2;
|
drop table t0, t1, t2;
|
||||||
for master_1
|
for master_1
|
||||||
for child2
|
for child2
|
||||||
|
@@ -2223,33 +2223,64 @@ bool spider_db_mbase::is_xa_nota_error(
|
|||||||
DBUG_RETURN(xa_nota);
|
DBUG_RETURN(xa_nota);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spider_db_mbase::fetch_and_print_warnings(struct tm *l_time)
|
int spider_db_mbase::fetch_and_print_warnings(struct tm *l_time)
|
||||||
{
|
{
|
||||||
|
int error_num = 0;
|
||||||
DBUG_ENTER("spider_db_mbase::fetch_and_print_warnings");
|
DBUG_ENTER("spider_db_mbase::fetch_and_print_warnings");
|
||||||
|
DBUG_PRINT("info",("spider this=%p", this));
|
||||||
|
|
||||||
if (spider_param_dry_access() || db_conn->status != MYSQL_STATUS_READY ||
|
if (spider_param_dry_access() || db_conn->status != MYSQL_STATUS_READY ||
|
||||||
db_conn->server_status & SERVER_MORE_RESULTS_EXISTS)
|
db_conn->server_status & SERVER_MORE_RESULTS_EXISTS ||
|
||||||
DBUG_VOID_RETURN;
|
!db_conn->warning_count)
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
if (mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR,
|
if (mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR,
|
||||||
SPIDER_SQL_SHOW_WARNINGS_LEN))
|
SPIDER_SQL_SHOW_WARNINGS_LEN))
|
||||||
DBUG_VOID_RETURN;
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
MYSQL_RES *res= mysql_store_result(db_conn);
|
MYSQL_RES *res= mysql_store_result(db_conn);
|
||||||
if (!res)
|
if (!res)
|
||||||
DBUG_VOID_RETURN;
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
if (mysql_num_fields(res) == 3)
|
uint num_fields= mysql_num_fields(res);
|
||||||
while (MYSQL_ROW row= mysql_fetch_row(res))
|
if (num_fields != 3)
|
||||||
|
{
|
||||||
|
mysql_free_result(res);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
MYSQL_ROW row= mysql_fetch_row(res);
|
||||||
|
if (l_time)
|
||||||
|
{
|
||||||
|
while (row)
|
||||||
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld "
|
"%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld "
|
||||||
"to %ld: %s %s %s\n",
|
"to %ld: %s %s %s\n",
|
||||||
l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday,
|
l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday,
|
||||||
l_time->tm_hour, l_time->tm_min, l_time->tm_sec, conn->tgt_host,
|
l_time->tm_hour, l_time->tm_min, l_time->tm_sec, conn->tgt_host,
|
||||||
(ulong) db_conn->thread_id, (ulong) current_thd->thread_id,
|
(ulong) db_conn->thread_id, (ulong) current_thd->thread_id, row[0],
|
||||||
row[0], row[1], row[2]);
|
row[1], row[2]);
|
||||||
|
row= mysql_fetch_row(res);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (row)
|
||||||
|
{
|
||||||
|
DBUG_PRINT("info",("spider row[0]=%s", row[0]));
|
||||||
|
DBUG_PRINT("info",("spider row[1]=%s", row[1]));
|
||||||
|
DBUG_PRINT("info",("spider row[2]=%s", row[2]));
|
||||||
|
longlong res_num =
|
||||||
|
(longlong) my_strtoll10(row[1], (char**) NULL, &error_num);
|
||||||
|
DBUG_PRINT("info",("spider res_num=%lld", res_num));
|
||||||
|
my_printf_error((int) res_num, row[2], MYF(0));
|
||||||
|
error_num = (int) res_num;
|
||||||
|
row = mysql_fetch_row(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
DBUG_VOID_RETURN;
|
|
||||||
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
spider_db_result *spider_db_mbase::store_result(
|
spider_db_result *spider_db_mbase::store_result(
|
||||||
@@ -13807,11 +13838,9 @@ int spider_mbase_handler::show_table_status(
|
|||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((error_num = ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(NULL)))
|
||||||
{
|
{
|
||||||
time_t cur_time = (time_t) time((time_t*) 0);
|
DBUG_RETURN(error_num);
|
||||||
struct tm lt;
|
|
||||||
struct tm *l_time = localtime_r(&cur_time, <);
|
|
||||||
((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(l_time);
|
|
||||||
}
|
}
|
||||||
if (share->static_records_for_status != -1)
|
if (share->static_records_for_status != -1)
|
||||||
{
|
{
|
||||||
|
@@ -434,7 +434,7 @@ public:
|
|||||||
bool is_xa_nota_error(
|
bool is_xa_nota_error(
|
||||||
int error_num
|
int error_num
|
||||||
);
|
);
|
||||||
void fetch_and_print_warnings(struct tm *l_time);
|
int fetch_and_print_warnings(struct tm *l_time);
|
||||||
spider_db_result *store_result(
|
spider_db_result *store_result(
|
||||||
spider_db_result_buffer **spider_res_buf,
|
spider_db_result_buffer **spider_res_buf,
|
||||||
st_spider_db_request_key *request_key,
|
st_spider_db_request_key *request_key,
|
||||||
|
Reference in New Issue
Block a user