summaryrefslogtreecommitdiff
path: root/storage/connect/mysql-test/connect
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/mysql-test/connect')
-rw-r--r--storage/connect/mysql-test/connect/r/index.result36
-rw-r--r--storage/connect/mysql-test/connect/r/mysql.result38
-rw-r--r--storage/connect/mysql-test/connect/t/index.test26
-rw-r--r--storage/connect/mysql-test/connect/t/mysql.test30
4 files changed, 130 insertions, 0 deletions
diff --git a/storage/connect/mysql-test/connect/r/index.result b/storage/connect/mysql-test/connect/r/index.result
index c156e10749e..baebf1f1ebe 100644
--- a/storage/connect/mysql-test/connect/r/index.result
+++ b/storage/connect/mysql-test/connect/r/index.result
@@ -140,6 +140,42 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
#
+# MDEV-28299: Server crashes in
+# XINDXS::Range/CntIndexRange (Connect engine)
+#
+CREATE TABLE t1 ( a int not null, KEY (a))engine=CONNECT;
+Warnings:
+Warning 1105 No table_type. Will be set to DOS
+Warning 1105 No file name. Table will use t1.dos
+SELECT * FROM t1 WHERE a=1;
+a
+INSERT INTO t1 values (1),(2),(1);
+SELECT * FROM t1 WHERE a=1;
+a
+1
+1
+DROP TABLE t1;
+CREATE TABLE t1 (a int, b int, pk int, PRIMARY KEY (pk)) engine=CONNECT;
+Warnings:
+Warning 1105 No table_type. Will be set to DOS
+Warning 1105 No file name. Table will use t1.dos
+SELECT x.a
+FROM t1 AS x JOIN t1 AS y ON (x.a = y.b)
+WHERE x.pk > 3;
+a
+INSERT INTO t1 values (1,2,1),(2,1,2),(1,2,3),(3,4,4);
+SELECT x.a
+FROM t1 AS x JOIN t1 AS y ON (x.a = y.b)
+WHERE x.pk > 3;
+a
+INSERT INTO t1 values (1,2,5);
+SELECT x.a
+FROM t1 AS x JOIN t1 AS y ON (x.a = y.b)
+WHERE x.pk > 3;
+a
+1
+DROP TABLE t1;
+#
# MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results
#
CREATE TABLE t1 (
diff --git a/storage/connect/mysql-test/connect/r/mysql.result b/storage/connect/mysql-test/connect/r/mysql.result
index 918256ac395..d3c244b277a 100644
--- a/storage/connect/mysql-test/connect/r/mysql.result
+++ b/storage/connect/mysql-test/connect/r/mysql.result
@@ -326,5 +326,43 @@ id
DROP TABLE t1;
DROP TABLE t2;
#
+# MDEV-28489 / MDEV-26722 UTF8 bytes calculated incorrectly
+#
+CREATE TABLE t1 (name varchar(20)) CHARSET=utf8;
+INSERT INTO t1 (name) VALUES ('Иванова'), ('Ivanova');
+CREATE TABLE t2 (name varchar(1)) ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT' CHARSET=utf8;
+SELECT hex(name) from t1;
+hex(name)
+C390CB9CC390C2B2C390C2B0C390C2BDC390C2BEC390C2B2C390C2B0
+4976616E6F7661
+SELECT hex(name) from t2;
+hex(name)
+C390
+49
+Warnings:
+Warning 1105 Out of range value for column name at row 1
+Warning 1265 Data truncated for column 'name' at row 1
+Warning 1105 Out of range value Ð? for column 'name' at row 1
+Warning 1105 Out of range value for column name at row 2
+Warning 1265 Data truncated for column 'name' at row 2
+Warning 1105 Out of range value Iva for column 'name' at row 2
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (col char(5)) CHARSET=utf8;
+INSERT INTO t1 (col) VALUES ('glace'), ('glacé');
+Warnings:
+Warning 1406 Data too long for column 'col' at row 2
+CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT' CHARSET=utf8;
+SELECT hex(col) from t1;
+hex(col)
+676C616365
+676C6163C383
+SELECT hex(col) from t2;
+hex(col)
+676C616365
+676C6163C383
+DROP TABLE t2;
+DROP TABLE t1;
+#
# End of 10.3 tests
#
diff --git a/storage/connect/mysql-test/connect/t/index.test b/storage/connect/mysql-test/connect/t/index.test
index b631236832d..47bfbae7680 100644
--- a/storage/connect/mysql-test/connect/t/index.test
+++ b/storage/connect/mysql-test/connect/t/index.test
@@ -79,6 +79,32 @@ DROP TABLE t2;
DROP TABLE t3;
--echo #
+--echo # MDEV-28299: Server crashes in
+--echo # XINDXS::Range/CntIndexRange (Connect engine)
+--echo #
+
+CREATE TABLE t1 ( a int not null, KEY (a))engine=CONNECT;
+SELECT * FROM t1 WHERE a=1;
+
+INSERT INTO t1 values (1),(2),(1);
+SELECT * FROM t1 WHERE a=1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a int, b int, pk int, PRIMARY KEY (pk)) engine=CONNECT;
+SELECT x.a
+FROM t1 AS x JOIN t1 AS y ON (x.a = y.b)
+WHERE x.pk > 3;
+INSERT INTO t1 values (1,2,1),(2,1,2),(1,2,3),(3,4,4);
+SELECT x.a
+FROM t1 AS x JOIN t1 AS y ON (x.a = y.b)
+WHERE x.pk > 3;
+INSERT INTO t1 values (1,2,5);
+SELECT x.a
+FROM t1 AS x JOIN t1 AS y ON (x.a = y.b)
+WHERE x.pk > 3;
+DROP TABLE t1;
+
+--echo #
--echo # MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results
--echo #
--error ER_UNKNOWN_ERROR
diff --git a/storage/connect/mysql-test/connect/t/mysql.test b/storage/connect/mysql-test/connect/t/mysql.test
index ce76a4665d5..a50db4a6457 100644
--- a/storage/connect/mysql-test/connect/t/mysql.test
+++ b/storage/connect/mysql-test/connect/t/mysql.test
@@ -504,5 +504,35 @@ DROP TABLE t1;
DROP TABLE t2;
--echo #
+--echo # MDEV-28489 / MDEV-26722 UTF8 bytes calculated incorrectly
+--echo #
+
+CREATE TABLE t1 (name varchar(20)) CHARSET=utf8;
+INSERT INTO t1 (name) VALUES ('Иванова'), ('Ivanova');
+
+--replace_result $PORT PORT
+--eval CREATE TABLE t2 (name varchar(1)) ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' CHARSET=utf8
+
+SELECT hex(name) from t1;
+# This will warn as we are truncating data
+SELECT hex(name) from t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (col char(5)) CHARSET=utf8;
+INSERT INTO t1 (col) VALUES ('glace'), ('glacé');
+
+--replace_result $PORT PORT
+--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' CHARSET=utf8
+
+SELECT hex(col) from t1;
+SELECT hex(col) from t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 10.3 tests
--echo #