mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.7 into 10.8
This commit is contained in:
17
debian/autobake-deb.sh
vendored
17
debian/autobake-deb.sh
vendored
@@ -76,8 +76,15 @@ disable_libfmt()
|
|||||||
|
|
||||||
architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
|
architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
|
||||||
|
|
||||||
CODENAME="$(lsb_release -sc)"
|
LSBID="$(lsb_release -si | tr '[:upper:]' '[:lower:]')"
|
||||||
case "${CODENAME}" in
|
LSBVERSION="$(lsb_release -sr | sed -e "s#\.##g")"
|
||||||
|
LSBNAME="$(lsb_release -sc)"
|
||||||
|
|
||||||
|
if [ -z "${LSBID}" ]
|
||||||
|
then
|
||||||
|
LSBID="unknown"
|
||||||
|
fi
|
||||||
|
case "${LSBNAME}" in
|
||||||
stretch)
|
stretch)
|
||||||
# MDEV-16525 libzstd-dev-1.1.3 minimum version
|
# MDEV-16525 libzstd-dev-1.1.3 minimum version
|
||||||
sed -e '/libzstd-dev/d' \
|
sed -e '/libzstd-dev/d' \
|
||||||
@@ -136,7 +143,7 @@ case "${CODENAME}" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error - unknown release codename $CODENAME" >&2
|
echo "Error - unknown release codename $LSBNAME" >&2
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -153,9 +160,9 @@ UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${
|
|||||||
PATCHLEVEL="+maria"
|
PATCHLEVEL="+maria"
|
||||||
LOGSTRING="MariaDB build"
|
LOGSTRING="MariaDB build"
|
||||||
EPOCH="1:"
|
EPOCH="1:"
|
||||||
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}"
|
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${LSBID:0:3}${LSBVERSION}"
|
||||||
|
|
||||||
dch -b -D "${CODENAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint
|
dch -b -D ${LSBNAME} -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint
|
||||||
|
|
||||||
echo "Creating package version ${VERSION} ... "
|
echo "Creating package version ${VERSION} ... "
|
||||||
|
|
||||||
|
@@ -180,9 +180,9 @@ insert IGNORE into t1 (a) values ('Garbage');
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 (fl) values (1);
|
insert into t1 (fl) values (1);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 (fl) values (1.11);
|
insert into t1 (fl) values (1.11);
|
||||||
--error 1416
|
--error 1416
|
||||||
insert into t1 (fl) values ("qwerty");
|
insert into t1 (fl) values ("qwerty");
|
||||||
|
258
mysql-test/include/type_mix_incompatible.inc
Normal file
258
mysql-test/include/type_mix_incompatible.inc
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
--echo # Start of type_store_assignment_incompatible.inc
|
||||||
|
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
|
||||||
|
let $source_type= `(SELECT @source_type)`;
|
||||||
|
let $target_type= `(SELECT @target_type)`;
|
||||||
|
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Single row INSERT..VALUES
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
DROP TABLE t3;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Multi-row INSERT..VALUES
|
||||||
|
#
|
||||||
|
|
||||||
|
# INSERT .. VALUES checks assignment compatibility for the first row only.
|
||||||
|
# Here the first row is compatible, so no error happens.
|
||||||
|
# The second row is not compatible. It works according to the
|
||||||
|
# current sql_mode and the table transaction ability, so it can:
|
||||||
|
# (a) either raise a warning
|
||||||
|
# (b) or escalate a warning to an error and abort on the current row
|
||||||
|
# (c) or escalate a warning to an error and rollback
|
||||||
|
# Here we test (a) and (b).
|
||||||
|
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
|
||||||
|
--error 0,ER_CANT_CREATE_GEOMETRY_OBJECT
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
SELECT * FROM v3;
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
--error ER_TRUNCATED_WRONG_VALUE, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, WARN_DATA_TRUNCATED, ER_CANT_CREATE_GEOMETRY_OBJECT
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
SELECT * FROM v3;
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
|
||||||
|
#
|
||||||
|
# INSERT .. SELECT
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# INSERT .. VALUES .. ON DUPLICATE KEY UPDATE target=source
|
||||||
|
#
|
||||||
|
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
|
||||||
|
#
|
||||||
|
# INSERT .. SELECT .. ON DUPLICATE KEY UPDATE target=source
|
||||||
|
#
|
||||||
|
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# UPDATE
|
||||||
|
#
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# UPDATE, multi-table
|
||||||
|
#
|
||||||
|
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# ALTER
|
||||||
|
#
|
||||||
|
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-28963 Incompatible data type assignment through SP vars is not consistent with columns
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# SP local variables
|
||||||
|
#
|
||||||
|
DELIMITER $$;
|
||||||
|
eval CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src $source_type DEFAULT NULL;
|
||||||
|
DECLARE dst $target_type DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
DELIMITER ;$$
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
CALL p1;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# SP IN parameters
|
||||||
|
#
|
||||||
|
|
||||||
|
--eval CREATE FUNCTION f1(a $target_type) RETURNS INT RETURN NULL;
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
|
||||||
|
--eval CREATE PROCEDURE p1(a $target_type) BEGIN END;
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# SP OUT parameters
|
||||||
|
#
|
||||||
|
|
||||||
|
DELIMITER $$;
|
||||||
|
eval CREATE PROCEDURE p1(OUT dst $target_type)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src $source_type DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
eval CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst $target_type DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
DELIMITER ;$$
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
CALL p2();
|
||||||
|
SHOW WARNINGS;
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# SF RETURN
|
||||||
|
#
|
||||||
|
|
||||||
|
DELIMITER $$;
|
||||||
|
eval CREATE FUNCTION f1() RETURNS $target_type
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc $source_type DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
DELIMITER ;$$
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
SELECT f1();
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Cursor IN parameters
|
||||||
|
#
|
||||||
|
|
||||||
|
DELIMITER $$;
|
||||||
|
eval CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src $source_type DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t $target_type) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
DELIMITER ;$$
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
CALL p1();
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# FETCH
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
|
||||||
|
DELIMITER $$;
|
||||||
|
eval CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst $target_type DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
DELIMITER ;$$
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
|
CALL p1();
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
DROP TABLE t2;
|
||||||
|
|
||||||
|
--echo # End of type_store_assignment_incompatible.inc
|
@@ -226,7 +226,7 @@ Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function
|
|||||||
SELECT * FROM v1;
|
SELECT * FROM v1;
|
||||||
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||||
UPDATE t2 SET f = f + 10;
|
UPDATE t2 SET f = f + 10;
|
||||||
ERROR 42S22: Unknown column 'd' in 'OLD'
|
ERROR 42S22: Unknown column 'd' in 'NEW'
|
||||||
CALL sp1();
|
CALL sp1();
|
||||||
ERROR 42S22: Unknown column 'd' in 'field list'
|
ERROR 42S22: Unknown column 'd' in 'field list'
|
||||||
DROP TRIGGER trg1;
|
DROP TRIGGER trg1;
|
||||||
|
@@ -1152,11 +1152,11 @@ SELECT @var62, @var63;
|
|||||||
@var62 @var63
|
@var62 @var63
|
||||||
1 NULL
|
1 NULL
|
||||||
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
||||||
ERROR 22007: Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
|
ERROR HY000: Illegal parameter data types double and point for operation 'SET'
|
||||||
GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
|
||||||
GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
|
Error 4078 Illegal parameter data types double and point for operation 'SET'
|
||||||
Error 1758 Invalid condition number
|
Error 1758 Invalid condition number
|
||||||
SELECT @var64, @var65;
|
SELECT @var64, @var65;
|
||||||
@var64 @var65
|
@var64 @var65
|
||||||
@@ -1396,11 +1396,11 @@ SELECT @var103, @var104;
|
|||||||
@var103 @var104
|
@var103 @var104
|
||||||
1 NULL
|
1 NULL
|
||||||
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
||||||
ERROR 22007: Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
|
ERROR HY000: Illegal parameter data types double and point for operation 'SET'
|
||||||
GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
|
||||||
GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
|
Error 4078 Illegal parameter data types double and point for operation 'SET'
|
||||||
Error 1758 Invalid condition number
|
Error 1758 Invalid condition number
|
||||||
SELECT @var105, @var106;
|
SELECT @var105, @var106;
|
||||||
@var105 @var106
|
@var105 @var106
|
||||||
|
@@ -1091,7 +1091,7 @@ GET DIAGNOSTICS CONDITION 1 @var62= ROW_NUMBER;
|
|||||||
GET DIAGNOSTICS CONDITION 2 @var63= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 2 @var63= ROW_NUMBER;
|
||||||
SELECT @var62, @var63;
|
SELECT @var62, @var63;
|
||||||
|
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
||||||
GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
|
||||||
GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
|
||||||
@@ -1277,7 +1277,7 @@ GET DIAGNOSTICS CONDITION 1 @var103= ROW_NUMBER;
|
|||||||
GET DIAGNOSTICS CONDITION 2 @var104= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 2 @var104= ROW_NUMBER;
|
||||||
SELECT @var103, @var104;
|
SELECT @var103, @var104;
|
||||||
|
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
INSERT INTO t1 SELECT id2, val2, p2 from t2;
|
||||||
GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
|
||||||
GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
|
GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
|
||||||
|
@@ -688,9 +688,9 @@ object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
insert into t1 values (1.11);
|
insert into t1 values (1.11);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
|
||||||
insert into t1 values ("qwerty");
|
insert into t1 values ("qwerty");
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
insert into t1 values (pointfromtext('point(1,1)'));
|
insert into t1 values (pointfromtext('point(1,1)'));
|
||||||
|
@@ -366,9 +366,9 @@ t1 where object_id=85984;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 values (1.11);
|
insert into t1 values (1.11);
|
||||||
--error 1416
|
--error 1416
|
||||||
insert into t1 values ("qwerty");
|
insert into t1 values ("qwerty");
|
||||||
|
@@ -834,3 +834,25 @@ set global keycache2.key_buffer_size=0;
|
|||||||
set global key_buffer_size=@save_key_buffer_size;
|
set global key_buffer_size=@save_key_buffer_size;
|
||||||
set global key_cache_segments=@save_key_cache_segments;
|
set global key_cache_segments=@save_key_cache_segments;
|
||||||
set global key_cache_file_hash_size=@save_key_cache_file_hash_size;
|
set global key_cache_file_hash_size=@save_key_cache_file_hash_size;
|
||||||
|
#
|
||||||
|
# SIGSEGV in flush_all_key_blocks when changing
|
||||||
|
# key_buffer_size / ASAN: heap-use-after-free in flush_all_key_blocks
|
||||||
|
#
|
||||||
|
SET GLOBAL keycache1.key_cache_segments=7;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=1*1024*1024;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=0;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=128*1024;
|
||||||
|
create table t1 (p int primary key, a char(10)) delay_key_write=1;
|
||||||
|
cache index t1 key (`primary`) in keycache1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 assign_to_keycache status OK
|
||||||
|
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
|
||||||
|
select * from t1;
|
||||||
|
p a
|
||||||
|
1 qqqq
|
||||||
|
11 yyyy
|
||||||
|
drop table t1;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=0;
|
||||||
|
#
|
||||||
|
# End of 10.3 tests
|
||||||
|
#
|
||||||
|
@@ -538,3 +538,24 @@ set global key_cache_segments=@save_key_cache_segments;
|
|||||||
set global key_cache_file_hash_size=@save_key_cache_file_hash_size;
|
set global key_cache_file_hash_size=@save_key_cache_file_hash_size;
|
||||||
|
|
||||||
# End of 5.2 tests
|
# End of 5.2 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # SIGSEGV in flush_all_key_blocks when changing
|
||||||
|
--echo # key_buffer_size / ASAN: heap-use-after-free in flush_all_key_blocks
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET GLOBAL keycache1.key_cache_segments=7;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=1*1024*1024;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=0;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=128*1024;
|
||||||
|
create table t1 (p int primary key, a char(10)) delay_key_write=1;
|
||||||
|
cache index t1 key (`primary`) in keycache1;
|
||||||
|
insert into t1 values (1, 'qqqq'), (11, 'yyyy');
|
||||||
|
select * from t1;
|
||||||
|
drop table t1;
|
||||||
|
SET GLOBAL keycache1.key_buffer_size=0;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.3 tests
|
||||||
|
--echo #
|
||||||
|
@@ -197,20 +197,6 @@ f2
|
|||||||
connection default;
|
connection default;
|
||||||
SET DEBUG_SYNC = 'RESET';
|
SET DEBUG_SYNC = 'RESET';
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
connection con1;
|
|
||||||
connection con2;
|
|
||||||
connection con1;
|
|
||||||
SET SESSION optimizer_search_depth=0;
|
|
||||||
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
|
|
||||||
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
|
|
||||||
EXECUTE stmt;
|
|
||||||
connection con2;
|
|
||||||
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
|
|
||||||
KILL QUERY @id;
|
|
||||||
connection con1;
|
|
||||||
ERROR 70100: Query execution was interrupted
|
|
||||||
connection default;
|
|
||||||
SET DEBUG_SYNC = 'RESET';
|
|
||||||
#
|
#
|
||||||
# Bug#19723: kill of active connection yields different error code
|
# Bug#19723: kill of active connection yields different error code
|
||||||
# depending on platform.
|
# depending on platform.
|
||||||
|
@@ -271,74 +271,6 @@ connection default;
|
|||||||
SET DEBUG_SYNC = 'RESET';
|
SET DEBUG_SYNC = 'RESET';
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
#
|
|
||||||
# Bug#28598: mysqld crash when killing a long-running explain query.
|
|
||||||
#
|
|
||||||
connection con1;
|
|
||||||
let $ID= `SELECT @id := CONNECTION_ID()`;
|
|
||||||
connection con2;
|
|
||||||
let $ignore= `SELECT @id := $ID`;
|
|
||||||
connection con1;
|
|
||||||
--disable_query_log
|
|
||||||
let $tab_count= 40;
|
|
||||||
|
|
||||||
--disable_query_log
|
|
||||||
begin;
|
|
||||||
let $i= $tab_count;
|
|
||||||
while ($i)
|
|
||||||
{
|
|
||||||
eval CREATE TABLE t$i (a$i INT, KEY(a$i));
|
|
||||||
eval INSERT INTO t$i VALUES (1),(2),(3),(4),(5),(6),(7);
|
|
||||||
dec $i ;
|
|
||||||
}
|
|
||||||
|
|
||||||
commit;
|
|
||||||
--enable_query_log
|
|
||||||
|
|
||||||
SET SESSION optimizer_search_depth=0;
|
|
||||||
|
|
||||||
let $i=$tab_count;
|
|
||||||
while ($i)
|
|
||||||
{
|
|
||||||
let $a= a$i;
|
|
||||||
let $t= t$i;
|
|
||||||
dec $i;
|
|
||||||
if ($i)
|
|
||||||
{
|
|
||||||
let $comma=,;
|
|
||||||
let $from=$comma$t$from;
|
|
||||||
let $where=a$i=$a $and $where;
|
|
||||||
}
|
|
||||||
if (!$i)
|
|
||||||
{
|
|
||||||
let $from=FROM $t$from;
|
|
||||||
let $where=WHERE $where;
|
|
||||||
}
|
|
||||||
let $and=AND;
|
|
||||||
}
|
|
||||||
|
|
||||||
--enable_query_log
|
|
||||||
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
|
|
||||||
eval PREPARE stmt FROM 'EXPLAIN SELECT * $from $where';
|
|
||||||
send EXECUTE stmt;
|
|
||||||
|
|
||||||
connection con2;
|
|
||||||
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
|
|
||||||
KILL QUERY @id;
|
|
||||||
connection con1;
|
|
||||||
--error 1317
|
|
||||||
reap;
|
|
||||||
--disable_query_log
|
|
||||||
let $i= $tab_count;
|
|
||||||
while ($i)
|
|
||||||
{
|
|
||||||
eval DROP TABLE t$i;
|
|
||||||
dec $i ;
|
|
||||||
}
|
|
||||||
--enable_query_log
|
|
||||||
connection default;
|
|
||||||
SET DEBUG_SYNC = 'RESET';
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Bug#19723: kill of active connection yields different error code
|
--echo # Bug#19723: kill of active connection yields different error code
|
||||||
--echo # depending on platform.
|
--echo # depending on platform.
|
||||||
|
@@ -20,7 +20,7 @@ RETURN a;
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
SELECT f1(ROW(10,20));
|
SELECT f1(ROW(10,20));
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
#
|
#
|
||||||
# ROW as an SP parameter
|
# ROW as an SP parameter
|
||||||
@@ -236,7 +236,7 @@ SELECT f1(a);
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
CALL p1();
|
CALL p1();
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
#
|
#
|
||||||
@@ -286,7 +286,7 @@ RETURN rec;
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
SELECT f1(10);
|
SELECT f1(10);
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
#
|
#
|
||||||
# Using the entire ROW in SELECT..CREATE
|
# Using the entire ROW in SELECT..CREATE
|
||||||
|
@@ -27,7 +27,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
SELECT f1(ROW(10,20));
|
SELECT f1(ROW(10,20));
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
CALL p1();
|
CALL p1();
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
@@ -393,7 +393,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
SELECT f1(10);
|
SELECT f1(10);
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
|
|
||||||
|
@@ -1026,11 +1026,11 @@ BEGIN
|
|||||||
SELECT arg;
|
SELECT arg;
|
||||||
END|
|
END|
|
||||||
CALL p1((1, 2));
|
CALL p1((1, 2));
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types tinyint and row for operation 'SET'
|
||||||
CALL p1((SELECT * FROM t1 LIMIT 1));
|
CALL p1((SELECT * FROM t1 LIMIT 1));
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types tinyint and row for operation 'SET'
|
||||||
CALL p1((SELECT col1, col2 FROM t1 LIMIT 1));
|
CALL p1((SELECT col1, col2 FROM t1 LIMIT 1));
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types tinyint and row for operation 'SET'
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
@@ -1221,13 +1221,13 @@ BEGIN
|
|||||||
END|
|
END|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
CALL p1((1, 2));
|
CALL p1((1, 2));
|
||||||
|
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
CALL p1((SELECT * FROM t1 LIMIT 1));
|
CALL p1((SELECT * FROM t1 LIMIT 1));
|
||||||
|
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
CALL p1((SELECT col1, col2 FROM t1 LIMIT 1));
|
CALL p1((SELECT col1, col2 FROM t1 LIMIT 1));
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -255,7 +255,7 @@ return i+1|
|
|||||||
call sub1("sub1a", (select 7))|
|
call sub1("sub1a", (select 7))|
|
||||||
call sub1("sub1b", (select max(i) from t2))|
|
call sub1("sub1b", (select max(i) from t2))|
|
||||||
call sub1("sub1c", (select i,d from t2 limit 1))|
|
call sub1("sub1c", (select i,d from t2 limit 1))|
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
call sub1("sub1d", (select 1 from (select 1) a))|
|
call sub1("sub1d", (select 1 from (select 1) a))|
|
||||||
call sub2("sub2")|
|
call sub2("sub2")|
|
||||||
select * from t1 order by id|
|
select * from t1 order by id|
|
||||||
|
@@ -386,7 +386,7 @@ create function sub3(i int) returns int deterministic
|
|||||||
|
|
||||||
call sub1("sub1a", (select 7))|
|
call sub1("sub1a", (select 7))|
|
||||||
call sub1("sub1b", (select max(i) from t2))|
|
call sub1("sub1b", (select max(i) from t2))|
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
call sub1("sub1c", (select i,d from t2 limit 1))|
|
call sub1("sub1c", (select i,d from t2 limit 1))|
|
||||||
call sub1("sub1d", (select 1 from (select 1) a))|
|
call sub1("sub1d", (select 1 from (select 1) a))|
|
||||||
call sub2("sub2")|
|
call sub2("sub2")|
|
||||||
|
340
mysql-test/main/type_geometry_mix_int.result
Normal file
340
mysql-test/main/type_geometry_mix_int.result
Normal file
@@ -0,0 +1,340 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target GEOMETRY DEFAULT POINT(1,1), source INT DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` geometry DEFAULT point(1,1),
|
||||||
|
`source` int(11) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 POINT(1 1) 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 POINT(1 1) 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target int(11)
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
DECLARE dst geometry DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a geometry) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a geometry) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst geometry)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst geometry DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS geometry
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc int(11) DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t geometry) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst geometry DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target INT DEFAULT 0, source GEOMETRY DEFAULT POINT(1,1));
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` int(11) DEFAULT 0,
|
||||||
|
`source` geometry DEFAULT point(1,1),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1366 Incorrect integer value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 POINT(1 1)
|
||||||
|
2 0 POINT(1 1)
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 POINT(1 1)
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target geometry
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src geometry DEFAULT NULL;
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a int(11)) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst int(11))
|
||||||
|
BEGIN
|
||||||
|
DECLARE src geometry DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS int(11)
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc geometry DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src geometry DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t int(11)) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
19
mysql-test/main/type_geometry_mix_int.test
Normal file
19
mysql-test/main/type_geometry_mix_int.test
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target GEOMETRY DEFAULT POINT(1,1), source INT DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INT DEFAULT 0, source GEOMETRY DEFAULT POINT(1,1));
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
@@ -3274,17 +3274,21 @@ sub do_before_run_mysqltest($)
|
|||||||
if ($^O eq "MSWin32") {
|
if ($^O eq "MSWin32") {
|
||||||
push @cmd, '--binary';
|
push @cmd, '--binary';
|
||||||
}
|
}
|
||||||
push @cmd, (qw/-r - -f -s -o/, $dest, $base_result, $resfile);
|
push @cmd, (qw/-r - -f -s -o/, $dest . $$, $base_result, $resfile);
|
||||||
if (-w $resdir) {
|
if (-w $resdir) {
|
||||||
# don't rebuild a file if it's up to date
|
# don't rebuild a file if it's up to date
|
||||||
unless (-e $dest and -M $dest < -M $resfile
|
unless (-e $dest and -M $dest < -M $resfile
|
||||||
and -M $dest < -M $base_result) {
|
and -M $dest < -M $base_result) {
|
||||||
run_system(@cmd);
|
run_system(@cmd);
|
||||||
|
rename $cmd[-3], $dest or unlink $cmd[-3];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$cmd[-3] = $dest = $opt_tmpdir . '/' . basename($dest);
|
$dest = $opt_tmpdir . '/' . basename($dest);
|
||||||
|
$cmd[-3] = $dest . $$;
|
||||||
run_system(@cmd);
|
run_system(@cmd);
|
||||||
|
rename $cmd[-3], $dest or unlink $cmd[-3];
|
||||||
}
|
}
|
||||||
|
|
||||||
$tinfo->{result_file} = $dest;
|
$tinfo->{result_file} = $dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
||||||
insert into t1 (fl) values (1);
|
insert into t1 (fl) values (1);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
insert into t1 (fl) values (1.11);
|
insert into t1 (fl) values (1.11);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
|
||||||
insert into t1 (fl) values ("qwerty");
|
insert into t1 (fl) values ("qwerty");
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
||||||
|
@@ -24,7 +24,7 @@ RETURN a;
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
SELECT f1(ROW(10,20));
|
SELECT f1(ROW(10,20));
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
#
|
#
|
||||||
# ROW as an SP parameter
|
# ROW as an SP parameter
|
||||||
@@ -261,7 +261,7 @@ SELECT f1(a);
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
CALL p1();
|
CALL p1();
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
CREATE FUNCTION f1(a INT) RETURN INT
|
CREATE FUNCTION f1(a INT) RETURN INT
|
||||||
@@ -278,7 +278,7 @@ SELECT f1(a);
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
CALL p1();
|
CALL p1();
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
#
|
#
|
||||||
@@ -332,7 +332,7 @@ RETURN rec;
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
SELECT f1(10);
|
SELECT f1(10);
|
||||||
ERROR 21000: Operand should contain 1 column(s)
|
ERROR HY000: Illegal parameter data types int and row for operation 'SET'
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
#
|
#
|
||||||
# Using the entire ROW in SELECT..CREATE
|
# Using the entire ROW in SELECT..CREATE
|
||||||
|
@@ -35,7 +35,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
SELECT f1(ROW(10,20));
|
SELECT f1(ROW(10,20));
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
CALL p1();
|
CALL p1();
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
@@ -355,7 +355,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
CALL p1();
|
CALL p1();
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
@@ -427,7 +427,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
DELIMITER ;$$
|
DELIMITER ;$$
|
||||||
--error ER_OPERAND_COLUMNS
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
SELECT f1(10);
|
SELECT f1(10);
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
|
|
||||||
|
@@ -1,27 +1,27 @@
|
|||||||
--- r/galera_ist_MDEV-28423.result
|
--- r/galera_ist_MDEV-28423.result
|
||||||
+++ r/galera_ist_MDEV-28423.reject
|
+++ r/galera_ist_MDEV-28423.reject
|
||||||
@@ -286,3 +286,111 @@
|
@@ -517,3 +517,187 @@
|
||||||
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
+Performing State Transfer on a server that has been killed and restarted
|
+Performing State Transfer on a server that has been killed and restarted
|
||||||
+while a DDL was in progress on it
|
+while a DDL was in progress on it
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
+connection node_2;
|
+connection node_2;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
@@ -32,26 +32,26 @@
|
|||||||
+connection node_1;
|
+connection node_1;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after');
|
||||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
+connection node_2;
|
+connection node_2;
|
||||||
+Performing --wsrep-recover ...
|
+Performing --wsrep-recover ...
|
||||||
+connection node_2;
|
+connection node_2;
|
||||||
@@ -59,56 +59,132 @@
|
|||||||
+Using --wsrep-start-position when starting mysqld ...
|
+Using --wsrep-start-position when starting mysqld ...
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+connection node_1a_galera_st_kill_slave_ddl;
|
+connection node_1a_galera_st_kill_slave_ddl;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
+ROLLBACK;
|
+ROLLBACK;
|
||||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
+SET AUTOCOMMIT=ON;
|
||||||
+COUNT(*) = 2
|
+SET SESSION wsrep_sync_wait=15;
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||||
+SELECT COUNT(*) = 35 FROM t1;
|
+EXPECT_3
|
||||||
+COUNT(*) = 35
|
+3
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
+EXPECT_35
|
||||||
|
+35
|
||||||
|
+SELECT * FROM t1;
|
||||||
|
+id f1 f2
|
||||||
|
+1 node1_committed_before NULL
|
||||||
|
+2 node1_committed_before NULL
|
||||||
|
+3 node1_committed_before NULL
|
||||||
|
+4 node1_committed_before NULL
|
||||||
|
+5 node1_committed_before NULL
|
||||||
|
+6 node2_committed_before NULL
|
||||||
|
+7 node2_committed_before NULL
|
||||||
|
+8 node2_committed_before NULL
|
||||||
|
+9 node2_committed_before NULL
|
||||||
|
+10 node2_committed_before NULL
|
||||||
|
+11 node1_committed_during NULL
|
||||||
|
+12 node1_committed_during NULL
|
||||||
|
+13 node1_committed_during NULL
|
||||||
|
+14 node1_committed_during NULL
|
||||||
|
+15 node1_committed_during NULL
|
||||||
|
+16 node1_to_be_committed_after NULL
|
||||||
|
+17 node1_to_be_committed_after NULL
|
||||||
|
+18 node1_to_be_committed_after NULL
|
||||||
|
+19 node1_to_be_committed_after NULL
|
||||||
|
+20 node1_to_be_committed_after NULL
|
||||||
|
+26 node2_committed_after NULL
|
||||||
|
+27 node2_committed_after NULL
|
||||||
|
+28 node2_committed_after NULL
|
||||||
|
+29 node2_committed_after NULL
|
||||||
|
+30 node2_committed_after NULL
|
||||||
|
+31 node1_to_be_committed_after NULL
|
||||||
|
+32 node1_to_be_committed_after NULL
|
||||||
|
+33 node1_to_be_committed_after NULL
|
||||||
|
+34 node1_to_be_committed_after NULL
|
||||||
|
+35 node1_to_be_committed_after NULL
|
||||||
|
+36 node1_committed_after NULL
|
||||||
|
+37 node1_committed_after NULL
|
||||||
|
+38 node1_committed_after NULL
|
||||||
|
+39 node1_committed_after NULL
|
||||||
|
+40 node1_committed_after NULL
|
||||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
+COUNT(*) = 0
|
+COUNT(*) = 0
|
||||||
+1
|
+1
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET AUTOCOMMIT=ON;
|
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
+SET AUTOCOMMIT=ON;
|
||||||
+COUNT(*) = 2
|
+SET SESSION wsrep_sync_wait=15;
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||||
+SELECT COUNT(*) = 35 FROM t1;
|
+EXPECT_3
|
||||||
+COUNT(*) = 35
|
+3
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
+EXPECT_35
|
||||||
|
+35
|
||||||
|
+SELECT * FROM t1;
|
||||||
|
+id f1 f2
|
||||||
|
+1 node1_committed_before NULL
|
||||||
|
+2 node1_committed_before NULL
|
||||||
|
+3 node1_committed_before NULL
|
||||||
|
+4 node1_committed_before NULL
|
||||||
|
+5 node1_committed_before NULL
|
||||||
|
+6 node2_committed_before NULL
|
||||||
|
+7 node2_committed_before NULL
|
||||||
|
+8 node2_committed_before NULL
|
||||||
|
+9 node2_committed_before NULL
|
||||||
|
+10 node2_committed_before NULL
|
||||||
|
+11 node1_committed_during NULL
|
||||||
|
+12 node1_committed_during NULL
|
||||||
|
+13 node1_committed_during NULL
|
||||||
|
+14 node1_committed_during NULL
|
||||||
|
+15 node1_committed_during NULL
|
||||||
|
+16 node1_to_be_committed_after NULL
|
||||||
|
+17 node1_to_be_committed_after NULL
|
||||||
|
+18 node1_to_be_committed_after NULL
|
||||||
|
+19 node1_to_be_committed_after NULL
|
||||||
|
+20 node1_to_be_committed_after NULL
|
||||||
|
+26 node2_committed_after NULL
|
||||||
|
+27 node2_committed_after NULL
|
||||||
|
+28 node2_committed_after NULL
|
||||||
|
+29 node2_committed_after NULL
|
||||||
|
+30 node2_committed_after NULL
|
||||||
|
+31 node1_to_be_committed_after NULL
|
||||||
|
+32 node1_to_be_committed_after NULL
|
||||||
|
+33 node1_to_be_committed_after NULL
|
||||||
|
+34 node1_to_be_committed_after NULL
|
||||||
|
+35 node1_to_be_committed_after NULL
|
||||||
|
+36 node1_committed_after NULL
|
||||||
|
+37 node1_committed_after NULL
|
||||||
|
+38 node1_committed_after NULL
|
||||||
|
+39 node1_committed_after NULL
|
||||||
|
+40 node1_committed_after NULL
|
||||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
+COUNT(*) = 0
|
+COUNT(*) = 0
|
||||||
+1
|
+1
|
||||||
+DROP TABLE t1;
|
+DROP TABLE t1;
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET AUTOCOMMIT=ON;
|
|
||||||
+SET GLOBAL debug_dbug = $debug_orig;
|
+SET GLOBAL debug_dbug = $debug_orig;
|
||||||
|
@@ -1,287 +1,519 @@
|
|||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Performing State Transfer on a server that has been temporarily disconnected
|
Performing State Transfer on a server that has been temporarily disconnected
|
||||||
connection node_1;
|
connection node_1;
|
||||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Unloading wsrep provider ...
|
Unloading wsrep provider ...
|
||||||
SET GLOBAL wsrep_cluster_address = '';
|
SET GLOBAL wsrep_cluster_address = '';
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (11,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (12,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (13,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (14,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (15,'node1_committed_during');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
|
||||||
connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Loading wsrep provider ...
|
Loading wsrep provider ...
|
||||||
|
disconnect node_2;
|
||||||
|
connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||||
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (26,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (27,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (28,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (29,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (30,'node2_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (36,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (37,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (38,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (39,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (40,'node1_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1a_galera_st_disconnect_slave;
|
connection node_1a_galera_st_disconnect_slave;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
COMMIT;
|
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||||
connection node_1;
|
connection node_1;
|
||||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Shutting down server ...
|
Shutting down server ...
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (11,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (12,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (13,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (14,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (15,'node1_committed_during');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
|
||||||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Starting server ...
|
Starting server ...
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (26,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (27,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (28,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (29,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (30,'node2_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (36,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (37,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (38,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (39,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (40,'node1_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1a_galera_st_shutdown_slave;
|
connection node_1a_galera_st_shutdown_slave;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_15 FROM t1;
|
||||||
|
EXPECT_15
|
||||||
|
35
|
||||||
|
SELECT * from t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_15 FROM t1;
|
||||||
|
EXPECT_15
|
||||||
|
35
|
||||||
|
SELECT * from t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
Performing State Transfer on a server that has been killed and restarted
|
Performing State Transfer on a server that has been killed and restarted
|
||||||
connection node_1;
|
connection node_1;
|
||||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Killing server ...
|
Killing server ...
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (11,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (12,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (13,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (14,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (15,'node1_committed_during');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
|
||||||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Performing --wsrep-recover ...
|
Performing --wsrep-recover ...
|
||||||
Starting server ...
|
Starting server ...
|
||||||
Using --wsrep-start-position when starting mysqld ...
|
Using --wsrep-start-position when starting mysqld ...
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (26,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (27,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (28,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (29,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (30,'node2_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (36,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (37,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (38,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (39,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (40,'node1_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1a_galera_st_kill_slave;
|
connection node_1a_galera_st_kill_slave;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after');
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
|
@@ -1,27 +1,27 @@
|
|||||||
--- r/galera_ist_MDEV-28583.result
|
--- r/galera_ist_MDEV-28583.result
|
||||||
+++ r/galera_ist_MDEV-28583.reject
|
+++ r/galera_ist_MDEV-28583.reject
|
||||||
@@ -285,3 +285,111 @@
|
@@ -517,3 +517,187 @@
|
||||||
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
+Performing State Transfer on a server that has been killed and restarted
|
+Performing State Transfer on a server that has been killed and restarted
|
||||||
+while a DDL was in progress on it
|
+while a DDL was in progress on it
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
+INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
+connection node_2;
|
+connection node_2;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
+INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
@@ -32,26 +32,26 @@
|
|||||||
+connection node_1;
|
+connection node_1;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
+INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after');
|
||||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
+connection node_2;
|
+connection node_2;
|
||||||
+Performing --wsrep-recover ...
|
+Performing --wsrep-recover ...
|
||||||
+connection node_2;
|
+connection node_2;
|
||||||
@@ -59,56 +59,132 @@
|
|||||||
+Using --wsrep-start-position when starting mysqld ...
|
+Using --wsrep-start-position when starting mysqld ...
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET AUTOCOMMIT=OFF;
|
+SET AUTOCOMMIT=OFF;
|
||||||
+START TRANSACTION;
|
+START TRANSACTION;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
+INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after');
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+connection node_1a_galera_st_kill_slave_ddl;
|
+connection node_1a_galera_st_kill_slave_ddl;
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after');
|
||||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
+INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
+ROLLBACK;
|
+ROLLBACK;
|
||||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
+SET AUTOCOMMIT=ON;
|
||||||
+COUNT(*) = 2
|
+SET SESSION wsrep_sync_wait=15;
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||||
+SELECT COUNT(*) = 35 FROM t1;
|
+EXPECT_3
|
||||||
+COUNT(*) = 35
|
+3
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
+EXPECT_35
|
||||||
|
+35
|
||||||
|
+SELECT * FROM t1;
|
||||||
|
+id f1 f2
|
||||||
|
+1 node1_committed_before NULL
|
||||||
|
+2 node1_committed_before NULL
|
||||||
|
+3 node1_committed_before NULL
|
||||||
|
+4 node1_committed_before NULL
|
||||||
|
+5 node1_committed_before NULL
|
||||||
|
+6 node2_committed_before NULL
|
||||||
|
+7 node2_committed_before NULL
|
||||||
|
+8 node2_committed_before NULL
|
||||||
|
+9 node2_committed_before NULL
|
||||||
|
+10 node2_committed_before NULL
|
||||||
|
+11 node1_committed_during NULL
|
||||||
|
+12 node1_committed_during NULL
|
||||||
|
+13 node1_committed_during NULL
|
||||||
|
+14 node1_committed_during NULL
|
||||||
|
+15 node1_committed_during NULL
|
||||||
|
+16 node1_to_be_committed_after NULL
|
||||||
|
+17 node1_to_be_committed_after NULL
|
||||||
|
+18 node1_to_be_committed_after NULL
|
||||||
|
+19 node1_to_be_committed_after NULL
|
||||||
|
+20 node1_to_be_committed_after NULL
|
||||||
|
+26 node2_committed_after NULL
|
||||||
|
+27 node2_committed_after NULL
|
||||||
|
+28 node2_committed_after NULL
|
||||||
|
+29 node2_committed_after NULL
|
||||||
|
+30 node2_committed_after NULL
|
||||||
|
+31 node1_to_be_committed_after NULL
|
||||||
|
+32 node1_to_be_committed_after NULL
|
||||||
|
+33 node1_to_be_committed_after NULL
|
||||||
|
+34 node1_to_be_committed_after NULL
|
||||||
|
+35 node1_to_be_committed_after NULL
|
||||||
|
+36 node1_committed_after NULL
|
||||||
|
+37 node1_committed_after NULL
|
||||||
|
+38 node1_committed_after NULL
|
||||||
|
+39 node1_committed_after NULL
|
||||||
|
+40 node1_committed_after NULL
|
||||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
+COUNT(*) = 0
|
+COUNT(*) = 0
|
||||||
+1
|
+1
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET AUTOCOMMIT=ON;
|
|
||||||
+connection node_1;
|
+connection node_1;
|
||||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
+SET AUTOCOMMIT=ON;
|
||||||
+COUNT(*) = 2
|
+SET SESSION wsrep_sync_wait=15;
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||||
+SELECT COUNT(*) = 35 FROM t1;
|
+EXPECT_3
|
||||||
+COUNT(*) = 35
|
+3
|
||||||
+1
|
+SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
+EXPECT_35
|
||||||
|
+35
|
||||||
|
+SELECT * FROM t1;
|
||||||
|
+id f1 f2
|
||||||
|
+1 node1_committed_before NULL
|
||||||
|
+2 node1_committed_before NULL
|
||||||
|
+3 node1_committed_before NULL
|
||||||
|
+4 node1_committed_before NULL
|
||||||
|
+5 node1_committed_before NULL
|
||||||
|
+6 node2_committed_before NULL
|
||||||
|
+7 node2_committed_before NULL
|
||||||
|
+8 node2_committed_before NULL
|
||||||
|
+9 node2_committed_before NULL
|
||||||
|
+10 node2_committed_before NULL
|
||||||
|
+11 node1_committed_during NULL
|
||||||
|
+12 node1_committed_during NULL
|
||||||
|
+13 node1_committed_during NULL
|
||||||
|
+14 node1_committed_during NULL
|
||||||
|
+15 node1_committed_during NULL
|
||||||
|
+16 node1_to_be_committed_after NULL
|
||||||
|
+17 node1_to_be_committed_after NULL
|
||||||
|
+18 node1_to_be_committed_after NULL
|
||||||
|
+19 node1_to_be_committed_after NULL
|
||||||
|
+20 node1_to_be_committed_after NULL
|
||||||
|
+26 node2_committed_after NULL
|
||||||
|
+27 node2_committed_after NULL
|
||||||
|
+28 node2_committed_after NULL
|
||||||
|
+29 node2_committed_after NULL
|
||||||
|
+30 node2_committed_after NULL
|
||||||
|
+31 node1_to_be_committed_after NULL
|
||||||
|
+32 node1_to_be_committed_after NULL
|
||||||
|
+33 node1_to_be_committed_after NULL
|
||||||
|
+34 node1_to_be_committed_after NULL
|
||||||
|
+35 node1_to_be_committed_after NULL
|
||||||
|
+36 node1_committed_after NULL
|
||||||
|
+37 node1_committed_after NULL
|
||||||
|
+38 node1_committed_after NULL
|
||||||
|
+39 node1_committed_after NULL
|
||||||
|
+40 node1_committed_after NULL
|
||||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
+COUNT(*) = 0
|
+COUNT(*) = 0
|
||||||
+1
|
+1
|
||||||
+DROP TABLE t1;
|
+DROP TABLE t1;
|
||||||
+COMMIT;
|
+COMMIT;
|
||||||
+SET AUTOCOMMIT=ON;
|
|
||||||
+SET GLOBAL debug_dbug = $debug_orig;
|
+SET GLOBAL debug_dbug = $debug_orig;
|
||||||
|
@@ -1,287 +1,519 @@
|
|||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Performing State Transfer on a server that has been temporarily disconnected
|
Performing State Transfer on a server that has been temporarily disconnected
|
||||||
connection node_1;
|
connection node_1;
|
||||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Unloading wsrep provider ...
|
Unloading wsrep provider ...
|
||||||
SET GLOBAL wsrep_cluster_address = '';
|
SET GLOBAL wsrep_cluster_address = '';
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (11,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (12,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (13,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (14,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (15,'node1_committed_during');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
|
||||||
connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Loading wsrep provider ...
|
Loading wsrep provider ...
|
||||||
|
disconnect node_2;
|
||||||
|
connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||||
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (26,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (27,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (28,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (29,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (30,'node2_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (36,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (37,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (38,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (39,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (40,'node1_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1a_galera_st_disconnect_slave;
|
connection node_1a_galera_st_disconnect_slave;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
COMMIT;
|
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||||
connection node_1;
|
connection node_1;
|
||||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Shutting down server ...
|
Shutting down server ...
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (11,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (12,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (13,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (14,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (15,'node1_committed_during');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
|
||||||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Starting server ...
|
Starting server ...
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (26,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (27,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (28,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (29,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (30,'node2_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (36,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (37,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (38,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (39,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (40,'node1_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1a_galera_st_shutdown_slave;
|
connection node_1a_galera_st_shutdown_slave;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_15 FROM t1;
|
||||||
|
EXPECT_15
|
||||||
|
35
|
||||||
|
SELECT * from t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_15 FROM t1;
|
||||||
|
EXPECT_15
|
||||||
|
35
|
||||||
|
SELECT * from t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
Performing State Transfer on a server that has been killed and restarted
|
Performing State Transfer on a server that has been killed and restarted
|
||||||
connection node_1;
|
connection node_1;
|
||||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (1,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (2,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (3,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (4,'node1_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
INSERT INTO t1 VALUES (5,'node1_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_2;
|
connection node_2;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (6,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (7,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (8,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (9,'node2_committed_before');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
INSERT INTO t1 VALUES (10,'node2_committed_before');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
Killing server ...
|
Killing server ...
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (11,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (12,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (13,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (14,'node1_committed_during');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
INSERT INTO t1 VALUES (15,'node1_committed_during');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
|
||||||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
|
||||||
connection node_2;
|
connection node_2;
|
||||||
Performing --wsrep-recover ...
|
Performing --wsrep-recover ...
|
||||||
Starting server ...
|
Starting server ...
|
||||||
Using --wsrep-start-position when starting mysqld ...
|
Using --wsrep-start-position when starting mysqld ...
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (26,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (27,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (28,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (29,'node2_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
INSERT INTO t1 VALUES (30,'node2_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=OFF;
|
SET AUTOCOMMIT=OFF;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (36,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (37,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (38,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (39,'node1_committed_after');
|
||||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
INSERT INTO t1 VALUES (40,'node1_committed_after');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
connection node_1a_galera_st_kill_slave;
|
connection node_1a_galera_st_kill_slave;
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
|
||||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after');
|
||||||
ROLLBACK;
|
ROLLBACK;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SELECT COUNT(*) = 35 FROM t1;
|
SET AUTOCOMMIT=ON;
|
||||||
COUNT(*) = 35
|
SET SESSION wsrep_sync_wait=15;
|
||||||
1
|
SELECT COUNT(*) AS EXPECT_35 FROM t1;
|
||||||
|
EXPECT_35
|
||||||
|
35
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id f1
|
||||||
|
1 node1_committed_before
|
||||||
|
2 node1_committed_before
|
||||||
|
3 node1_committed_before
|
||||||
|
4 node1_committed_before
|
||||||
|
5 node1_committed_before
|
||||||
|
6 node2_committed_before
|
||||||
|
7 node2_committed_before
|
||||||
|
8 node2_committed_before
|
||||||
|
9 node2_committed_before
|
||||||
|
10 node2_committed_before
|
||||||
|
11 node1_committed_during
|
||||||
|
12 node1_committed_during
|
||||||
|
13 node1_committed_during
|
||||||
|
14 node1_committed_during
|
||||||
|
15 node1_committed_during
|
||||||
|
16 node1_to_be_committed_after
|
||||||
|
17 node1_to_be_committed_after
|
||||||
|
18 node1_to_be_committed_after
|
||||||
|
19 node1_to_be_committed_after
|
||||||
|
20 node1_to_be_committed_after
|
||||||
|
26 node2_committed_after
|
||||||
|
27 node2_committed_after
|
||||||
|
28 node2_committed_after
|
||||||
|
29 node2_committed_after
|
||||||
|
30 node2_committed_after
|
||||||
|
31 node1_to_be_committed_after
|
||||||
|
32 node1_to_be_committed_after
|
||||||
|
33 node1_to_be_committed_after
|
||||||
|
34 node1_to_be_committed_after
|
||||||
|
35 node1_to_be_committed_after
|
||||||
|
36 node1_committed_after
|
||||||
|
37 node1_committed_after
|
||||||
|
38 node1_committed_after
|
||||||
|
39 node1_committed_after
|
||||||
|
40 node1_committed_after
|
||||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||||
COUNT(*) = 0
|
COUNT(*) = 0
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET AUTOCOMMIT=ON;
|
|
||||||
|
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
||||||
insert into t1 (fl) values (1);
|
insert into t1 (fl) values (1);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
insert into t1 (fl) values (1.11);
|
insert into t1 (fl) values (1.11);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
|
||||||
insert into t1 (fl) values ("qwerty");
|
insert into t1 (fl) values ("qwerty");
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
||||||
|
9
mysql-test/suite/innodb/r/instant_alter_upgrade.result
Normal file
9
mysql-test/suite/innodb/r/instant_alter_upgrade.result
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
|
||||||
|
# during ADD COLUMN
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
FLUSH TABLES;
|
||||||
|
ALTER TABLE t2 ADD COLUMN b INT;
|
||||||
|
DROP TABLE t1,t2;
|
@@ -6,9 +6,9 @@ SET DEBUG_SYNC='dict_stats_update_persistent SIGNAL stop WAIT_FOR go';
|
|||||||
ANALYZE TABLE t1;
|
ANALYZE TABLE t1;
|
||||||
connect con1, localhost, root;
|
connect con1, localhost, root;
|
||||||
SET DEBUG_SYNC='now WAIT_FOR stop';
|
SET DEBUG_SYNC='now WAIT_FOR stop';
|
||||||
SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB';
|
SELECT SUM(DATA_LENGTH+INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB';
|
||||||
ENGINE SUM(DATA_LENGTH+INDEX_LENGTH) COUNT(ENGINE) SUM(DATA_LENGTH) SUM(INDEX_LENGTH)
|
SUM(DATA_LENGTH+INDEX_LENGTH)
|
||||||
InnoDB 114688 4 65536 49152
|
SUM
|
||||||
SET DEBUG_SYNC='now SIGNAL go';
|
SET DEBUG_SYNC='now SIGNAL go';
|
||||||
disconnect con1;
|
disconnect con1;
|
||||||
connection default;
|
connection default;
|
||||||
|
@@ -8,6 +8,7 @@ call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed r
|
|||||||
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted.");
|
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted.");
|
||||||
call mtr.add_suppression("Table test/t1 is corrupted. Please drop the table and recreate\\.");
|
call mtr.add_suppression("Table test/t1 is corrupted. Please drop the table and recreate\\.");
|
||||||
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
|
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
|
||||||
|
call mtr.add_suppression("InnoDB: A long wait .* was observed for dict_sys");
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
||||||
|
16
mysql-test/suite/innodb/t/instant_alter_upgrade.test
Normal file
16
mysql-test/suite/innodb/t/instant_alter_upgrade.test
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/innodb_row_format.inc
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
|
||||||
|
--echo # during ADD COLUMN
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||||
|
FLUSH TABLES;
|
||||||
|
--let $datadir=`select @@datadir`
|
||||||
|
--remove_file $datadir/test/t2.frm
|
||||||
|
--copy_file $datadir/test/t1.frm $datadir/test/t2.frm
|
||||||
|
ALTER TABLE t2 ADD COLUMN b INT;
|
||||||
|
DROP TABLE t1,t2;
|
@@ -14,7 +14,8 @@ SET DEBUG_SYNC='dict_stats_update_persistent SIGNAL stop WAIT_FOR go';
|
|||||||
--connect(con1, localhost, root)
|
--connect(con1, localhost, root)
|
||||||
SET DEBUG_SYNC='now WAIT_FOR stop';
|
SET DEBUG_SYNC='now WAIT_FOR stop';
|
||||||
|
|
||||||
SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB';
|
--replace_column 1 SUM
|
||||||
|
SELECT SUM(DATA_LENGTH+INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB';
|
||||||
|
|
||||||
SET DEBUG_SYNC='now SIGNAL go';
|
SET DEBUG_SYNC='now SIGNAL go';
|
||||||
--disconnect con1
|
--disconnect con1
|
||||||
|
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
create table t1 (pk integer primary key auto_increment, fl geometry not null);
|
||||||
insert into t1 (fl) values (1);
|
insert into t1 (fl) values (1);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
insert into t1 (fl) values (1.11);
|
insert into t1 (fl) values (1.11);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
|
||||||
insert into t1 (fl) values ("qwerty");
|
insert into t1 (fl) values ("qwerty");
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
||||||
|
@@ -660,9 +660,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo))
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
insert into t1 values (1.11);
|
insert into t1 values (1.11);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
|
||||||
insert into t1 values ("qwerty");
|
insert into t1 values ("qwerty");
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
insert into t1 values (ST_pointfromtext('point(1,1)'));
|
insert into t1 values (ST_pointfromtext('point(1,1)'));
|
||||||
|
@@ -661,9 +661,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo))
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
|
||||||
insert into t1 values (1.11);
|
insert into t1 values (1.11);
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
|
||||||
insert into t1 values ("qwerty");
|
insert into t1 values ("qwerty");
|
||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
insert into t1 values (ST_pointfromtext('point(1,1)'));
|
insert into t1 values (ST_pointfromtext('point(1,1)'));
|
||||||
|
@@ -387,9 +387,9 @@ t1 where object_id=85984;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 values (1.11);
|
insert into t1 values (1.11);
|
||||||
--error 1416
|
--error 1416
|
||||||
insert into t1 values ("qwerty");
|
insert into t1 values ("qwerty");
|
||||||
|
@@ -380,9 +380,9 @@ t1 where object_id=85984;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
create table t1 (fl geometry not null);
|
create table t1 (fl geometry not null);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
--error 1416
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
insert into t1 values (1.11);
|
insert into t1 values (1.11);
|
||||||
--error 1416
|
--error 1416
|
||||||
insert into t1 values ("qwerty");
|
insert into t1 values ("qwerty");
|
||||||
|
@@ -886,5 +886,16 @@ UPDATE t1 SET pk = 0;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$skip_update)
|
||||||
|
{
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
|
||||||
|
--echo # ha_partition::set_auto_increment_if_higher
|
||||||
|
--echo #
|
||||||
|
eval CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine PARTITION BY HASH (a) PARTITIONS 3;
|
||||||
|
REPLACE INTO t1 PARTITION (p0) VALUES (3);
|
||||||
|
DROP TABLE t1;
|
||||||
|
}
|
||||||
|
|
||||||
--echo ##############################################################################
|
--echo ##############################################################################
|
||||||
}
|
}
|
||||||
|
@@ -1124,4 +1124,11 @@ CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam
|
|||||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||||
UPDATE t1 SET pk = 0;
|
UPDATE t1 SET pk = 0;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
|
||||||
|
# ha_partition::set_auto_increment_if_higher
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='InnoDB' PARTITION BY HASH (a) PARTITIONS 3;
|
||||||
|
REPLACE INTO t1 PARTITION (p0) VALUES (3);
|
||||||
|
DROP TABLE t1;
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@@ -1156,4 +1156,11 @@ CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam
|
|||||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||||
UPDATE t1 SET pk = 0;
|
UPDATE t1 SET pk = 0;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
|
||||||
|
# ha_partition::set_auto_increment_if_higher
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Aria' PARTITION BY HASH (a) PARTITIONS 3;
|
||||||
|
REPLACE INTO t1 PARTITION (p0) VALUES (3);
|
||||||
|
DROP TABLE t1;
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@@ -1137,4 +1137,11 @@ CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam
|
|||||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||||
UPDATE t1 SET pk = 0;
|
UPDATE t1 SET pk = 0;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
|
||||||
|
# ha_partition::set_auto_increment_if_higher
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Memory' PARTITION BY HASH (a) PARTITIONS 3;
|
||||||
|
REPLACE INTO t1 PARTITION (p0) VALUES (3);
|
||||||
|
DROP TABLE t1;
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@@ -1156,4 +1156,11 @@ CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam
|
|||||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||||
UPDATE t1 SET pk = 0;
|
UPDATE t1 SET pk = 0;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
|
||||||
|
# ha_partition::set_auto_increment_if_higher
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='MyISAM' PARTITION BY HASH (a) PARTITIONS 3;
|
||||||
|
REPLACE INTO t1 PARTITION (p0) VALUES (3);
|
||||||
|
DROP TABLE t1;
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@@ -2,6 +2,26 @@ install plugin test_sql_service soname 'test_sql_service';
|
|||||||
show status like 'test_sql_service_passed';
|
show status like 'test_sql_service_passed';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Test_sql_service_passed 1
|
Test_sql_service_passed 1
|
||||||
|
set global test_sql_service_execute_sql_global= 'create table test.t1 select 1 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_local= 'insert into test.t1 select 2 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=1';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 3 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=0';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 4 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=1';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 5 as a, @@sql_auto_is_null';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=0';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 6 as a, @@sql_auto_is_null';
|
||||||
|
select * from t1 order by a;
|
||||||
|
a @@SQL_LOG_BIN
|
||||||
|
1 0
|
||||||
|
2 0
|
||||||
|
3 1
|
||||||
|
4 0
|
||||||
|
5 1
|
||||||
|
6 0
|
||||||
|
drop table t1;
|
||||||
|
SET SQL_LOG_BIN=0;
|
||||||
set global test_sql_service_run_test= 1;
|
set global test_sql_service_run_test= 1;
|
||||||
show status like 'test_sql_service_passed';
|
show status like 'test_sql_service_passed';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
@@ -68,3 +88,12 @@ drop table t1;
|
|||||||
uninstall plugin test_sql_service;
|
uninstall plugin test_sql_service;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
Warning 1620 Plugin is busy and will be uninstalled on shutdown
|
||||||
|
include/show_binlog_events.inc
|
||||||
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
|
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||||
|
master-bin.000001 # Annotate_rows # # insert into test.t1 select 3 as a, @@SQL_LOG_BIN
|
||||||
|
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||||
|
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||||
|
master-bin.000001 # Query # # COMMIT
|
||||||
|
master-bin.000001 # Gtid # # GTID #-#-#
|
||||||
|
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
--source include/not_embedded.inc
|
--source include/not_embedded.inc
|
||||||
|
--source include/have_log_bin.inc
|
||||||
|
|
||||||
if (!$TEST_SQL_SERVICE_SO) {
|
if (!$TEST_SQL_SERVICE_SO) {
|
||||||
skip No TEST_SQL_SERVICE plugin;
|
skip No TEST_SQL_SERVICE plugin;
|
||||||
@@ -11,6 +12,20 @@ source include/wait_until_count_sessions.inc;
|
|||||||
install plugin test_sql_service soname 'test_sql_service';
|
install plugin test_sql_service soname 'test_sql_service';
|
||||||
show status like 'test_sql_service_passed';
|
show status like 'test_sql_service_passed';
|
||||||
|
|
||||||
|
set global test_sql_service_execute_sql_global= 'create table test.t1 select 1 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_local= 'insert into test.t1 select 2 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=1';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 3 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=0';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 4 as a, @@SQL_LOG_BIN';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=1';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 5 as a, @@sql_auto_is_null';
|
||||||
|
set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=0';
|
||||||
|
set global test_sql_service_execute_sql_global= 'insert into test.t1 select 6 as a, @@sql_auto_is_null';
|
||||||
|
select * from t1 order by a;
|
||||||
|
drop table t1;
|
||||||
|
SET SQL_LOG_BIN=0;
|
||||||
|
|
||||||
set global test_sql_service_run_test= 1;
|
set global test_sql_service_run_test= 1;
|
||||||
show status like 'test_sql_service_passed';
|
show status like 'test_sql_service_passed';
|
||||||
|
|
||||||
@@ -58,3 +73,9 @@ drop table t1;
|
|||||||
|
|
||||||
uninstall plugin test_sql_service;
|
uninstall plugin test_sql_service;
|
||||||
|
|
||||||
|
# Check that statements were executed/binlogged in correct order.
|
||||||
|
source include/show_binlog_events.inc;
|
||||||
|
# --replace_column 2 # 5 #
|
||||||
|
# --replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/
|
||||||
|
# SHOW BINLOG EVENTS LIMIT 3,100;
|
||||||
|
|
||||||
|
@@ -13,6 +13,5 @@
|
|||||||
rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition with archive table
|
rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition with archive table
|
||||||
rpl_row_binlog_max_cache_size : MDEV-11092
|
rpl_row_binlog_max_cache_size : MDEV-11092
|
||||||
rpl_row_index_choice : MDEV-11666
|
rpl_row_index_choice : MDEV-11666
|
||||||
rpl_semi_sync_after_sync : fails after MDEV-16172
|
|
||||||
rpl_auto_increment_update_failure : disabled for now
|
rpl_auto_increment_update_failure : disabled for now
|
||||||
rpl_current_user : waits for MDEV-22374 fix
|
rpl_current_user : waits for MDEV-22374 fix
|
||||||
|
@@ -701,7 +701,7 @@ int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
|
|||||||
keycache->in_resize= 1;
|
keycache->in_resize= 1;
|
||||||
|
|
||||||
/* Need to flush only if keycache is enabled. */
|
/* Need to flush only if keycache is enabled. */
|
||||||
if (keycache->can_be_used)
|
if (keycache->can_be_used && keycache->disk_blocks != -1)
|
||||||
{
|
{
|
||||||
/* Start the flush phase. */
|
/* Start the flush phase. */
|
||||||
keycache->resize_in_flush= 1;
|
keycache->resize_in_flush= 1;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
SET(FILE_KEY_MANAGEMENT_PLUGIN_SOURCES file_key_management_plugin.cc parser.cc)
|
SET(FILE_KEY_MANAGEMENT_PLUGIN_SOURCES file_key_management_plugin.cc parser.cc)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
|
||||||
MYSQL_ADD_PLUGIN(FILE_KEY_MANAGEMENT ${FILE_KEY_MANAGEMENT_PLUGIN_SOURCES})
|
MYSQL_ADD_PLUGIN(FILE_KEY_MANAGEMENT ${FILE_KEY_MANAGEMENT_PLUGIN_SOURCES} MODULE_ONLY)
|
||||||
|
@@ -192,9 +192,9 @@ CREATE TABLE t1 (a INET6);
|
|||||||
INSERT INTO t1 VALUES ('x');
|
INSERT INTO t1 VALUES ('x');
|
||||||
ERROR 22007: Incorrect inet6 value: 'x' for column `test`.`t1`.`a` at row 1
|
ERROR 22007: Incorrect inet6 value: 'x' for column `test`.`t1`.`a` at row 1
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
ERROR 22007: Incorrect inet6 value: '1' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
INSERT INTO t1 VALUES (TIME'10:20:30');
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
||||||
ERROR 22007: Incorrect inet6 value: '10:20:30' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
INSERT INTO t1 VALUES (0x00);
|
INSERT INTO t1 VALUES (0x00);
|
||||||
ERROR 22007: Incorrect inet6 value: '\x00' for column `test`.`t1`.`a` at row 1
|
ERROR 22007: Incorrect inet6 value: '\x00' for column `test`.`t1`.`a` at row 1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -820,15 +820,15 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
ERROR 22007: Incorrect integer value: '::' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a DOUBLE);
|
CREATE TABLE t1 (a DOUBLE);
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
ERROR 22007: Incorrect double value: '::' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a DECIMAL(32,0));
|
CREATE TABLE t1 (a DECIMAL(32,0));
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
ERROR 22007: Incorrect decimal value: '::' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a VARCHAR(64));
|
CREATE TABLE t1 (a VARCHAR(64));
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
@@ -1606,7 +1606,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b INT);
|
CREATE TABLE t1 (a INET6, b INT);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect integer value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1614,7 +1614,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b DOUBLE);
|
CREATE TABLE t1 (a INET6, b DOUBLE);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect double value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1622,7 +1622,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b DECIMAL(32,0));
|
CREATE TABLE t1 (a INET6, b DECIMAL(32,0));
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect decimal value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1630,7 +1630,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b YEAR);
|
CREATE TABLE t1 (a INET6, b YEAR);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect integer value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types year and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1641,7 +1641,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INT, b INET6);
|
CREATE TABLE t1 (a INT, b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '1' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1649,7 +1649,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DOUBLE, b INET6);
|
CREATE TABLE t1 (a DOUBLE, b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '1' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1657,7 +1657,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DECIMAL(32,0), b INET6);
|
CREATE TABLE t1 (a DECIMAL(32,0), b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '1' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1665,7 +1665,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a YEAR, b INET6);
|
CREATE TABLE t1 (a YEAR, b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '2001' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and year for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1676,7 +1676,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b TIME);
|
CREATE TABLE t1 (a INET6, b TIME);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect time value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1684,7 +1684,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b DATE);
|
CREATE TABLE t1 (a INET6, b DATE);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect date value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types date and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1692,7 +1692,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b DATETIME);
|
CREATE TABLE t1 (a INET6, b DATETIME);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect datetime value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types datetime and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1700,7 +1700,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b TIMESTAMP NULL DEFAULT NULL);
|
CREATE TABLE t1 (a INET6, b TIMESTAMP NULL DEFAULT NULL);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect datetime value: 'ffff::ffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types timestamp and inet6 for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1711,7 +1711,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a TIME, b INET6);
|
CREATE TABLE t1 (a TIME, b INET6);
|
||||||
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '00:00:00' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1719,7 +1719,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DATE, b INET6);
|
CREATE TABLE t1 (a DATE, b INET6);
|
||||||
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '2001-01-01' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and date for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1727,7 +1727,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DATETIME, b INET6);
|
CREATE TABLE t1 (a DATETIME, b INET6);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '2001-01-01 10:20:30' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and datetime for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1735,7 +1735,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a TIMESTAMP, b INET6);
|
CREATE TABLE t1 (a TIMESTAMP, b INET6);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect inet6 value: '2001-01-01 10:20:30' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types inet6 and timestamp for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -1922,7 +1922,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INET6, b INT);
|
CREATE TABLE t1 (a INET6, b INT);
|
||||||
INSERT INTO t1 (a) VALUES ('::');
|
INSERT INTO t1 (a) VALUES ('::');
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect integer value: '::' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
a b
|
a b
|
||||||
:: NULL
|
:: NULL
|
||||||
@@ -1931,7 +1931,7 @@ SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
|
|||||||
CREATE TABLE t1 (a INET6, b TIMESTAMP);
|
CREATE TABLE t1 (a INET6, b TIMESTAMP);
|
||||||
INSERT INTO t1 (a) VALUES ('::');
|
INSERT INTO t1 (a) VALUES ('::');
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect datetime value: '::' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types timestamp and inet6 for operation 'SET'
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
a b
|
a b
|
||||||
:: 2001-01-01 10:20:30
|
:: 2001-01-01 10:20:30
|
||||||
@@ -1940,7 +1940,7 @@ SET timestamp=DEFAULT;
|
|||||||
CREATE OR REPLACE TABLE t1 (a INET6);
|
CREATE OR REPLACE TABLE t1 (a INET6);
|
||||||
INSERT INTO t1 (a) VALUES ('::');
|
INSERT INTO t1 (a) VALUES ('::');
|
||||||
ALTER TABLE t1 MODIFY a DATE;
|
ALTER TABLE t1 MODIFY a DATE;
|
||||||
ERROR 22007: Incorrect date value: '::' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types date and inet6 for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
# MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed in write_block_record on temporary table
|
# MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed in write_block_record on temporary table
|
||||||
@@ -2222,8 +2222,8 @@ Warnings:
|
|||||||
Warning 1292 Truncated incorrect max_sort_length value: '4'
|
Warning 1292 Truncated incorrect max_sort_length value: '4'
|
||||||
CREATE TEMPORARY TABLE t1(c INET6,d DATE);
|
CREATE TEMPORARY TABLE t1(c INET6,d DATE);
|
||||||
INSERT INTO t1 VALUES(0,0);
|
INSERT INTO t1 VALUES(0,0);
|
||||||
Warnings:
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
Warning 1292 Incorrect inet6 value: '0' for column `test`.`t1`.`c` at row 1
|
INSERT INTO t1 VALUES('::',0);
|
||||||
SELECT c FROM t1 ORDER BY c;
|
SELECT c FROM t1 ORDER BY c;
|
||||||
c
|
c
|
||||||
::
|
::
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Basic CREATE functionality, defaults, metadata
|
--echo # Basic CREATE functionality, defaults, metadata
|
||||||
--echo #
|
--echo #
|
||||||
@@ -48,9 +47,9 @@ CREATE TABLE t1 (c1 INET6 DEFAULT '');
|
|||||||
CREATE TABLE t1 (a INET6);
|
CREATE TABLE t1 (a INET6);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_TRUNCATED_WRONG_VALUE
|
||||||
INSERT INTO t1 VALUES ('x');
|
INSERT INTO t1 VALUES ('x');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (TIME'10:20:30');
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_TRUNCATED_WRONG_VALUE
|
||||||
INSERT INTO t1 VALUES (0x00);
|
INSERT INTO t1 VALUES (0x00);
|
||||||
@@ -447,17 +446,17 @@ DROP TABLE t1;
|
|||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DOUBLE);
|
CREATE TABLE t1 (a DOUBLE);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DECIMAL(32,0));
|
CREATE TABLE t1 (a DECIMAL(32,0));
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
INSERT INTO t1 VALUES (CAST('::' AS INET6));
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
@@ -1095,28 +1094,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b INT);
|
CREATE TABLE t1 (a INET6, b INT);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b DOUBLE);
|
CREATE TABLE t1 (a INET6, b DOUBLE);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b DECIMAL(32,0));
|
CREATE TABLE t1 (a INET6, b DECIMAL(32,0));
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b YEAR);
|
CREATE TABLE t1 (a INET6, b YEAR);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1128,28 +1127,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a INT, b INET6);
|
CREATE TABLE t1 (a INT, b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DOUBLE, b INET6);
|
CREATE TABLE t1 (a DOUBLE, b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DECIMAL(32,0), b INET6);
|
CREATE TABLE t1 (a DECIMAL(32,0), b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a YEAR, b INET6);
|
CREATE TABLE t1 (a YEAR, b INET6);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1161,28 +1160,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b TIME);
|
CREATE TABLE t1 (a INET6, b TIME);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b DATE);
|
CREATE TABLE t1 (a INET6, b DATE);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b DATETIME);
|
CREATE TABLE t1 (a INET6, b DATETIME);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b TIMESTAMP NULL DEFAULT NULL);
|
CREATE TABLE t1 (a INET6, b TIMESTAMP NULL DEFAULT NULL);
|
||||||
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1194,28 +1193,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a TIME, b INET6);
|
CREATE TABLE t1 (a TIME, b INET6);
|
||||||
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DATE, b INET6);
|
CREATE TABLE t1 (a DATE, b INET6);
|
||||||
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DATETIME, b INET6);
|
CREATE TABLE t1 (a DATETIME, b INET6);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a TIMESTAMP, b INET6);
|
CREATE TABLE t1 (a TIMESTAMP, b INET6);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1406,7 +1405,7 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a INET6, b INT);
|
CREATE TABLE t1 (a INET6, b INT);
|
||||||
INSERT INTO t1 (a) VALUES ('::');
|
INSERT INTO t1 (a) VALUES ('::');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1414,7 +1413,7 @@ DROP TABLE t1;
|
|||||||
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
|
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
|
||||||
CREATE TABLE t1 (a INET6, b TIMESTAMP);
|
CREATE TABLE t1 (a INET6, b TIMESTAMP);
|
||||||
INSERT INTO t1 (a) VALUES ('::');
|
INSERT INTO t1 (a) VALUES ('::');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1422,7 +1421,7 @@ SET timestamp=DEFAULT;
|
|||||||
|
|
||||||
CREATE OR REPLACE TABLE t1 (a INET6);
|
CREATE OR REPLACE TABLE t1 (a INET6);
|
||||||
INSERT INTO t1 (a) VALUES ('::');
|
INSERT INTO t1 (a) VALUES ('::');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
ALTER TABLE t1 MODIFY a DATE;
|
ALTER TABLE t1 MODIFY a DATE;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
@@ -1638,7 +1637,9 @@ DROP TABLE companies;
|
|||||||
SET sql_mode='';
|
SET sql_mode='';
|
||||||
SET @@SESSION.max_sort_length=4;
|
SET @@SESSION.max_sort_length=4;
|
||||||
CREATE TEMPORARY TABLE t1(c INET6,d DATE);
|
CREATE TEMPORARY TABLE t1(c INET6,d DATE);
|
||||||
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES(0,0);
|
INSERT INTO t1 VALUES(0,0);
|
||||||
|
INSERT INTO t1 VALUES('::',0);
|
||||||
SELECT c FROM t1 ORDER BY c;
|
SELECT c FROM t1 ORDER BY c;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET max_sort_length=DEFAULT;
|
SET max_sort_length=DEFAULT;
|
||||||
|
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source DECIMAL(38,0) DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` inet6 DEFAULT '::',
|
||||||
|
`source` decimal(38,0) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
2 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target decimal(38,0)
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src decimal(38,0) DEFAULT NULL;
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a inet6) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst inet6)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src decimal(38,0) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS inet6
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc decimal(38,0) DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src decimal(38,0) DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` decimal(38,0) DEFAULT 0,
|
||||||
|
`source` inet6 DEFAULT '::',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1366 Incorrect decimal value: '::' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
2 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target inet6
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE dst decimal(38,0) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a decimal(38,0)) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a decimal(38,0)) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst decimal(38,0))
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst decimal(38,0) DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS decimal(38,0)
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc inet6 DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t decimal(38,0)) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst decimal(38,0) DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source DECIMAL(38,0) DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` inet6 DEFAULT '::',
|
||||||
|
`source` double DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
2 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target double
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src double DEFAULT NULL;
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a inet6) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst inet6)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src double DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS inet6
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc double DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src double DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` double DEFAULT 0,
|
||||||
|
`source` inet6 DEFAULT '::',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
2 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target inet6
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE dst double DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a double) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst double)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst double DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS double
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc inet6 DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t double) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst double DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
343
plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result
Normal file
343
plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` inet6 DEFAULT '::',
|
||||||
|
`source` int(11) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
2 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target int(11)
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a inet6) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst inet6)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS inet6
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc int(11) DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target INT DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` int(11) DEFAULT 0,
|
||||||
|
`source` inet6 DEFAULT '::',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1366 Incorrect integer value: '::' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
2 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target inet6
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a int(11)) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst int(11))
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS int(11)
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc inet6 DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t int(11)) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INT DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
343
plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result
Normal file
343
plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source TIME DEFAULT '00:00:00');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` inet6 DEFAULT '::',
|
||||||
|
`source` time DEFAULT '00:00:00',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect inet6 value: '00:00:00' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 00:00:00
|
||||||
|
2 :: 00:00:00
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 00:00:00
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target time
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src time DEFAULT NULL;
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a inet6) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst inet6)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src time DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS inet6
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc time DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src time DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source INET6 DEFAULT '::0');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` time DEFAULT '00:00:00',
|
||||||
|
`source` inet6 DEFAULT '::',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'target' at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00:00:00 ::
|
||||||
|
2 00:00:00 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00:00:00 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target inet6
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE dst time DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a time) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a time) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst time)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst time DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS time
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc inet6 DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t time) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst time DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source TIME DEFAULT '00:00:00');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source INET6 DEFAULT '::0');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
343
plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result
Normal file
343
plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT UNSIGNED DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` inet6 DEFAULT '::',
|
||||||
|
`source` int(10) unsigned DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
2 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 :: 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target int(10) unsigned
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(10) unsigned DEFAULT NULL;
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a inet6) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst inet6)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(10) unsigned DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS inet6
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc int(10) unsigned DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(10) unsigned DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` int(10) unsigned DEFAULT 0,
|
||||||
|
`source` inet6 DEFAULT '::',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1366 Incorrect integer value: '::' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
2 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 ::
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target inet6
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE dst int(10) unsigned DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a int(10) unsigned) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a int(10) unsigned) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst int(10) unsigned)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(10) unsigned DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS int(10) unsigned
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc inet6 DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src inet6 DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t int(10) unsigned) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(10) unsigned DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT UNSIGNED DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source INET6 DEFAULT '::0');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
@@ -40,6 +40,18 @@ public:
|
|||||||
void Column_definition_reuse_fix_attributes(THD *thd,
|
void Column_definition_reuse_fix_attributes(THD *thd,
|
||||||
Column_definition *def,
|
Column_definition *def,
|
||||||
const Field *field) const override;
|
const Field *field) const override;
|
||||||
|
const Type_handler *type_handler_base() const override
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Override this method in the same way with what Type_handler_blob_json
|
||||||
|
does, to tell the server that MySQL JSON inherits aggregation behaviour
|
||||||
|
from the LONGBLOB data type.
|
||||||
|
This makes MariaDB JSON column and a MySQL JSON column compatible for
|
||||||
|
assignment, so "ALTER TABLE table_with_mysql_json FORCE" can run without
|
||||||
|
raising ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION.
|
||||||
|
*/
|
||||||
|
return &type_handler_long_blob;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Type_handler_mysql_json type_handler_mysql_json;
|
Type_handler_mysql_json type_handler_mysql_json;
|
||||||
|
@@ -195,9 +195,9 @@ CREATE TABLE t1 (a UUID);
|
|||||||
INSERT INTO t1 VALUES ('x');
|
INSERT INTO t1 VALUES ('x');
|
||||||
ERROR 22007: Incorrect uuid value: 'x' for column `test`.`t1`.`a` at row 1
|
ERROR 22007: Incorrect uuid value: 'x' for column `test`.`t1`.`a` at row 1
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
INSERT INTO t1 VALUES (TIME'10:20:30');
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
||||||
ERROR 22007: Incorrect uuid value: '10:20:30' for column `test`.`t1`.`a` at row 1
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
INSERT INTO t1 VALUES (0x00);
|
INSERT INTO t1 VALUES (0x00);
|
||||||
ERROR 22007: Incorrect uuid value: '\x00' for column `test`.`t1`.`a` at row 1
|
ERROR 22007: Incorrect uuid value: '\x00' for column `test`.`t1`.`a` at row 1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1931,15 +1931,15 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
ERROR 01000: Data truncated for column 'a' at row 1
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a DOUBLE);
|
CREATE TABLE t1 (a DOUBLE);
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
ERROR 01000: Data truncated for column 'a' at row 1
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a DECIMAL(32,0));
|
CREATE TABLE t1 (a DECIMAL(32,0));
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
ERROR 01000: Data truncated for column 'a' at row 1
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a VARCHAR(64));
|
CREATE TABLE t1 (a VARCHAR(64));
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
@@ -2762,7 +2762,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b INT);
|
CREATE TABLE t1 (a UUID, b INT);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect integer value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2770,7 +2770,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b DOUBLE);
|
CREATE TABLE t1 (a UUID, b DOUBLE);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect double value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2778,7 +2778,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b DECIMAL(32,0));
|
CREATE TABLE t1 (a UUID, b DECIMAL(32,0));
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect decimal value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2786,7 +2786,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b YEAR);
|
CREATE TABLE t1 (a UUID, b YEAR);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect integer value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types year and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2797,7 +2797,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a INT, b UUID);
|
CREATE TABLE t1 (a INT, b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2805,7 +2805,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DOUBLE, b UUID);
|
CREATE TABLE t1 (a DOUBLE, b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2813,7 +2813,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
|
CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2821,7 +2821,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a YEAR, b UUID);
|
CREATE TABLE t1 (a YEAR, b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '2001' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and year for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2832,7 +2832,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b TIME);
|
CREATE TABLE t1 (a UUID, b TIME);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect time value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2840,7 +2840,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b DATE);
|
CREATE TABLE t1 (a UUID, b DATE);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect date value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types date and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2848,7 +2848,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b DATETIME);
|
CREATE TABLE t1 (a UUID, b DATETIME);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect datetime value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types datetime and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2856,7 +2856,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL);
|
CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect datetime value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types timestamp and uuid for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2867,7 +2867,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a TIME, b UUID);
|
CREATE TABLE t1 (a TIME, b UUID);
|
||||||
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '00:00:00' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2875,7 +2875,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DATE, b UUID);
|
CREATE TABLE t1 (a DATE, b UUID);
|
||||||
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '2001-01-01' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and date for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2883,7 +2883,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a DATETIME, b UUID);
|
CREATE TABLE t1 (a DATETIME, b UUID);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '2001-01-01 10:20:30' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and datetime for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
@@ -2891,7 +2891,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (a TIMESTAMP, b UUID);
|
CREATE TABLE t1 (a TIMESTAMP, b UUID);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
ERROR 22007: Incorrect uuid value: '2001-01-01 10:20:30' for column `test`.`t1`.`b` at row 1
|
ERROR HY000: Illegal parameter data types uuid and timestamp for operation 'SET'
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
b
|
b
|
||||||
NULL
|
NULL
|
||||||
|
@@ -51,9 +51,9 @@ CREATE TABLE t1 (c1 UUID DEFAULT '');
|
|||||||
CREATE TABLE t1 (a UUID);
|
CREATE TABLE t1 (a UUID);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_TRUNCATED_WRONG_VALUE
|
||||||
INSERT INTO t1 VALUES ('x');
|
INSERT INTO t1 VALUES ('x');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (TIME'10:20:30');
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_TRUNCATED_WRONG_VALUE
|
||||||
INSERT INTO t1 VALUES (0x00);
|
INSERT INTO t1 VALUES (0x00);
|
||||||
@@ -542,17 +542,17 @@ DROP TABLE t1;
|
|||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
--error WARN_DATA_TRUNCATED
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DOUBLE);
|
CREATE TABLE t1 (a DOUBLE);
|
||||||
--error WARN_DATA_TRUNCATED
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DECIMAL(32,0));
|
CREATE TABLE t1 (a DECIMAL(32,0));
|
||||||
--error WARN_DATA_TRUNCATED
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
@@ -1250,28 +1250,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b INT);
|
CREATE TABLE t1 (a UUID, b INT);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b DOUBLE);
|
CREATE TABLE t1 (a UUID, b DOUBLE);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b DECIMAL(32,0));
|
CREATE TABLE t1 (a UUID, b DECIMAL(32,0));
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b YEAR);
|
CREATE TABLE t1 (a UUID, b YEAR);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1283,28 +1283,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a INT, b UUID);
|
CREATE TABLE t1 (a INT, b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DOUBLE, b UUID);
|
CREATE TABLE t1 (a DOUBLE, b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
|
CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a YEAR, b UUID);
|
CREATE TABLE t1 (a YEAR, b UUID);
|
||||||
INSERT INTO t1 VALUES (1, NULL);
|
INSERT INTO t1 VALUES (1, NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1316,28 +1316,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b TIME);
|
CREATE TABLE t1 (a UUID, b TIME);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b DATE);
|
CREATE TABLE t1 (a UUID, b DATE);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b DATETIME);
|
CREATE TABLE t1 (a UUID, b DATETIME);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL);
|
CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL);
|
||||||
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@@ -1349,28 +1349,28 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (a TIME, b UUID);
|
CREATE TABLE t1 (a TIME, b UUID);
|
||||||
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
INSERT INTO t1 VALUES ('00:00:00', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DATE, b UUID);
|
CREATE TABLE t1 (a DATE, b UUID);
|
||||||
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
INSERT INTO t1 VALUES ('2001-01:01', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a DATETIME, b UUID);
|
CREATE TABLE t1 (a DATETIME, b UUID);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (a TIMESTAMP, b UUID);
|
CREATE TABLE t1 (a TIMESTAMP, b UUID);
|
||||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
|
||||||
--error ER_TRUNCATED_WRONG_VALUE
|
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
|
||||||
UPDATE t1 SET b=a;
|
UPDATE t1 SET b=a;
|
||||||
SELECT b FROM t1;
|
SELECT b FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from UUID UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DECIMAL(38,0) DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
`source` decimal(38,0) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
2 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target decimal(38,0)
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src decimal(38,0) DEFAULT NULL;
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a uuid) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst uuid)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src decimal(38,0) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS uuid
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc decimal(38,0) DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src decimal(38,0) DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t uuid) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` decimal(38,0) DEFAULT 0,
|
||||||
|
`source` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'target' at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
2 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target uuid
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE dst decimal(38,0) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a decimal(38,0)) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a decimal(38,0)) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst decimal(38,0))
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst decimal(38,0) DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS decimal(38,0)
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc uuid DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t decimal(38,0)) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst decimal(38,0) DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from UUID UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DECIMAL(38,0) DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DOUBLE DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
`source` double DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
2 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target double
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src double DEFAULT NULL;
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a uuid) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst uuid)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src double DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS uuid
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc double DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src double DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t uuid) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target DOUBLE DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` double DEFAULT 0,
|
||||||
|
`source` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'target' at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
2 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target uuid
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE dst double DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a double) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst double)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst double DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS double
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc uuid DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t double) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst double DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DOUBLE DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target DOUBLE DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
343
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result
Normal file
343
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
`source` int(11) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
2 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target int(11)
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a uuid) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst uuid)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS uuid
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc int(11) DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(11) DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t uuid) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target INT DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` int(11) DEFAULT 0,
|
||||||
|
`source` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'target' at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
2 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target uuid
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a int(11)) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst int(11))
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS int(11)
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc uuid DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t int(11)) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(11) DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
19
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.test
Normal file
19
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.test
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INT DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
343
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result
Normal file
343
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source TIME DEFAULT '00:00:00');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
`source` time DEFAULT '00:00:00',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect uuid value: '00:00:00' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 00:00:00
|
||||||
|
2 00000000-0000-0000-0000-000000000000 00:00:00
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 00:00:00
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target time
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src time DEFAULT NULL;
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a uuid) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst uuid)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src time DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS uuid
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc time DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src time DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t uuid) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` time DEFAULT '00:00:00',
|
||||||
|
`source` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'target' at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00:00:00 00000000-0000-0000-0000-000000000000
|
||||||
|
2 00:00:00 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00:00:00 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target uuid
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE dst time DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a time) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a time) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst time)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst time DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS time
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc uuid DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t time) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst time DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source TIME DEFAULT '00:00:00');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
343
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result
Normal file
343
plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
#
|
||||||
|
# Start of 10.7 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT UNSIGNED DEFAULT 0);
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
`source` int(10) unsigned DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
2 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 00000000-0000-0000-0000-000000000000 0
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target int(10) unsigned
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(10) unsigned DEFAULT NULL;
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a uuid) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst uuid)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(10) unsigned DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS uuid
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc int(10) unsigned DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src int(10) unsigned DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t uuid) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst uuid DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
# Start of type_store_assignment_incompatible.inc
|
||||||
|
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='source'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE COLUMN_NAME='target'
|
||||||
|
AND TABLE_NAME='t1'
|
||||||
|
AND TABLE_SCHEMA='test');
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
|
||||||
|
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`target` int(10) unsigned DEFAULT 0,
|
||||||
|
`source` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
SET sql_mode='';
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
ALTER TABLE t3 ENGINE=MyISAM;
|
||||||
|
EXECUTE IMMEDIATE
|
||||||
|
CONCAT('CREATE VIEW v3 AS SELECT id,',
|
||||||
|
IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
|
||||||
|
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
|
||||||
|
' FROM t3');
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'target' at row 2
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
2 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=STRICT_ALL_TABLES;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(1,
|
||||||
|
(SELECT target FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
|
||||||
|
(2,
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1),
|
||||||
|
(SELECT source FROM t2 ORDER BY id LIMIT 1));
|
||||||
|
Got one of the listed errors
|
||||||
|
SELECT * FROM v3;
|
||||||
|
id target source
|
||||||
|
1 0 00000000-0000-0000-0000-000000000000
|
||||||
|
TRUNCATE TABLE t3;
|
||||||
|
SET sql_mode=DEFAULT;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
CREATE TABLE t3 LIKE t2;
|
||||||
|
INSERT INTO t3 SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
UPDATE t3 SET target=source;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
|
||||||
|
SELECT @alter;
|
||||||
|
@alter
|
||||||
|
ALTER TABLE t3 MODIFY target uuid
|
||||||
|
EXECUTE IMMEDIATE @alter;
|
||||||
|
ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE dst int(10) unsigned DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1;
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1(a int(10) unsigned) RETURNS INT RETURN NULL;;
|
||||||
|
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1(a int(10) unsigned) BEGIN END;;
|
||||||
|
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE PROCEDURE p1(OUT dst int(10) unsigned)
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
SET dst=src;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE PROCEDURE p2()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(10) unsigned DEFAULT NULL;
|
||||||
|
CALL p1(dst);
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p2();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 4078 Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
Note 4094 At line 4 in test.p1
|
||||||
|
Note 4094 At line 4 in test.p2
|
||||||
|
DROP PROCEDURE p2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE FUNCTION f1() RETURNS int(10) unsigned
|
||||||
|
BEGIN
|
||||||
|
DECLARE rc uuid DEFAULT NULL;
|
||||||
|
RETURN rc;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
SELECT f1();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE src uuid DEFAULT NULL;
|
||||||
|
DECLARE cur1 CURSOR(t int(10) unsigned) FOR SELECT * FROM t1 WHERE target=t;
|
||||||
|
OPEN cur1(src);
|
||||||
|
CLOSE cur1;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t2 VALUES ();
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
DECLARE dst int(10) unsigned DEFAULT NULL;
|
||||||
|
DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
|
||||||
|
OPEN cur2;
|
||||||
|
FETCH cur2 INTO dst;
|
||||||
|
CLOSE cur2;
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CALL p1();
|
||||||
|
ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
# End of type_store_assignment_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.7 tests
|
||||||
|
#
|
@@ -0,0 +1,19 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # Start of 10.7 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT UNSIGNED DEFAULT 0);
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
|
||||||
|
--source include/type_mix_incompatible.inc
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.7 tests
|
||||||
|
--echo #
|
@@ -72,7 +72,7 @@ then
|
|||||||
# (c) ERROR file, in case flush tables operation failed.
|
# (c) ERROR file, in case flush tables operation failed.
|
||||||
|
|
||||||
while [ ! -r "$FLUSHED" ] && \
|
while [ ! -r "$FLUSHED" ] && \
|
||||||
! grep -q -F ':' -- "$FLUSHED" >/dev/null 2>&1
|
! grep -q -F ':' -- "$FLUSHED"
|
||||||
do
|
do
|
||||||
# Check whether ERROR file exists.
|
# Check whether ERROR file exists.
|
||||||
if [ -f "$ERROR" ]; then
|
if [ -f "$ERROR" ]; then
|
||||||
@@ -105,4 +105,5 @@ else # joiner
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE completed on $WSREP_SST_OPT_ROLE"
|
||||||
exit 0
|
exit 0
|
||||||
|
@@ -80,6 +80,7 @@ to_minuses()
|
|||||||
}
|
}
|
||||||
|
|
||||||
WSREP_SST_OPT_BYPASS=0
|
WSREP_SST_OPT_BYPASS=0
|
||||||
|
WSREP_SST_OPT_PROGRESS=0
|
||||||
WSREP_SST_OPT_BINLOG=""
|
WSREP_SST_OPT_BINLOG=""
|
||||||
WSREP_SST_OPT_BINLOG_INDEX=""
|
WSREP_SST_OPT_BINLOG_INDEX=""
|
||||||
WSREP_SST_OPT_LOG_BASENAME=""
|
WSREP_SST_OPT_LOG_BASENAME=""
|
||||||
@@ -187,6 +188,10 @@ case "$1" in
|
|||||||
'--bypass')
|
'--bypass')
|
||||||
readonly WSREP_SST_OPT_BYPASS=1
|
readonly WSREP_SST_OPT_BYPASS=1
|
||||||
;;
|
;;
|
||||||
|
'--progress')
|
||||||
|
readonly WSREP_SST_OPT_PROGRESS=$(( $2 ))
|
||||||
|
shift
|
||||||
|
;;
|
||||||
'--datadir')
|
'--datadir')
|
||||||
# Let's remove the trailing slash:
|
# Let's remove the trailing slash:
|
||||||
readonly WSREP_SST_OPT_DATA=$(trim_dir "$2")
|
readonly WSREP_SST_OPT_DATA=$(trim_dir "$2")
|
||||||
@@ -246,11 +251,11 @@ case "$1" in
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
'--local-port')
|
'--local-port')
|
||||||
readonly WSREP_SST_OPT_LPORT="$2"
|
readonly WSREP_SST_OPT_LPORT=$(( $2 ))
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
'--parent')
|
'--parent')
|
||||||
readonly WSREP_SST_OPT_PARENT="$2"
|
readonly WSREP_SST_OPT_PARENT=$(( $2 ))
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
'--password')
|
'--password')
|
||||||
@@ -258,7 +263,7 @@ case "$1" in
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
'--port')
|
'--port')
|
||||||
readonly WSREP_SST_OPT_PORT="$2"
|
readonly WSREP_SST_OPT_PORT=$(( $2 ))
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
'--role')
|
'--role')
|
||||||
@@ -531,6 +536,8 @@ else
|
|||||||
readonly WSREP_SST_OPT_ROLE='donor'
|
readonly WSREP_SST_OPT_ROLE='donor'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
readonly WSREP_SST_OPT_PROGRESS
|
||||||
|
|
||||||
# The same argument can be present on the command line several
|
# The same argument can be present on the command line several
|
||||||
# times, in this case we must take its last value:
|
# times, in this case we must take its last value:
|
||||||
if [ -n "${MYSQLD_OPT_INNODB_DATA_HOME_DIR:-}" -a \
|
if [ -n "${MYSQLD_OPT_INNODB_DATA_HOME_DIR:-}" -a \
|
||||||
@@ -1180,7 +1187,6 @@ check_port()
|
|||||||
check_for_dhparams()
|
check_for_dhparams()
|
||||||
{
|
{
|
||||||
ssl_dhparams="$DATA/dhparams.pem"
|
ssl_dhparams="$DATA/dhparams.pem"
|
||||||
if [ ! -r "$ssl_dhparams" ]; then
|
|
||||||
get_openssl
|
get_openssl
|
||||||
if [ -n "$OPENSSL_BINARY" ]; then
|
if [ -n "$OPENSSL_BINARY" ]; then
|
||||||
wsrep_log_info \
|
wsrep_log_info \
|
||||||
@@ -1188,9 +1194,10 @@ check_for_dhparams()
|
|||||||
local bug=0
|
local bug=0
|
||||||
local errmsg
|
local errmsg
|
||||||
errmsg=$("$OPENSSL_BINARY" \
|
errmsg=$("$OPENSSL_BINARY" \
|
||||||
dhparam -out "$ssl_dhparams" 2048 2>&1) || bug=1
|
dhparam -out "$ssl_dhparams" -dsaparam 2048 2>&1) || bug=1
|
||||||
if [ $bug -ne 0 ]; then
|
if [ $bug -ne 0 ]; then
|
||||||
wsrep_log_info "run: \"$OPENSSL_BINARY\" dhparam -out \"$ssl_dhparams\" 2048"
|
wsrep_log_info "run: \"$OPENSSL_BINARY\" dhparam"\
|
||||||
|
"-out \"$ssl_dhparams\" -dsaparam 2048"
|
||||||
wsrep_log_info "output: $errmsg"
|
wsrep_log_info "output: $errmsg"
|
||||||
wsrep_log_error "******** ERROR *****************************************"
|
wsrep_log_error "******** ERROR *****************************************"
|
||||||
wsrep_log_error "* Could not create the dhparams.pem file with OpenSSL. *"
|
wsrep_log_error "* Could not create the dhparams.pem file with OpenSSL. *"
|
||||||
@@ -1202,7 +1209,6 @@ check_for_dhparams()
|
|||||||
# the default parameters:
|
# the default parameters:
|
||||||
ssl_dhparams=""
|
ssl_dhparams=""
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1303,29 +1309,39 @@ verify_cert_matches_key()
|
|||||||
#
|
#
|
||||||
check_for_version()
|
check_for_version()
|
||||||
{
|
{
|
||||||
y1="${1#*.}"
|
local y1="${1#*.}"
|
||||||
[ "$y1" = "$1" ] && y1=""
|
[ "$y1" = "$1" ] && y1=""
|
||||||
z1=${y1#*.}
|
local z1="${y1#*.}"
|
||||||
[ "$z1" = "$y1" ] && z1=""
|
[ "$z1" = "$y1" ] && z1=""
|
||||||
x1="${1%%.*}"
|
local w1="${z1#*.}"
|
||||||
|
[ "$w1" = "$z1" ] && w1=""
|
||||||
|
local x1="${1%%.*}"
|
||||||
y1="${y1%%.*}"
|
y1="${y1%%.*}"
|
||||||
z1="${z1%%.*}"
|
z1="${z1%%.*}"
|
||||||
|
w1="${w1%%.*}"
|
||||||
[ -z "$y1" ] && y1=0
|
[ -z "$y1" ] && y1=0
|
||||||
[ -z "$z1" ] && z1=0
|
[ -z "$z1" ] && z1=0
|
||||||
y2="${2#*.}"
|
[ -z "$w1" ] && w1=0
|
||||||
|
local y2="${2#*.}"
|
||||||
[ "$y2" = "$2" ] && y2=""
|
[ "$y2" = "$2" ] && y2=""
|
||||||
z2="${y2#*.}"
|
local z2="${y2#*.}"
|
||||||
[ "$z2" = "$y2" ] && z2=""
|
[ "$z2" = "$y2" ] && z2=""
|
||||||
x2="${2%%.*}"
|
local w2="${z2#*.}"
|
||||||
|
[ "$w2" = "$z2" ] && w2=""
|
||||||
|
local x2="${2%%.*}"
|
||||||
y2="${y2%%.*}"
|
y2="${y2%%.*}"
|
||||||
z2="${z2%%.*}"
|
z2="${z2%%.*}"
|
||||||
|
w2="${w2%%.*}"
|
||||||
[ -z "$y2" ] && y2=0
|
[ -z "$y2" ] && y2=0
|
||||||
[ -z "$z2" ] && z2=0
|
[ -z "$z2" ] && z2=0
|
||||||
|
[ -z "$w2" ] && w2=0
|
||||||
[ $x1 -lt $x2 ] && return 1
|
[ $x1 -lt $x2 ] && return 1
|
||||||
[ $x1 -gt $x2 ] && return 0
|
[ $x1 -gt $x2 ] && return 0
|
||||||
[ $y1 -lt $y2 ] && return 1
|
[ $y1 -lt $y2 ] && return 1
|
||||||
[ $y1 -gt $y2 ] && return 0
|
[ $y1 -gt $y2 ] && return 0
|
||||||
[ $z1 -lt $z2 ] && return 1
|
[ $z1 -lt $z2 ] && return 1
|
||||||
|
[ $z1 -gt $z2 ] && return 0
|
||||||
|
[ $w1 -lt $w2 ] && return 1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,15 +86,12 @@ encrypt_threads=""
|
|||||||
encrypt_chunk=""
|
encrypt_chunk=""
|
||||||
|
|
||||||
readonly SECRET_TAG='secret'
|
readonly SECRET_TAG='secret'
|
||||||
|
readonly TOTAL_TAG='total'
|
||||||
|
|
||||||
# Required for backup locks
|
# Required for backup locks
|
||||||
# For backup locks it is 1 sent by joiner
|
# For backup locks it is 1 sent by joiner
|
||||||
sst_ver=1
|
sst_ver=1
|
||||||
|
|
||||||
if [ -n "$(commandex pv)" ] && pv --help | grep -qw -F -- '-F'; then
|
|
||||||
pvopts="$pvopts $pvformat"
|
|
||||||
fi
|
|
||||||
pcmd="pv $pvopts"
|
|
||||||
declare -a RC
|
declare -a RC
|
||||||
|
|
||||||
BACKUP_BIN=$(commandex 'mariabackup')
|
BACKUP_BIN=$(commandex 'mariabackup')
|
||||||
@@ -121,18 +118,19 @@ timeit()
|
|||||||
|
|
||||||
if [ $ttime -eq 1 ]; then
|
if [ $ttime -eq 1 ]; then
|
||||||
x1=$(date +%s)
|
x1=$(date +%s)
|
||||||
|
fi
|
||||||
|
|
||||||
wsrep_log_info "Evaluating $cmd"
|
wsrep_log_info "Evaluating $cmd"
|
||||||
eval "$cmd"
|
eval $cmd
|
||||||
extcode=$?
|
extcode=$?
|
||||||
|
|
||||||
|
if [ $ttime -eq 1 ]; then
|
||||||
x2=$(date +%s)
|
x2=$(date +%s)
|
||||||
took=$(( x2-x1 ))
|
took=$(( x2-x1 ))
|
||||||
wsrep_log_info "NOTE: $stage took $took seconds"
|
wsrep_log_info "NOTE: $stage took $took seconds"
|
||||||
totime=$(( totime+took ))
|
totime=$(( totime+took ))
|
||||||
else
|
|
||||||
wsrep_log_info "Evaluating $cmd"
|
|
||||||
eval "$cmd"
|
|
||||||
extcode=$?
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $extcode
|
return $extcode
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +218,21 @@ get_keys()
|
|||||||
stagemsg="$stagemsg-XB-Encrypted"
|
stagemsg="$stagemsg-XB-Encrypted"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_socat_ver()
|
||||||
|
{
|
||||||
|
[ -n "${SOCAT_VERSION+x}" ] && return
|
||||||
|
# Determine the socat version
|
||||||
|
SOCAT_VERSION=$(socat -V 2>&1 | \
|
||||||
|
grep -m1 -owE '[0-9]+(\.[0-9]+)+' | \
|
||||||
|
head -n1 || :)
|
||||||
|
if [ -z "$SOCAT_VERSION" ]; then
|
||||||
|
wsrep_log_error "******** FATAL ERROR ******************"
|
||||||
|
wsrep_log_error "* Cannot determine the socat version. *"
|
||||||
|
wsrep_log_error "***************************************"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_transfer()
|
get_transfer()
|
||||||
{
|
{
|
||||||
if [ "$tfmt" = 'nc' ]; then
|
if [ "$tfmt" = 'nc' ]; then
|
||||||
@@ -285,7 +298,7 @@ get_transfer()
|
|||||||
# If sockopt contains 'pf=ip6' somewhere in the middle,
|
# If sockopt contains 'pf=ip6' somewhere in the middle,
|
||||||
# this will not interfere with socat, but exclude the trivial
|
# this will not interfere with socat, but exclude the trivial
|
||||||
# cases when sockopt contains 'pf=ip6' as prefix or suffix:
|
# cases when sockopt contains 'pf=ip6' as prefix or suffix:
|
||||||
if [ "$sockopt" = "${sockopt#,pf=ip6}" -a \
|
if [ "$sockopt" = "${sockopt#,pf=ip6,}" -a \
|
||||||
"$sockopt" = "${sockopt%,pf=ip6}" ]
|
"$sockopt" = "${sockopt%,pf=ip6}" ]
|
||||||
then
|
then
|
||||||
sockopt=",pf=ip6$sockopt"
|
sockopt=",pf=ip6$sockopt"
|
||||||
@@ -312,22 +325,25 @@ get_transfer()
|
|||||||
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
|
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
|
||||||
tcmd="socat -u openssl-listen:$SST_PORT,reuseaddr"
|
tcmd="socat -u openssl-listen:$SST_PORT,reuseaddr"
|
||||||
else
|
else
|
||||||
tcmd="socat -u stdio openssl-connect:$REMOTEIP:$SST_PORT"
|
local addr="$REMOTEIP:$SST_PORT"
|
||||||
|
tcmd="socat -u stdio openssl-connect:$addr"
|
||||||
action='Encrypting'
|
action='Encrypting'
|
||||||
|
get_socat_ver
|
||||||
|
if ! check_for_version "$SOCAT_VERSION" '1.7.4.1'; then
|
||||||
|
if check_for_version "$SOCAT_VERSION" '1.7.3.3'; then
|
||||||
|
# Workaround for a bug known as 'Red Hat issue 1870279'
|
||||||
|
# (connection reset by peer) in socat versions 1.7.3.3
|
||||||
|
# to 1.7.4.0:
|
||||||
|
tcmd="socat stdio openssl-connect:$addr,linger=10"
|
||||||
|
wsrep_log_info \
|
||||||
|
"Use workaround for socat $SOCAT_VERSION bug"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${sockopt#*,dhparam=}" != "$sockopt" ]; then
|
if [ "${sockopt#*,dhparam=}" = "$sockopt" ]; then
|
||||||
if [ -z "$ssl_dhparams" ]; then
|
if [ -z "$ssl_dhparams" ]; then
|
||||||
# Determine the socat version
|
get_socat_ver
|
||||||
SOCAT_VERSION=$(socat -V 2>&1 | \
|
|
||||||
grep -m1 -owE '[0-9]+(\.[0-9]+)+' | \
|
|
||||||
head -n1 || :)
|
|
||||||
if [ -z "$SOCAT_VERSION" ]; then
|
|
||||||
wsrep_log_error "******** FATAL ERROR ******************"
|
|
||||||
wsrep_log_error "* Cannot determine the socat version. *"
|
|
||||||
wsrep_log_error "***************************************"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
if ! check_for_version "$SOCAT_VERSION" '1.7.3'; then
|
if ! check_for_version "$SOCAT_VERSION" '1.7.3'; then
|
||||||
# socat versions < 1.7.3 will have 512-bit dhparams (too small)
|
# socat versions < 1.7.3 will have 512-bit dhparams (too small)
|
||||||
# so create 2048-bit dhparams and send that as a parameter:
|
# so create 2048-bit dhparams and send that as a parameter:
|
||||||
@@ -419,44 +435,90 @@ get_transfer()
|
|||||||
get_footprint()
|
get_footprint()
|
||||||
{
|
{
|
||||||
cd "$DATA_DIR"
|
cd "$DATA_DIR"
|
||||||
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' \
|
local payload_data=$(find . \
|
||||||
|
-regex '.*undo[0-9]+$\|.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' \
|
||||||
-type f -print0 | du --files0-from=- --block-size=1 -c -s | \
|
-type f -print0 | du --files0-from=- --block-size=1 -c -s | \
|
||||||
awk 'END { print $1 }')
|
awk 'END { print $1 }')
|
||||||
|
|
||||||
|
local payload_undo=0
|
||||||
|
if [ -n "$ib_undo_dir" -a -d "$ib_undo_dir" ]; then
|
||||||
|
cd "$ib_undo_dir"
|
||||||
|
payload_undo=$(find . -regex '.*undo[0-9]+$' -type f -print0 | \
|
||||||
|
du --files0-from=- --block-size=1 -c -s | awk 'END { print $1 }')
|
||||||
|
fi
|
||||||
|
cd "$OLD_PWD"
|
||||||
|
|
||||||
|
wsrep_log_info \
|
||||||
|
"SST footprint estimate: data: $payload_data, undo: $payload_undo"
|
||||||
|
|
||||||
|
payload=$(( payload_data + payload_undo ))
|
||||||
|
|
||||||
if [ "$compress" != 'none' ]; then
|
if [ "$compress" != 'none' ]; then
|
||||||
# QuickLZ has around 50% compression ratio
|
# QuickLZ has around 50% compression ratio
|
||||||
# When compression/compaction used, the progress is only an approximate.
|
# When compression/compaction used, the progress is only an approximate.
|
||||||
payload=$(( payload*1/2 ))
|
payload=$(( payload*1/2 ))
|
||||||
fi
|
fi
|
||||||
cd "$OLD_PWD"
|
|
||||||
pcmd="$pcmd -s $payload"
|
if [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
|
||||||
|
# report to parent the total footprint of the SST
|
||||||
|
echo "$TOTAL_TAG $payload"
|
||||||
|
fi
|
||||||
|
|
||||||
adjust_progress
|
adjust_progress
|
||||||
}
|
}
|
||||||
|
|
||||||
adjust_progress()
|
adjust_progress()
|
||||||
{
|
{
|
||||||
if [ -z "$(commandex pv)" ]; then
|
|
||||||
wsrep_log_error "pv not found in path: $PATH"
|
|
||||||
wsrep_log_error "Disabling all progress/rate-limiting"
|
|
||||||
pcmd=""
|
pcmd=""
|
||||||
rlimit=""
|
rcmd=""
|
||||||
progress=""
|
|
||||||
return
|
[ "$progress" = 'none' ] && return
|
||||||
|
|
||||||
|
rlimitopts=""
|
||||||
|
if [ -n "$rlimit" -a "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
||||||
|
wsrep_log_info "Rate-limiting SST to $rlimit"
|
||||||
|
rlimitopts=" -L $rlimit"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$progress" -a "$progress" != '1' ]; then
|
if [ -n "$progress" ]; then
|
||||||
|
|
||||||
|
# Backward compatibility: user-configured progress output
|
||||||
|
pcmd="pv $pvopts$rlimitopts"
|
||||||
|
|
||||||
|
if [ -z "${PV_FORMAT+x}" ]; then
|
||||||
|
PV_FORMAT=0
|
||||||
|
pv --help | grep -qw -F -- '-F' && PV_FORMAT=1
|
||||||
|
fi
|
||||||
|
if [ $PV_FORMAT -eq 1 ]; then
|
||||||
|
pcmd="$pcmd $pvformat"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $payload -ne 0 ]; then
|
||||||
|
pcmd="$pcmd -s $payload"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$progress" != '1' ]; then
|
||||||
if [ -e "$progress" ]; then
|
if [ -e "$progress" ]; then
|
||||||
pcmd="$pcmd 2>>'$progress'"
|
pcmd="$pcmd 2>>'$progress'"
|
||||||
else
|
else
|
||||||
pcmd="$pcmd 2>'$progress'"
|
pcmd="$pcmd 2>'$progress'"
|
||||||
fi
|
fi
|
||||||
elif [ -z "$progress" -a -n "$rlimit" ]; then
|
|
||||||
# When rlimit is non-zero
|
|
||||||
pcmd='pv -q'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$rlimit" -a "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
elif [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
|
||||||
wsrep_log_info "Rate-limiting SST to $rlimit"
|
|
||||||
pcmd="$pcmd -L \$rlimit"
|
# Default progress output parseable by parent
|
||||||
|
pcmd="pv -f -i 1 -n -b$rlimitopts"
|
||||||
|
|
||||||
|
# read progress data, add tag and post to stdout
|
||||||
|
# for the parent
|
||||||
|
rcmd="stdbuf -oL tr '\r' '\n' | xargs -n1 echo complete"
|
||||||
|
|
||||||
|
elif [ -n "$rlimitopts" ]; then
|
||||||
|
|
||||||
|
# Rate-limiting only, when rlimit is non-zero
|
||||||
|
pcmd="pv -q$rlimitopts"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,6 +574,10 @@ read_cnf()
|
|||||||
"CERT='$tpem', KEY='$tkey', MODE='$tmode'," \
|
"CERT='$tpem', KEY='$tkey', MODE='$tmode'," \
|
||||||
"encrypt='$encrypt'"
|
"encrypt='$encrypt'"
|
||||||
|
|
||||||
|
if [ $encrypt -ge 2 ]; then
|
||||||
|
ssl_dhparams=$(parse_cnf "$encgroups" 'ssl-dhparams')
|
||||||
|
fi
|
||||||
|
|
||||||
sockopt=$(parse_cnf sst sockopt "")
|
sockopt=$(parse_cnf sst sockopt "")
|
||||||
progress=$(parse_cnf sst progress "")
|
progress=$(parse_cnf sst progress "")
|
||||||
ttime=$(parse_cnf sst time 0)
|
ttime=$(parse_cnf sst time 0)
|
||||||
@@ -765,13 +831,10 @@ recv_joiner()
|
|||||||
wsrep_log_info $(ls -l "$dir/"*)
|
wsrep_log_info $(ls -l "$dir/"*)
|
||||||
exit 32
|
exit 32
|
||||||
fi
|
fi
|
||||||
# Select the "secret" tag whose value does not start
|
|
||||||
# with a slash symbol. All new tags must to start with
|
if [ -n "$MY_SECRET" ]; then
|
||||||
# the space and the slash symbol after the word "secret" -
|
|
||||||
# to be removed by older versions of the SST scripts:
|
|
||||||
SECRET=$(grep -m1 -E "^$SECRET_TAG[[:space:]]+[^/]" \
|
|
||||||
-- "$MAGIC_FILE" || :)
|
|
||||||
# Check donor supplied secret:
|
# Check donor supplied secret:
|
||||||
|
SECRET=$(grep -m1 -E "^$SECRET_TAG[[:space:]]" "$MAGIC_FILE" || :)
|
||||||
SECRET=$(trim_string "${SECRET#$SECRET_TAG}")
|
SECRET=$(trim_string "${SECRET#$SECRET_TAG}")
|
||||||
if [ "$SECRET" != "$MY_SECRET" ]; then
|
if [ "$SECRET" != "$MY_SECRET" ]; then
|
||||||
wsrep_log_error "Donor does not know my secret!"
|
wsrep_log_error "Donor does not know my secret!"
|
||||||
@@ -779,6 +842,19 @@ recv_joiner()
|
|||||||
exit 32
|
exit 32
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
|
||||||
|
# check total SST footprint
|
||||||
|
payload=$(grep -m1 -E "^$TOTAL_TAG[[:space:]]" "$MAGIC_FILE" || :)
|
||||||
|
if [ -n "$payload" ]; then
|
||||||
|
payload=$(trim_string "${payload#$TOTAL_TAG}")
|
||||||
|
if [ $payload -ge 0 ]; then
|
||||||
|
# report to parent
|
||||||
|
echo "$TOTAL_TAG $payload"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
send_donor()
|
send_donor()
|
||||||
@@ -825,6 +901,14 @@ monitor_process()
|
|||||||
read_cnf
|
read_cnf
|
||||||
setup_ports
|
setup_ports
|
||||||
|
|
||||||
|
if [ "$progress" = 'none' ]; then
|
||||||
|
wsrep_log_info "All progress/rate-limiting disabled by configuration"
|
||||||
|
elif [ -z "$(commandex pv)" ]; then
|
||||||
|
wsrep_log_info "Progress reporting tool pv not found in path: $PATH"
|
||||||
|
wsrep_log_info "Disabling all progress/rate-limiting"
|
||||||
|
progress='none'
|
||||||
|
fi
|
||||||
|
|
||||||
if "$BACKUP_BIN" --help 2>/dev/null | grep -qw -F -- '--version-check'; then
|
if "$BACKUP_BIN" --help 2>/dev/null | grep -qw -F -- '--version-check'; then
|
||||||
disver=' --no-version-check'
|
disver=' --no-version-check'
|
||||||
fi
|
fi
|
||||||
@@ -980,6 +1064,14 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
|||||||
|
|
||||||
check_extra
|
check_extra
|
||||||
|
|
||||||
|
if [ -n "$progress" -o $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
|
||||||
|
wsrep_log_info "Estimating total transfer size"
|
||||||
|
get_footprint
|
||||||
|
wsrep_log_info "To transfer: $payload"
|
||||||
|
else
|
||||||
|
adjust_progress
|
||||||
|
fi
|
||||||
|
|
||||||
wsrep_log_info "Streaming GTID file before SST"
|
wsrep_log_info "Streaming GTID file before SST"
|
||||||
|
|
||||||
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
|
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
|
||||||
@@ -991,6 +1083,11 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
|||||||
echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
|
echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
|
||||||
|
# Tell joiner what to expect:
|
||||||
|
echo "$TOTAL_TAG $payload" >> "$MAGIC_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
ttcmd="$tcmd"
|
ttcmd="$tcmd"
|
||||||
|
|
||||||
if [ -n "$scomp" ]; then
|
if [ -n "$scomp" ]; then
|
||||||
@@ -1007,13 +1104,15 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
|||||||
# Restore the transport commmand to its original state
|
# Restore the transport commmand to its original state
|
||||||
tcmd="$ttcmd"
|
tcmd="$ttcmd"
|
||||||
|
|
||||||
if [ -n "$progress" ]; then
|
if [ -n "$pcmd" ]; then
|
||||||
get_footprint
|
if [ -n "$rcmd" ]; then
|
||||||
tcmd="$pcmd | $tcmd"
|
# redirect pv stderr to rcmd for tagging and output to parent
|
||||||
elif [ -n "$rlimit" ]; then
|
tcmd="{ $pcmd 2>&3 | $tcmd; } 3>&1 | $rcmd"
|
||||||
adjust_progress
|
else
|
||||||
|
# use user-configured pv output
|
||||||
tcmd="$pcmd | $tcmd"
|
tcmd="$pcmd | $tcmd"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
wsrep_log_info "Sleeping before data transfer for SST"
|
wsrep_log_info "Sleeping before data transfer for SST"
|
||||||
sleep 10
|
sleep 10
|
||||||
@@ -1214,13 +1313,6 @@ else # joiner
|
|||||||
MY_SECRET="" # for check down in recv_joiner()
|
MY_SECRET="" # for check down in recv_joiner()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
trap cleanup_at_exit EXIT
|
|
||||||
|
|
||||||
if [ -n "$progress" ]; then
|
|
||||||
adjust_progress
|
|
||||||
tcmd="$tcmd | $pcmd"
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_keys
|
get_keys
|
||||||
if [ $encrypt -eq 1 ]; then
|
if [ $encrypt -eq 1 ]; then
|
||||||
strmcmd="$ecmd | $strmcmd"
|
strmcmd="$ecmd | $strmcmd"
|
||||||
@@ -1232,6 +1324,8 @@ else # joiner
|
|||||||
|
|
||||||
check_sockets_utils
|
check_sockets_utils
|
||||||
|
|
||||||
|
trap cleanup_at_exit EXIT
|
||||||
|
|
||||||
STATDIR="$(mktemp -d)"
|
STATDIR="$(mktemp -d)"
|
||||||
MAGIC_FILE="$STATDIR/$INFO_FILE"
|
MAGIC_FILE="$STATDIR/$INFO_FILE"
|
||||||
|
|
||||||
@@ -1245,6 +1339,17 @@ else # joiner
|
|||||||
|
|
||||||
if [ ! -r "$STATDIR/$IST_FILE" ]; then
|
if [ ! -r "$STATDIR/$IST_FILE" ]; then
|
||||||
|
|
||||||
|
adjust_progress
|
||||||
|
if [ -n "$pcmd" ]; then
|
||||||
|
if [ -n "$rcmd" ]; then
|
||||||
|
# redirect pv stderr to rcmd for tagging and output to parent
|
||||||
|
strmcmd="{ $pcmd 2>&3 | $strmcmd; } 3>&1 | $rcmd"
|
||||||
|
else
|
||||||
|
# use user-configured pv output
|
||||||
|
strmcmd="$pcmd | $strmcmd"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d "$DATA/.sst" ]; then
|
if [ -d "$DATA/.sst" ]; then
|
||||||
wsrep_log_info \
|
wsrep_log_info \
|
||||||
"WARNING: Stale temporary SST directory:" \
|
"WARNING: Stale temporary SST directory:" \
|
||||||
@@ -1265,13 +1370,13 @@ else # joiner
|
|||||||
cd "$DATA"
|
cd "$DATA"
|
||||||
wsrep_log_info "Cleaning the old binary logs"
|
wsrep_log_info "Cleaning the old binary logs"
|
||||||
# If there is a file with binlogs state, delete it:
|
# If there is a file with binlogs state, delete it:
|
||||||
[ -f "$binlog_base.state" ] && rm -f "$binlog_base.state" >&2
|
[ -f "$binlog_base.state" ] && rm "$binlog_base.state" >&2
|
||||||
# Clean up the old binlog files and index:
|
# Clean up the old binlog files and index:
|
||||||
if [ -f "$binlog_index" ]; then
|
if [ -f "$binlog_index" ]; then
|
||||||
while read bin_file || [ -n "$bin_file" ]; do
|
while read bin_file || [ -n "$bin_file" ]; do
|
||||||
rm -f "$bin_file" >&2 || :
|
rm -f "$bin_file" >&2 || :
|
||||||
done < "$binlog_index"
|
done < "$binlog_index"
|
||||||
rm -f "$binlog_index" >&2
|
rm "$binlog_index" >&2
|
||||||
fi
|
fi
|
||||||
if [ -n "$binlog_dir" -a "$binlog_dir" != '.' -a \
|
if [ -n "$binlog_dir" -a "$binlog_dir" != '.' -a \
|
||||||
-d "$binlog_dir" ]
|
-d "$binlog_dir" ]
|
||||||
@@ -1335,16 +1440,14 @@ else # joiner
|
|||||||
|
|
||||||
dcmd="xargs -n 2 qpress -dT$nproc"
|
dcmd="xargs -n 2 qpress -dT$nproc"
|
||||||
|
|
||||||
if [ -n "$progress" ] && \
|
if [ -n "$progress" -a "$progress" != 'none' ] && \
|
||||||
pv --help | grep -qw -F -- '--line-mode'
|
pv --help | grep -qw -F -- '--line-mode'
|
||||||
then
|
then
|
||||||
count=$(find "$DATA" -type f -name '*.qp' | wc -l)
|
count=$(find "$DATA" -maxdepth 1 -type f -name '*.qp' | wc -l)
|
||||||
count=$(( count*2 ))
|
count=$(( count*2 ))
|
||||||
pvopts="-f -s $count -l -N Decompression"
|
pvopts='-f -l -N Decompression'
|
||||||
if pv --help | grep -qw -F -- '-F'; then
|
pvformat="-F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
|
||||||
pvopts="$pvopts -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'"
|
payload=$count
|
||||||
fi
|
|
||||||
pcmd="pv $pvopts"
|
|
||||||
adjust_progress
|
adjust_progress
|
||||||
dcmd="$pcmd | $dcmd"
|
dcmd="$pcmd | $dcmd"
|
||||||
fi
|
fi
|
||||||
@@ -1442,7 +1545,7 @@ else # joiner
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove special tags from the magic file, and from the output:
|
# Remove special tags from the magic file, and from the output:
|
||||||
coords=$(grep -v -E "^$SECRET_TAG[[:space:]]" -- "$MAGIC_FILE")
|
coords=$(head -n1 "$MAGIC_FILE")
|
||||||
wsrep_log_info "Galera co-ords from recovery: $coords"
|
wsrep_log_info "Galera co-ords from recovery: $coords"
|
||||||
echo "$coords" # Output : UUID:seqno wsrep_gtid_domain_id
|
echo "$coords" # Output : UUID:seqno wsrep_gtid_domain_id
|
||||||
|
|
||||||
|
@@ -65,21 +65,21 @@ cleanup_joiner()
|
|||||||
|
|
||||||
if [ $failure -eq 0 ]; then
|
if [ $failure -eq 0 ]; then
|
||||||
if cleanup_pid $RSYNC_REAL_PID "$RSYNC_PID" "$RSYNC_CONF"; then
|
if cleanup_pid $RSYNC_REAL_PID "$RSYNC_PID" "$RSYNC_CONF"; then
|
||||||
[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
|
[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE" || :
|
||||||
[ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
|
[ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE" || :
|
||||||
else
|
else
|
||||||
wsrep_log_warning "rsync cleanup failed."
|
wsrep_log_warning "rsync cleanup failed."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wsrep_log_info "Joiner cleanup done."
|
|
||||||
|
|
||||||
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
|
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
|
||||||
wsrep_cleanup_progress_file
|
wsrep_cleanup_progress_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -f "$SST_PID" ] && rm -f "$SST_PID" || :
|
[ -f "$SST_PID" ] && rm -f "$SST_PID" || :
|
||||||
|
|
||||||
|
wsrep_log_info "Joiner cleanup done."
|
||||||
|
|
||||||
exit $estatus
|
exit $estatus
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ if [ -n "$SSLMODE" -a "$SSLMODE" != 'DISABLED' ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
readonly SECRET_TAG='secret'
|
readonly SECRET_TAG='secret'
|
||||||
readonly BYPASS_TAG='secret /bypass'
|
readonly BYPASS_TAG='bypass'
|
||||||
|
|
||||||
SST_PID="$WSREP_SST_OPT_DATA/wsrep_sst.pid"
|
SST_PID="$WSREP_SST_OPT_DATA/wsrep_sst.pid"
|
||||||
|
|
||||||
@@ -371,10 +371,11 @@ done
|
|||||||
[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
|
[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
|
||||||
[ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
|
[ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
|
||||||
|
|
||||||
|
RC=0
|
||||||
|
|
||||||
if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
|
||||||
|
|
||||||
if [ -n "$STUNNEL" ]
|
if [ -n "$STUNNEL" ]; then
|
||||||
then
|
|
||||||
cat << EOF > "$STUNNEL_CONF"
|
cat << EOF > "$STUNNEL_CONF"
|
||||||
key = $SSTKEY
|
key = $SSTKEY
|
||||||
cert = $SSTCERT
|
cert = $SSTCERT
|
||||||
@@ -392,8 +393,6 @@ ${CHECK_OPT_LOCAL}
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RC=0
|
|
||||||
|
|
||||||
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]; then
|
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]; then
|
||||||
|
|
||||||
FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed"
|
FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed"
|
||||||
@@ -410,19 +409,19 @@ EOF
|
|||||||
# (c) ERROR file, in case flush tables operation failed.
|
# (c) ERROR file, in case flush tables operation failed.
|
||||||
|
|
||||||
while [ ! -r "$FLUSHED" ] && \
|
while [ ! -r "$FLUSHED" ] && \
|
||||||
! grep -q -F ':' -- "$FLUSHED" 2>/dev/null
|
! grep -q -F ':' -- "$FLUSHED"
|
||||||
do
|
do
|
||||||
# Check whether ERROR file exists.
|
# Check whether ERROR file exists.
|
||||||
if [ -f "$ERROR" ]; then
|
if [ -f "$ERROR" ]; then
|
||||||
# Flush tables operation failed.
|
# Flush tables operation failed.
|
||||||
rm -f "$ERROR"
|
rm "$ERROR"
|
||||||
exit 255
|
exit 255
|
||||||
fi
|
fi
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
done
|
done
|
||||||
|
|
||||||
STATE=$(cat "$FLUSHED")
|
STATE=$(cat "$FLUSHED")
|
||||||
rm -f "$FLUSHED"
|
rm "$FLUSHED"
|
||||||
|
|
||||||
sync
|
sync
|
||||||
|
|
||||||
@@ -629,6 +628,8 @@ FILTER="-f '- /lost+found'
|
|||||||
|
|
||||||
wsrep_log_info "Transfer of data done"
|
wsrep_log_info "Transfer of data done"
|
||||||
|
|
||||||
|
[ -f "$BINLOG_TAR_FILE" ] && rm "$BINLOG_TAR_FILE"
|
||||||
|
|
||||||
else # BYPASS
|
else # BYPASS
|
||||||
|
|
||||||
wsrep_log_info "Bypassing state dump."
|
wsrep_log_info "Bypassing state dump."
|
||||||
@@ -657,6 +658,8 @@ FILTER="-f '- /lost+found'
|
|||||||
--archive --quiet --checksum "$MAGIC_FILE" \
|
--archive --quiet --checksum "$MAGIC_FILE" \
|
||||||
"rsync://$WSREP_SST_OPT_ADDR" >&2 || RC=$?
|
"rsync://$WSREP_SST_OPT_ADDR" >&2 || RC=$?
|
||||||
|
|
||||||
|
rm "$MAGIC_FILE"
|
||||||
|
|
||||||
if [ $RC -ne 0 ]; then
|
if [ $RC -ne 0 ]; then
|
||||||
wsrep_log_error "rsync $MAGIC_FILE returned code $RC:"
|
wsrep_log_error "rsync $MAGIC_FILE returned code $RC:"
|
||||||
exit 255 # unknown error
|
exit 255 # unknown error
|
||||||
@@ -665,8 +668,8 @@ FILTER="-f '- /lost+found'
|
|||||||
echo "done $STATE"
|
echo "done $STATE"
|
||||||
|
|
||||||
if [ -n "$STUNNEL" ]; then
|
if [ -n "$STUNNEL" ]; then
|
||||||
[ -f "$STUNNEL_CONF" ] && rm -f "$STUNNEL_CONF"
|
rm "$STUNNEL_CONF"
|
||||||
[ -f "$STUNNEL_PID" ] && rm -f "$STUNNEL_PID"
|
[ -f "$STUNNEL_PID" ] && rm "$STUNNEL_PID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else # joiner
|
else # joiner
|
||||||
@@ -704,8 +707,7 @@ $SILENT
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# If the IP is local, listen only on it:
|
# If the IP is local, listen only on it:
|
||||||
if is_local_ip "$RSYNC_ADDR_UNESCAPED"
|
if is_local_ip "$RSYNC_ADDR_UNESCAPED"; then
|
||||||
then
|
|
||||||
RSYNC_EXTRA_ARGS="--address $RSYNC_ADDR_UNESCAPED"
|
RSYNC_EXTRA_ARGS="--address $RSYNC_ADDR_UNESCAPED"
|
||||||
STUNNEL_ACCEPT="$RSYNC_ADDR_UNESCAPED:$RSYNC_PORT"
|
STUNNEL_ACCEPT="$RSYNC_ADDR_UNESCAPED:$RSYNC_PORT"
|
||||||
else
|
else
|
||||||
@@ -826,13 +828,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$MY_SECRET" ]; then
|
if [ -n "$MY_SECRET" ]; then
|
||||||
# Select the "secret" tag whose value does not start
|
|
||||||
# with a slash symbol. All new tags must to start with
|
|
||||||
# the space and the slash symbol after the word "secret" -
|
|
||||||
# to be removed by older versions of the SST scripts:
|
|
||||||
SECRET=$(grep -m1 -E "^$SECRET_TAG[[:space:]]+[^/]" \
|
|
||||||
-- "$MAGIC_FILE" || :)
|
|
||||||
# Check donor supplied secret:
|
# Check donor supplied secret:
|
||||||
|
SECRET=$(grep -m1 -E "^$SECRET_TAG[[:space:]]" "$MAGIC_FILE" || :)
|
||||||
SECRET=$(trim_string "${SECRET#$SECRET_TAG}")
|
SECRET=$(trim_string "${SECRET#$SECRET_TAG}")
|
||||||
if [ "$SECRET" != "$MY_SECRET" ]; then
|
if [ "$SECRET" != "$MY_SECRET" ]; then
|
||||||
wsrep_log_error "Donor does not know my secret!"
|
wsrep_log_error "Donor does not know my secret!"
|
||||||
@@ -842,7 +839,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]; then
|
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]; then
|
||||||
if grep -m1 -qE "^$BYPASS_TAG([[:space:]]+.*)?\$" -- "$MAGIC_FILE"; then
|
if grep -m1 -qE "^$BYPASS_TAG([[:space:]]+.*)?\$" "$MAGIC_FILE"; then
|
||||||
readonly WSREP_SST_OPT_BYPASS=1
|
readonly WSREP_SST_OPT_BYPASS=1
|
||||||
readonly WSREP_TRANSFER_TYPE='IST'
|
readonly WSREP_TRANSFER_TYPE='IST'
|
||||||
fi
|
fi
|
||||||
@@ -850,10 +847,10 @@ EOF
|
|||||||
|
|
||||||
binlog_tar_present=0
|
binlog_tar_present=0
|
||||||
if [ -f "$BINLOG_TAR_FILE" ]; then
|
if [ -f "$BINLOG_TAR_FILE" ]; then
|
||||||
|
binlog_tar_present=1
|
||||||
if [ $WSREP_SST_OPT_BYPASS -ne 0 ]; then
|
if [ $WSREP_SST_OPT_BYPASS -ne 0 ]; then
|
||||||
wsrep_log_warning "tar with binlogs transferred in the IST mode"
|
wsrep_log_warning "tar with binlogs transferred in the IST mode"
|
||||||
fi
|
fi
|
||||||
binlog_tar_present=1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $WSREP_SST_OPT_BYPASS -eq 0 -a -n "$WSREP_SST_OPT_BINLOG" ]; then
|
if [ $WSREP_SST_OPT_BYPASS -eq 0 -a -n "$WSREP_SST_OPT_BINLOG" ]; then
|
||||||
@@ -867,7 +864,7 @@ EOF
|
|||||||
while read bin_file || [ -n "$bin_file" ]; do
|
while read bin_file || [ -n "$bin_file" ]; do
|
||||||
rm -f "$bin_file" || :
|
rm -f "$bin_file" || :
|
||||||
done < "$binlog_index"
|
done < "$binlog_index"
|
||||||
rm -f "$binlog_index"
|
rm "$binlog_index"
|
||||||
fi
|
fi
|
||||||
binlog_cd=0
|
binlog_cd=0
|
||||||
# Change the directory to binlog base (if possible):
|
# Change the directory to binlog base (if possible):
|
||||||
@@ -902,7 +899,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
# Extracting binlog files:
|
# Extracting binlog files:
|
||||||
wsrep_log_info "Extracting binlog files:"
|
wsrep_log_info "Extracting binlog files:"
|
||||||
RC=0
|
|
||||||
if tar --version | grep -qw -E '^bsdtar'; then
|
if tar --version | grep -qw -E '^bsdtar'; then
|
||||||
tar -tf "$BINLOG_TAR_FILE" > "$tmpfile" && \
|
tar -tf "$BINLOG_TAR_FILE" > "$tmpfile" && \
|
||||||
tar -xvf "$BINLOG_TAR_FILE" > /dev/null || RC=$?
|
tar -xvf "$BINLOG_TAR_FILE" > /dev/null || RC=$?
|
||||||
@@ -912,7 +908,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
if [ $RC -ne 0 ]; then
|
if [ $RC -ne 0 ]; then
|
||||||
wsrep_log_error "Error unpacking tar file with binlog files"
|
wsrep_log_error "Error unpacking tar file with binlog files"
|
||||||
rm -f "$tmpfile"
|
rm "$tmpfile"
|
||||||
exit 32
|
exit 32
|
||||||
fi
|
fi
|
||||||
# Rebuild binlog index:
|
# Rebuild binlog index:
|
||||||
@@ -920,18 +916,16 @@ EOF
|
|||||||
while read bin_file || [ -n "$bin_file" ]; do
|
while read bin_file || [ -n "$bin_file" ]; do
|
||||||
echo "$binlog_dir${binlog_dir:+/}$bin_file" >> "$binlog_index"
|
echo "$binlog_dir${binlog_dir:+/}$bin_file" >> "$binlog_index"
|
||||||
done < "$tmpfile"
|
done < "$tmpfile"
|
||||||
rm -f "$tmpfile"
|
rm "$tmpfile"
|
||||||
cd "$OLD_PWD"
|
cd "$OLD_PWD"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove special tags from the magic file, and from the output:
|
# Remove special tags from the magic file, and from the output:
|
||||||
coords=$(grep -v -E "^$SECRET_TAG[[:space:]]" -- "$MAGIC_FILE")
|
coords=$(head -n1 "$MAGIC_FILE")
|
||||||
wsrep_log_info "Galera co-ords from recovery: $coords"
|
wsrep_log_info "Galera co-ords from recovery: $coords"
|
||||||
echo "$coords" # Output : UUID:seqno wsrep_gtid_domain_id
|
echo "$coords" # Output : UUID:seqno wsrep_gtid_domain_id
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE"
|
|
||||||
|
|
||||||
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE completed on $WSREP_SST_OPT_ROLE"
|
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE completed on $WSREP_SST_OPT_ROLE"
|
||||||
exit 0
|
exit 0
|
||||||
|
28
sql/field.cc
28
sql/field.cc
@@ -964,6 +964,32 @@ Type_handler::aggregate_for_result_traditional(const Type_handler *a,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Field::check_assignability_from(const Type_handler *from) const
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Using type_handler_for_item_field() here to get the data type handler
|
||||||
|
on both sides. This is needed to make sure aggregation for Field
|
||||||
|
works the same way with how Item_field aggregates for UNION or CASE,
|
||||||
|
so these statements:
|
||||||
|
SELECT a FROM t1 UNION SELECT b FROM t1; // Item_field vs Item_field
|
||||||
|
UPDATE t1 SET a=b; // Field vs Item_field
|
||||||
|
either both return "Illegal parameter data types" or both pass
|
||||||
|
the data type compatibility test.
|
||||||
|
For MariaDB standard data types, using type_handler_for_item_field()
|
||||||
|
turns ENUM/SET into just CHAR.
|
||||||
|
*/
|
||||||
|
Type_handler_hybrid_field_type th(type_handler()->
|
||||||
|
type_handler_for_item_field());
|
||||||
|
if (th.aggregate_for_result(from->type_handler_for_item_field()))
|
||||||
|
{
|
||||||
|
my_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION, MYF(0),
|
||||||
|
type_handler()->name().ptr(), from->name().ptr(), "SET");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Test if the given string contains important data:
|
Test if the given string contains important data:
|
||||||
not spaces for character string,
|
not spaces for character string,
|
||||||
@@ -1445,7 +1471,7 @@ bool Field::sp_prepare_and_store_item(THD *thd, Item **value)
|
|||||||
|
|
||||||
Item *expr_item;
|
Item *expr_item;
|
||||||
|
|
||||||
if (!(expr_item= thd->sp_prepare_func_item(value, 1)))
|
if (!(expr_item= thd->sp_fix_func_item_for_assignment(this, value)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -905,6 +905,12 @@ public:
|
|||||||
|
|
||||||
bool is_unsigned() const { return flags & UNSIGNED_FLAG; }
|
bool is_unsigned() const { return flags & UNSIGNED_FLAG; }
|
||||||
|
|
||||||
|
bool check_assignability_from(const Type_handler *from) const;
|
||||||
|
bool check_assignability_from(const Field *from) const
|
||||||
|
{
|
||||||
|
return check_assignability_from(from->type_handler());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Convenience definition of a copy function returned by
|
Convenience definition of a copy function returned by
|
||||||
Field::get_copy_func()
|
Field::get_copy_func()
|
||||||
|
@@ -3801,7 +3801,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
check_insert_autoincrement();
|
check_insert_or_replace_autoincrement();
|
||||||
if (unlikely((error= open_read_partitions(name_buff, sizeof(name_buff)))))
|
if (unlikely((error= open_read_partitions(name_buff, sizeof(name_buff)))))
|
||||||
goto err_handler;
|
goto err_handler;
|
||||||
m_num_locks= m_file_sample->lock_count();
|
m_num_locks= m_file_sample->lock_count();
|
||||||
@@ -8851,7 +8851,7 @@ int ha_partition::change_partitions_to_open(List<String> *partition_names)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
check_insert_autoincrement();
|
check_insert_or_replace_autoincrement();
|
||||||
if (bitmap_cmp(&m_opened_partitions, &m_part_info->read_partitions) != 0)
|
if (bitmap_cmp(&m_opened_partitions, &m_part_info->read_partitions) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@@ -1405,15 +1405,16 @@ private:
|
|||||||
unlock_auto_increment();
|
unlock_auto_increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_insert_autoincrement()
|
void check_insert_or_replace_autoincrement()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
If we INSERT into the table having the AUTO_INCREMENT column,
|
If we INSERT or REPLACE into the table having the AUTO_INCREMENT column,
|
||||||
we have to read all partitions for the next autoincrement value
|
we have to read all partitions for the next autoincrement value
|
||||||
unless we already did it.
|
unless we already did it.
|
||||||
*/
|
*/
|
||||||
if (!part_share->auto_inc_initialized &&
|
if (!part_share->auto_inc_initialized &&
|
||||||
ha_thd()->lex->sql_command == SQLCOM_INSERT &&
|
(ha_thd()->lex->sql_command == SQLCOM_INSERT ||
|
||||||
|
ha_thd()->lex->sql_command == SQLCOM_REPLACE) &&
|
||||||
table->found_next_number_field)
|
table->found_next_number_field)
|
||||||
bitmap_set_all(&m_part_info->read_partitions);
|
bitmap_set_all(&m_part_info->read_partitions);
|
||||||
}
|
}
|
||||||
|
22
sql/item.cc
22
sql/item.cc
@@ -4509,6 +4509,22 @@ bool Item_param::is_evaluable_expression() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Item_param::check_assignability_to(const Field *to) const
|
||||||
|
{
|
||||||
|
switch (state) {
|
||||||
|
case SHORT_DATA_VALUE:
|
||||||
|
case LONG_DATA_VALUE:
|
||||||
|
case NULL_VALUE:
|
||||||
|
return to->check_assignability_from(type_handler());
|
||||||
|
case NO_VALUE:
|
||||||
|
case IGNORE_VALUE:
|
||||||
|
case DEFAULT_VALUE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Item_param::can_return_value() const
|
bool Item_param::can_return_value() const
|
||||||
{
|
{
|
||||||
// There's no "default". See comments in Item_param::save_in_field().
|
// There's no "default". See comments in Item_param::save_in_field().
|
||||||
@@ -9876,9 +9892,11 @@ void Item_trigger_field::set_required_privilege(bool rw)
|
|||||||
|
|
||||||
bool Item_trigger_field::set_value(THD *thd, sp_rcontext * /*ctx*/, Item **it)
|
bool Item_trigger_field::set_value(THD *thd, sp_rcontext * /*ctx*/, Item **it)
|
||||||
{
|
{
|
||||||
Item *item= thd->sp_prepare_func_item(it);
|
if (fix_fields_if_needed(thd, NULL))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!item || fix_fields_if_needed(thd, NULL))
|
Item *item= thd->sp_fix_func_item_for_assignment(field, it);
|
||||||
|
if (!item)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// NOTE: field->table->copy_blobs should be false here, but let's
|
// NOTE: field->table->copy_blobs should be false here, but let's
|
||||||
|
19
sql/item.h
19
sql/item.h
@@ -1838,6 +1838,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool is_evaluable_expression() const { return true; }
|
virtual bool is_evaluable_expression() const { return true; }
|
||||||
|
|
||||||
|
virtual bool check_assignability_to(const Field *to) const
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
"this" must be neither DEFAULT/IGNORE,
|
||||||
|
nor Item_param bound to DEFAULT/IGNORE.
|
||||||
|
*/
|
||||||
|
DBUG_ASSERT(is_evaluable_expression());
|
||||||
|
return to->check_assignability_from(type_handler());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the item is a parameter ('?') of stored routine.
|
* Check whether the item is a parameter ('?') of stored routine.
|
||||||
* Default implementation returns false. Method is overridden in the class
|
* Default implementation returns false. Method is overridden in the class
|
||||||
@@ -4091,6 +4101,7 @@ class Item_param :public Item_basic_value,
|
|||||||
const String *value_query_val_str(THD *thd, String* str) const;
|
const String *value_query_val_str(THD *thd, String* str) const;
|
||||||
Item *value_clone_item(THD *thd);
|
Item *value_clone_item(THD *thd);
|
||||||
bool is_evaluable_expression() const override;
|
bool is_evaluable_expression() const override;
|
||||||
|
bool check_assignability_to(const Field *field) const override;
|
||||||
bool can_return_value() const;
|
bool can_return_value() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -6771,6 +6782,10 @@ public:
|
|||||||
{
|
{
|
||||||
str->append(STRING_WITH_LEN("default"));
|
str->append(STRING_WITH_LEN("default"));
|
||||||
}
|
}
|
||||||
|
bool check_assignability_to(const Field *to) const override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
int save_in_field(Field *field_arg, bool) override
|
int save_in_field(Field *field_arg, bool) override
|
||||||
{
|
{
|
||||||
return field_arg->save_in_field_default_value(false);
|
return field_arg->save_in_field_default_value(false);
|
||||||
@@ -6804,6 +6819,10 @@ public:
|
|||||||
{
|
{
|
||||||
str->append(STRING_WITH_LEN("ignore"));
|
str->append(STRING_WITH_LEN("ignore"));
|
||||||
}
|
}
|
||||||
|
bool check_assignability_to(const Field *to) const override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
int save_in_field(Field *field_arg, bool) override
|
int save_in_field(Field *field_arg, bool) override
|
||||||
{
|
{
|
||||||
return field_arg->save_in_field_ignore_value(false);
|
return field_arg->save_in_field_ignore_value(false);
|
||||||
|
@@ -85,6 +85,12 @@ static inline void output_core_info()
|
|||||||
my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff);
|
my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff);
|
||||||
my_close(fd, MYF(0));
|
my_close(fd, MYF(0));
|
||||||
}
|
}
|
||||||
|
if ((fd= my_open("/proc/version", O_RDONLY, MYF(0))) >= 0)
|
||||||
|
{
|
||||||
|
len= my_read(fd, (uchar*)buff, sizeof(buff), MYF(0));
|
||||||
|
my_safe_printf_stderr("Kernel version: %.*s\n", (int) len, buff);
|
||||||
|
my_close(fd, MYF(0));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__APPLE__) || defined(__FreeBSD__)
|
#elif defined(__APPLE__) || defined(__FreeBSD__)
|
||||||
char buff[PATH_MAX];
|
char buff[PATH_MAX];
|
||||||
@@ -93,6 +99,10 @@ static inline void output_core_info()
|
|||||||
{
|
{
|
||||||
my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff);
|
my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff);
|
||||||
}
|
}
|
||||||
|
if (sysctlbyname("kern.version", buff, &len, NULL, 0) == 0)
|
||||||
|
{
|
||||||
|
my_safe_printf_stderr("Kernel version: %.*s\n", (int) len, buff);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
char buff[80];
|
char buff[80];
|
||||||
my_getwd(buff, sizeof(buff), 0);
|
my_getwd(buff, sizeof(buff), 0);
|
||||||
|
@@ -410,6 +410,26 @@ Item *THD::sp_fix_func_item(Item **it_addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Prepare an Item for evaluation as an assignment source,
|
||||||
|
for assignment to the given target.
|
||||||
|
|
||||||
|
@param to - the assignment target
|
||||||
|
@param it_addr - a pointer on item refernce
|
||||||
|
|
||||||
|
@retval - NULL on error
|
||||||
|
@retval - a prepared item pointer on success
|
||||||
|
*/
|
||||||
|
Item *THD::sp_fix_func_item_for_assignment(const Field *to, Item **it_addr)
|
||||||
|
{
|
||||||
|
DBUG_ENTER("THD::sp_fix_func_item_for_assignment");
|
||||||
|
Item *res= sp_fix_func_item(it_addr);
|
||||||
|
if (res && (!res->check_assignability_to(to)))
|
||||||
|
DBUG_RETURN(res);
|
||||||
|
DBUG_RETURN(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Evaluate an expression and store the result in the field.
|
Evaluate an expression and store the result in the field.
|
||||||
|
|
||||||
@@ -4128,7 +4148,7 @@ sp_instr_jump_if_not::exec_core(THD *thd, uint *nextp)
|
|||||||
Item *it;
|
Item *it;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
it= thd->sp_prepare_func_item(&m_expr);
|
it= thd->sp_prepare_func_item(&m_expr, 1);
|
||||||
if (! it)
|
if (! it)
|
||||||
{
|
{
|
||||||
res= -1;
|
res= -1;
|
||||||
|
@@ -715,7 +715,7 @@ Item_cache *sp_rcontext::create_case_expr_holder(THD *thd,
|
|||||||
bool sp_rcontext::set_case_expr(THD *thd, int case_expr_id,
|
bool sp_rcontext::set_case_expr(THD *thd, int case_expr_id,
|
||||||
Item **case_expr_item_ptr)
|
Item **case_expr_item_ptr)
|
||||||
{
|
{
|
||||||
Item *case_expr_item= thd->sp_prepare_func_item(case_expr_item_ptr);
|
Item *case_expr_item= thd->sp_prepare_func_item(case_expr_item_ptr, 1);
|
||||||
if (!case_expr_item)
|
if (!case_expr_item)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@@ -1298,10 +1298,7 @@ void THD::init()
|
|||||||
wsrep_desynced_backup_stage= false;
|
wsrep_desynced_backup_stage= false;
|
||||||
#endif /* WITH_WSREP */
|
#endif /* WITH_WSREP */
|
||||||
|
|
||||||
if (variables.sql_log_bin)
|
set_binlog_bit();
|
||||||
variables.option_bits|= OPTION_BIN_LOG;
|
|
||||||
else
|
|
||||||
variables.option_bits&= ~OPTION_BIN_LOG;
|
|
||||||
|
|
||||||
select_commands= update_commands= other_commands= 0;
|
select_commands= update_commands= other_commands= 0;
|
||||||
/* Set to handle counting of aborted connections */
|
/* Set to handle counting of aborted connections */
|
||||||
|
@@ -3263,6 +3263,13 @@ public:
|
|||||||
auto_inc_intervals_forced.empty(); // in case of multiple SET INSERT_ID
|
auto_inc_intervals_forced.empty(); // in case of multiple SET INSERT_ID
|
||||||
auto_inc_intervals_forced.append(next_id, ULONGLONG_MAX, 0);
|
auto_inc_intervals_forced.append(next_id, ULONGLONG_MAX, 0);
|
||||||
}
|
}
|
||||||
|
inline void set_binlog_bit()
|
||||||
|
{
|
||||||
|
if (variables.sql_log_bin)
|
||||||
|
variables.option_bits |= OPTION_BIN_LOG;
|
||||||
|
else
|
||||||
|
variables.option_bits &= ~OPTION_BIN_LOG;
|
||||||
|
}
|
||||||
|
|
||||||
ulonglong limit_found_rows;
|
ulonglong limit_found_rows;
|
||||||
|
|
||||||
@@ -5493,7 +5500,8 @@ public:
|
|||||||
bool restore_from_local_lex_to_old_lex(LEX *oldlex);
|
bool restore_from_local_lex_to_old_lex(LEX *oldlex);
|
||||||
|
|
||||||
Item *sp_fix_func_item(Item **it_addr);
|
Item *sp_fix_func_item(Item **it_addr);
|
||||||
Item *sp_prepare_func_item(Item **it_addr, uint cols= 1);
|
Item *sp_fix_func_item_for_assignment(const Field *to, Item **it_addr);
|
||||||
|
Item *sp_prepare_func_item(Item **it_addr, uint cols);
|
||||||
bool sp_eval_expr(Field *result_field, Item **expr_item_ptr);
|
bool sp_eval_expr(Field *result_field, Item **expr_item_ptr);
|
||||||
|
|
||||||
bool sql_parser(LEX *old_lex, LEX *lex,
|
bool sql_parser(LEX *old_lex, LEX *lex,
|
||||||
|
@@ -829,6 +829,19 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
|
|||||||
context->resolve_in_table_list_only(table_list);
|
context->resolve_in_table_list_only(table_list);
|
||||||
switch_to_nullable_trigger_fields(*values, table);
|
switch_to_nullable_trigger_fields(*values, table);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check assignability for the leftmost () in VALUES:
|
||||||
|
INSERT INTO t1 (a,b) VALUES (1,2), (3,4);
|
||||||
|
This checks if the values (1,2) can be assigned to fields (a,b).
|
||||||
|
The further values, e.g. (3,4) are not checked - they will be
|
||||||
|
checked during the execution time (when processing actual rows).
|
||||||
|
This is to preserve the "insert until the very first error"-style
|
||||||
|
behaviour for non-transactional tables.
|
||||||
|
*/
|
||||||
|
if (values->elements &&
|
||||||
|
table_list->table->check_assignability_opt_fields(fields, *values))
|
||||||
|
goto abort;
|
||||||
|
|
||||||
while ((values= its++))
|
while ((values= its++))
|
||||||
{
|
{
|
||||||
thd->get_stmt_da()->inc_current_row_for_warning();
|
thd->get_stmt_da()->inc_current_row_for_warning();
|
||||||
@@ -1688,7 +1701,15 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
|
|||||||
{
|
{
|
||||||
select_lex->no_wrap_view_item= TRUE;
|
select_lex->no_wrap_view_item= TRUE;
|
||||||
res= check_update_fields(thd, context->table_list, update_fields,
|
res= check_update_fields(thd, context->table_list, update_fields,
|
||||||
update_values, false, &map);
|
update_values, false, &map) ||
|
||||||
|
/*
|
||||||
|
Check that all col=expr pairs are compatible for assignment in
|
||||||
|
INSERT INTO t1 VALUES (...)
|
||||||
|
ON DUPLICATE KEY UPDATE col=expr [, col=expr];
|
||||||
|
*/
|
||||||
|
TABLE::check_assignability_explicit_fields(update_fields,
|
||||||
|
update_values);
|
||||||
|
|
||||||
select_lex->no_wrap_view_item= FALSE;
|
select_lex->no_wrap_view_item= FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3883,6 +3904,16 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
|||||||
check_insert_fields(thd, table_list, *fields, values,
|
check_insert_fields(thd, table_list, *fields, values,
|
||||||
!insert_into_view, 1, &map));
|
!insert_into_view, 1, &map));
|
||||||
|
|
||||||
|
if (!res)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Check that all colN=exprN pairs are compatible for assignment, e.g.:
|
||||||
|
INSERT INTO t1 (col1, col2) VALUES (expr1, expr2);
|
||||||
|
INSERT INTO t1 SET col1=expr1, col2=expr2;
|
||||||
|
*/
|
||||||
|
res= table_list->table->check_assignability_opt_fields(*fields, values);
|
||||||
|
}
|
||||||
|
|
||||||
if (!res && fields->elements)
|
if (!res && fields->elements)
|
||||||
{
|
{
|
||||||
Abort_on_warning_instant_set aws(thd,
|
Abort_on_warning_instant_set aws(thd,
|
||||||
@@ -3936,7 +3967,14 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
|||||||
}
|
}
|
||||||
|
|
||||||
res= res || setup_fields(thd, Ref_ptr_array(), *info.update_values,
|
res= res || setup_fields(thd, Ref_ptr_array(), *info.update_values,
|
||||||
MARK_COLUMNS_READ, 0, NULL, 0);
|
MARK_COLUMNS_READ, 0, NULL, 0) ||
|
||||||
|
/*
|
||||||
|
Check that all col=expr pairs are compatible for assignment in
|
||||||
|
INSERT INTO t1 SELECT ... FROM t2
|
||||||
|
ON DUPLICATE KEY UPDATE col=expr [, col=expr]
|
||||||
|
*/
|
||||||
|
TABLE::check_assignability_explicit_fields(*info.update_fields,
|
||||||
|
*info.update_values);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@@ -5627,12 +5627,26 @@ public:
|
|||||||
THD *new_thd;
|
THD *new_thd;
|
||||||
Security_context empty_ctx;
|
Security_context empty_ctx;
|
||||||
|
|
||||||
|
my_bool do_log_bin;
|
||||||
|
|
||||||
Protocol_local(THD *thd_arg, THD *new_thd_arg, ulong prealloc) :
|
Protocol_local(THD *thd_arg, THD *new_thd_arg, ulong prealloc) :
|
||||||
Protocol_text(thd_arg, prealloc),
|
Protocol_text(thd_arg, prealloc),
|
||||||
cur_data(0), first_data(0), data_tail(&first_data), alloc(0),
|
cur_data(0), first_data(0), data_tail(&first_data), alloc(0),
|
||||||
new_thd(new_thd_arg)
|
new_thd(new_thd_arg), do_log_bin(FALSE)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
void set_binlog_vars(my_bool *sav_log_bin)
|
||||||
|
{
|
||||||
|
*sav_log_bin= thd->variables.sql_log_bin;
|
||||||
|
thd->variables.sql_log_bin= do_log_bin;
|
||||||
|
thd->set_binlog_bit();
|
||||||
|
}
|
||||||
|
void restore_binlog_vars(my_bool sav_log_bin)
|
||||||
|
{
|
||||||
|
do_log_bin= thd->variables.sql_log_bin;
|
||||||
|
thd->variables.sql_log_bin= sav_log_bin;
|
||||||
|
thd->set_binlog_bit();
|
||||||
|
}
|
||||||
protected:
|
protected:
|
||||||
bool net_store_data(const uchar *from, size_t length);
|
bool net_store_data(const uchar *from, size_t length);
|
||||||
bool net_store_data_cs(const uchar *from, size_t length,
|
bool net_store_data_cs(const uchar *from, size_t length,
|
||||||
@@ -6240,12 +6254,16 @@ loc_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||||||
Ed_connection con(p->thd);
|
Ed_connection con(p->thd);
|
||||||
Security_context *ctx_orig= p->thd->security_ctx;
|
Security_context *ctx_orig= p->thd->security_ctx;
|
||||||
MYSQL_LEX_STRING sql_text;
|
MYSQL_LEX_STRING sql_text;
|
||||||
|
my_bool log_bin_orig;
|
||||||
|
p->set_binlog_vars(&log_bin_orig);
|
||||||
|
|
||||||
DBUG_ASSERT(current_thd == p->thd);
|
DBUG_ASSERT(current_thd == p->thd);
|
||||||
sql_text.str= (char *) arg;
|
sql_text.str= (char *) arg;
|
||||||
sql_text.length= arg_length;
|
sql_text.length= arg_length;
|
||||||
p->thd->security_ctx= &p->empty_ctx;
|
p->thd->security_ctx= &p->empty_ctx;
|
||||||
result= con.execute_direct(p, sql_text);
|
result= con.execute_direct(p, sql_text);
|
||||||
p->thd->security_ctx= ctx_orig;
|
p->thd->security_ctx= ctx_orig;
|
||||||
|
p->restore_binlog_vars(log_bin_orig);
|
||||||
}
|
}
|
||||||
if (skip_check)
|
if (skip_check)
|
||||||
result= 0;
|
result= 0;
|
||||||
@@ -6401,6 +6419,9 @@ extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql)
|
|||||||
new_thd->security_ctx->skip_grants();
|
new_thd->security_ctx->skip_grants();
|
||||||
new_thd->query_cache_is_applicable= 0;
|
new_thd->query_cache_is_applicable= 0;
|
||||||
new_thd->variables.wsrep_on= 0;
|
new_thd->variables.wsrep_on= 0;
|
||||||
|
new_thd->variables.sql_log_bin= 0;
|
||||||
|
new_thd->set_binlog_bit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TOSO: decide if we should turn the auditing off
|
TOSO: decide if we should turn the auditing off
|
||||||
for such threads.
|
for such threads.
|
||||||
|
@@ -7030,19 +7030,18 @@ static int get_check_constraints_record(THD *thd, TABLE_LIST *tables,
|
|||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||||
TABLE_LIST table_acl_check;
|
TABLE_LIST table_acl_check;
|
||||||
bzero((char*) &table_acl_check, sizeof(table_acl_check));
|
bzero((char*) &table_acl_check, sizeof(table_acl_check));
|
||||||
#endif
|
|
||||||
for (uint i= 0; i < tables->table->s->table_check_constraints; i++)
|
|
||||||
{
|
|
||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
|
||||||
if (!(thd->col_access & TABLE_ACLS))
|
if (!(thd->col_access & TABLE_ACLS))
|
||||||
{
|
{
|
||||||
table_acl_check.db= *db_name;
|
table_acl_check.db= *db_name;
|
||||||
table_acl_check.table_name= *table_name;
|
table_acl_check.table_name= *table_name;
|
||||||
table_acl_check.grant.privilege= thd->col_access;
|
table_acl_check.grant.privilege= thd->col_access;
|
||||||
if (check_grant(thd, TABLE_ACLS, &table_acl_check, FALSE, 1, TRUE))
|
if (check_grant(thd, TABLE_ACLS, &table_acl_check, FALSE, 1, TRUE))
|
||||||
continue;
|
DBUG_RETURN(res);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
for (uint i= 0; i < tables->table->s->table_check_constraints; i++)
|
||||||
|
{
|
||||||
Virtual_column_info *check= tables->table->check_constraints[i];
|
Virtual_column_info *check= tables->table->check_constraints[i];
|
||||||
table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
|
table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
|
||||||
table->field[3]->store(check->name.str, check->name.length,
|
table->field[3]->store(check->name.str, check->name.length,
|
||||||
|
@@ -11465,6 +11465,8 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
|
|||||||
if (!(*ptr)->vcol_info)
|
if (!(*ptr)->vcol_info)
|
||||||
{
|
{
|
||||||
bitmap_set_bit(from->read_set, def->field->field_index);
|
bitmap_set_bit(from->read_set, def->field->field_index);
|
||||||
|
if ((*ptr)->check_assignability_from(def->field))
|
||||||
|
goto err;
|
||||||
(copy_end++)->set(*ptr,def->field,0);
|
(copy_end++)->set(*ptr,def->field,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -523,6 +523,9 @@ int mysql_update(THD *thd,
|
|||||||
DBUG_RETURN(1); /* purecov: inspected */
|
DBUG_RETURN(1); /* purecov: inspected */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (table_list->table->check_assignability_explicit_fields(fields, values))
|
||||||
|
DBUG_RETURN(true);
|
||||||
|
|
||||||
if (check_unique_table(thd, table_list))
|
if (check_unique_table(thd, table_list))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
|
|
||||||
@@ -2082,7 +2085,8 @@ int multi_update::prepare(List<Item> ¬_used_values,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int error= setup_fields(thd, Ref_ptr_array(),
|
int error= setup_fields(thd, Ref_ptr_array(),
|
||||||
*values, MARK_COLUMNS_READ, 0, NULL, 0);
|
*values, MARK_COLUMNS_READ, 0, NULL, 0) ||
|
||||||
|
TABLE::check_assignability_explicit_fields(*fields, *values);
|
||||||
|
|
||||||
ti.rewind();
|
ti.rewind();
|
||||||
while ((table_ref= ti++))
|
while ((table_ref= ti++))
|
||||||
|
@@ -4490,10 +4490,7 @@ static bool fix_sql_log_bin_after_update(sys_var *self, THD *thd,
|
|||||||
{
|
{
|
||||||
DBUG_ASSERT(type == OPT_SESSION);
|
DBUG_ASSERT(type == OPT_SESSION);
|
||||||
|
|
||||||
if (thd->variables.sql_log_bin)
|
thd->set_binlog_bit();
|
||||||
thd->variables.option_bits |= OPTION_BIN_LOG;
|
|
||||||
else
|
|
||||||
thd->variables.option_bits &= ~OPTION_BIN_LOG;
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
54
sql/table.cc
54
sql/table.cc
@@ -9244,6 +9244,60 @@ bool TABLE::validate_default_values_of_unset_fields(THD *thd) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check assignment compatibility of a value list against an explicitly
|
||||||
|
specified field list, e.g.
|
||||||
|
INSERT INTO t1 (a,b) VALUES (1,2);
|
||||||
|
*/
|
||||||
|
bool TABLE::check_assignability_explicit_fields(List<Item> fields,
|
||||||
|
List<Item> values)
|
||||||
|
{
|
||||||
|
DBUG_ENTER("TABLE::check_assignability_explicit_fields");
|
||||||
|
DBUG_ASSERT(fields.elements == values.elements);
|
||||||
|
|
||||||
|
List_iterator<Item> fi(fields);
|
||||||
|
List_iterator<Item> vi(values);
|
||||||
|
Item *f, *value;
|
||||||
|
while ((f= fi++) && (value= vi++))
|
||||||
|
{
|
||||||
|
Item_field *item_field= f->field_for_view_update();
|
||||||
|
if (!item_field)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
A non-updatable field of a view found.
|
||||||
|
This scenario is caught later and an error is raised.
|
||||||
|
We could eventually move error reporting here. For now just continue.
|
||||||
|
*/
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (value->check_assignability_to(item_field->field))
|
||||||
|
DBUG_RETURN(true);
|
||||||
|
}
|
||||||
|
DBUG_RETURN(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Check assignment compatibility for a value list against
|
||||||
|
all visible fields of the table, e.g.
|
||||||
|
INSERT INTO t1 VALUES (1,2);
|
||||||
|
*/
|
||||||
|
bool TABLE::check_assignability_all_visible_fields(List<Item> &values) const
|
||||||
|
{
|
||||||
|
DBUG_ENTER("TABLE::check_assignability_all_visible_fields");
|
||||||
|
DBUG_ASSERT(s->visible_fields == values.elements);
|
||||||
|
|
||||||
|
List_iterator<Item> vi(values);
|
||||||
|
for (uint i= 0; i < s->fields; i++)
|
||||||
|
{
|
||||||
|
if (!field[i]->invisible &&
|
||||||
|
(vi++)->check_assignability_to(field[i]))
|
||||||
|
DBUG_RETURN(true);
|
||||||
|
}
|
||||||
|
DBUG_RETURN(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TABLE::insert_all_rows_into_tmp_table(THD *thd,
|
bool TABLE::insert_all_rows_into_tmp_table(THD *thd,
|
||||||
TABLE *tmp_table,
|
TABLE *tmp_table,
|
||||||
TMP_TABLE_PARAM *tmp_table_param,
|
TMP_TABLE_PARAM *tmp_table_param,
|
||||||
|
21
sql/table.h
21
sql/table.h
@@ -1691,6 +1691,27 @@ public:
|
|||||||
Field **field_to_fill();
|
Field **field_to_fill();
|
||||||
bool validate_default_values_of_unset_fields(THD *thd) const;
|
bool validate_default_values_of_unset_fields(THD *thd) const;
|
||||||
|
|
||||||
|
// Check if the value list is assignable to the explicit field list
|
||||||
|
static bool check_assignability_explicit_fields(List<Item> fields,
|
||||||
|
List<Item> values);
|
||||||
|
// Check if the value list is assignable to all visible fields
|
||||||
|
bool check_assignability_all_visible_fields(List<Item> &values) const;
|
||||||
|
/*
|
||||||
|
Check if the value list is assignable to:
|
||||||
|
- The explicit field list if fields.elements > 0, e.g.
|
||||||
|
INSERT INTO t1 (a,b) VALUES (1,2);
|
||||||
|
- All visible fields, if fields.elements==0, e.g.
|
||||||
|
INSERT INTO t1 VALUES (1,2);
|
||||||
|
*/
|
||||||
|
bool check_assignability_opt_fields(List<Item> fields,
|
||||||
|
List<Item> values) const
|
||||||
|
{
|
||||||
|
DBUG_ASSERT(values.elements);
|
||||||
|
return fields.elements ?
|
||||||
|
check_assignability_explicit_fields(fields, values) :
|
||||||
|
check_assignability_all_visible_fields(values);
|
||||||
|
}
|
||||||
|
|
||||||
bool insert_all_rows_into_tmp_table(THD *thd,
|
bool insert_all_rows_into_tmp_table(THD *thd,
|
||||||
TABLE *tmp_table,
|
TABLE *tmp_table,
|
||||||
TMP_TABLE_PARAM *tmp_table_param,
|
TMP_TABLE_PARAM *tmp_table_param,
|
||||||
|
@@ -1069,12 +1069,14 @@ static ssize_t sst_prepare_other (const char* method,
|
|||||||
WSREP_SST_OPT_ADDR " '%s' "
|
WSREP_SST_OPT_ADDR " '%s' "
|
||||||
WSREP_SST_OPT_DATA " '%s' "
|
WSREP_SST_OPT_DATA " '%s' "
|
||||||
"%s"
|
"%s"
|
||||||
WSREP_SST_OPT_PARENT " '%d'"
|
WSREP_SST_OPT_PARENT " %d "
|
||||||
|
WSREP_SST_OPT_PROGRESS " %d"
|
||||||
"%s"
|
"%s"
|
||||||
"%s",
|
"%s",
|
||||||
method, addr_in, mysql_real_data_home,
|
method, addr_in, mysql_real_data_home,
|
||||||
wsrep_defaults_file,
|
wsrep_defaults_file,
|
||||||
(int)getpid(),
|
(int)getpid(),
|
||||||
|
0,
|
||||||
binlog_opt_val, binlog_index_opt_val);
|
binlog_opt_val, binlog_index_opt_val);
|
||||||
|
|
||||||
my_free(binlog_opt_val);
|
my_free(binlog_opt_val);
|
||||||
@@ -1854,16 +1856,18 @@ static int sst_donate_other (const char* method,
|
|||||||
"wsrep_sst_%s "
|
"wsrep_sst_%s "
|
||||||
WSREP_SST_OPT_ROLE " 'donor' "
|
WSREP_SST_OPT_ROLE " 'donor' "
|
||||||
WSREP_SST_OPT_ADDR " '%s' "
|
WSREP_SST_OPT_ADDR " '%s' "
|
||||||
WSREP_SST_OPT_LPORT " '%u' "
|
WSREP_SST_OPT_LPORT " %u "
|
||||||
WSREP_SST_OPT_SOCKET " '%s' "
|
WSREP_SST_OPT_SOCKET " '%s' "
|
||||||
|
WSREP_SST_OPT_PROGRESS " %d "
|
||||||
WSREP_SST_OPT_DATA " '%s' "
|
WSREP_SST_OPT_DATA " '%s' "
|
||||||
"%s"
|
"%s"
|
||||||
WSREP_SST_OPT_GTID " '%s:%lld' "
|
WSREP_SST_OPT_GTID " '%s:%lld' "
|
||||||
WSREP_SST_OPT_GTID_DOMAIN_ID " '%d'"
|
WSREP_SST_OPT_GTID_DOMAIN_ID " %d"
|
||||||
"%s"
|
"%s"
|
||||||
"%s"
|
"%s"
|
||||||
"%s",
|
"%s",
|
||||||
method, addr, mysqld_port, mysqld_unix_port,
|
method, addr, mysqld_port, mysqld_unix_port,
|
||||||
|
0,
|
||||||
mysql_real_data_home,
|
mysql_real_data_home,
|
||||||
wsrep_defaults_file,
|
wsrep_defaults_file,
|
||||||
uuid_oss.str().c_str(), gtid.seqno().get(), wsrep_gtid_server.domain_id,
|
uuid_oss.str().c_str(), gtid.seqno().get(), wsrep_gtid_server.domain_id,
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#define WSREP_SST_OPT_PARENT "--parent"
|
#define WSREP_SST_OPT_PARENT "--parent"
|
||||||
#define WSREP_SST_OPT_BINLOG "--binlog"
|
#define WSREP_SST_OPT_BINLOG "--binlog"
|
||||||
#define WSREP_SST_OPT_BINLOG_INDEX "--binlog-index"
|
#define WSREP_SST_OPT_BINLOG_INDEX "--binlog-index"
|
||||||
|
#define WSREP_SST_OPT_PROGRESS "--progress"
|
||||||
#define WSREP_SST_OPT_MYSQLD "--mysqld-args"
|
#define WSREP_SST_OPT_MYSQLD "--mysqld-args"
|
||||||
|
|
||||||
// mysqldump-specific options
|
// mysqldump-specific options
|
||||||
|
@@ -294,3 +294,15 @@ a
|
|||||||
30
|
30
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-27766 CONNECT Engine Support for INSERT IGNORE with Mysql Table type
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||||
|
INSERT INTO t1 VALUES (10),(20),(30);
|
||||||
|
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:PORT/test/t1' OPTION_LIST="Delayed=1,Ignored=1";
|
||||||
|
INSERT INTO t2 VALUES (10),(20),(30),(40);
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 10.3 tests
|
||||||
|
#
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user