mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@@ -1641,3 +1641,21 @@ a b
|
|||||||
drop procedure p1;
|
drop procedure p1;
|
||||||
drop procedure p2;
|
drop procedure p2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-17107: PS for CREATE OR REPLACE VIEW defined by SELECT with CTEs
|
||||||
|
#
|
||||||
|
create table t1(a int);
|
||||||
|
insert into t1 values (3), (1), (2);
|
||||||
|
create table t2 (b int);
|
||||||
|
insert into t2 values (2), (10);
|
||||||
|
prepare stmt from
|
||||||
|
"create or replace view v1 as
|
||||||
|
with t as (select s.a from (select t1.a from t1) s),
|
||||||
|
r as(select t.a from t2, t where t2.b=t.a)
|
||||||
|
select a from r;";
|
||||||
|
execute stmt;
|
||||||
|
select * from v1;
|
||||||
|
a
|
||||||
|
2
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
@@ -1147,3 +1147,24 @@ select * from t1;
|
|||||||
drop procedure p1;
|
drop procedure p1;
|
||||||
drop procedure p2;
|
drop procedure p2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-17107: PS for CREATE OR REPLACE VIEW defined by SELECT with CTEs
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
create table t1(a int);
|
||||||
|
insert into t1 values (3), (1), (2);
|
||||||
|
create table t2 (b int);
|
||||||
|
insert into t2 values (2), (10);
|
||||||
|
|
||||||
|
prepare stmt from
|
||||||
|
"create or replace view v1 as
|
||||||
|
with t as (select s.a from (select t1.a from t1) s),
|
||||||
|
r as(select t.a from t2, t where t2.b=t.a)
|
||||||
|
select a from r;";
|
||||||
|
|
||||||
|
execute stmt;
|
||||||
|
select * from v1;
|
||||||
|
|
||||||
|
drop view v1;
|
||||||
|
drop table t1,t2;
|
||||||
|
@@ -16393,6 +16393,152 @@ a b c
|
|||||||
1 2 2
|
1 2 2
|
||||||
3 2 2
|
3 2 2
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-17354: INSERT SELECT with condition pushdown into derived
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (f INT NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (3), (7), (3);
|
||||||
|
CREATE ALGORITHM= TEMPTABLE VIEW v1 AS SELECT * FROM ( SELECT * FROM t1 ) AS sq;
|
||||||
|
INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
|
||||||
|
EXPLAIN INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 144 Using where
|
||||||
|
2 DERIVED <derived3> ALL NULL NULL NULL NULL 12
|
||||||
|
2 DERIVED t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
|
||||||
|
3 DERIVED t1 ALL NULL NULL NULL NULL 12
|
||||||
|
EXPLAIN FORMAT=JSON INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
|
||||||
|
EXPLAIN
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 1,
|
||||||
|
"table": {
|
||||||
|
"table_name": "<derived2>",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 144,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "t.f is not null",
|
||||||
|
"materialized": {
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 2,
|
||||||
|
"table": {
|
||||||
|
"table_name": "<derived3>",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 12,
|
||||||
|
"filtered": 100,
|
||||||
|
"materialized": {
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 3,
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 12,
|
||||||
|
"filtered": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"block-nl-join": {
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 12,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "t1.f is not null"
|
||||||
|
},
|
||||||
|
"buffer_type": "flat",
|
||||||
|
"buffer_size": "256Kb",
|
||||||
|
"join_type": "BNL"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SELECT * FROM t1;
|
||||||
|
f
|
||||||
|
3
|
||||||
|
7
|
||||||
|
3
|
||||||
|
3
|
||||||
|
3
|
||||||
|
3
|
||||||
|
7
|
||||||
|
7
|
||||||
|
7
|
||||||
|
3
|
||||||
|
3
|
||||||
|
3
|
||||||
|
DELETE FROM t1;
|
||||||
|
INSERT INTO t1 VALUES (3), (7), (3);
|
||||||
|
INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t
|
||||||
|
WHERE f IS NOT NULL;
|
||||||
|
EXPLAIN FORMAT=JSON INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t
|
||||||
|
WHERE f IS NOT NULL;
|
||||||
|
EXPLAIN
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 1,
|
||||||
|
"table": {
|
||||||
|
"table_name": "<derived2>",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 16,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "t.f is not null",
|
||||||
|
"materialized": {
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 2,
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 8,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "t1.f is not null"
|
||||||
|
},
|
||||||
|
"table": {
|
||||||
|
"table_name": "<derived3>",
|
||||||
|
"access_type": "ref",
|
||||||
|
"possible_keys": ["key0"],
|
||||||
|
"key": "key0",
|
||||||
|
"key_length": "4",
|
||||||
|
"used_key_parts": ["f"],
|
||||||
|
"ref": ["test.t1.f"],
|
||||||
|
"rows": 2,
|
||||||
|
"filtered": 100,
|
||||||
|
"materialized": {
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 3,
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "ALL",
|
||||||
|
"rows": 8,
|
||||||
|
"filtered": 100,
|
||||||
|
"attached_condition": "t1.f is not null"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SELECT * FROM t1;
|
||||||
|
f
|
||||||
|
3
|
||||||
|
7
|
||||||
|
3
|
||||||
|
3
|
||||||
|
3
|
||||||
|
7
|
||||||
|
3
|
||||||
|
3
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
# Start of 10.3 tests
|
# Start of 10.3 tests
|
||||||
#
|
#
|
||||||
# MDEV-16801: splittable materialized derived/views with
|
# MDEV-16801: splittable materialized derived/views with
|
||||||
|
@@ -3109,6 +3109,40 @@ WHERE ((a,b) IN ((1,2),(3,2)));
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-17354: INSERT SELECT with condition pushdown into derived
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (f INT NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (3), (7), (3);
|
||||||
|
|
||||||
|
CREATE ALGORITHM= TEMPTABLE VIEW v1 AS SELECT * FROM ( SELECT * FROM t1 ) AS sq;
|
||||||
|
|
||||||
|
let $q1=
|
||||||
|
INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
|
||||||
|
|
||||||
|
eval $q1;
|
||||||
|
eval EXPLAIN $q1;
|
||||||
|
eval EXPLAIN FORMAT=JSON $q1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DELETE FROM t1;
|
||||||
|
INSERT INTO t1 VALUES (3), (7), (3);
|
||||||
|
|
||||||
|
let $q2=
|
||||||
|
INSERT INTO t1
|
||||||
|
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t
|
||||||
|
WHERE f IS NOT NULL;
|
||||||
|
|
||||||
|
eval $q2;
|
||||||
|
eval EXPLAIN FORMAT=JSON $q2;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo # Start of 10.3 tests
|
--echo # Start of 10.3 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
|
@@ -3315,6 +3315,18 @@ COUNT(DISTINCT t2.a2) rank() OVER (ORDER BY t2.b1)
|
|||||||
1 3
|
1 3
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
#
|
#
|
||||||
|
# MDEV-16990: server crashes in base_list_iterator::next
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(i int);
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
SELECT DISTINCT row_number() OVER (), MAX(1) FROM t1;
|
||||||
|
row_number() OVER () MAX(1)
|
||||||
|
1 1
|
||||||
|
SELECT DISTINCT BIT_AND(0) OVER (), MAX(1) FROM t1;
|
||||||
|
BIT_AND(0) OVER () MAX(1)
|
||||||
|
0 1
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
# Start of 10.3 tests
|
# Start of 10.3 tests
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@@ -2083,6 +2083,16 @@ SELECT COUNT(DISTINCT t2.a2),
|
|||||||
FROM t2 ,t1 GROUP BY t2.b1 ORDER BY t1.a1;
|
FROM t2 ,t1 GROUP BY t2.b1 ORDER BY t1.a1;
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-16990: server crashes in base_list_iterator::next
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1(i int);
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
SELECT DISTINCT row_number() OVER (), MAX(1) FROM t1;
|
||||||
|
SELECT DISTINCT BIT_AND(0) OVER (), MAX(1) FROM t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Start of 10.3 tests
|
--echo # Start of 10.3 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@@ -47,6 +47,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
||||||
@@ -59,6 +63,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
||||||
@@ -71,6 +79,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
||||||
@@ -83,6 +95,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
**** Result of conversions ****
|
**** Result of conversions ****
|
||||||
@@ -244,6 +260,13 @@ LONGBLOB TINYBLOB <Correct error>
|
|||||||
LONGBLOB BLOB <Correct error>
|
LONGBLOB BLOB <Correct error>
|
||||||
LONGBLOB MEDIUMBLOB <Correct error>
|
LONGBLOB MEDIUMBLOB <Correct error>
|
||||||
LONGBLOB VARBINARY(65500 <Correct error>
|
LONGBLOB VARBINARY(65500 <Correct error>
|
||||||
|
DATE DATETIME(6) <Correct error>
|
||||||
|
DATE DATETIME(6) <Correct error>
|
||||||
|
DATE DATETIME(6) <Correct error>
|
||||||
|
DATE DATETIME(0) <Correct error>
|
||||||
|
DATETIME(6) DATE <Correct error>
|
||||||
|
DATETIME(6) DATE <Correct error>
|
||||||
|
DATETIME(0) DATE <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
@@ -401,6 +424,13 @@ LONGBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
|||||||
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
|
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
|
||||||
LONGBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct error>
|
LONGBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct error>
|
||||||
LONGBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
LONGBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(6) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(0) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_NON_LOSSY <Correct error>
|
||||||
|
DATETIME(6) DATE ALL_NON_LOSSY <Correct error>
|
||||||
|
DATETIME(0) DATE ALL_NON_LOSSY <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
@@ -558,6 +588,13 @@ LONGBLOB TINYBLOB ALL_LOSSY <Correct value>
|
|||||||
LONGBLOB BLOB ALL_LOSSY <Correct value>
|
LONGBLOB BLOB ALL_LOSSY <Correct value>
|
||||||
LONGBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
|
LONGBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
|
||||||
LONGBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
LONGBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(0) ALL_LOSSY <Correct error>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY <Correct value>
|
||||||
|
DATETIME(0) DATE ALL_LOSSY <Correct value>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
@@ -715,6 +752,13 @@ LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
|||||||
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
LONGBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
LONGBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(0) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(0) DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
DROP TABLE type_conversions;
|
DROP TABLE type_conversions;
|
||||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
||||||
connection master;
|
connection master;
|
||||||
|
@@ -24,11 +24,19 @@ connection master;
|
|||||||
disable_warnings;
|
disable_warnings;
|
||||||
DROP TABLE IF EXISTS t1;
|
DROP TABLE IF EXISTS t1;
|
||||||
enable_warnings;
|
enable_warnings;
|
||||||
|
if ($source_temp_format)
|
||||||
|
{
|
||||||
|
--eval SET @@global.mysql56_temporal_format= $source_temp_format
|
||||||
|
}
|
||||||
eval CREATE TABLE t1(
|
eval CREATE TABLE t1(
|
||||||
pk INT NOT NULL PRIMARY KEY,
|
pk INT NOT NULL PRIMARY KEY,
|
||||||
a $source_type
|
a $source_type
|
||||||
) ENGINE=$engine_type;
|
) ENGINE=$engine_type;
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
|
if ($target_temp_format)
|
||||||
|
{
|
||||||
|
--eval SET @@global.mysql56_temporal_format= $source_temp_format
|
||||||
|
}
|
||||||
eval ALTER TABLE t1 MODIFY a $target_type;
|
eval ALTER TABLE t1 MODIFY a $target_type;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
|
@@ -1177,5 +1177,96 @@ source suite/rpl/include/check_type.inc;
|
|||||||
|
|
||||||
--echo # End of MDEV-15833
|
--echo # End of MDEV-15833
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-17098 DATE <-> DATETIME
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
# NON-LOSSY
|
||||||
|
let $source_temp_format= 1; # irrelevant with DATE though
|
||||||
|
let $source_type= DATE;
|
||||||
|
let $target_temp_format= 1; # to produce MYSQL_TYPE_DATETIME2
|
||||||
|
let $target_type= DATETIME(6);
|
||||||
|
let $source_value= '2018-10-11';
|
||||||
|
let $target_value= '2018-10-11 00:00:00.000000';
|
||||||
|
let $can_convert = $if_is_non_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
let $source_temp_format= 1;
|
||||||
|
let $source_type= DATE;
|
||||||
|
let $target_temp_format= 0; # to produce "old" MYSQL_TYPE_DATETIME
|
||||||
|
let $target_type= DATETIME(6);
|
||||||
|
let $source_value= '2018-10-11';
|
||||||
|
let $target_value= '2018-10-11 00:00:00.000000';
|
||||||
|
let $can_convert = $if_is_non_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
let $source_temp_format= 0;
|
||||||
|
let $source_type= DATE;
|
||||||
|
let $target_temp_format= 1;
|
||||||
|
let $target_type= DATETIME(6);
|
||||||
|
let $source_value= '2018-10-11';
|
||||||
|
let $target_value= '2018-10-11 00:00:00.000000';
|
||||||
|
let $can_convert = $if_is_non_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
# zero-precision test version
|
||||||
|
let $source_temp_format= 1;
|
||||||
|
let $source_type= DATE;
|
||||||
|
let $target_temp_format= 1;
|
||||||
|
let $target_type= DATETIME(0);
|
||||||
|
let $source_value= '2018-10-11';
|
||||||
|
let $target_value= '2018-10-11 00:00:00';
|
||||||
|
let $can_convert = $if_is_non_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
# LOSSY
|
||||||
|
let $source_temp_format= 1;
|
||||||
|
let $source_type= DATETIME(6);
|
||||||
|
let $target_temp_format= 1;
|
||||||
|
let $target_type= DATE;
|
||||||
|
let $source_value= '2018-10-11 00:00:00.000001';
|
||||||
|
let $target_value= '2018-10-11';
|
||||||
|
let $can_convert = $if_is_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
let $source_temp_format= 1;
|
||||||
|
let $source_type= DATETIME(6);
|
||||||
|
let $target_temp_format= 0;
|
||||||
|
let $target_type= DATE;
|
||||||
|
let $source_value= '2018-10-11 00:00:00.000001';
|
||||||
|
let $target_value= '2018-10-11';
|
||||||
|
let $can_convert = $if_is_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
# zero-precision test version
|
||||||
|
let $source_temp_format= 1;
|
||||||
|
let $source_type= DATETIME(0);
|
||||||
|
let $target_temp_format= 1;
|
||||||
|
let $target_type= DATE;
|
||||||
|
let $source_value= '2018-10-11 00:00:00';
|
||||||
|
let $target_value= '2018-10-11';
|
||||||
|
let $can_convert = $if_is_lossy;
|
||||||
|
source suite/rpl/include/check_type.inc;
|
||||||
|
|
||||||
|
# TODO: fix MDEV-17394 Row-based replication DATETIME(m) to
|
||||||
|
# DATETIME(s) does not work or incorrect
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# let $source_temp_format= 0;
|
||||||
|
# let $source_type= DATETIME(6);
|
||||||
|
# let $target_temp_format= 1;
|
||||||
|
# let $target_type= DATE;
|
||||||
|
# ...
|
||||||
|
# let $source_temp_format= 0;
|
||||||
|
# let $source_type= DATETIME(6);
|
||||||
|
# let $target_temp_format= 0;
|
||||||
|
# let $target_type= DATE;
|
||||||
|
# ...
|
||||||
|
|
||||||
|
let $source_temp_format=;
|
||||||
|
let $target_temp_format=;
|
||||||
|
--echo # End of MDEV-17098
|
||||||
|
|
||||||
|
|
||||||
--source include/rpl_reset.inc
|
--source include/rpl_reset.inc
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
|
@@ -47,6 +47,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
||||||
@@ -59,6 +63,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
||||||
@@ -71,6 +79,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
||||||
@@ -83,6 +95,10 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
|||||||
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
#
|
#
|
||||||
# End of MDEV-15833
|
# End of MDEV-15833
|
||||||
|
#
|
||||||
|
# MDEV-17098 DATE <-> DATETIME
|
||||||
|
#
|
||||||
|
# End of MDEV-17098
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
**** Result of conversions ****
|
**** Result of conversions ****
|
||||||
@@ -244,6 +260,13 @@ LONGBLOB TINYBLOB <Correct error>
|
|||||||
LONGBLOB BLOB <Correct error>
|
LONGBLOB BLOB <Correct error>
|
||||||
LONGBLOB MEDIUMBLOB <Correct error>
|
LONGBLOB MEDIUMBLOB <Correct error>
|
||||||
LONGBLOB VARBINARY(65500 <Correct error>
|
LONGBLOB VARBINARY(65500 <Correct error>
|
||||||
|
DATE DATETIME(6) <Correct error>
|
||||||
|
DATE DATETIME(6) <Correct error>
|
||||||
|
DATE DATETIME(6) <Correct error>
|
||||||
|
DATE DATETIME(0) <Correct error>
|
||||||
|
DATETIME(6) DATE <Correct error>
|
||||||
|
DATETIME(6) DATE <Correct error>
|
||||||
|
DATETIME(0) DATE <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
@@ -401,6 +424,13 @@ LONGBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
|||||||
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
|
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
|
||||||
LONGBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct error>
|
LONGBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct error>
|
||||||
LONGBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
LONGBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(6) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(0) ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_NON_LOSSY <Correct error>
|
||||||
|
DATETIME(6) DATE ALL_NON_LOSSY <Correct error>
|
||||||
|
DATETIME(0) DATE ALL_NON_LOSSY <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
@@ -558,6 +588,13 @@ LONGBLOB TINYBLOB ALL_LOSSY <Correct value>
|
|||||||
LONGBLOB BLOB ALL_LOSSY <Correct value>
|
LONGBLOB BLOB ALL_LOSSY <Correct value>
|
||||||
LONGBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
|
LONGBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
|
||||||
LONGBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
LONGBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY <Correct error>
|
||||||
|
DATE DATETIME(0) ALL_LOSSY <Correct error>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY <Correct value>
|
||||||
|
DATETIME(0) DATE ALL_LOSSY <Correct value>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
@@ -715,6 +752,13 @@ LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
|||||||
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
LONGBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
LONGBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATE DATETIME(0) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(6) DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
DATETIME(0) DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
DROP TABLE type_conversions;
|
DROP TABLE type_conversions;
|
||||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
||||||
connection master;
|
connection master;
|
||||||
|
@@ -7617,7 +7617,7 @@ Item *Item_direct_view_ref::derived_field_transformer_for_where(THD *thd,
|
|||||||
DBUG_ASSERT (producing_item != NULL);
|
DBUG_ASSERT (producing_item != NULL);
|
||||||
return producing_item->build_clone(thd);
|
return producing_item->build_clone(thd);
|
||||||
}
|
}
|
||||||
return this;
|
return (*ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@@ -817,14 +817,44 @@ can_convert_field_to(Field *field,
|
|||||||
case MYSQL_TYPE_TIME:
|
case MYSQL_TYPE_TIME:
|
||||||
case MYSQL_TYPE_DATETIME:
|
case MYSQL_TYPE_DATETIME:
|
||||||
case MYSQL_TYPE_YEAR:
|
case MYSQL_TYPE_YEAR:
|
||||||
case MYSQL_TYPE_NEWDATE:
|
|
||||||
case MYSQL_TYPE_NULL:
|
case MYSQL_TYPE_NULL:
|
||||||
case MYSQL_TYPE_ENUM:
|
case MYSQL_TYPE_ENUM:
|
||||||
case MYSQL_TYPE_SET:
|
case MYSQL_TYPE_SET:
|
||||||
case MYSQL_TYPE_TIMESTAMP2:
|
case MYSQL_TYPE_TIMESTAMP2:
|
||||||
case MYSQL_TYPE_DATETIME2:
|
|
||||||
case MYSQL_TYPE_TIME2:
|
case MYSQL_TYPE_TIME2:
|
||||||
DBUG_RETURN(false);
|
DBUG_RETURN(false);
|
||||||
|
case MYSQL_TYPE_NEWDATE:
|
||||||
|
{
|
||||||
|
if (field->real_type() == MYSQL_TYPE_DATETIME2 ||
|
||||||
|
field->real_type() == MYSQL_TYPE_DATETIME)
|
||||||
|
{
|
||||||
|
*order_var= -1;
|
||||||
|
DBUG_RETURN(is_conversion_ok(*order_var, rli));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBUG_RETURN(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
//case MYSQL_TYPE_DATETIME: TODO: fix MDEV-17394 and uncomment.
|
||||||
|
//
|
||||||
|
//The "old" type does not specify the fraction part size which is required
|
||||||
|
//for correct conversion.
|
||||||
|
case MYSQL_TYPE_DATETIME2:
|
||||||
|
{
|
||||||
|
if (field->real_type() == MYSQL_TYPE_NEWDATE)
|
||||||
|
{
|
||||||
|
*order_var= 1;
|
||||||
|
DBUG_RETURN(is_conversion_ok(*order_var, rli));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBUG_RETURN(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
DBUG_RETURN(false); // To keep GCC happy
|
DBUG_RETURN(false); // To keep GCC happy
|
||||||
}
|
}
|
||||||
|
@@ -3127,7 +3127,7 @@ bool JOIN::make_aggr_tables_info()
|
|||||||
remove_duplicates() assumes there is a preceding computation step (and
|
remove_duplicates() assumes there is a preceding computation step (and
|
||||||
in the degenerate join, there's none)
|
in the degenerate join, there's none)
|
||||||
*/
|
*/
|
||||||
if (top_join_tab_count)
|
if (top_join_tab_count && tables_list)
|
||||||
curr_tab->distinct= true;
|
curr_tab->distinct= true;
|
||||||
|
|
||||||
having= NULL;
|
having= NULL;
|
||||||
|
@@ -255,6 +255,8 @@ row_build_index_entry_low(
|
|||||||
|
|
||||||
ut_ad(dfield_is_null(dfield2) ||
|
ut_ad(dfield_is_null(dfield2) ||
|
||||||
dfield_get_len(dfield2) == 0 || dfield2->data);
|
dfield_get_len(dfield2) == 0 || dfield2->data);
|
||||||
|
ut_ad(dfield2->type.mtype != DATA_MISSING
|
||||||
|
|| !index->is_committed());
|
||||||
} else {
|
} else {
|
||||||
dfield2 = dtuple_get_nth_field(row, col_no);
|
dfield2 = dtuple_get_nth_field(row, col_no);
|
||||||
ut_ad(dfield_get_type(dfield2)->mtype == DATA_MISSING
|
ut_ad(dfield_get_type(dfield2)->mtype == DATA_MISSING
|
||||||
|
@@ -18,6 +18,7 @@ show_engine : SHOW ENGINE produces different number of lines depending
|
|||||||
show_table_status : MDEV-13152 - Indeterministic row number in SHOW TABLE STATUS on RocksDB table
|
show_table_status : MDEV-13152 - Indeterministic row number in SHOW TABLE STATUS on RocksDB table
|
||||||
tbl_opt_data_dir : Not supported
|
tbl_opt_data_dir : Not supported
|
||||||
tbl_opt_index_dir : Not supported
|
tbl_opt_index_dir : Not supported
|
||||||
|
type_binary_indexes : MDEV-16387 - Wrong execution plan
|
||||||
type_spatial : Not supported
|
type_spatial : Not supported
|
||||||
type_spatial_indexes : Not supported
|
type_spatial_indexes : Not supported
|
||||||
update_low_prio : Not supported
|
update_low_prio : Not supported
|
||||||
|
Reference in New Issue
Block a user