Skip to content

Commit

Permalink
Merge 10.9 into 10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 27, 2023
2 parents ce6616a + d0a71e9 commit 4f16e95
Show file tree
Hide file tree
Showing 31 changed files with 602 additions and 70 deletions.
6 changes: 5 additions & 1 deletion debian/autobake-deb.sh
Expand Up @@ -241,7 +241,11 @@ then
for package in *.deb
do
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 "------------------------------------------------"
done
fi
Expand Down
5 changes: 4 additions & 1 deletion debian/mariadb-server.mariadb.init
Expand Up @@ -84,7 +84,10 @@ sanity_checks() {

# check for diskspace shortage
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!"
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
exit 1
Expand Down
6 changes: 4 additions & 2 deletions debian/mariadb-server.preinst
Expand Up @@ -208,8 +208,10 @@ if [ ! -d $mysql_datadir ] && [ ! -L $mysql_datadir ]; then
mkdir -Z $mysql_datadir
fi

# checking disc space
if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; 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
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
db_stop
exit 1
Expand Down
4 changes: 4 additions & 0 deletions debian/mariadb-test.install
Expand Up @@ -41,7 +41,11 @@ usr/share/mysql/mysql-test/README.stress
usr/share/mysql/mysql-test/dgcov.pl
usr/share/mysql/mysql-test/lib
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/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/suite.pm
usr/share/mysql/mysql-test/valgrind.supp
1 change: 0 additions & 1 deletion debian/mariadb-test.links

This file was deleted.

2 changes: 2 additions & 0 deletions libmysqld/lib_sql.cc
Expand Up @@ -575,6 +575,8 @@ int init_embedded_server(int argc, char **argv, char **groups)
if (ho_error != 0)
return 1;

my_timer_init(&sys_timer_info);

if (init_common_variables())
{
mysql_server_end();
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/main/analyze_format_json_emb.result
@@ -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 changes: 18 additions & 0 deletions mysql-test/main/analyze_format_json_emb.test
@@ -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;

91 changes: 91 additions & 0 deletions mysql-test/main/derived_cond_pushdown.result
Expand Up @@ -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
drop view v1;
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
#
# MDEV-28958: condition pushable into view after simplification
Expand Down
30 changes: 30 additions & 0 deletions mysql-test/main/derived_cond_pushdown.test
Expand Up @@ -3943,6 +3943,36 @@ explain select * from v1;
drop view v1;
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 #
Expand Down
28 changes: 17 additions & 11 deletions mysql-test/main/mysqld--help,win.rdiff
@@ -1,14 +1,20 @@
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -647,6 +646,7 @@
@@ -180,6 +180,7 @@
--console Write error output on screen; don't remove the console
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,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
+ --named-pipe Enable the named pipe (NT)
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
@@ -1236,6 +1236,10 @@
@@ -1281,6 +1283,10 @@
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
slow log options
Expand All @@ -19,15 +25,15 @@
--socket=name Socket file to use for connection
--sort-buffer-size=#
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.
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
+ --standalone Dummy option to start as a standalone program (NT).
--standard-compliant-cte
Allow only CTEs compliant to SQL standard
(Defaults to on; use --skip-standard-compliant-cte to disable.)
@@ -1330,6 +1335,11 @@
@@ -1380,6 +1387,11 @@
--thread-pool-max-threads=#
Maximum allowed number of worker threads in the thread
pool
Expand All @@ -39,7 +45,7 @@
--thread-pool-oversubscribe=#
How many additional active worker threads in a group are
allowed.
@@ -1370,8 +1380,8 @@
@@ -1418,8 +1430,8 @@
automatically convert it to an on-disk MyISAM or Aria
table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
Expand All @@ -50,24 +56,24 @@
--transaction-alloc-block-size=#
Allocation block size for transactions to be stored in
binary log
@@ -1587,6 +1596,7 @@
@@ -1634,6 +1646,7 @@
myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
mysql56-temporal-format TRUE
+named-pipe FALSE
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
@@ -1726,6 +1736,7 @@
@@ -1788,6 +1801,7 @@
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
+slow-start-timeout 15000
sort-buffer-size 2097152
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql-safe-updates FALSE
@@ -1753,6 +1764,8 @@
thread-cache-size 151
@@ -1814,6 +1828,8 @@
thread-pool-exact-stats FALSE
thread-pool-idle-timeout 60
thread-pool-max-threads 65536
+thread-pool-min-threads 1
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/main/mysqld--help.result
Expand Up @@ -189,7 +189,7 @@ The following specify which files/extra groups are read (specified before remain
ALWAYS
--console Write error output on screen; don't remove the console
window on windows.
--core-file Write core on errors.
--core-file Write core on crashes
-h, --datadir=name Path to the database root directory
--date-format=name The DATE format (ignored)
--datetime-format=name
Expand Down Expand Up @@ -1523,6 +1523,7 @@ column-compression-zlib-wrap FALSE
completion-type NO_CHAIN
concurrent-insert AUTO
console TRUE
core-file TRUE
date-format %Y-%m-%d
datetime-format %Y-%m-%d %H:%i:%s
deadlock-search-depth-long 15
Expand Down
Expand Up @@ -9,6 +9,7 @@ include/start_slave.inc
connection server_1;
connection server_2;
include/stop_slave.inc
CHANGE MASTER TO MASTER_USE_GTID=NO;
#####################################################
# Part 1: unencrypted master
#####################################################
Expand Down

0 comments on commit 4f16e95

Please sign in to comment.