Skip to content

Commit 44c5144

Browse files
committed
Merge 10.1 into 10.2
2 parents 1ad79c8 + 896974f commit 44c5144

File tree

9 files changed

+81
-16
lines changed

9 files changed

+81
-16
lines changed

debian/mariadb-server-10.2.postinst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
. /usr/share/debconf/confmodule
44

5-
# assume the filename is /path/to/mariadb-server-##.#.postinst
6-
VER=${0: -13:4}
5+
# Automatically set version to ease maintenance of this file
6+
MAJOR_VER="${DPKG_MAINTSCRIPT_PACKAGE#mariadb-server-}"
77

88
if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
99
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
1010

1111
export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
1212

1313
# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
14-
ERR_LOGGER="logger -p daemon.err -t mariadb-server-$VER.postinst -i"
14+
ERR_LOGGER="logger -p daemon.err -t mariadb-server-$MAJOR_VER.postinst -i"
1515
# This will make an error in a logged command immediately apparent by aborting
1616
# the install, rather than failing silently and leaving a broken install.
1717
set -o pipefail
@@ -149,8 +149,8 @@ EOF
149149

150150

151151
# To avoid downgrades.
152-
touch $mysql_statedir/debian-$VER.flag
153-
152+
touch $mysql_statedir/debian-$MAJOR_VER.flag
153+
154154
## On every reconfiguration the maintenance user is recreated.
155155
#
156156
# - It is easier to regenerate the password every time but as people

mysql-test/r/group_min_max.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,12 +2119,12 @@ id select_type table type possible_keys key key_len ref rows Extra
21192119
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using index
21202120
explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
21212121
id select_type table type possible_keys key key_len ref rows filtered Extra
2122-
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
2122+
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 102 94.12 Using where; Using index
21232123
Warnings:
21242124
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
21252125
explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
21262126
id select_type table type possible_keys key key_len ref rows filtered Extra
2127-
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
2127+
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 102 94.12 Using where; Using index
21282128
Warnings:
21292129
Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
21302130
create table t4 as select distinct a1, a2, b, c from t1;

mysql-test/r/order_by_innodb.result

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,32 @@ id select_type table type possible_keys key key_len ref rows Extra
4949
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL # Using sort_union(key1,key2); Using where
5050
drop table t0, t1;
5151
#
52+
# MDEV-18094: Query with order by limit picking index scan over filesort
53+
#
54+
create table t0 (a int);
55+
INSERT INTO t0 VALUES (0),(0),(0),(0),(2),(0),(0),(1),(1),(0);
56+
CREATE TABLE t1 (
57+
a int(11),
58+
b int(11),
59+
c int(11),
60+
KEY a_c (a,c),
61+
KEY a_b (a,b)
62+
) ENGINE=InnoDB;
63+
insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C;
64+
# should use ref access
65+
explain select a,b,c from t1 where a=1 and c=2 order by b;
66+
id select_type table type possible_keys key key_len ref rows Extra
67+
1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort
68+
# both should use range access
69+
explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000;
70+
id select_type table type possible_keys key key_len ref rows Extra
71+
1 SIMPLE t1 range a_c,a_b a_b 5 NULL 200 Using where
72+
explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000;
73+
id select_type table type possible_keys key key_len ref rows Extra
74+
1 SIMPLE t1 range a_c,a_b a_b 5 NULL 200 Using where
75+
drop table t1,t0;
76+
# Start of 10.2 tests
77+
#
5278
# MDEV-14071: wrong results with orderby_uses_equalities=on
5379
# (duplicate of MDEV-13994)
5480
#
@@ -121,3 +147,4 @@ i n
121147
656 eight
122148
set optimizer_switch= @save_optimizer_switch;
123149
DROP TABLE t1,t2,t3;
150+
# End of 10.2 tests

mysql-test/suite/maria/icp.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00'
167167
ORDER BY ts DESC
168168
LIMIT 2;
169169
id select_type table type possible_keys key key_len ref rows Extra
170-
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using where
170+
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where
171171

172172
DROP TABLE t1;
173173
#

mysql-test/t/order_by_innodb.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,32 @@ where key1<3 or key2<3;
6262

6363
drop table t0, t1;
6464

65+
--echo #
66+
--echo # MDEV-18094: Query with order by limit picking index scan over filesort
67+
--echo #
68+
69+
create table t0 (a int);
70+
INSERT INTO t0 VALUES (0),(0),(0),(0),(2),(0),(0),(1),(1),(0);
71+
72+
CREATE TABLE t1 (
73+
a int(11),
74+
b int(11),
75+
c int(11),
76+
KEY a_c (a,c),
77+
KEY a_b (a,b)
78+
) ENGINE=InnoDB;
79+
insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C;
80+
81+
--echo # should use ref access
82+
explain select a,b,c from t1 where a=1 and c=2 order by b;
83+
84+
--echo # both should use range access
85+
explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000;
86+
explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000;
87+
drop table t1,t0;
88+
89+
--echo # Start of 10.2 tests
90+
6591
--echo #
6692
--echo # MDEV-14071: wrong results with orderby_uses_equalities=on
6793
--echo # (duplicate of MDEV-13994)
@@ -108,3 +134,5 @@ eval $q2;
108134
set optimizer_switch= @save_optimizer_switch;
109135

110136
DROP TABLE t1,t2,t3;
137+
138+
--echo # End of 10.2 tests

scripts/mysqld_safe.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,13 @@ do
958958
cmd="$cmd "`shell_quote_string "$i"`
959959
done
960960
cmd="$cmd $args"
961-
[ $dry_run -eq 1 ] && return
961+
962+
if [ $dry_run -eq 1 ]
963+
then
964+
# RETURN or EXIT depending if the script is being sourced or not.
965+
(return 2> /dev/null) && return || exit
966+
fi
967+
962968

963969
# Avoid 'nohup: ignoring input' warning
964970
test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"

sql/opt_range.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,12 +2408,16 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
24082408
records= head->stat_records();
24092409
if (!records)
24102410
records++; /* purecov: inspected */
2411-
scan_time= (double) records / TIME_FOR_COMPARE + 1;
2412-
read_time= (double) head->file->scan_time() + scan_time + 1.1;
2413-
if (head->force_index)
2411+
2412+
if (head->force_index || force_quick_range)
24142413
scan_time= read_time= DBL_MAX;
2415-
if (limit < records)
2416-
read_time= (double) records + scan_time + 1; // Force to use index
2414+
else
2415+
{
2416+
scan_time= (double) records / TIME_FOR_COMPARE + 1;
2417+
read_time= (double) head->file->scan_time() + scan_time + 1.1;
2418+
if (limit < records)
2419+
read_time= (double) records + scan_time + 1; // Force to use index
2420+
}
24172421

24182422
possible_keys.clear_all();
24192423

storage/tokudb/mysql-test/tokudb_bugs/r/2970.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ create table t2970 (a int, b int, c int, d int, key(a), key(a,b));
66
insert into t2970 values (1,1,1,1),(1,2,3,4);
77
explain select a,count(b),max(b) from t2970 where a > 0 group by a order by a;
88
id select_type table type possible_keys key key_len ref rows Extra
9-
1 SIMPLE t2970 index a,a_2 a_2 10 NULL 2 Using where; Using index
9+
1 SIMPLE t2970 range a,a_2 a_2 5 NULL 2 Using where; Using index
1010
drop table t2970;

support-files/mariadb@.service.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# (at your option) any later version.
2727

2828
[Unit]
29-
Description=MariaDB @VERSION@ database server (multi-instance)
29+
Description=MariaDB @VERSION@ database server (multi-instance %I)
3030
Documentation=man:mysqld(8)
3131
Documentation=https://mariadb.com/kb/en/library/systemd/
3232
After=network.target

0 commit comments

Comments
 (0)