Skip to content

Commit

Permalink
Merge 10.6 into 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jan 13, 2023
2 parents ab36eac + 3386b30 commit 1e04caf
Show file tree
Hide file tree
Showing 85 changed files with 1,854 additions and 634 deletions.
18 changes: 18 additions & 0 deletions mysql-test/main/cache_temporal_4265.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,21 @@ select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1;
2001-01-01 00:00:00.200000
2001-01-01 00:00:00.200000
drop table t1;
#
# MDEV-30345 DML does not find rows it is supposed to
#
CREATE TABLE t1 (f timestamp);
INSERT INTO t1 VALUES ('2022-01-01 00:00:00'),('2022-12-12 12:12:12');
CREATE TABLE t2 (f timestamp);
INSERT INTO t2 VALUES ('2022-01-01 00:00:00'),('2022-12-12 12:12:12');
SELECT * FROM t2 WHERE f IN ( SELECT f FROM t1 ) ;
f
2022-01-01 00:00:00
2022-12-12 12:12:12
DELETE FROM t2 WHERE f IN ( SELECT f FROM t1 ) ;
SELECT * FROM t2 WHERE f IN ( SELECT f FROM t1 ) ;
f
DROP TABLE t1,t2;
#
# End of 10.4 tests
#
18 changes: 18 additions & 0 deletions mysql-test/main/cache_temporal_4265.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,21 @@ select * from t1;
select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1;
drop table t1;

--echo #
--echo # MDEV-30345 DML does not find rows it is supposed to
--echo #

CREATE TABLE t1 (f timestamp);
INSERT INTO t1 VALUES ('2022-01-01 00:00:00'),('2022-12-12 12:12:12');

CREATE TABLE t2 (f timestamp);
INSERT INTO t2 VALUES ('2022-01-01 00:00:00'),('2022-12-12 12:12:12');

SELECT * FROM t2 WHERE f IN ( SELECT f FROM t1 ) ;
DELETE FROM t2 WHERE f IN ( SELECT f FROM t1 ) ;
SELECT * FROM t2 WHERE f IN ( SELECT f FROM t1 ) ;
DROP TABLE t1,t2;

--echo #
--echo # End of 10.4 tests
--echo #
11 changes: 11 additions & 0 deletions mysql-test/main/create.result
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,17 @@ Warnings:
Warning 1280 Name 'foo' ignored for PRIMARY key.
DROP TABLE t1;
#
# MDEV-30342 Wrong "Truncated incorrect DECIMAL value" warning/error
#
create table t1(c1 varchar(1));
insert into t1(c1) values('#');
select @@sql_mode like '%strict_all_tables%';
@@sql_mode like '%strict_all_tables%'
0
create table t2 as select if(c1 = '#', c1 = 0, c1) as c1 from t1;
ERROR 22007: Truncated incorrect DECIMAL value: '#'
drop table t1;
#
# End of 10.3 tests
#
#
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/main/create.test
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,19 @@ create table t1 (c int(10) unsigned) engine=memory transactional=0;
CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2));
DROP TABLE t1;

--echo #
--echo # MDEV-30342 Wrong "Truncated incorrect DECIMAL value" warning/error
--echo #

create table t1(c1 varchar(1));
insert into t1(c1) values('#');

select @@sql_mode like '%strict_all_tables%';
--error ER_TRUNCATED_WRONG_VALUE
create table t2 as select if(c1 = '#', c1 = 0, c1) as c1 from t1;

drop table t1;

--echo #
--echo # End of 10.3 tests
--echo #
Expand Down
21 changes: 21 additions & 0 deletions mysql-test/main/default.result
Original file line number Diff line number Diff line change
Expand Up @@ -3463,5 +3463,26 @@ SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
1
DROP TABLE t1;
#
# MDEV-29890 Update with inner join false row count result
#
create table t1 (a int not null);
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='t1';
column_name column_default has_default is_nullable
a NULL 0 NO
create or replace view v1 as select * from t1;
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='v1';
column_name column_default has_default is_nullable
a NULL 0 NO
create or replace view v1 as select * from t1 group by a;
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='v1';
column_name column_default has_default is_nullable
a NULL 0 NO
create or replace view v1 as select * from t1 group by a with rollup;
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='v1';
column_name column_default has_default is_nullable
a NULL 1 YES
drop view v1;
drop table t1;
#
# End of 10.4 test
#
14 changes: 14 additions & 0 deletions mysql-test/main/default.test
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,20 @@ INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
DROP TABLE t1;

--echo #
--echo # MDEV-29890 Update with inner join false row count result
--echo #
create table t1 (a int not null);
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='t1';
create or replace view v1 as select * from t1;
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='v1';
create or replace view v1 as select * from t1 group by a;
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='v1';
create or replace view v1 as select * from t1 group by a with rollup;
select column_name, column_default, column_default is not null as 'has_default', is_nullable from information_schema.columns where table_schema='test' and table_name='v1';
drop view v1;
drop table t1;

--echo #
--echo # End of 10.4 test
--echo #
11 changes: 10 additions & 1 deletion mysql-test/main/func_group.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
drop table if exists t1,t2,t3,t4,t5,t6;
set @sav_dpi= @@div_precision_increment;
set div_precision_increment= 5;
show variables like 'div_precision_increment';
Expand Down Expand Up @@ -2567,5 +2566,15 @@ stddev_samp(i) stddev_pop(i) stddev(i) std(i)
drop view v1;
drop table t1;
#
# MDEV-29988: Major performance regression with 10.6.11
#
create table t1 (a varchar(10) charset utf8mb4, b int, c int);
insert t1 values (1,2,3),(4,5,6),(1,7,8);
select concat(a,":",group_concat(b)) from t1 group by a;
concat(a,":",group_concat(b))
1:2,7
4:5
drop table t1;
#
# End of 10.3 tests
#
12 changes: 8 additions & 4 deletions mysql-test/main/func_group.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ if (`SELECT $PS_PROTOCOL != 0`)
--skip Test temporarily disabled for ps-protocol
}

--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6;
--enable_warnings

set @sav_dpi= @@div_precision_increment;
set div_precision_increment= 5;
show variables like 'div_precision_increment';
Expand Down Expand Up @@ -1807,6 +1803,14 @@ select * from v1;
drop view v1;
drop table t1;

--echo #
--echo # MDEV-29988: Major performance regression with 10.6.11
--echo #
create table t1 (a varchar(10) charset utf8mb4, b int, c int);
insert t1 values (1,2,3),(4,5,6),(1,7,8);
select concat(a,":",group_concat(b)) from t1 group by a;
drop table t1;

--echo #
--echo # End of 10.3 tests
--echo #
158 changes: 158 additions & 0 deletions mysql-test/main/func_json.result
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,164 @@ SELECT JSON_OBJECTAGG(a) FROM t1;
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 ') FROM t1' at line 1
DROP TABLE t1;
#
# MDEV-19160 JSON_DETAILED output unnecessarily verbose
#
create table t200 (a text);
insert into t200 values
('{
"steps": [
{
"join_optimization": {
"select_id": 1,
"steps": [
{
"rows_estimation": [
{
"table": "t1",
"range_analysis": {
"table_scan": {
"rows": 1000,
"cost": 2e308
},
"potential_range_indexes": [
{
"index": "a_b",
"usable": true,
"key_parts": ["a", "b"]
}
],
"best_covering_index_scan": {
"index": "a_b",
"cost": 52.195,
"chosen": true
},
"setup_range_conditions": [],
"group_index_range": {
"chosen": false,
"cause": "no group by or distinct"
},
"analyzing_range_alternatives": {
"range_scan_alternatives": [
{
"index": "a_b",
"ranges": ["2 <= a <= 2 AND 4 <= b <= 4", "123"],
"rowid_ordered": true,
"using_mrr": false,
"index_only": true,
"rows": 1,
"cost": 1.1752,
"chosen": true
}
],
"analyzing_roworder_intersect": {
"cause": "too few roworder scans"
},
"analyzing_index_merge_union": [],
"test_one_line_array":["123"]
},
"chosen_range_access_summary": {
"range_access_plan": {
"type": "range_scan",
"index": "a_b",
"rows": 1,
"ranges": ["2 <= a <= 2 AND 4 <= b <= 4"]
},
"rows_for_plan": 1,
"cost_for_plan": 1.1752,
"chosen": true
}
}
},
{
"selectivity_for_indexes": [
{
"index_name": "a_b",
"selectivity_from_index": 0.001
}
],
"selectivity_for_columns": [],
"cond_selectivity": 0.001
}
]
}
]
}
},
{
"join_execution": {
"select_id": 1,
"steps": []
}
}
]
}');
select JSON_DETAILED(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200;
JSON_DETAILED(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
[
{
"range_scan_alternatives":
[
{
"index": "a_b",
"ranges":
[
"2 <= a <= 2 AND 4 <= b <= 4",
"123"
],
"rowid_ordered": true,
"using_mrr": false,
"index_only": true,
"rows": 1,
"cost": 1.1752,
"chosen": true
}
],
"analyzing_roworder_intersect":
{
"cause": "too few roworder scans"
},
"analyzing_index_merge_union":
[],
"test_one_line_array":
["123"]
}
]
select JSON_PRETTY(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200;
JSON_PRETTY(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
[
{
"range_scan_alternatives":
[
{
"index": "a_b",
"ranges":
[
"2 <= a <= 2 AND 4 <= b <= 4",
"123"
],
"rowid_ordered": true,
"using_mrr": false,
"index_only": true,
"rows": 1,
"cost": 1.1752,
"chosen": true
}
],
"analyzing_roworder_intersect":
{
"cause": "too few roworder scans"
},
"analyzing_index_merge_union":
[],
"test_one_line_array":
["123"]
}
]
select JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200;
JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
[{"range_scan_alternatives": [{"index": "a_b", "ranges": ["2 <= a <= 2 AND 4 <= b <= 4", "123"], "rowid_ordered": true, "using_mrr": false, "index_only": true, "rows": 1, "cost": 1.1752, "chosen": true}], "analyzing_roworder_intersect": {"cause": "too few roworder scans"}, "analyzing_index_merge_union": [], "test_one_line_array": ["123"]}]
drop table t200;
#
# End of 10.4 tests
#
#
Expand Down
Loading

0 comments on commit 1e04caf

Please sign in to comment.