Skip to content

Commit 961c793

Browse files
committed
Merge 10.4 into 10.5
2 parents 5adcb2e + 3467f63 commit 961c793

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1123
-278
lines changed

libmariadb

mysql-test/main/derived_cond_pushdown.result

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17034,6 +17034,78 @@ id
1703417034
2
1703517035
3
1703617036
DROP TABLE t;
17037+
#
17038+
# MDEV-23804: Server crashes in st_select_lex::collect_grouping_fields_for_derived
17039+
#
17040+
CREATE TABLE t1 (a INT);
17041+
INSERT INTO t1 VALUES (3),(4);
17042+
CREATE VIEW v1 AS SELECT a FROM t1 UNION VALUES (3),(4);
17043+
ANALYZE FORMAT=JSON SELECT * from v1 WHERE a=3;
17044+
ANALYZE
17045+
{
17046+
"query_block": {
17047+
"select_id": 1,
17048+
"r_loops": 1,
17049+
"r_total_time_ms": "REPLACED",
17050+
"table": {
17051+
"table_name": "<derived2>",
17052+
"access_type": "ALL",
17053+
"r_loops": 1,
17054+
"rows": 4,
17055+
"r_rows": 2,
17056+
"r_table_time_ms": "REPLACED",
17057+
"r_other_time_ms": "REPLACED",
17058+
"filtered": 100,
17059+
"r_filtered": 50,
17060+
"attached_condition": "v1.a = 3",
17061+
"materialized": {
17062+
"query_block": {
17063+
"union_result": {
17064+
"table_name": "<union2,3>",
17065+
"access_type": "ALL",
17066+
"r_loops": 1,
17067+
"r_rows": 2,
17068+
"query_specifications": [
17069+
{
17070+
"query_block": {
17071+
"select_id": 2,
17072+
"r_loops": 1,
17073+
"r_total_time_ms": "REPLACED",
17074+
"table": {
17075+
"table_name": "t1",
17076+
"access_type": "ALL",
17077+
"r_loops": 1,
17078+
"rows": 2,
17079+
"r_rows": 2,
17080+
"r_table_time_ms": "REPLACED",
17081+
"r_other_time_ms": "REPLACED",
17082+
"filtered": 100,
17083+
"r_filtered": 50,
17084+
"attached_condition": "t1.a = 3"
17085+
}
17086+
}
17087+
},
17088+
{
17089+
"query_block": {
17090+
"select_id": 3,
17091+
"operation": "UNION",
17092+
"table": {
17093+
"message": "No tables used"
17094+
}
17095+
}
17096+
}
17097+
]
17098+
}
17099+
}
17100+
}
17101+
}
17102+
}
17103+
}
17104+
SELECT * from v1 WHERE a=3;
17105+
a
17106+
3
17107+
DROP VIEW v1;
17108+
DROP TABLE t1;
1703717109
# End of 10.3 tests
1703817110
#
1703917111
# MDEV-18679: materialized view with SELECT S containing materialized

mysql-test/main/derived_cond_pushdown.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3466,6 +3466,19 @@ eval set statement optimizer_switch='split_materialized=on' for $q;
34663466

34673467
DROP TABLE t;
34683468

3469+
--echo #
3470+
--echo # MDEV-23804: Server crashes in st_select_lex::collect_grouping_fields_for_derived
3471+
--echo #
3472+
3473+
CREATE TABLE t1 (a INT);
3474+
INSERT INTO t1 VALUES (3),(4);
3475+
CREATE VIEW v1 AS SELECT a FROM t1 UNION VALUES (3),(4);
3476+
--source include/analyze-format.inc
3477+
ANALYZE FORMAT=JSON SELECT * from v1 WHERE a=3;
3478+
SELECT * from v1 WHERE a=3;
3479+
DROP VIEW v1;
3480+
DROP TABLE t1;
3481+
34693482
--echo # End of 10.3 tests
34703483

34713484
--echo #

mysql-test/main/empty_string_literal.result

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,32 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
179179
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
180180
Warnings:
181181
Note 1003 select NULL AS `NULL`
182+
#
183+
# MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode
184+
#
185+
create table t1 (a int, b binary(1) generated always as (''), key(a,b));
186+
insert into t1 (a) values (1);
187+
set sql_mode= default;
188+
flush tables;
189+
update t1 set a = 2;
190+
show create table t1;
191+
Table Create Table
192+
t1 CREATE TABLE `t1` (
193+
`a` int(11) DEFAULT NULL,
194+
`b` binary(1) GENERATED ALWAYS AS (NULL) VIRTUAL,
195+
KEY `a` (`a`,`b`)
196+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
197+
drop table t1;
198+
create table t1 (a int, b binary(1) generated always as (''), key(a,b));
199+
insert into t1 (a) values (1);
200+
set sql_mode= 'empty_string_is_null';
201+
flush tables;
202+
update t1 set a = 2;
203+
show create table t1;
204+
Table Create Table
205+
t1 CREATE TABLE `t1` (
206+
`a` int(11) DEFAULT NULL,
207+
`b` binary(1) GENERATED ALWAYS AS ('') VIRTUAL,
208+
KEY `a` (`a`,`b`)
209+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
210+
drop table t1;

mysql-test/main/empty_string_literal.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,22 @@ USE test;
66
set @mode='EMPTY_STRING_IS_NULL';
77

88
--source include/empty_string_literal.inc
9+
10+
--echo #
11+
--echo # MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode
12+
--echo #
13+
create table t1 (a int, b binary(1) generated always as (''), key(a,b));
14+
insert into t1 (a) values (1);
15+
set sql_mode= default;
16+
flush tables;
17+
update t1 set a = 2;
18+
show create table t1;
19+
drop table t1;
20+
21+
create table t1 (a int, b binary(1) generated always as (''), key(a,b));
22+
insert into t1 (a) values (1);
23+
set sql_mode= 'empty_string_is_null';
24+
flush tables;
25+
update t1 set a = 2;
26+
show create table t1;
27+
drop table t1;

mysql-test/main/information_schema.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,5 +2304,14 @@ create table t2 (n int);
23042304
insert into t1 set n = (select table_rows from information_schema.tables where table_name='t2');
23052305
drop table t1, t2;
23062306
#
2307+
# MDEV-24593 Signal 11 when group by primary key of table joined to information_schema.columns
2308+
#
2309+
create table t1 (f varchar(64) primary key);
2310+
select f from information_schema.columns i
2311+
inner join t1 on f=i.column_name
2312+
group by f;
2313+
f
2314+
drop table t1;
2315+
#
23072316
# End of 10.3 tests
23082317
#

mysql-test/main/information_schema.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,16 @@ create table t2 (n int);
20052005
insert into t1 set n = (select table_rows from information_schema.tables where table_name='t2');
20062006
drop table t1, t2;
20072007

2008+
2009+
--echo #
2010+
--echo # MDEV-24593 Signal 11 when group by primary key of table joined to information_schema.columns
2011+
--echo #
2012+
create table t1 (f varchar(64) primary key);
2013+
select f from information_schema.columns i
2014+
inner join t1 on f=i.column_name
2015+
group by f;
2016+
drop table t1;
2017+
20082018
--echo #
20092019
--echo # End of 10.3 tests
20102020
--echo #

mysql-test/main/parser.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,15 @@ EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST';
18251825
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`systeminfo /FO LIST' at line 1
18261826
EXECUTE IMMEDIATE 'if(`systeminfo';
18271827
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`systeminfo' at line 1
1828+
#
1829+
# MDEV-23666 Assertion failed in Lex_input_stream::body_utf8_append
1830+
#
1831+
SET @@sql_mode='ANSI_QUOTES';
1832+
EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"';
1833+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"' at line 1
1834+
EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc';
1835+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"abc' at line 1
1836+
SET @@sql_mode=@save_sql_mode;
18281837
# End of 10.3 tests
18291838
#
18301839
# MDEV-19540: 10.4 allow lock options with SELECT in brackets

mysql-test/main/parser.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,21 @@ EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST';
15661566
--error ER_PARSE_ERROR
15671567
EXECUTE IMMEDIATE 'if(`systeminfo';
15681568

1569+
--echo #
1570+
--echo # MDEV-23666 Assertion failed in Lex_input_stream::body_utf8_append
1571+
--echo #
1572+
SET @@sql_mode='ANSI_QUOTES';
1573+
1574+
# Without a patch execution of the following statements results in assertion
1575+
# in Lex_input_stream::body_utf8_append on parsing the statement
1576+
--error ER_PARSE_ERROR
1577+
EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"';
1578+
1579+
--error ER_PARSE_ERROR
1580+
EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc';
1581+
1582+
SET @@sql_mode=@save_sql_mode;
1583+
15691584
--echo # End of 10.3 tests
15701585

15711586
--echo #
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
33
#
4-
connect con1,localhost,root,,;
4+
connect con1,localhost,root;
55
connection con1;
66
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go';
77
connection default;
@@ -13,17 +13,21 @@ User
1313
disconnect con1;
1414
connection default;
1515
SET DEBUG_SYNC = 'RESET';
16-
End of 5.5 tests
16+
#
17+
# End of 5.5 tests
18+
#
1719
#
1820
# MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep
1921
#
20-
connect con1,localhost,root,,;
21-
select sleep(100000);;
22+
connect con1,localhost,root;
23+
select sleep(100000);
2224
connection default;
23-
SHOW EXPLAIN FOR con_id;
25+
SHOW EXPLAIN FOR $con_id;
2426
id select_type table type possible_keys key key_len ref rows Extra
2527
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
2628
Warnings:
2729
Note 1003 select sleep(100000)
28-
KILL QUERY con_id;
30+
KILL QUERY $con_id;
31+
#
2932
# End of 10.2 tests
33+
#

0 commit comments

Comments
 (0)