Skip to content

Commit b15d1ad

Browse files
committed
Merge branch '12.2.1' into 12.2
2 parents 277c30f + 144dead commit b15d1ad

19 files changed

+472
-208
lines changed

mysql-test/main/delete.result

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,22 @@ id
779779
Warnings:
780780
Warning 4207 Index hints are ignored because they are incompatible with RETURNING clause
781781
drop table t2;
782-
#
783782
# End of 11.4 test
784783
#
784+
# MDEV-38068 Query doesn't delete all data it should after update to 11.8.4
785+
#
786+
create table t1 (id varchar(32), d1 char, key (id), key (d1)) engine=myisam;
787+
insert into t1 values ('1','A'), ('1','B'), ('1','C'), ('2','D'), ('2','E');
788+
select count(*) from t1;
789+
count(*)
790+
5
791+
need "range" below
792+
explain delete from t1 where id = '1';
793+
id select_type table type possible_keys key key_len ref rows Extra
794+
1 SIMPLE t1 range id id 131 NULL 3 Using where
795+
delete from t1 where id = '1';
796+
select count(*) from t1;
797+
count(*)
798+
2
799+
drop table t1;
800+
# End of 11.8 test

mysql-test/main/delete.test

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,18 @@ DELETE FROM t2 ignore index(primary) ORDER BY (id) LIMIT 2 RETURNING id;
825825

826826
drop table t2;
827827

828-
--echo #
829828
--echo # End of 11.4 test
829+
830830
--echo #
831+
--echo # MDEV-38068 Query doesn't delete all data it should after update to 11.8.4
832+
--echo #
833+
create table t1 (id varchar(32), d1 char, key (id), key (d1)) engine=myisam;
834+
insert into t1 values ('1','A'), ('1','B'), ('1','C'), ('2','D'), ('2','E');
835+
select count(*) from t1;
836+
--echo need "range" below
837+
explain delete from t1 where id = '1';
838+
delete from t1 where id = '1';
839+
select count(*) from t1;
840+
drop table t1;
841+
842+
--echo # End of 11.8 test

mysql-test/main/mdev_32854.result

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,14 @@ SELECT JSON_VALUE(@json_doc_arr_lev45_valid, '$[1][1][1][1][1][1][1][1][1][1][1]
452452
JSON_VALUE(@json_doc_arr_lev45_valid, '$[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1]')
453453
45
454454
DROP TABLE t1 ,t2;
455+
#
456+
# MDEV-37082: Sig 11 in json_normalize_sort
457+
#
458+
CREATE TABLE t (a JSON)Engine=InnoDB;
459+
INSERT INTO t VALUES (CONCAT (REPEAT('{"v":',5000),'1',REPEAT('}',5000)));
460+
INSERT INTO t VALUES (CONCAT (REPEAT('[',5000),'1',REPEAT(']',5000)));
461+
SELECT JSON_EQUALS (a,a) FROM t;
462+
JSON_EQUALS (a,a)
463+
1
464+
1
465+
DROP TABLE t;

mysql-test/main/mdev_32854.test

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ SELECT JSON_SCHEMA_VALID(@json_schema, @json_doc_obj_lev45_valid) AS found_path;
9090
SELECT JSON_SCHEMA_VALID(@json_schema, @json_doc_obj_lev45_valid2);
9191

9292

93-
9493
SELECT JSON_SEARCH(@json_doc_obj_lev45_valid,'one', 'This is level 45');
9594

9695
SET @json_updated = JSON_SET(@json_doc_obj_lev45_valid,
@@ -111,3 +110,18 @@ SELECT JSON_VALUE(@json_doc_obj_lev45_valid, '$.level1.level2.level3.level4.leve
111110
SELECT JSON_VALUE(@json_doc_arr_lev45_valid, '$[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1]');
112111

113112
DROP TABLE t1 ,t2;
113+
114+
--echo #
115+
--echo # MDEV-37082: Sig 11 in json_normalize_sort
116+
--echo #
117+
118+
--source include/have_innodb.inc
119+
120+
CREATE TABLE t (a JSON)Engine=InnoDB;
121+
122+
INSERT INTO t VALUES (CONCAT (REPEAT('{"v":',5000),'1',REPEAT('}',5000)));
123+
INSERT INTO t VALUES (CONCAT (REPEAT('[',5000),'1',REPEAT(']',5000)));
124+
125+
SELECT JSON_EQUALS (a,a) FROM t;
126+
127+
DROP TABLE t;

mysql-test/main/null_aware_cardinality.result

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
SET @session_start_value = @@new_mode;
21
# Small driving table
32
CREATE TABLE t1 (a INT, b INT);
43
INSERT INTO t1 VALUES (1, 1), (2, 2000),(3,300);
@@ -14,9 +13,6 @@ ANALYZE TABLE t2 PERSISTENT FOR ALL;
1413
Table Op Msg_type Msg_text
1514
test.t2 analyze status Engine-independent statistics collected
1615
test.t2 analyze status Table is already up to date
17-
SET @@new_mode = "FIX_INDEX_STATS_FOR_ALL_NULLS";
18-
Warnings:
19-
Warning 4200 The setting 'new_mode=FIX_INDEX_STATS_FOR_ALL_NULLS' is ignored. It only exists for compatibility with old installations and will be removed in a future release
2016
# NULL-rejecting equality t1.b = t2.b will not return any matches
2117
# because all values of t2.b are NULL. So "rows" = 1 for t2 where 1 is
2218
# a special value meaning "very few" rows
@@ -82,23 +78,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
8278
1 SIMPLE t3 ref key_ab key_ab 10 test.t1.a,const 11 100.00 Using where; Using index
8379
Warnings:
8480
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t3`.`b` is null
85-
# In the old mode (null-aware estimation is not enabled), "rows" > 1
86-
SET @@new_mode = "";
87-
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b = t2.b;
88-
id select_type table type possible_keys key key_len ref rows filtered Extra
89-
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
90-
1 SIMPLE t2 ref key_b key_b 5 test.t1.b 100 100.00 Using where
91-
Warnings:
92-
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` = `test`.`t1`.`b`
9381
# Insert some non-NULL values and re-collect the stats
9482
INSERT INTO t3 SELECT 1, 1 FROM seq_1_to_100;
9583
ANALYZE TABLE t3 PERSISTENT FOR COLUMNS (b) INDEXES (key_ab);
9684
Table Op Msg_type Msg_text
9785
test.t3 analyze status Engine-independent statistics collected
9886
test.t3 analyze status OK
99-
SET @@new_mode = "FIX_INDEX_STATS_FOR_ALL_NULLS";
100-
Warnings:
101-
Warning 4200 The setting 'new_mode=FIX_INDEX_STATS_FOR_ALL_NULLS' is ignored. It only exists for compatibility with old installations and will be removed in a future release
10287
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t3 ON t1.a = t3.a AND t1.b = t3.b;
10388
id select_type table type possible_keys key key_len ref rows filtered Extra
10489
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
@@ -158,5 +143,4 @@ EXPLAIN SELECT * FROM t1, t2 WHERE t2.a=t1.a AND t2.b=t1.a;
158143
id select_type table type possible_keys key key_len ref rows Extra
159144
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
160145
1 SIMPLE t2 ref i1 i1 66 test.t1.a,test.t1.a 1 Using where
161-
SET @@new_mode = @session_start_value;
162146
DROP TABLE t1, t2;

mysql-test/main/null_aware_cardinality.test

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--source include/have_sequence.inc
22

3-
SET @session_start_value = @@new_mode;
4-
53
--echo # Small driving table
64
CREATE TABLE t1 (a INT, b INT);
75
INSERT INTO t1 VALUES (1, 1), (2, 2000),(3,300);
@@ -15,8 +13,6 @@ INSERT INTO t2 SELECT seq/100, NULL FROM seq_1_to_1000;
1513

1614
ANALYZE TABLE t2 PERSISTENT FOR ALL;
1715

18-
SET @@new_mode = "FIX_INDEX_STATS_FOR_ALL_NULLS";
19-
2016
--echo # NULL-rejecting equality t1.b = t2.b will not return any matches
2117
--echo # because all values of t2.b are NULL. So "rows" = 1 for t2 where 1 is
2218
--echo # a special value meaning "very few" rows
@@ -52,16 +48,11 @@ EXPLAIN EXTENDED SELECT * FROM t1 JOIN t3 ON t1.a = t3.a AND t1.b <=> t3.b;
5248

5349
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t3 ON t1.a = t3.a AND t3.b is NULL;
5450

55-
--echo # In the old mode (null-aware estimation is not enabled), "rows" > 1
56-
SET @@new_mode = "";
57-
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b = t2.b;
58-
5951
--echo # Insert some non-NULL values and re-collect the stats
6052
INSERT INTO t3 SELECT 1, 1 FROM seq_1_to_100;
6153

6254
ANALYZE TABLE t3 PERSISTENT FOR COLUMNS (b) INDEXES (key_ab);
6355

64-
SET @@new_mode = "FIX_INDEX_STATS_FOR_ALL_NULLS";
6556
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t3 ON t1.a = t3.a AND t1.b = t3.b;
6657

6758
--echo # Test composite index for 3 columns. Key prefix is used for access
@@ -99,5 +90,4 @@ ANALYZE TABLE t2 PERSISTENT FOR COLUMNS (b) INDEXES (i1);
9990

10091
EXPLAIN SELECT * FROM t1, t2 WHERE t2.a=t1.a AND t2.b=t1.a;
10192

102-
SET @@new_mode = @session_start_value;
10393
DROP TABLE t1, t2;

mysql-test/suite/vcol/r/order_by_group_by_subst.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,19 @@ a b
222222
5 4
223223
5 5
224224
drop table t1, t2;
225+
#
226+
# MDEV-37422: SIGSEGV failed in base_list_iterator::replace, Assertion `n < m_size'
227+
# in Baounds_checked_array, ASAN use-after-poison in JOIN::rollup_make_fields
228+
#
229+
CREATE TABLE t1 (
230+
a INT,
231+
b INT,
232+
a1 INT GENERATED ALWAYS AS (a) VIRTUAL,
233+
INDEX (a1)
234+
) ENGINE=INNODB;
235+
SELECT * FROM t1 GROUP BY a WITH ROLLUP;
236+
a b a1
237+
drop table t1;
238+
#
239+
# End of 12.1 tests
240+
#

mysql-test/suite/vcol/t/order_by_group_by_subst.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,22 @@ insert into t1 (a) select seq from seq_1_to_5;
168168
insert into t2 (b) select seq from seq_1_to_5;
169169
SELECT a, b FROM t1, t2 GROUP BY a, b HAVING a>2 and b>2;
170170
drop table t1, t2;
171+
172+
--echo #
173+
--echo # MDEV-37422: SIGSEGV failed in base_list_iterator::replace, Assertion `n < m_size'
174+
--echo # in Baounds_checked_array, ASAN use-after-poison in JOIN::rollup_make_fields
175+
--echo #
176+
--source include/have_innodb.inc
177+
CREATE TABLE t1 (
178+
a INT,
179+
b INT,
180+
a1 INT GENERATED ALWAYS AS (a) VIRTUAL,
181+
INDEX (a1)
182+
) ENGINE=INNODB;
183+
184+
SELECT * FROM t1 GROUP BY a WITH ROLLUP;
185+
drop table t1;
186+
187+
--echo #
188+
--echo # End of 12.1 tests
189+
--echo #

sql/item_numconvfunc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,7 @@ class Parser: public Tokenizer,
24442444
:A(Unsigned_currency::Container(
24452445
Approximate::Container(
24462446
Decimal(
2447-
std::move(Zeros_or_nines(static_cast<Zeros&&>(rhs))),
2447+
Zeros_or_nines(static_cast<Zeros&&>(rhs)),
24482448
std::move(static_cast<Decimal_tail&&>(rhs))),
24492449
std::move(static_cast<EEEE&&>(rhs))))),
24502450
B(std::move(static_cast<Postfix_sign&&>(rhs)))

sql/opt_hints.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,8 +1525,8 @@ bool Opt_hints_qb::compare_table_name(
15251525
considered to be equal to `Opt_hints_qb::get_name()`
15261526
*/
15271527
const LEX_CSTRING &hint_tab_qb_name=
1528-
hint_table_and_qb->qb_name.length > 0 ? hint_table_and_qb->qb_name :
1529-
this->get_name();
1528+
hint_table_and_qb->qb_name.length > 0 || this->get_name().length == 0
1529+
? hint_table_and_qb->qb_name : this->get_name();
15301530

15311531
CHARSET_INFO *cs= charset_info();
15321532
// Compare QB names

0 commit comments

Comments
 (0)