Skip to content

Commit 436d8ef

Browse files
committed
Merge 10.8 into 10.9
2 parents 09fdd3a + bbd261b commit 436d8ef

29 files changed

+598
-69
lines changed

debian/autobake-deb.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ then
224224
for package in *.deb
225225
do
226226
echo "$package" | cut -d '_' -f 1
227-
dpkg-deb -c "$package" | awk '{print $1 " " $2 " " $6 " " $7 " " $8}' | sort -k 3
227+
# shellcheck disable=SC2034
228+
dpkg-deb -c "$package" | while IFS=" " read -r col1 col2 col3 col4 col5 col6 col7 col8
229+
do
230+
echo "$col1 $col2 $col6 $col7 $col8" | sort -k 3
231+
done
228232
echo "------------------------------------------------"
229233
done
230234
fi

debian/mariadb-server.mariadb.init

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ sanity_checks() {
8484

8585
# check for diskspace shortage
8686
datadir=`mariadbd_get_param datadir`
87-
if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
87+
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
88+
# 4096 blocks is then lower than 4 MB
89+
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
90+
if [ "$df_available_blocks" -lt "4096" ]; then
8891
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
8992
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
9093
exit 1

debian/mariadb-server.preinst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ if [ ! -d $mysql_datadir ] && [ ! -L $mysql_datadir ]; then
208208
mkdir -Z $mysql_datadir
209209
fi
210210

211-
# checking disc space
212-
if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
211+
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
212+
# 4096 blocks is then lower than 4 MB
213+
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
214+
if [ "$df_available_blocks" -lt "4096" ]; then
213215
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
214216
db_stop
215217
exit 1

libmysqld/lib_sql.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ int init_embedded_server(int argc, char **argv, char **groups)
575575
if (ho_error != 0)
576576
return 1;
577577

578+
my_timer_init(&sys_timer_info);
579+
578580
if (init_common_variables())
579581
{
580582
mysql_server_end();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve
3+
#
4+
create table t1 (a int);
5+
insert into t1 values (0),(0);
6+
set @js='$out';
7+
set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms'));
8+
select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
9+
cast(json_extract(@out,'$[0]') as DOUBLE) > 0
10+
1
11+
drop table t1;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--source include/is_embedded.inc
2+
--source include/big_test.inc
3+
4+
--echo #
5+
--echo # MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve
6+
--echo #
7+
create table t1 (a int);
8+
insert into t1 values (0),(0);
9+
let $out=`
10+
analyze format=json select sleep(1+a) from t1
11+
`;
12+
13+
evalp set @js='$out';
14+
set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms'));
15+
select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
16+
17+
drop table t1;
18+

mysql-test/main/derived_cond_pushdown.result

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20696,6 +20696,97 @@ id select_type table type possible_keys key key_len ref rows Extra
2069620696
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary
2069720697
drop view v1;
2069820698
drop table t1;
20699+
#
20700+
# MDEV-31102: execution of PS for query where pushdown of condition
20701+
# into view defined as union is applied
20702+
#
20703+
create table t1 (
20704+
n int,
20705+
lv varchar(31) charset latin1,
20706+
mv varchar(31) charset utf8mb3
20707+
) engine=myisam;
20708+
insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz');
20709+
create view v1 as
20710+
select case when n=1 then lv when n=2 then mv else NULL end as r from t1
20711+
union
20712+
select 'a';
20713+
select * from v1 where r < 'x';
20714+
r
20715+
aa
20716+
a
20717+
explain extended select * from v1 where r < 'x';
20718+
id select_type table type possible_keys key key_len ref rows filtered Extra
20719+
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00 Using where
20720+
2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where
20721+
3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
20722+
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
20723+
Warnings:
20724+
Note 1003 /* select#1 */ select `v1`.`r` AS `r` from `test`.`v1` where `v1`.`r` < 'x'
20725+
explain format=json select * from v1 where r < 'x';
20726+
EXPLAIN
20727+
{
20728+
"query_block": {
20729+
"select_id": 1,
20730+
"nested_loop": [
20731+
{
20732+
"table": {
20733+
"table_name": "<derived2>",
20734+
"access_type": "ALL",
20735+
"rows": 3,
20736+
"filtered": 100,
20737+
"attached_condition": "v1.r < 'x'",
20738+
"materialized": {
20739+
"query_block": {
20740+
"union_result": {
20741+
"table_name": "<union2,3>",
20742+
"access_type": "ALL",
20743+
"query_specifications": [
20744+
{
20745+
"query_block": {
20746+
"select_id": 2,
20747+
"nested_loop": [
20748+
{
20749+
"table": {
20750+
"table_name": "t1",
20751+
"access_type": "ALL",
20752+
"rows": 3,
20753+
"filtered": 100,
20754+
"attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8mb3) when t1.n = 2 then t1.mv else NULL end < 'x'"
20755+
}
20756+
}
20757+
]
20758+
}
20759+
},
20760+
{
20761+
"query_block": {
20762+
"select_id": 3,
20763+
"operation": "UNION",
20764+
"table": {
20765+
"message": "No tables used"
20766+
}
20767+
}
20768+
}
20769+
]
20770+
}
20771+
}
20772+
}
20773+
}
20774+
}
20775+
]
20776+
}
20777+
}
20778+
prepare stmt from "select * from v1 where r < 'x'";
20779+
execute stmt;
20780+
r
20781+
aa
20782+
a
20783+
execute stmt;
20784+
r
20785+
aa
20786+
a
20787+
deallocate prepare stmt;
20788+
drop view v1;
20789+
drop table t1;
2069920790
# End of 10.4 tests
2070020791
#
2070120792
# MDEV-28958: condition pushable into view after simplification

mysql-test/main/derived_cond_pushdown.test

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,6 +3943,36 @@ explain select * from v1;
39433943
drop view v1;
39443944
drop table t1;
39453945

3946+
--echo #
3947+
--echo # MDEV-31102: execution of PS for query where pushdown of condition
3948+
--echo # into view defined as union is applied
3949+
--echo #
3950+
3951+
create table t1 (
3952+
n int,
3953+
lv varchar(31) charset latin1,
3954+
mv varchar(31) charset utf8mb3
3955+
) engine=myisam;
3956+
insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz');
3957+
create view v1 as
3958+
select case when n=1 then lv when n=2 then mv else NULL end as r from t1
3959+
union
3960+
select 'a';
3961+
3962+
let $q=
3963+
select * from v1 where r < 'x';
3964+
3965+
eval $q;
3966+
eval explain extended $q;
3967+
eval explain format=json $q;
3968+
eval prepare stmt from "$q";
3969+
execute stmt;
3970+
execute stmt;
3971+
deallocate prepare stmt;
3972+
3973+
drop view v1;
3974+
drop table t1;
3975+
39463976
--echo # End of 10.4 tests
39473977

39483978
--echo #

mysql-test/main/mysqld--help,win.rdiff

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
--- a/mysql-test/r/mysqld--help.result
2-
+++ b/mysql-test/r/mysqld--help.result
3-
@@ -647,6 +646,7 @@
1+
@@ -180,6 +180,7 @@
2+
--console Write error output on screen; don't remove the console
3+
window on windows.
4+
--core-file Write core on crashes
5+
+ (Defaults to on; use --skip-core-file to disable.)
6+
-h, --datadir=name Path to the database root directory
7+
--date-format=name The DATE format (ignored)
8+
--datetime-format=name
9+
@@ -650,6 +651,7 @@
410
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
511
DATETIME, TIMESTAMP columns.
612
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
713
+ --named-pipe Enable the named pipe (NT)
814
--net-buffer-length=#
915
Buffer length for TCP/IP and socket communication
1016
--net-read-timeout=#
11-
@@ -1236,6 +1236,10 @@
17+
@@ -1281,6 +1283,10 @@
1218
Log slow queries to given log file. Defaults logging to
1319
'hostname'-slow.log. Must be enabled to activate other
1420
slow log options
@@ -19,15 +25,15 @@
1925
--socket=name Socket file to use for connection
2026
--sort-buffer-size=#
2127
Each thread that needs to do a sort allocates a buffer of
22-
@@ -1260,6 +1264,7 @@
28+
@@ -1305,6 +1311,7 @@
2329
deleting or updating every row in a table.
2430
--stack-trace Print a symbolic stack trace on failure
2531
(Defaults to on; use --skip-stack-trace to disable.)
2632
+ --standalone Dummy option to start as a standalone program (NT).
2733
--standard-compliant-cte
2834
Allow only CTEs compliant to SQL standard
2935
(Defaults to on; use --skip-standard-compliant-cte to disable.)
30-
@@ -1330,6 +1335,11 @@
36+
@@ -1380,6 +1387,11 @@
3137
--thread-pool-max-threads=#
3238
Maximum allowed number of worker threads in the thread
3339
pool
@@ -39,7 +45,7 @@
3945
--thread-pool-oversubscribe=#
4046
How many additional active worker threads in a group are
4147
allowed.
42-
@@ -1370,8 +1380,8 @@
48+
@@ -1418,8 +1430,8 @@
4349
automatically convert it to an on-disk MyISAM or Aria
4450
table.
4551
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
@@ -50,24 +56,24 @@
5056
--transaction-alloc-block-size=#
5157
Allocation block size for transactions to be stored in
5258
binary log
53-
@@ -1587,6 +1596,7 @@
59+
@@ -1634,6 +1646,7 @@
5460
myisam-stats-method NULLS_UNEQUAL
5561
myisam-use-mmap FALSE
5662
mysql56-temporal-format TRUE
5763
+named-pipe FALSE
5864
net-buffer-length 16384
5965
net-read-timeout 30
6066
net-retry-count 10
61-
@@ -1726,6 +1736,7 @@
67+
@@ -1788,6 +1801,7 @@
6268
slave-type-conversions
6369
slow-launch-time 2
6470
slow-query-log FALSE
6571
+slow-start-timeout 15000
6672
sort-buffer-size 2097152
6773
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
6874
sql-safe-updates FALSE
69-
@@ -1753,6 +1764,8 @@
70-
thread-cache-size 151
75+
@@ -1814,6 +1828,8 @@
76+
thread-pool-exact-stats FALSE
7177
thread-pool-idle-timeout 60
7278
thread-pool-max-threads 65536
7379
+thread-pool-min-threads 1

mysql-test/main/mysqld--help.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ The following specify which files/extra groups are read (specified before remain
188188
ALWAYS
189189
--console Write error output on screen; don't remove the console
190190
window on windows.
191-
--core-file Write core on errors.
191+
--core-file Write core on crashes
192192
-h, --datadir=name Path to the database root directory
193193
--date-format=name The DATE format (ignored)
194194
--datetime-format=name
@@ -1511,6 +1511,7 @@ column-compression-zlib-wrap FALSE
15111511
completion-type NO_CHAIN
15121512
concurrent-insert AUTO
15131513
console TRUE
1514+
core-file TRUE
15141515
date-format %Y-%m-%d
15151516
datetime-format %Y-%m-%d %H:%i:%s
15161517
deadlock-search-depth-long 15

mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result renamed to mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
include/rpl_init.inc [topology=1->2]
55
connection server_2;
66
include/stop_slave.inc
7+
CHANGE MASTER TO MASTER_USE_GTID=NO;
78
#####################################################
89
# Part 1: unencrypted master
910
#####################################################

mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test renamed to mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
#
2-
# TODO: write here what the test checks after MDEV-11288 is fixed
3-
#
4-
# The test starts with unencrypted master.
2+
# The test starts with unencrypted master.
53
# It stops replication, generates a few statement and row events
6-
# on the master, then restarts the server with encrypted binlog,
7-
# generates some more events and restarts it back without encryption
4+
# on the master, then restarts the server with encrypted binlog,
5+
# generates some more events and restarts it back without encryption
86
# (no encryption plugin).
9-
# Then it resumes replication and checks what happens when the server
10-
# tries to feed the binary logs (included the encrypted ones)
11-
# to the slave.
7+
# Then it resumes replication and should error with
8+
# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is
9+
# sent and unable to be decrypted.
10+
#
11+
# Note this variation of encrypted_master_switch_to_unencrypted tests
12+
# using MASTER_USE_GTID=NO. In contrast to the GTID variant of this
13+
# test, at part 3 (the error case), the master will scan binlogs
14+
# starting from the first one (which is unencrypted initially, so
15+
# replication is okay) and continue until the slave encounters the
16+
# first encrypted event, which causes the slave to error.
1217
#
1318

1419
--source include/have_binlog_format_mixed.inc
@@ -27,6 +32,7 @@
2732
--connection server_2
2833
--disable_connect_log
2934
--source include/stop_slave.inc
35+
CHANGE MASTER TO MASTER_USE_GTID=NO;
3036
--enable_connect_log
3137

3238
--echo #####################################################
@@ -41,7 +47,7 @@ CREATE TABLE table1_no_encryption (
4147
pk INT AUTO_INCREMENT PRIMARY KEY,
4248
ts TIMESTAMP NULL,
4349
b BLOB
44-
) ENGINE=MyISAM;
50+
) ENGINE=MyISAM;
4551

4652
INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
4753
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
@@ -74,7 +80,7 @@ CREATE TABLE table2_to_encrypt (
7480
pk INT AUTO_INCREMENT PRIMARY KEY,
7581
ts TIMESTAMP NULL,
7682
b BLOB
77-
) ENGINE=MyISAM;
83+
) ENGINE=MyISAM;
7884

7985
INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
8086
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
@@ -101,7 +107,7 @@ CREATE TABLE table3_no_encryption (
101107
pk INT AUTO_INCREMENT PRIMARY KEY,
102108
ts TIMESTAMP NULL,
103109
b BLOB
104-
) ENGINE=MyISAM;
110+
) ENGINE=MyISAM;
105111

106112
INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
107113
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
@@ -113,7 +119,7 @@ INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
113119

114120
--connection server_2
115121
start slave;
116-
# The slave should be able to synchronize with master up to
122+
# The slave should be able to synchronize with master up to
117123
# the previously saved position (when the log was still unencrypted)
118124
--sync_with_master
119125

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
!include my.cnf
2+
3+
[mysqld.1]
4+
encrypt-binlog=0
5+
skip-file-key-management
6+
7+
[mysqld.2]
8+
gtid-domain-id=1

0 commit comments

Comments
 (0)