Commit 644a6b10 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge branch '11.0' into mariadb-11.0.4

parents 48af85db 13cc1963
......@@ -32,7 +32,7 @@ Without automated tests, future regressions in the expected behavior can't be au
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
<!--
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)
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)
-->
## Basing the PR against the correct MariaDB version
- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.*
......
MYSQL_VERSION_MAJOR=11
MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=4
MYSQL_VERSION_PATCH=5
SERVER_MATURITY=stable
......@@ -2545,3 +2545,24 @@ SET @@collation_connection= @save_collation_connection;
#
# End of 10.9 Test
#
#
# MDEV-32007: JSON_VALUE and JSON_EXTRACT doesn't handle dash (-)
# as first character in key
#
CREATE TEMPORARY TABLE IF NOT EXISTS jsonTest AS
SELECT '{ "-1234" : "something",
"12-34" : "else",
"1234-" : "and",
"1234" : "match" }' AS 'message';
SELECT JSON_SEARCH(message, 'one', 'something') AS t1_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'something'))) AS t1_result,
JSON_SEARCH(message, 'one', 'else') AS t2_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'else'))) AS t2_result,
JSON_SEARCH(message, 'one', 'and') AS t3_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'and'))) AS t3_result,
JSON_SEARCH(message, 'one', 'match') AS t4_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'match'))) AS t4_result
FROM jsonTest;
t1_path t1_result t2_path t2_result t3_path t3_result t4_path t4_result
"$.-1234" something "$.12-34" else "$.1234-" and "$.1234" match
# End of 11.0 test
......@@ -1828,3 +1828,26 @@ SET @@collation_connection= @save_collation_connection;
--echo #
--echo # End of 10.9 Test
--echo #
--echo #
--echo # MDEV-32007: JSON_VALUE and JSON_EXTRACT doesn't handle dash (-)
--echo # as first character in key
--echo #
CREATE TEMPORARY TABLE IF NOT EXISTS jsonTest AS
SELECT '{ "-1234" : "something",
"12-34" : "else",
"1234-" : "and",
"1234" : "match" }' AS 'message';
SELECT JSON_SEARCH(message, 'one', 'something') AS t1_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'something'))) AS t1_result,
JSON_SEARCH(message, 'one', 'else') AS t2_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'else'))) AS t2_result,
JSON_SEARCH(message, 'one', 'and') AS t3_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'and'))) AS t3_result,
JSON_SEARCH(message, 'one', 'match') AS t4_path,
JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'match'))) AS t4_result
FROM jsonTest;
--echo # End of 11.0 test
......@@ -306,3 +306,13 @@ a b c
6 2 26
6 3 36
drop table t1;
#
# MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
#
CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
a b
ab NULL
DROP TABLE t1;
# End of 11.0 tests
......@@ -252,3 +252,12 @@ explain select * from t1 force index(r) order by a,b limit 20;
explain select * from t1 force index(r) order by a desc,b limit 20;
select * from t1 force index(r) order by a desc,b limit 20;
drop table t1;
--echo #
--echo # MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
--echo #
CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
DROP TABLE t1;
--echo # End of 11.0 tests
......@@ -26596,7 +26596,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
!table->is_clustering_key(best_key)))
goto use_filesort;
if (table->opt_range_keys.is_set(best_key) && best_key != ref_key)
if (select && table->opt_range_keys.is_set(best_key) && best_key != ref_key)
{
key_map tmp_map;
tmp_map.clear_all(); // Force the creation of quick select
......@@ -1093,7 +1093,7 @@ static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]=
/* AS */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_T, PS_PT, JE_SYN, PS_NEG,
PS_Z, PS_INT, PS_LAST, PS_AS, JE_SYN, JE_SYN, JE_SYN,
JE_NOT_JSON_CHR, JE_BAD_CHR},
/* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, PS_KNM, JE_SYN, JE_SYN,
/* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, PS_KNM, JE_SYN, PS_KNM,
PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_KNM, JE_SYN, PS_KEYX, PS_KNM,
JE_NOT_JSON_CHR, JE_BAD_CHR},
/* KNM */ { PS_KOK, PS_KNM, PS_AST, PS_EAR, PS_KNM, PS_KNM, PS_EKY, PS_KNM,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment