Skip to content

Commit d8dc853

Browse files
committed
Merge 10.3 into 10.4
2 parents 550cf13 + 0f3045e commit d8dc853

File tree

12 files changed

+116
-318
lines changed

12 files changed

+116
-318
lines changed

libmariadb

mysql-test/main/func_group.result

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,38 @@ count(*)+sleep(0)
24602460
2
24612461
drop table t1;
24622462
#
2463-
# Start of 10.3 tests
2463+
# MDEV-25112: MIN/MAX optimization for query containing BETWEEN in WHERE
2464+
#
2465+
create table t1 (a int) engine=myisam;
2466+
insert into t1 values (267), (273), (287), (303), (308);
2467+
select max(a) from t1 where a < 303 and (a between 267 AND 287);
2468+
max(a)
2469+
287
2470+
explain select max(a) from t1 where a < 303 and (a between 267 AND 287);
2471+
id select_type table type possible_keys key key_len ref rows Extra
2472+
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
2473+
select min(a) from t1 where a > 267 and (a between 273 AND 303);
2474+
min(a)
2475+
273
2476+
explain select min(a) from t1 where a > 267 and (a between 273 AND 303);
2477+
id select_type table type possible_keys key key_len ref rows Extra
2478+
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
2479+
create index idx on t1(a);
2480+
select max(a) from t1 where a < 303 and (a between 267 AND 287);
2481+
max(a)
2482+
287
2483+
explain select max(a) from t1 where a < 303 and (a between 267 AND 287);
2484+
id select_type table type possible_keys key key_len ref rows Extra
2485+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2486+
select min(a) from t1 where a > 267 and (a between 273 AND 303);
2487+
min(a)
2488+
273
2489+
explain select min(a) from t1 where a > 267 and (a between 273 AND 303);
2490+
id select_type table type possible_keys key key_len ref rows Extra
2491+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2492+
drop table t1;
2493+
#
2494+
# End of 10.2 tests
24642495
#
24652496
#
24662497
# MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view
@@ -2492,3 +2523,6 @@ t2 CREATE TABLE `t2` (
24922523
DROP TABLE t2;
24932524
DROP VIEW v1;
24942525
DROP TABLE t1;
2526+
#
2527+
# End of 10.3 tests
2528+
#

mysql-test/main/func_group.test

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,33 @@ select count(*)+sleep(0) from t1;
17051705
drop table t1;
17061706

17071707
--echo #
1708-
--echo # Start of 10.3 tests
1708+
--echo # MDEV-25112: MIN/MAX optimization for query containing BETWEEN in WHERE
1709+
--echo #
1710+
1711+
create table t1 (a int) engine=myisam;
1712+
insert into t1 values (267), (273), (287), (303), (308);
1713+
1714+
let $q1=
1715+
select max(a) from t1 where a < 303 and (a between 267 AND 287);
1716+
let $q2=
1717+
select min(a) from t1 where a > 267 and (a between 273 AND 303);
1718+
1719+
eval $q1;
1720+
eval explain $q1;
1721+
eval $q2;
1722+
eval explain $q2;
1723+
1724+
create index idx on t1(a);
1725+
1726+
eval $q1;
1727+
eval explain $q1;
1728+
eval $q2;
1729+
eval explain $q2;
1730+
1731+
drop table t1;
1732+
1733+
--echo #
1734+
--echo # End of 10.2 tests
17091735
--echo #
17101736

17111737
--echo #
@@ -1730,3 +1756,7 @@ DROP TABLE t2;
17301756

17311757
DROP VIEW v1;
17321758
DROP TABLE t1;
1759+
1760+
--echo #
1761+
--echo # End of 10.3 tests
1762+
--echo #

mysql-test/suite/engines/funcs/r/rpl_000015.result

Lines changed: 24 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -7,241 +7,40 @@ master-bin.000001 329
77
connection slave;
88
include/stop_slave.inc
99
reset slave;
10-
show slave status;
11-
Slave_IO_State #
12-
Master_Host 127.0.0.1
13-
Master_User root
14-
Master_Port MASTER_PORT
15-
Connect_Retry #
16-
Master_Log_File
17-
Read_Master_Log_Pos 4
18-
Relay_Log_File #
19-
Relay_Log_Pos #
20-
Relay_Master_Log_File
21-
Slave_IO_Running No
22-
Slave_SQL_Running No
23-
Replicate_Do_DB
24-
Replicate_Ignore_DB
25-
Replicate_Do_Table
26-
Replicate_Ignore_Table
27-
Replicate_Wild_Do_Table
28-
Replicate_Wild_Ignore_Table
29-
Last_Errno 0
30-
Last_Error
31-
Skip_Counter 0
32-
Exec_Master_Log_Pos 0
33-
Relay_Log_Space #
34-
Until_Condition None
35-
Until_Log_File
36-
Until_Log_Pos 0
37-
Master_SSL_Allowed No
38-
Master_SSL_CA_File
39-
Master_SSL_CA_Path
40-
Master_SSL_Cert
41-
Master_SSL_Cipher
42-
Master_SSL_Key
43-
Seconds_Behind_Master #
44-
Master_SSL_Verify_Server_Cert No
45-
Last_IO_Errno 0
46-
Last_IO_Error
47-
Last_SQL_Errno 0
48-
Last_SQL_Error
49-
Replicate_Ignore_Server_Ids
50-
Master_Server_Id 1
51-
Master_SSL_Crl
52-
Master_SSL_Crlpath
53-
Using_Gtid No
54-
Gtid_IO_Pos
55-
Replicate_Do_Domain_Ids
56-
Replicate_Ignore_Domain_Ids
57-
Parallel_Mode conservative
58-
SQL_Delay 0
59-
SQL_Remaining_Delay NULL
60-
Slave_SQL_Running_State
61-
Slave_DDL_Groups 2
62-
Slave_Non_Transactional_Groups 0
63-
Slave_Transactional_Groups 2
10+
Slave_IO_Running = 'No'
11+
Slave_SQL_Running = 'No'
12+
Last_SQL_Errno = '0'
13+
Last_SQL_Error = ''
14+
Exec_Master_Log_Pos = '0'
6415
change master to master_host='127.0.0.1';
65-
show slave status;
66-
Slave_IO_State #
67-
Master_Host 127.0.0.1
68-
Master_User root
69-
Master_Port MASTER_PORT
70-
Connect_Retry #
71-
Master_Log_File
72-
Read_Master_Log_Pos 4
73-
Relay_Log_File #
74-
Relay_Log_Pos #
75-
Relay_Master_Log_File
76-
Slave_IO_Running No
77-
Slave_SQL_Running No
78-
Replicate_Do_DB
79-
Replicate_Ignore_DB
80-
Replicate_Do_Table
81-
Replicate_Ignore_Table
82-
Replicate_Wild_Do_Table
83-
Replicate_Wild_Ignore_Table
84-
Last_Errno 0
85-
Last_Error
86-
Skip_Counter 0
87-
Exec_Master_Log_Pos 0
88-
Relay_Log_Space #
89-
Until_Condition None
90-
Until_Log_File
91-
Until_Log_Pos 0
92-
Master_SSL_Allowed No
93-
Master_SSL_CA_File
94-
Master_SSL_CA_Path
95-
Master_SSL_Cert
96-
Master_SSL_Cipher
97-
Master_SSL_Key
98-
Seconds_Behind_Master #
99-
Master_SSL_Verify_Server_Cert No
100-
Last_IO_Errno 0
101-
Last_IO_Error
102-
Last_SQL_Errno 0
103-
Last_SQL_Error
104-
Replicate_Ignore_Server_Ids
105-
Master_Server_Id 1
106-
Master_SSL_Crl
107-
Master_SSL_Crlpath
108-
Using_Gtid No
109-
Gtid_IO_Pos
110-
Replicate_Do_Domain_Ids
111-
Replicate_Ignore_Domain_Ids
112-
Parallel_Mode conservative
113-
SQL_Delay 0
114-
SQL_Remaining_Delay NULL
115-
Slave_SQL_Running_State
116-
Slave_DDL_Groups 2
117-
Slave_Non_Transactional_Groups 0
118-
Slave_Transactional_Groups 2
119-
change master to master_host='127.0.0.1',master_user='root',
16+
Slave_IO_Running = 'No'
17+
Slave_SQL_Running = 'No'
18+
Last_SQL_Errno = '0'
19+
Last_SQL_Error = ''
20+
Exec_Master_Log_Pos = '0'
21+
change master to master_host='127.0.0.1',master_user='root',
12022
master_password='',master_port=MASTER_PORT;
121-
show slave status;
122-
Slave_IO_State #
123-
Master_Host 127.0.0.1
124-
Master_User root
125-
Master_Port MASTER_PORT
126-
Connect_Retry #
127-
Master_Log_File
128-
Read_Master_Log_Pos 4
129-
Relay_Log_File #
130-
Relay_Log_Pos #
131-
Relay_Master_Log_File
132-
Slave_IO_Running No
133-
Slave_SQL_Running No
134-
Replicate_Do_DB
135-
Replicate_Ignore_DB
136-
Replicate_Do_Table
137-
Replicate_Ignore_Table
138-
Replicate_Wild_Do_Table
139-
Replicate_Wild_Ignore_Table
140-
Last_Errno 0
141-
Last_Error
142-
Skip_Counter 0
143-
Exec_Master_Log_Pos 0
144-
Relay_Log_Space #
145-
Until_Condition None
146-
Until_Log_File
147-
Until_Log_Pos 0
148-
Master_SSL_Allowed No
149-
Master_SSL_CA_File
150-
Master_SSL_CA_Path
151-
Master_SSL_Cert
152-
Master_SSL_Cipher
153-
Master_SSL_Key
154-
Seconds_Behind_Master #
155-
Master_SSL_Verify_Server_Cert No
156-
Last_IO_Errno 0
157-
Last_IO_Error
158-
Last_SQL_Errno 0
159-
Last_SQL_Error
160-
Replicate_Ignore_Server_Ids
161-
Master_Server_Id 1
162-
Master_SSL_Crl
163-
Master_SSL_Crlpath
164-
Using_Gtid No
165-
Gtid_IO_Pos
166-
Replicate_Do_Domain_Ids
167-
Replicate_Ignore_Domain_Ids
168-
Parallel_Mode conservative
169-
SQL_Delay 0
170-
SQL_Remaining_Delay NULL
171-
Slave_SQL_Running_State
172-
Slave_DDL_Groups 2
173-
Slave_Non_Transactional_Groups 0
174-
Slave_Transactional_Groups 2
17523
include/start_slave.inc
176-
show slave status;
177-
Slave_IO_State Waiting for master to send event
178-
Master_Host 127.0.0.1
179-
Master_User root
180-
Master_Port MASTER_PORT
181-
Connect_Retry 1
182-
Master_Log_File master-bin.000001
183-
Read_Master_Log_Pos 329
184-
Relay_Log_File slave-relay-bin.000002
185-
Relay_Log_Pos 629
186-
Relay_Master_Log_File master-bin.000001
187-
Slave_IO_Running Yes
188-
Slave_SQL_Running Yes
189-
Replicate_Do_DB
190-
Replicate_Ignore_DB
191-
Replicate_Do_Table
192-
Replicate_Ignore_Table
193-
Replicate_Wild_Do_Table
194-
Replicate_Wild_Ignore_Table
195-
Last_Errno 0
196-
Last_Error
197-
Skip_Counter 0
198-
Exec_Master_Log_Pos 329
199-
Relay_Log_Space 938
200-
Until_Condition None
201-
Until_Log_File
202-
Until_Log_Pos 0
203-
Master_SSL_Allowed No
204-
Master_SSL_CA_File
205-
Master_SSL_CA_Path
206-
Master_SSL_Cert
207-
Master_SSL_Cipher
208-
Master_SSL_Key
209-
Seconds_Behind_Master #
210-
Master_SSL_Verify_Server_Cert No
211-
Last_IO_Errno 0
212-
Last_IO_Error
213-
Last_SQL_Errno 0
214-
Last_SQL_Error
215-
Replicate_Ignore_Server_Ids
216-
Master_Server_Id 1
217-
Master_SSL_Crl
218-
Master_SSL_Crlpath
219-
Using_Gtid No
220-
Gtid_IO_Pos
221-
Replicate_Do_Domain_Ids
222-
Replicate_Ignore_Domain_Ids
223-
Parallel_Mode conservative
224-
SQL_Delay 0
225-
SQL_Remaining_Delay NULL
226-
Slave_SQL_Running_State Slave has read all relay log; waiting for the slave I/O thread to update it
227-
Slave_DDL_Groups 2
228-
Slave_Non_Transactional_Groups 0
229-
Slave_Transactional_Groups 2
24+
Slave_IO_Running = 'Yes'
25+
Slave_SQL_Running = 'Yes'
26+
Last_SQL_Errno = '0'
27+
Last_SQL_Error = ''
28+
Exec_Master_Log_Pos = '329'
23029
connection master;
231-
drop table if exists t1;
23230
create table t1 (n int, PRIMARY KEY(n));
23331
insert into t1 values (10),(45),(90);
23432
connection slave;
235-
connection slave;
23633
SELECT * FROM t1 ORDER BY n;
237-
n 10
238-
n 45
239-
n 90
34+
n
35+
10
36+
45
37+
90
24038
connection master;
24139
SELECT * FROM t1 ORDER BY n;
242-
n 10
243-
n 45
244-
n 90
40+
n
41+
10
42+
45
43+
90
24544
drop table t1;
24645
connection slave;
24746
include/rpl_end.inc

0 commit comments

Comments
 (0)