Skip to content

Commit 644a6b1

Browse files
committed
Merge branch '11.0' into mariadb-11.0.4
2 parents 48af85d + 13cc196 commit 644a6b1

File tree

8 files changed

+67
-4
lines changed

8 files changed

+67
-4
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Without automated tests, future regressions in the expected behavior can't be au
3232
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
3333

3434
<!--
35-
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct. (Currently the earliest maintained branch is 10.3)
35+
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct. (Currently the earliest maintained branch is 10.4)
3636
-->
3737
## Basing the PR against the correct MariaDB version
3838
- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.*

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=11
22
MYSQL_VERSION_MINOR=0
3-
MYSQL_VERSION_PATCH=4
3+
MYSQL_VERSION_PATCH=5
44
SERVER_MATURITY=stable

mysql-test/main/func_json.result

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,3 +2545,24 @@ SET @@collation_connection= @save_collation_connection;
25452545
#
25462546
# End of 10.9 Test
25472547
#
2548+
#
2549+
# MDEV-32007: JSON_VALUE and JSON_EXTRACT doesn't handle dash (-)
2550+
# as first character in key
2551+
#
2552+
CREATE TEMPORARY TABLE IF NOT EXISTS jsonTest AS
2553+
SELECT '{ "-1234" : "something",
2554+
"12-34" : "else",
2555+
"1234-" : "and",
2556+
"1234" : "match" }' AS 'message';
2557+
SELECT JSON_SEARCH(message, 'one', 'something') AS t1_path,
2558+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'something'))) AS t1_result,
2559+
JSON_SEARCH(message, 'one', 'else') AS t2_path,
2560+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'else'))) AS t2_result,
2561+
JSON_SEARCH(message, 'one', 'and') AS t3_path,
2562+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'and'))) AS t3_result,
2563+
JSON_SEARCH(message, 'one', 'match') AS t4_path,
2564+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'match'))) AS t4_result
2565+
FROM jsonTest;
2566+
t1_path t1_result t2_path t2_result t3_path t3_result t4_path t4_result
2567+
"$.-1234" something "$.12-34" else "$.1234-" and "$.1234" match
2568+
# End of 11.0 test

mysql-test/main/func_json.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,3 +1828,26 @@ SET @@collation_connection= @save_collation_connection;
18281828
--echo #
18291829
--echo # End of 10.9 Test
18301830
--echo #
1831+
1832+
--echo #
1833+
--echo # MDEV-32007: JSON_VALUE and JSON_EXTRACT doesn't handle dash (-)
1834+
--echo # as first character in key
1835+
--echo #
1836+
1837+
CREATE TEMPORARY TABLE IF NOT EXISTS jsonTest AS
1838+
SELECT '{ "-1234" : "something",
1839+
"12-34" : "else",
1840+
"1234-" : "and",
1841+
"1234" : "match" }' AS 'message';
1842+
1843+
SELECT JSON_SEARCH(message, 'one', 'something') AS t1_path,
1844+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'something'))) AS t1_result,
1845+
JSON_SEARCH(message, 'one', 'else') AS t2_path,
1846+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'else'))) AS t2_result,
1847+
JSON_SEARCH(message, 'one', 'and') AS t3_path,
1848+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'and'))) AS t3_result,
1849+
JSON_SEARCH(message, 'one', 'match') AS t4_path,
1850+
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'match'))) AS t4_result
1851+
FROM jsonTest;
1852+
1853+
--echo # End of 11.0 test

mysql-test/main/order_by_innodb.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,13 @@ a b c
306306
6 2 26
307307
6 3 36
308308
drop table t1;
309+
#
310+
# MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
311+
#
312+
CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
313+
INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
314+
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
315+
a b
316+
ab NULL
317+
DROP TABLE t1;
318+
# End of 11.0 tests

mysql-test/main/order_by_innodb.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,12 @@ explain select * from t1 force index(r) order by a,b limit 20;
252252
explain select * from t1 force index(r) order by a desc,b limit 20;
253253
select * from t1 force index(r) order by a desc,b limit 20;
254254
drop table t1;
255+
256+
--echo #
257+
--echo # MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
258+
--echo #
259+
CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
260+
INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
261+
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
262+
DROP TABLE t1;
263+
--echo # End of 11.0 tests

sql/sql_select.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26596,7 +26596,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
2659626596
!table->is_clustering_key(best_key)))
2659726597
goto use_filesort;
2659826598

26599-
if (table->opt_range_keys.is_set(best_key) && best_key != ref_key)
26599+
if (select && table->opt_range_keys.is_set(best_key) && best_key != ref_key)
2660026600
{
2660126601
key_map tmp_map;
2660226602
tmp_map.clear_all(); // Force the creation of quick select

strings/json_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]=
10931093
/* AS */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_T, PS_PT, JE_SYN, PS_NEG,
10941094
PS_Z, PS_INT, PS_LAST, PS_AS, JE_SYN, JE_SYN, JE_SYN,
10951095
JE_NOT_JSON_CHR, JE_BAD_CHR},
1096-
/* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, PS_KNM, JE_SYN, JE_SYN,
1096+
/* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, PS_KNM, JE_SYN, PS_KNM,
10971097
PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_KNM, JE_SYN, PS_KEYX, PS_KNM,
10981098
JE_NOT_JSON_CHR, JE_BAD_CHR},
10991099
/* KNM */ { PS_KOK, PS_KNM, PS_AST, PS_EAR, PS_KNM, PS_KNM, PS_EKY, PS_KNM,

0 commit comments

Comments
 (0)