diff --git a/mysql-test/columnstore/1pmonly/t/mcol4652-cpimport-sets-wide-decimals-ranges.test b/mysql-test/columnstore/1pmonly/t/mcol4652-cpimport-sets-wide-decimals-ranges.test index 9eeb068f15..00c901f8e4 100644 --- a/mysql-test/columnstore/1pmonly/t/mcol4652-cpimport-sets-wide-decimals-ranges.test +++ b/mysql-test/columnstore/1pmonly/t/mcol4652-cpimport-sets-wide-decimals-ranges.test @@ -1,4 +1,5 @@ -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcol4652; diff --git a/mysql-test/columnstore/1pmonly/t/mcs201_calshowpartitions_function.test b/mysql-test/columnstore/1pmonly/t/mcs201_calshowpartitions_function.test index b2f50ec39a..f9f2e8c896 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs201_calshowpartitions_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs201_calshowpartitions_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs201_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs202_caldisablepartitions_function.test b/mysql-test/columnstore/1pmonly/t/mcs202_caldisablepartitions_function.test index a7b055b92f..83c447e3e3 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs202_caldisablepartitions_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs202_caldisablepartitions_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs202_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs203_calenablepartitions_function.test b/mysql-test/columnstore/1pmonly/t/mcs203_calenablepartitions_function.test index 777dcd29e1..543c8aef45 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs203_calenablepartitions_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs203_calenablepartitions_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs203_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs204_caldroppartitions_function.test b/mysql-test/columnstore/1pmonly/t/mcs204_caldroppartitions_function.test index a2c626abdd..70c36af24b 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs204_caldroppartitions_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs204_caldroppartitions_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs204_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs208_idbPartition_function.test b/mysql-test/columnstore/1pmonly/t/mcs208_idbPartition_function.test index 939b086823..2102a459e1 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs208_idbPartition_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs208_idbPartition_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs208_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs209_idbDBRoot_function.test b/mysql-test/columnstore/1pmonly/t/mcs209_idbDBRoot_function.test index b7b3812156..d8088cf463 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs209_idbDBRoot_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs209_idbDBRoot_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs209_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs210_idbPm_function.test b/mysql-test/columnstore/1pmonly/t/mcs210_idbPm_function.test index 683acb5193..118fa9271d 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs210_idbPm_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs210_idbPm_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs210_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs214_idbExtentRelativeRid_function.test b/mysql-test/columnstore/1pmonly/t/mcs214_idbExtentRelativeRid_function.test index 3799c855aa..dce101885b 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs214_idbExtentRelativeRid_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs214_idbExtentRelativeRid_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs214_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs215_idbSegment_function.test b/mysql-test/columnstore/1pmonly/t/mcs215_idbSegment_function.test index 927c93c896..eb30ae1b83 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs215_idbSegment_function.test +++ b/mysql-test/columnstore/1pmonly/t/mcs215_idbSegment_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs215_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs4009_autopilot_partition_management.test b/mysql-test/columnstore/1pmonly/t/mcs4009_autopilot_partition_management.test index bfacdf3f1a..074cd1e1bf 100755 --- a/mysql-test/columnstore/1pmonly/t/mcs4009_autopilot_partition_management.test +++ b/mysql-test/columnstore/1pmonly/t/mcs4009_autopilot_partition_management.test @@ -4,6 +4,7 @@ # Author: Daniel Lee, daniel.lee@mariadb.com # -------------------------------------------------------------- # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4009_db; diff --git a/mysql-test/columnstore/1pmonly/t/mcs7000_version_buffer.test b/mysql-test/columnstore/1pmonly/t/mcs7000_version_buffer.test index db4b43de5f..265e121e3a 100644 --- a/mysql-test/columnstore/1pmonly/t/mcs7000_version_buffer.test +++ b/mysql-test/columnstore/1pmonly/t/mcs7000_version_buffer.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs7000_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4004_autopilot_batchInsert_ldi.test b/mysql-test/columnstore/autopilot/t/mcs4004_autopilot_batchInsert_ldi.test index 4d6c27ed87..81356dcef5 100644 --- a/mysql-test/columnstore/autopilot/t/mcs4004_autopilot_batchInsert_ldi.test +++ b/mysql-test/columnstore/autopilot/t/mcs4004_autopilot_batchInsert_ldi.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4004_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4005_autopilot_add_drop_columns.test b/mysql-test/columnstore/autopilot/t/mcs4005_autopilot_add_drop_columns.test index 861ed85c78..1b2a311bbc 100755 --- a/mysql-test/columnstore/autopilot/t/mcs4005_autopilot_add_drop_columns.test +++ b/mysql-test/columnstore/autopilot/t/mcs4005_autopilot_add_drop_columns.test @@ -4,6 +4,7 @@ # Author: Daniel Lee, daniel.lee@mariadb.com # -------------------------------------------------------------- # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4005_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4006_autopilot_create_dbt3_database_1m.test b/mysql-test/columnstore/autopilot/t/mcs4006_autopilot_create_dbt3_database_1m.test index fe537e1674..148281e164 100755 --- a/mysql-test/columnstore/autopilot/t/mcs4006_autopilot_create_dbt3_database_1m.test +++ b/mysql-test/columnstore/autopilot/t/mcs4006_autopilot_create_dbt3_database_1m.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4006_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4007_autopilot_dbt3_performance_queries_1g.test b/mysql-test/columnstore/autopilot/t/mcs4007_autopilot_dbt3_performance_queries_1g.test index eb7560ad6b..1a106a2d6d 100644 --- a/mysql-test/columnstore/autopilot/t/mcs4007_autopilot_dbt3_performance_queries_1g.test +++ b/mysql-test/columnstore/autopilot/t/mcs4007_autopilot_dbt3_performance_queries_1g.test @@ -8,6 +8,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4007_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4008_autopilot_sanity_test.test b/mysql-test/columnstore/autopilot/t/mcs4008_autopilot_sanity_test.test index 81f9d4dea3..0ce02a5809 100755 --- a/mysql-test/columnstore/autopilot/t/mcs4008_autopilot_sanity_test.test +++ b/mysql-test/columnstore/autopilot/t/mcs4008_autopilot_sanity_test.test @@ -4,6 +4,7 @@ # Author: Daniel Lee, daniel.lee@mariadb.com # -------------------------------------------------------------- # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4008_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4010_autopilot_cross_engine_join.test b/mysql-test/columnstore/autopilot/t/mcs4010_autopilot_cross_engine_join.test index bbceec2ad1..4649a4d2f9 100755 --- a/mysql-test/columnstore/autopilot/t/mcs4010_autopilot_cross_engine_join.test +++ b/mysql-test/columnstore/autopilot/t/mcs4010_autopilot_cross_engine_join.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4010_db; diff --git a/mysql-test/columnstore/autopilot/t/mcs4011_autopilot_query_stats.test b/mysql-test/columnstore/autopilot/t/mcs4011_autopilot_query_stats.test index 0387834af2..d08529bd54 100755 --- a/mysql-test/columnstore/autopilot/t/mcs4011_autopilot_query_stats.test +++ b/mysql-test/columnstore/autopilot/t/mcs4011_autopilot_query_stats.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs4011_db; diff --git a/mysql-test/columnstore/basic/r/mcs10_drop_db_table.result b/mysql-test/columnstore/basic/r/mcs10_drop_db_table.result index 655070bdab..b1e8acc10e 100644 --- a/mysql-test/columnstore/basic/r/mcs10_drop_db_table.result +++ b/mysql-test/columnstore/basic/r/mcs10_drop_db_table.result @@ -62,8 +62,6 @@ DROP TABLE IF EXISTS mcs10_db2.t_columnstore1; USE mcs10_db1; CREATE TABLE t_columnstore1 (id int) engine=columnstore; CREATE TABLE t_columnstore2 (id int) engine=columnstore; -connect addconroot1, localhost, root,,; -connect addconroot2, localhost, root,,; connection addconroot1; DROP TABLE mcs10_db1.t_columnstore1; connection addconroot2; diff --git a/mysql-test/columnstore/basic/r/mcs117_create_utf8_maxscale.result b/mysql-test/columnstore/basic/r/mcs117_create_utf8_maxscale.result new file mode 100644 index 0000000000..1007dcd307 --- /dev/null +++ b/mysql-test/columnstore/basic/r/mcs117_create_utf8_maxscale.result @@ -0,0 +1,39 @@ +set names utf8; +DROP DATABASE IF EXISTS mcs117_db; +CREATE DATABASE имя_базы_в_кодировке_утф8_длиной_больше_чем_45; +USE имя_базы_в_кодировке_утф8_длиной_больше_чем_45; +SELECT DATABASE(); +DATABASE() +имя_базы_в_кодировке_утф8_длиной_больше_чем_45 +CREATE DATABASE mcs117_db; +USE mcs117_db; +SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata +WHERE schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45'; +SCHEMA_NAME +имя_базы_в_кодировке_утф8_длиной_больше_чем_45 +DROP DATABASE имя_базы_в_кодировке_утф8_длиной_больше_чем_45; +CREATE TABLE имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 +( +имя_поля_в_кодировке_утф8_длиной_больше_чем_45 INT +)ENGINE=Columnstore; +SHOW CREATE TABLE имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +Table Create Table +имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 CREATE TABLE `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` ( + `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int(11) DEFAULT NULL +) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci +CREATE VIEW имя_вью_кодировке_утф8_длиной_больше_чем_42 AS SELECT * FROM имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +SHOW CREATE VIEW имя_вью_кодировке_утф8_длиной_больше_чем_42; +View Create View character_set_client collation_connection +имя_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`testUser`@`%` SQL SECURITY DEFINER VIEW `имя_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` AS `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` from `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` utf8mb3 utf8mb3_general_ci +select TABLE_NAME from information_schema.tables where table_schema='mcs117_db' order by 1; +TABLE_NAME +имя_вью_кодировке_утф8_длиной_больше_чем_42 +имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 +select COLUMN_NAME from information_schema.columns where table_schema='mcs117_db' order by 1; +COLUMN_NAME +имя_поля_в_кодировке_утф8_длиной_больше_чем_45 +имя_поля_в_кодировке_утф8_длиной_больше_чем_45 +select TABLE_NAME from information_schema.views where table_schema='mcs117_db' order by 1; +TABLE_NAME +имя_вью_кодировке_утф8_длиной_больше_чем_42 +DROP DATABASE mcs117_db; diff --git a/mysql-test/columnstore/basic/r/mcs11_show_db_table.result b/mysql-test/columnstore/basic/r/mcs11_show_db_table.result index a6085be2ae..d703e01f44 100644 --- a/mysql-test/columnstore/basic/r/mcs11_show_db_table.result +++ b/mysql-test/columnstore/basic/r/mcs11_show_db_table.result @@ -40,8 +40,6 @@ SHOW TABLES IN mcs11_db2; Tables_in_mcs11_db2 t1 t2 -connect addconroot1, localhost, root,,; -connect addconroot2, localhost, root,,; connection addconroot1; SHOW DATABASES LIKE 'mcs11%'; Database (mcs11%) diff --git a/mysql-test/columnstore/basic/r/mcs12_alter_table.result b/mysql-test/columnstore/basic/r/mcs12_alter_table.result index 62a91fe61a..086f051437 100644 --- a/mysql-test/columnstore/basic/r/mcs12_alter_table.result +++ b/mysql-test/columnstore/basic/r/mcs12_alter_table.result @@ -114,8 +114,6 @@ new_i c i2 2 b 22 DROP TABLE t1; CREATE TABLE t1 (i INTEGER) ENGINE=Columnstore; -connect addconroot1, localhost, root,,; -connect addconroot2, localhost, root,,; connection addconroot1; SHOW CREATE TABLE mcs12_db1.t1; Table Create Table diff --git a/mysql-test/columnstore/basic/r/mcs13_alter_table_negative.result b/mysql-test/columnstore/basic/r/mcs13_alter_table_negative.result index 02d6be8fd3..288952088d 100644 --- a/mysql-test/columnstore/basic/r/mcs13_alter_table_negative.result +++ b/mysql-test/columnstore/basic/r/mcs13_alter_table_negative.result @@ -38,8 +38,6 @@ ALTER TABLE t1 ADD PRIMARY KEY pk(c1); ERROR 42000: Too many keys specified; max 0 keys allowed ALTER TABLE t1 DROP KEY k1; ERROR 42000: Can't DROP INDEX `k1`; check that it exists -connect addconroot1, localhost, root,,; -connect addconroot2, localhost, root,,; connection addconroot1; ALTER TABLE mcs13_db1.t1 CHANGE c1 c2 INVALIDDATATYPE; ERROR HY000: Unknown data type: 'INVALIDDATATYPE' diff --git a/mysql-test/columnstore/basic/r/mcs14_truncate_table.result b/mysql-test/columnstore/basic/r/mcs14_truncate_table.result index 835d89b289..82b23a0d56 100644 --- a/mysql-test/columnstore/basic/r/mcs14_truncate_table.result +++ b/mysql-test/columnstore/basic/r/mcs14_truncate_table.result @@ -65,8 +65,6 @@ CREATE TABLE t1 (id INT) ENGINE=Columnstore; INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5); CREATE TABLE t2 LIKE t1; INSERT INTO t2 SELECT * FROM t1; -connect addconroot1, localhost, root,,; -connect addconroot2, localhost, root,,; connection addconroot1; TRUNCATE mcs14_db1.t1; connection addconroot2; diff --git a/mysql-test/columnstore/basic/r/mcs170_session_functions_maxscale.result b/mysql-test/columnstore/basic/r/mcs170_session_functions_maxscale.result new file mode 100644 index 0000000000..a00639d398 --- /dev/null +++ b/mysql-test/columnstore/basic/r/mcs170_session_functions_maxscale.result @@ -0,0 +1,23 @@ +SET default_storage_engine=Columnstore; +DROP DATABASE IF EXISTS mcs170_db; +CREATE DATABASE mcs170_db; +USE mcs170_db; +SELECT CONNECTION_ID() > 0; +CONNECTION_ID() > 0 +1 +SELECT CURRENT_USER(); +CURRENT_USER() +testUser@max +SELECT USER(); +USER() +testUser@% +SELECT SESSION_USER(); +SESSION_USER() +testUser@max +SELECT SYSTEM_USER(); +SYSTEM_USER() +testUser@max +SELECT DATABASE(); +DATABASE() +mcs170_db +DROP DATABASE mcs170_db; diff --git a/mysql-test/columnstore/basic/r/mcs19_grant_revoke.result b/mysql-test/columnstore/basic/r/mcs19_grant_revoke.result index b342d3a923..6ab1854c42 100644 --- a/mysql-test/columnstore/basic/r/mcs19_grant_revoke.result +++ b/mysql-test/columnstore/basic/r/mcs19_grant_revoke.result @@ -23,8 +23,6 @@ SHOW GRANTS FOR 'user1'@'localhost'; Grants for user1@localhost GRANT USAGE ON *.* TO `user1`@`localhost` IDENTIFIED BY PASSWORD '*CB386B3062EFB295ED40F6A5B1A8CFE300642E38' GRANT CREATE, SELECT, INSERT ON mcs19_db.* TO 'user1'@'localhost'; -connect conn1, localhost, user1, Vagrant1|0000001,; -connect conn2, localhost, user1, Vagrant1|0000001,; connection conn1; SELECT USER(); USER() diff --git a/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet-large-volume.test b/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet-large-volume.test index 3eb85019dd..cac56283bf 100644 --- a/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet-large-volume.test +++ b/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet-large-volume.test @@ -7,6 +7,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcol_5505_parquet_large_volume; @@ -79,4 +80,4 @@ SELECT COUNT(*) FROM t4; --exec rm $MTR_SUITE_DIR/../std_data/10MRows.parquet --exec rm $MTR_SUITE_DIR/../std_data/50MRows.parquet --exec rm $MTR_SUITE_DIR/../std_data/100MRows.parquet -DROP DATABASE mcol_5505_parquet_large_volume; \ No newline at end of file +DROP DATABASE mcol_5505_parquet_large_volume; diff --git a/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet.test b/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet.test index 5e3003e989..579592c3be 100644 --- a/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet.test +++ b/mysql-test/columnstore/basic/t/mcol-5505-cpimport-parquet.test @@ -7,6 +7,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcol_5505_cpimport_parquet; @@ -61,4 +62,4 @@ SELECT COUNT(*) FROM t1; # Clean UP --exec rm $MTR_SUITE_DIR/../std_data/tests.parquet --exec rm $MTR_SUITE_DIR/../std_data/nulls.parquet -DROP DATABASE mcol_5505_cpimport_parquet; \ No newline at end of file +DROP DATABASE mcol_5505_cpimport_parquet; diff --git a/mysql-test/columnstore/basic/t/mcol641-insert.test b/mysql-test/columnstore/basic/t/mcol641-insert.test index 4d0fbda377..1936c3a6b3 100644 --- a/mysql-test/columnstore/basic/t/mcol641-insert.test +++ b/mysql-test/columnstore/basic/t/mcol641-insert.test @@ -1,4 +1,5 @@ -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcol641_insert_db; diff --git a/mysql-test/columnstore/basic/t/mcs102_ldi_transform_csv.test b/mysql-test/columnstore/basic/t/mcs102_ldi_transform_csv.test index 1490893e8e..0772e48c1f 100755 --- a/mysql-test/columnstore/basic/t/mcs102_ldi_transform_csv.test +++ b/mysql-test/columnstore/basic/t/mcs102_ldi_transform_csv.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/columnstore/basic/t/mcs103_ldi_fields_enclosed_by.test b/mysql-test/columnstore/basic/t/mcs103_ldi_fields_enclosed_by.test index 81ddf530d9..6fc5f1ac6d 100755 --- a/mysql-test/columnstore/basic/t/mcs103_ldi_fields_enclosed_by.test +++ b/mysql-test/columnstore/basic/t/mcs103_ldi_fields_enclosed_by.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/columnstore/basic/t/mcs104_ldi_fields_escaped_by.test b/mysql-test/columnstore/basic/t/mcs104_ldi_fields_escaped_by.test index fbaff61f2a..75f0769b80 100755 --- a/mysql-test/columnstore/basic/t/mcs104_ldi_fields_escaped_by.test +++ b/mysql-test/columnstore/basic/t/mcs104_ldi_fields_escaped_by.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/columnstore/basic/t/mcs105_ldi_lines_terminated_by.test b/mysql-test/columnstore/basic/t/mcs105_ldi_lines_terminated_by.test index cd0b4c9af0..1a4b9c61d4 100755 --- a/mysql-test/columnstore/basic/t/mcs105_ldi_lines_terminated_by.test +++ b/mysql-test/columnstore/basic/t/mcs105_ldi_lines_terminated_by.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/columnstore/basic/t/mcs106_ldi_ignore_rows.test b/mysql-test/columnstore/basic/t/mcs106_ldi_ignore_rows.test index 79d7995585..ee984177e4 100755 --- a/mysql-test/columnstore/basic/t/mcs106_ldi_ignore_rows.test +++ b/mysql-test/columnstore/basic/t/mcs106_ldi_ignore_rows.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/columnstore/basic/t/mcs10_drop_db_table.test b/mysql-test/columnstore/basic/t/mcs10_drop_db_table.test index 2699ead992..8cc8c15f33 100644 --- a/mysql-test/columnstore/basic/t/mcs10_drop_db_table.test +++ b/mysql-test/columnstore/basic/t/mcs10_drop_db_table.test @@ -3,6 +3,8 @@ # -- source ../include/have_columnstore.inc -- source include/have_innodb.inc +-- source ../include/check_maxscale.inc + --disable_warnings DROP DATABASE IF EXISTS mcs10_db1; @@ -68,8 +70,18 @@ DROP TABLE IF EXISTS mcs10_db2.t_columnstore1; USE mcs10_db1; CREATE TABLE t_columnstore1 (id int) engine=columnstore; CREATE TABLE t_columnstore2 (id int) engine=columnstore; -connect (addconroot1, localhost, root,,); -connect (addconroot2, localhost, root,,); +--disable_query_log +if ($maxscale == 1) +{ + connect(addconroot1, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); + connect(addconroot2, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); +} +if ($maxscale == 0) +{ + connect (addconroot1, localhost, root,,); + connect (addconroot2, localhost, root,,); +} +--enable_query_log connection addconroot1; DROP TABLE mcs10_db1.t_columnstore1; connection addconroot2; diff --git a/mysql-test/columnstore/basic/t/mcs117_create_utf8.test b/mysql-test/columnstore/basic/t/mcs117_create_utf8.test index 6b40b3b61f..0c11cab5bd 100644 --- a/mysql-test/columnstore/basic/t/mcs117_create_utf8.test +++ b/mysql-test/columnstore/basic/t/mcs117_create_utf8.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +-- source ../include/detect_maxscale.inc set names utf8; diff --git a/mysql-test/columnstore/basic/t/mcs117_create_utf8_maxscale.test b/mysql-test/columnstore/basic/t/mcs117_create_utf8_maxscale.test new file mode 100644 index 0000000000..b04312d386 --- /dev/null +++ b/mysql-test/columnstore/basic/t/mcs117_create_utf8_maxscale.test @@ -0,0 +1,44 @@ +# +# Test UTF8 names +# Author: Bharath, bharath.bokka@mariadb.com +# +-- source ../include/have_columnstore.inc +-- source ../include/detect_no_maxscale.inc + +set names utf8; + +--disable_warnings +DROP DATABASE IF EXISTS mcs117_db; +--enable_warnings + +CREATE DATABASE имя_базы_в_кодировке_утф8_длиной_больше_чем_45; +USE имя_базы_в_кодировке_утф8_длиной_больше_чем_45; +SELECT DATABASE(); + +CREATE DATABASE mcs117_db; +USE mcs117_db; + +SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata +WHERE schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45'; + +DROP DATABASE имя_базы_в_кодировке_утф8_длиной_больше_чем_45; + +CREATE TABLE имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 +( + имя_поля_в_кодировке_утф8_длиной_больше_чем_45 INT +)ENGINE=Columnstore; + +--replace_regex /( COLLATE=latin1_swedish_ci)// +SHOW CREATE TABLE имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48; + +CREATE VIEW имя_вью_кодировке_утф8_длиной_больше_чем_42 AS SELECT * FROM имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48; +SHOW CREATE VIEW имя_вью_кодировке_утф8_длиной_больше_чем_42; + +select TABLE_NAME from information_schema.tables where table_schema='mcs117_db' order by 1; + +select COLUMN_NAME from information_schema.columns where table_schema='mcs117_db' order by 1; + +select TABLE_NAME from information_schema.views where table_schema='mcs117_db' order by 1; + +# Clean UP +DROP DATABASE mcs117_db; diff --git a/mysql-test/columnstore/basic/t/mcs11_show_db_table.test b/mysql-test/columnstore/basic/t/mcs11_show_db_table.test index 3d7fb87565..2d90ca47d2 100644 --- a/mysql-test/columnstore/basic/t/mcs11_show_db_table.test +++ b/mysql-test/columnstore/basic/t/mcs11_show_db_table.test @@ -3,6 +3,8 @@ # -- source ../include/have_columnstore.inc -- source include/have_innodb.inc +-- source ../include/check_maxscale.inc + --disable_warnings DROP DATABASE IF EXISTS mcs11_db1; @@ -41,8 +43,18 @@ SHOW TABLES; SHOW TABLES IN mcs11_db2; # Test from parallel connections -connect (addconroot1, localhost, root,,); -connect (addconroot2, localhost, root,,); +--disable_query_log +if ($maxscale == 1) +{ + connect(addconroot1, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); + connect(addconroot2, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); +} +if ($maxscale == 0) +{ + connect (addconroot1, localhost, root,,); + connect (addconroot2, localhost, root,,); +} +--enable_query_log connection addconroot1; --sorted_result SHOW DATABASES LIKE 'mcs11%'; diff --git a/mysql-test/columnstore/basic/t/mcs12_alter_table.test b/mysql-test/columnstore/basic/t/mcs12_alter_table.test index f1f67b5f84..69fa2c1ffa 100644 --- a/mysql-test/columnstore/basic/t/mcs12_alter_table.test +++ b/mysql-test/columnstore/basic/t/mcs12_alter_table.test @@ -3,6 +3,8 @@ # -- source ../include/have_columnstore.inc -- source include/have_innodb.inc +-- source ../include/check_maxscale.inc + --disable_warnings DROP DATABASE IF EXISTS mcs12_db1; @@ -67,8 +69,18 @@ DROP TABLE t1; CREATE TABLE t1 (i INTEGER) ENGINE=Columnstore; # Test from parallel connections -connect (addconroot1, localhost, root,,); -connect (addconroot2, localhost, root,,); +--disable_query_log +if ($maxscale == 1) +{ + connect(addconroot1, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); + connect(addconroot2, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); +} +if ($maxscale == 0) +{ + connect (addconroot1, localhost, root,,); + connect (addconroot2, localhost, root,,); +} +--enable_query_log connection addconroot1; --replace_regex /( COLLATE=latin1_swedish_ci)// SHOW CREATE TABLE mcs12_db1.t1; diff --git a/mysql-test/columnstore/basic/t/mcs13_alter_table_negative.test b/mysql-test/columnstore/basic/t/mcs13_alter_table_negative.test index 436fd65351..0c4b86415e 100644 --- a/mysql-test/columnstore/basic/t/mcs13_alter_table_negative.test +++ b/mysql-test/columnstore/basic/t/mcs13_alter_table_negative.test @@ -2,6 +2,8 @@ # Test ALTER TABLE schemas in various negative scenarios. # -- source ../include/have_columnstore.inc +-- source ../include/check_maxscale.inc + --disable_warnings DROP DATABASE IF EXISTS mcs13_db1; @@ -54,8 +56,18 @@ ALTER TABLE t1 ADD PRIMARY KEY pk(c1); ALTER TABLE t1 DROP KEY k1; # Test from parallel connections -connect (addconroot1, localhost, root,,); -connect (addconroot2, localhost, root,,); +--disable_query_log +if ($maxscale == 1) +{ + connect(addconroot1, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); + connect(addconroot2, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); +} +if ($maxscale == 0) +{ + connect (addconroot1, localhost, root,,); + connect (addconroot2, localhost, root,,); +} +--enable_query_log connection addconroot1; --error 4161 ALTER TABLE mcs13_db1.t1 CHANGE c1 c2 INVALIDDATATYPE; diff --git a/mysql-test/columnstore/basic/t/mcs14_truncate_table.test b/mysql-test/columnstore/basic/t/mcs14_truncate_table.test index ad143d68d4..58903bf7f8 100644 --- a/mysql-test/columnstore/basic/t/mcs14_truncate_table.test +++ b/mysql-test/columnstore/basic/t/mcs14_truncate_table.test @@ -3,6 +3,8 @@ # -- source ../include/have_columnstore.inc -- source include/have_innodb.inc +-- source ../include/check_maxscale.inc + --disable_warnings DROP DATABASE IF EXISTS mcs14_db1; @@ -68,8 +70,18 @@ CREATE TABLE t2 LIKE t1; INSERT INTO t2 SELECT * FROM t1; # Test from parallel connections -connect (addconroot1, localhost, root,,); -connect (addconroot2, localhost, root,,); +--disable_query_log +if ($maxscale == 1) +{ + connect(addconroot1, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); + connect(addconroot2, 127.0.0.1, testUser, 'ct570c3521fCCR#ef',,4006); +} +if ($maxscale == 0) +{ + connect (addconroot1, localhost, root,,); + connect (addconroot2, localhost, root,,); +} +--enable_query_log connection addconroot1; TRUNCATE mcs14_db1.t1; connection addconroot2; diff --git a/mysql-test/columnstore/basic/t/mcs170_session_functions.test b/mysql-test/columnstore/basic/t/mcs170_session_functions.test index 210f172bb5..27bd334714 100644 --- a/mysql-test/columnstore/basic/t/mcs170_session_functions.test +++ b/mysql-test/columnstore/basic/t/mcs170_session_functions.test @@ -3,6 +3,8 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + SET default_storage_engine=Columnstore; diff --git a/mysql-test/columnstore/basic/t/mcs170_session_functions_maxscale.test b/mysql-test/columnstore/basic/t/mcs170_session_functions_maxscale.test new file mode 100644 index 0000000000..dbf1987487 --- /dev/null +++ b/mysql-test/columnstore/basic/t/mcs170_session_functions_maxscale.test @@ -0,0 +1,26 @@ +# +# Test Session functions +# Author: Bharath, bharath.bokka@mariadb.com +# +-- source ../include/have_columnstore.inc +--source ../include/detect_no_maxscale.inc + + +SET default_storage_engine=Columnstore; + +--disable_warnings +DROP DATABASE IF EXISTS mcs170_db; +--enable_warnings + +CREATE DATABASE mcs170_db; +USE mcs170_db; + +SELECT CONNECTION_ID() > 0; +SELECT CURRENT_USER(); +SELECT USER(); +SELECT SESSION_USER(); +SELECT SYSTEM_USER(); +SELECT DATABASE(); + +# Clean UP +DROP DATABASE mcs170_db; diff --git a/mysql-test/columnstore/basic/t/mcs19_grant_revoke.test b/mysql-test/columnstore/basic/t/mcs19_grant_revoke.test index 8ad56181c6..f514756ef7 100644 --- a/mysql-test/columnstore/basic/t/mcs19_grant_revoke.test +++ b/mysql-test/columnstore/basic/t/mcs19_grant_revoke.test @@ -4,6 +4,8 @@ # -- source ../include/have_columnstore.inc -- source include/have_innodb.inc +-- source ../include/check_maxscale.inc + SET default_storage_engine=InnoDB; @@ -29,10 +31,17 @@ GRANT CREATE, SELECT, INSERT ON mcs19_db.* TO 'user1'@'localhost'; --disable_query_log GRANT ALL ON test.* TO 'user1'@'localhost'; +if ($maxscale == 1) +{ + connect(conn1, 127.0.0.1, user1, Vagrant1|0000001,,4006); + connect(conn2, 127.0.0.1, user1, Vagrant1|0000001,,4006); +} +if ($maxscale == 0) +{ + connect(conn1, localhost, user1, Vagrant1|0000001,); + connect(conn2, localhost, user1, Vagrant1|0000001,); +} --enable_query_log -connect(conn1, localhost, user1, Vagrant1|0000001,); -connect(conn2, localhost, user1, Vagrant1|0000001,); - connection conn1; SELECT USER(); SHOW GRANTS FOR 'user1'@'localhost'; diff --git a/mysql-test/columnstore/basic/t/mcs211_idbExtentId_function.test b/mysql-test/columnstore/basic/t/mcs211_idbExtentId_function.test index 09b676e305..97d4d5a3fa 100644 --- a/mysql-test/columnstore/basic/t/mcs211_idbExtentId_function.test +++ b/mysql-test/columnstore/basic/t/mcs211_idbExtentId_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs211_db; diff --git a/mysql-test/columnstore/basic/t/mcs212_idbExtentMax_function.test b/mysql-test/columnstore/basic/t/mcs212_idbExtentMax_function.test index af0e28b596..ed1d6d85cb 100644 --- a/mysql-test/columnstore/basic/t/mcs212_idbExtentMax_function.test +++ b/mysql-test/columnstore/basic/t/mcs212_idbExtentMax_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs212_db; diff --git a/mysql-test/columnstore/basic/t/mcs213_idbExtentMin_function.test b/mysql-test/columnstore/basic/t/mcs213_idbExtentMin_function.test index 6f19f7c3ef..fefccb5686 100644 --- a/mysql-test/columnstore/basic/t/mcs213_idbExtentMin_function.test +++ b/mysql-test/columnstore/basic/t/mcs213_idbExtentMin_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs213_db; diff --git a/mysql-test/columnstore/basic/t/mcs216_idbSegmentDir_function.test b/mysql-test/columnstore/basic/t/mcs216_idbSegmentDir_function.test index ec3a48419b..303deafc8a 100644 --- a/mysql-test/columnstore/basic/t/mcs216_idbSegmentDir_function.test +++ b/mysql-test/columnstore/basic/t/mcs216_idbSegmentDir_function.test @@ -3,6 +3,7 @@ # Author: Bharath, bharath.bokka@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs216_db; diff --git a/mysql-test/columnstore/basic/t/mcs28_load_data_local_infile.test b/mysql-test/columnstore/basic/t/mcs28_load_data_local_infile.test index ff994d78cd..af2e11e78f 100755 --- a/mysql-test/columnstore/basic/t/mcs28_load_data_local_infile.test +++ b/mysql-test/columnstore/basic/t/mcs28_load_data_local_infile.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs28_db1; diff --git a/mysql-test/columnstore/basic/t/mcs29_load_data_local_infile_negative.test b/mysql-test/columnstore/basic/t/mcs29_load_data_local_infile_negative.test index 3923f74b97..514c5fc76b 100755 --- a/mysql-test/columnstore/basic/t/mcs29_load_data_local_infile_negative.test +++ b/mysql-test/columnstore/basic/t/mcs29_load_data_local_infile_negative.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs29_db1; diff --git a/mysql-test/columnstore/basic/t/mcs47_cpimport_central_loc_sin_source.test b/mysql-test/columnstore/basic/t/mcs47_cpimport_central_loc_sin_source.test index 613dfb88b5..e31f97e7c4 100644 --- a/mysql-test/columnstore/basic/t/mcs47_cpimport_central_loc_sin_source.test +++ b/mysql-test/columnstore/basic/t/mcs47_cpimport_central_loc_sin_source.test @@ -8,6 +8,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs47_db; diff --git a/mysql-test/columnstore/basic/t/mcs50_cpimport_stdin.test b/mysql-test/columnstore/basic/t/mcs50_cpimport_stdin.test index 431ff01159..180677a0f2 100644 --- a/mysql-test/columnstore/basic/t/mcs50_cpimport_stdin.test +++ b/mysql-test/columnstore/basic/t/mcs50_cpimport_stdin.test @@ -8,6 +8,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs50_db; diff --git a/mysql-test/columnstore/basic/t/mcs51_cpimport_select_from.test b/mysql-test/columnstore/basic/t/mcs51_cpimport_select_from.test index 00ba6ce8d4..84d70a107f 100644 --- a/mysql-test/columnstore/basic/t/mcs51_cpimport_select_from.test +++ b/mysql-test/columnstore/basic/t/mcs51_cpimport_select_from.test @@ -8,6 +8,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc -- source include/have_innodb.inc --disable_warnings diff --git a/mysql-test/columnstore/basic/t/mcs55_cpimport_binary_source.test b/mysql-test/columnstore/basic/t/mcs55_cpimport_binary_source.test index 993e0fdba9..aa5f7e9789 100644 --- a/mysql-test/columnstore/basic/t/mcs55_cpimport_binary_source.test +++ b/mysql-test/columnstore/basic/t/mcs55_cpimport_binary_source.test @@ -8,6 +8,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs55_db; diff --git a/mysql-test/columnstore/basic/t/mcs67_ldi_datafile_separators.test b/mysql-test/columnstore/basic/t/mcs67_ldi_datafile_separators.test index ff4bef139c..23ac684567 100644 --- a/mysql-test/columnstore/basic/t/mcs67_ldi_datafile_separators.test +++ b/mysql-test/columnstore/basic/t/mcs67_ldi_datafile_separators.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs67_db; diff --git a/mysql-test/columnstore/basic/t/mcs68_cpimport_datafile_separators.test b/mysql-test/columnstore/basic/t/mcs68_cpimport_datafile_separators.test index 907f090145..e22913d11f 100644 --- a/mysql-test/columnstore/basic/t/mcs68_cpimport_datafile_separators.test +++ b/mysql-test/columnstore/basic/t/mcs68_cpimport_datafile_separators.test @@ -8,6 +8,7 @@ if (!$MYSQL_TEST_ROOT){ } -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS mcs68_db; diff --git a/mysql-test/columnstore/basic/t/mcs88_import_export_csv.test b/mysql-test/columnstore/basic/t/mcs88_import_export_csv.test index 99a50e08eb..9c717c6700 100644 --- a/mysql-test/columnstore/basic/t/mcs88_import_export_csv.test +++ b/mysql-test/columnstore/basic/t/mcs88_import_export_csv.test @@ -3,6 +3,7 @@ # Author: Susil, susil.behera@mariadb.com # -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR= `SELECT @@datadir`; diff --git a/mysql-test/columnstore/basic/t/std_aggregate_columnstore.test b/mysql-test/columnstore/basic/t/std_aggregate_columnstore.test index fdc90fba97..8b95985040 100644 --- a/mysql-test/columnstore/basic/t/std_aggregate_columnstore.test +++ b/mysql-test/columnstore/basic/t/std_aggregate_columnstore.test @@ -1,4 +1,5 @@ -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS std_test_db; diff --git a/mysql-test/columnstore/basic/t/std_aggregate_window_columnstore.test b/mysql-test/columnstore/basic/t/std_aggregate_window_columnstore.test index 8740950765..17405588bc 100644 --- a/mysql-test/columnstore/basic/t/std_aggregate_window_columnstore.test +++ b/mysql-test/columnstore/basic/t/std_aggregate_window_columnstore.test @@ -1,4 +1,5 @@ -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS std_test_db; diff --git a/mysql-test/columnstore/basic/t/unsigned_aggregate.test b/mysql-test/columnstore/basic/t/unsigned_aggregate.test index 14c0689919..e45fb4e4d7 100644 --- a/mysql-test/columnstore/basic/t/unsigned_aggregate.test +++ b/mysql-test/columnstore/basic/t/unsigned_aggregate.test @@ -1,4 +1,5 @@ -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS unsigned_aggregate_db; diff --git a/mysql-test/columnstore/basic/t/unsigned_joins.test b/mysql-test/columnstore/basic/t/unsigned_joins.test index 9accb2be01..9d60f0b4bc 100644 --- a/mysql-test/columnstore/basic/t/unsigned_joins.test +++ b/mysql-test/columnstore/basic/t/unsigned_joins.test @@ -1,4 +1,5 @@ -- source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS unsigned_joins_db; diff --git a/mysql-test/columnstore/bugfixes/mcol-4741-strings-ranges-are-unsigned.test b/mysql-test/columnstore/bugfixes/mcol-4741-strings-ranges-are-unsigned.test index 06cc2abdde..31311d9926 100644 --- a/mysql-test/columnstore/bugfixes/mcol-4741-strings-ranges-are-unsigned.test +++ b/mysql-test/columnstore/bugfixes/mcol-4741-strings-ranges-are-unsigned.test @@ -1,3 +1,5 @@ +--source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc --disable_warnings DROP DATABASE IF EXISTS db4741; --enable_warnings diff --git a/mysql-test/columnstore/bugfixes/mcol-4931.test b/mysql-test/columnstore/bugfixes/mcol-4931.test index eafcc3cebf..5a5c509cf5 100644 --- a/mysql-test/columnstore/bugfixes/mcol-4931.test +++ b/mysql-test/columnstore/bugfixes/mcol-4931.test @@ -7,6 +7,7 @@ if (!$MYSQL_TEST_ROOT){ } --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR=`SELECT @@datadir`; diff --git a/mysql-test/columnstore/bugfixes/mcol-5480.test b/mysql-test/columnstore/bugfixes/mcol-5480.test index 48fa794643..ab32e15035 100644 --- a/mysql-test/columnstore/bugfixes/mcol-5480.test +++ b/mysql-test/columnstore/bugfixes/mcol-5480.test @@ -4,6 +4,7 @@ # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc let $DATADIR=`SELECT @@datadir`; diff --git a/mysql-test/columnstore/devregression/t/mcs7058_regression_bug3262.test b/mysql-test/columnstore/devregression/t/mcs7058_regression_bug3262.test index fde00b3066..87cf3c0578 100644 --- a/mysql-test/columnstore/devregression/t/mcs7058_regression_bug3262.test +++ b/mysql-test/columnstore/devregression/t/mcs7058_regression_bug3262.test @@ -5,6 +5,8 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + # USE tpch1; # diff --git a/mysql-test/columnstore/devregression/t/mcs7072_regression_bug3406.test b/mysql-test/columnstore/devregression/t/mcs7072_regression_bug3406.test index 990f68501e..39aa61e80e 100644 --- a/mysql-test/columnstore/devregression/t/mcs7072_regression_bug3406.test +++ b/mysql-test/columnstore/devregression/t/mcs7072_regression_bug3406.test @@ -5,6 +5,8 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + # USE tpch1; # diff --git a/mysql-test/columnstore/devregression/t/mcs7094_regression_bug3520.test b/mysql-test/columnstore/devregression/t/mcs7094_regression_bug3520.test index b65aa5f542..f347bf345d 100644 --- a/mysql-test/columnstore/devregression/t/mcs7094_regression_bug3520.test +++ b/mysql-test/columnstore/devregression/t/mcs7094_regression_bug3520.test @@ -5,6 +5,8 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + # USE ssb1; # diff --git a/mysql-test/columnstore/devregression/t/mcs7130_regression_bug3935.test b/mysql-test/columnstore/devregression/t/mcs7130_regression_bug3935.test index f676adf9c7..fd189fd57b 100644 --- a/mysql-test/columnstore/devregression/t/mcs7130_regression_bug3935.test +++ b/mysql-test/columnstore/devregression/t/mcs7130_regression_bug3935.test @@ -5,6 +5,8 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + # USE tpch1; # diff --git a/mysql-test/columnstore/devregression/t/mcs7230_regression_MCOL-4000.test b/mysql-test/columnstore/devregression/t/mcs7230_regression_MCOL-4000.test index d3e351086c..f618e48ca3 100644 --- a/mysql-test/columnstore/devregression/t/mcs7230_regression_MCOL-4000.test +++ b/mysql-test/columnstore/devregression/t/mcs7230_regression_MCOL-4000.test @@ -5,6 +5,8 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + # USE tpch1; # diff --git a/mysql-test/columnstore/devregression/t/mcs7231_regression_MCOL-4002.test b/mysql-test/columnstore/devregression/t/mcs7231_regression_MCOL-4002.test index 26cdc880d9..65f09adf42 100644 --- a/mysql-test/columnstore/devregression/t/mcs7231_regression_MCOL-4002.test +++ b/mysql-test/columnstore/devregression/t/mcs7231_regression_MCOL-4002.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # USE tpch1; # diff --git a/mysql-test/columnstore/extended/t/mcs7001_update_100mil_rows.test b/mysql-test/columnstore/extended/t/mcs7001_update_100mil_rows.test index f14947289c..0763bdf044 100644 --- a/mysql-test/columnstore/extended/t/mcs7001_update_100mil_rows.test +++ b/mysql-test/columnstore/extended/t/mcs7001_update_100mil_rows.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs7001_db; diff --git a/mysql-test/columnstore/extended/t/mcs7002_ldi_rollback.test b/mysql-test/columnstore/extended/t/mcs7002_ldi_rollback.test index f667302217..aa7dd7ff41 100644 --- a/mysql-test/columnstore/extended/t/mcs7002_ldi_rollback.test +++ b/mysql-test/columnstore/extended/t/mcs7002_ldi_rollback.test @@ -5,6 +5,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS mcs7002_db; diff --git a/mysql-test/columnstore/include/check_maxscale.inc b/mysql-test/columnstore/include/check_maxscale.inc new file mode 100644 index 0000000000..10039348e6 --- /dev/null +++ b/mysql-test/columnstore/include/check_maxscale.inc @@ -0,0 +1,9 @@ +--disable_abort_on_error +let $maxscale = 0; +let $maxscalerepl = `SELECT @is_maxscale`; +if ($maxscalerepl == "YES") +{ + let $maxscale = 1; +} + +--enable_abort_on_error diff --git a/mysql-test/columnstore/include/detect_maxscale.inc b/mysql-test/columnstore/include/detect_maxscale.inc new file mode 100644 index 0000000000..33165732a7 --- /dev/null +++ b/mysql-test/columnstore/include/detect_maxscale.inc @@ -0,0 +1,10 @@ +--disable_abort_on_error + +let $maxscale = `SELECT @is_maxscale`; + +if ($maxscale == "YES") +{ + --skip Test can not be used with Maxscale. +} + +--enable_abort_on_error diff --git a/mysql-test/columnstore/include/detect_no_maxscale.inc b/mysql-test/columnstore/include/detect_no_maxscale.inc new file mode 100644 index 0000000000..4701df8440 --- /dev/null +++ b/mysql-test/columnstore/include/detect_no_maxscale.inc @@ -0,0 +1,10 @@ +--disable_abort_on_error + +let $maxscale = `SELECT @is_maxscale`; + +if ($maxscale != "YES") +{ + --skip Test requires connection via Maxscale. +} + +--enable_abort_on_error diff --git a/mysql-test/columnstore/oracle/func_concat_oracle.test b/mysql-test/columnstore/oracle/func_concat_oracle.test index 3b8ac4ea9e..465eceb9a9 100644 --- a/mysql-test/columnstore/oracle/func_concat_oracle.test +++ b/mysql-test/columnstore/oracle/func_concat_oracle.test @@ -1,6 +1,9 @@ # # Testing CONCAT with null values # +--source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc + SET sql_mode=ORACLE; SET default_storage_engine=ColumnStore; diff --git a/mysql-test/columnstore/oracle/func_concat_oracle_maxscale.result b/mysql-test/columnstore/oracle/func_concat_oracle_maxscale.result new file mode 100644 index 0000000000..2efb6daffa --- /dev/null +++ b/mysql-test/columnstore/oracle/func_concat_oracle_maxscale.result @@ -0,0 +1,389 @@ +SET sql_mode=ORACLE; +SET default_storage_engine=ColumnStore; +EXPLAIN EXTENDED SELECT 'a'||'b'||'c'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(concat('a','b'),'c') AS "'a'||'b'||'c'" +EXPLAIN EXTENDED SELECT CONCAT('a'||'b'||'c'); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(concat(concat('a','b'),'c')) AS "CONCAT('a'||'b'||'c')" +SELECT '' || ''; +'' || '' + +SELECT '' || 'b'; +'' || 'b' +b +SELECT '' || NULL; +'' || NULL + +SELECT 'a' || ''; +'a' || '' +a +SELECT 'a' || 'b'; +'a' || 'b' +ab +SELECT 'a' || NULL; +'a' || NULL +a +SELECT NULL || ''; +NULL || '' + +SELECT NULL || 'b'; +NULL || 'b' +b +SELECT NULL || NULL; +NULL || NULL +NULL +SELECT '' || '' || ''; +'' || '' || '' + +SELECT '' || '' || 'c'; +'' || '' || 'c' +c +SELECT '' || '' || NULL; +'' || '' || NULL + +SELECT '' || 'b' || ''; +'' || 'b' || '' +b +SELECT '' || 'b' || 'c'; +'' || 'b' || 'c' +bc +SELECT '' || 'b' || NULL; +'' || 'b' || NULL +b +SELECT '' || NULL || ''; +'' || NULL || '' + +SELECT '' || NULL || 'c'; +'' || NULL || 'c' +c +SELECT '' || NULL || NULL; +'' || NULL || NULL + +SELECT 'a' || '' || ''; +'a' || '' || '' +a +SELECT 'a' || '' || 'c'; +'a' || '' || 'c' +ac +SELECT 'a' || '' || NULL; +'a' || '' || NULL +a +SELECT 'a' || 'b' || ''; +'a' || 'b' || '' +ab +SELECT 'a' || 'b' || 'c'; +'a' || 'b' || 'c' +abc +SELECT 'a' || 'b' || NULL; +'a' || 'b' || NULL +ab +SELECT 'a' || NULL || ''; +'a' || NULL || '' +a +SELECT 'a' || NULL || 'c'; +'a' || NULL || 'c' +ac +SELECT 'a' || NULL || NULL; +'a' || NULL || NULL +a +SELECT NULL || '' || ''; +NULL || '' || '' + +SELECT NULL || '' || 'c'; +NULL || '' || 'c' +c +SELECT NULL || '' || NULL; +NULL || '' || NULL + +SELECT NULL || 'b' || ''; +NULL || 'b' || '' +b +SELECT NULL || 'b' || 'c'; +NULL || 'b' || 'c' +bc +SELECT NULL || 'b' || NULL; +NULL || 'b' || NULL +b +SELECT NULL || NULL || ''; +NULL || NULL || '' + +SELECT NULL || NULL || 'c'; +NULL || NULL || 'c' +c +SELECT NULL || NULL || NULL; +NULL || NULL || NULL +NULL +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(10)); +INSERT INTO t1 VALUES ('', '', ''); +INSERT INTO t1 VALUES ('', '', 'c'); +INSERT INTO t1 VALUES ('', '', NULL); +INSERT INTO t1 VALUES ('', 'b', ''); +INSERT INTO t1 VALUES ('', 'b', 'c'); +INSERT INTO t1 VALUES ('', 'b', NULL); +INSERT INTO t1 VALUES ('', NULL, ''); +INSERT INTO t1 VALUES ('', NULL, 'c'); +INSERT INTO t1 VALUES ('', NULL, NULL); +INSERT INTO t1 VALUES ('a', '', ''); +INSERT INTO t1 VALUES ('a', '', 'c'); +INSERT INTO t1 VALUES ('a', '', NULL); +INSERT INTO t1 VALUES ('a', 'b', ''); +INSERT INTO t1 VALUES ('a', 'b', 'c'); +INSERT INTO t1 VALUES ('a', 'b', NULL); +INSERT INTO t1 VALUES ('a', NULL, ''); +INSERT INTO t1 VALUES ('a', NULL, 'c'); +INSERT INTO t1 VALUES ('a', NULL, NULL); +INSERT INTO t1 VALUES (NULL, '', ''); +INSERT INTO t1 VALUES (NULL, '', 'c'); +INSERT INTO t1 VALUES (NULL, '', NULL); +INSERT INTO t1 VALUES (NULL, 'b', ''); +INSERT INTO t1 VALUES (NULL, 'b', 'c'); +INSERT INTO t1 VALUES (NULL, 'b', NULL); +INSERT INTO t1 VALUES (NULL, NULL, ''); +INSERT INTO t1 VALUES (NULL, NULL, 'c'); +INSERT INTO t1 VALUES (NULL, NULL, NULL); +SELECT LENGTH(a||b||c), a||b||c FROM t1 ORDER BY a,b,c; +LENGTH(a||b||c) a||b||c +NULL NULL +0 +1 c +0 +0 +1 c +1 b +1 b +2 bc +0 +0 +1 c +0 +0 +1 c +1 b +1 b +2 bc +1 a +1 a +2 ac +1 a +1 a +2 ac +2 ab +2 ab +3 abc +SELECT LENGTH(CONCAT(a||b||c)), CONCAT(a||b||c) FROM t1 ORDER BY a,b,c; +LENGTH(CONCAT(a||b||c)) CONCAT(a||b||c) +NULL NULL +0 +1 c +0 +0 +1 c +1 b +1 b +2 bc +0 +0 +1 c +0 +0 +1 c +1 b +1 b +2 bc +1 a +1 a +2 ac +1 a +1 a +2 ac +2 ab +2 ab +3 abc +DROP TABLE t1; +# +# MDEV-12478 CONCAT function inside view casts values incorrectly with Oracle sql_mode +# +SET sql_mode=ORACLE; +CREATE VIEW v1 AS SELECT 'foo'||NULL||'bar' AS test; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE VIEW "v1" AS select concat(concat('foo',NULL),'bar') AS "test" latin1 latin1_swedish_ci +SELECT * FROM v1; +test +foobar +SET sql_mode=DEFAULT; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`testUser`@`%` SQL SECURITY DEFINER VIEW `v1` AS select oracle_schema.concat(oracle_schema.concat('foo',NULL),'bar') AS `test` latin1 latin1_swedish_ci +SELECT * FROM v1; +test +foobar +DROP VIEW v1; +SET sql_mode=DEFAULT; +CREATE VIEW v1 AS SELECT CONCAT('foo',NULL,'bar') AS test; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`testUser`@`%` SQL SECURITY DEFINER VIEW `v1` AS select concat('foo',NULL,'bar') AS `test` latin1 latin1_swedish_ci +SELECT * FROM v1; +test +NULL +SET sql_mode=ORACLE; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE VIEW "v1" AS select mariadb_schema.concat('foo',NULL,'bar') AS "test" latin1 latin1_swedish_ci +SELECT * FROM v1; +test +NULL +DROP VIEW v1; +SET sql_mode=DEFAULT; +CREATE VIEW v1 AS SELECT '0'||'1' AS test; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`testUser`@`%` SQL SECURITY DEFINER VIEW `v1` AS select '0' or '1' AS `test` latin1 latin1_swedish_ci +SELECT * FROM v1; +test +1 +SET sql_mode=ORACLE; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE VIEW "v1" AS select '0' or '1' AS "test" latin1 latin1_swedish_ci +SELECT * FROM v1; +test +1 +DROP VIEW v1; +# +# MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE +# +SELECT -1<<1||1 AS a FROM DUAL; +a +18446744073709549568 +SELECT -1||0<<1 AS a FROM DUAL; +a +18446744073709551596 +EXPLAIN EXTENDED SELECT -1<<1||1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select -1 << concat(1,1) AS "a" +EXPLAIN EXTENDED SELECT -1||0<<1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(-1,0) << 1 AS "a" +SELECT -1+1||1 AS a FROM DUAL; +a +01 +SELECT -1||0+1 AS a FROM DUAL; +a +-9 +EXPLAIN EXTENDED SELECT -1+1||1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(-1 + 1,1) AS "a" +EXPLAIN EXTENDED SELECT -1||0+1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(-1,0) + 1 AS "a" +SELECT 1*1||-1 AS a FROM DUAL; +a +1-1 +SELECT 1||1*-1 AS a FROM DUAL; +a +1-1 +EXPLAIN EXTENDED SELECT 1*1||-1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(1 * 1,-1) AS "a" +EXPLAIN EXTENDED SELECT 1||1*-1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(1,1 * -1) AS "a" +SELECT -1^1||1 AS a FROM DUAL; +a +184467440737095516141 +SELECT -1||0^1 AS a FROM DUAL; +a +-11 +EXPLAIN EXTENDED SELECT -1^1||1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(-1 ^ 1,1) AS "a" +EXPLAIN EXTENDED SELECT -1||0^1 AS a FROM DUAL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select concat(-1,0 ^ 1) AS "a" +# +# MDEV-17359 Concatenation operator || in like expression failed in sql_mode=ORACLE +# +SELECT 'abc' LIKE 'a'||'%'; +'abc' LIKE 'a'||'%' +1 +EXPLAIN EXTENDED SELECT 'abc' LIKE 'a'||'%'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abc' like concat('a','%') AS "'abc' LIKE 'a'||'%'" +SELECT 'x' FROM DUAL WHERE 11 LIKE 1||1; +x +x +SELECT 'x' FROM DUAL WHERE 1||1 LIKE 11; +x +x +SELECT 'x' FROM DUAL WHERE 1||1 LIKE 1||1; +x +x +CREATE TABLE t1 (c1 VARCHAR(10),c2 VARCHAR(10), ord INTEGER); +INSERT INTO t1 VALUES ('a', 'ab' ,1); +INSERT INTO t1 VALUES ('ab', 'ab', 2); +INSERT INTO t1 VALUES ('abc', 'ab', 3); +SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord; +c1 +ab +EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like convert(concat('%','b') using utf8mb3) order by "test"."t1"."ord" +SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord; +c1 +abc +EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like concat(concat("test"."t1"."c2",'%'),'c') order by "test"."t1"."ord" +SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%'; +x +x +EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select 'x' AS "x" from "test"."t1" where concat("test"."t1"."c1","test"."t1"."c2") like 'aa%' +SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1; +x +x +EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select 'x' AS "x" from "test"."t1" where concat("test"."t1"."c1","test"."t1"."c2") like concat("test"."t1"."c2","test"."t1"."c1") +CREATE VIEW v1 AS SELECT c1, c2, c1 LIKE c2||'_' FROM t1 ORDER BY ord; +EXPLAIN EXTENDED SELECT * FROM v1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select "test"."t1"."c1" AS "c1","test"."t1"."c2" AS "c2","test"."t1"."c1" like concat("test"."t1"."c2",'_') AS "c1 LIKE c2||'_'" from ("test"."t1") order by "test"."t1"."ord" +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/columnstore/oracle/func_concat_oracle_maxscale.test b/mysql-test/columnstore/oracle/func_concat_oracle_maxscale.test new file mode 100644 index 0000000000..a4fbe5a60e --- /dev/null +++ b/mysql-test/columnstore/oracle/func_concat_oracle_maxscale.test @@ -0,0 +1,192 @@ +# +# Testing CONCAT with null values +# +--source ../include/have_columnstore.inc +--source ../include/detect_no_maxscale.inc + + +SET sql_mode=ORACLE; +SET default_storage_engine=ColumnStore; + +EXPLAIN EXTENDED SELECT 'a'||'b'||'c'; +EXPLAIN EXTENDED SELECT CONCAT('a'||'b'||'c'); + +SELECT '' || ''; +SELECT '' || 'b'; +SELECT '' || NULL; +SELECT 'a' || ''; +SELECT 'a' || 'b'; +SELECT 'a' || NULL; +SELECT NULL || ''; +SELECT NULL || 'b'; +SELECT NULL || NULL; + +SELECT '' || '' || ''; +SELECT '' || '' || 'c'; +SELECT '' || '' || NULL; +SELECT '' || 'b' || ''; +SELECT '' || 'b' || 'c'; +SELECT '' || 'b' || NULL; +SELECT '' || NULL || ''; +SELECT '' || NULL || 'c'; +SELECT '' || NULL || NULL; + +SELECT 'a' || '' || ''; +SELECT 'a' || '' || 'c'; +SELECT 'a' || '' || NULL; +SELECT 'a' || 'b' || ''; +SELECT 'a' || 'b' || 'c'; +SELECT 'a' || 'b' || NULL; +SELECT 'a' || NULL || ''; +SELECT 'a' || NULL || 'c'; +SELECT 'a' || NULL || NULL; + +SELECT NULL || '' || ''; +SELECT NULL || '' || 'c'; +SELECT NULL || '' || NULL; +SELECT NULL || 'b' || ''; +SELECT NULL || 'b' || 'c'; +SELECT NULL || 'b' || NULL; +SELECT NULL || NULL || ''; +SELECT NULL || NULL || 'c'; +SELECT NULL || NULL || NULL; + + +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c VARCHAR(10)); + +INSERT INTO t1 VALUES ('', '', ''); +INSERT INTO t1 VALUES ('', '', 'c'); +INSERT INTO t1 VALUES ('', '', NULL); +INSERT INTO t1 VALUES ('', 'b', ''); +INSERT INTO t1 VALUES ('', 'b', 'c'); +INSERT INTO t1 VALUES ('', 'b', NULL); +INSERT INTO t1 VALUES ('', NULL, ''); +INSERT INTO t1 VALUES ('', NULL, 'c'); +INSERT INTO t1 VALUES ('', NULL, NULL); + +INSERT INTO t1 VALUES ('a', '', ''); +INSERT INTO t1 VALUES ('a', '', 'c'); +INSERT INTO t1 VALUES ('a', '', NULL); +INSERT INTO t1 VALUES ('a', 'b', ''); +INSERT INTO t1 VALUES ('a', 'b', 'c'); +INSERT INTO t1 VALUES ('a', 'b', NULL); +INSERT INTO t1 VALUES ('a', NULL, ''); +INSERT INTO t1 VALUES ('a', NULL, 'c'); +INSERT INTO t1 VALUES ('a', NULL, NULL); + +INSERT INTO t1 VALUES (NULL, '', ''); +INSERT INTO t1 VALUES (NULL, '', 'c'); +INSERT INTO t1 VALUES (NULL, '', NULL); +INSERT INTO t1 VALUES (NULL, 'b', ''); +INSERT INTO t1 VALUES (NULL, 'b', 'c'); +INSERT INTO t1 VALUES (NULL, 'b', NULL); +INSERT INTO t1 VALUES (NULL, NULL, ''); +INSERT INTO t1 VALUES (NULL, NULL, 'c'); +INSERT INTO t1 VALUES (NULL, NULL, NULL); + +SELECT LENGTH(a||b||c), a||b||c FROM t1 ORDER BY a,b,c; +SELECT LENGTH(CONCAT(a||b||c)), CONCAT(a||b||c) FROM t1 ORDER BY a,b,c; + +DROP TABLE t1; + + + + + +--echo # +--echo # MDEV-12478 CONCAT function inside view casts values incorrectly with Oracle sql_mode +--echo # + +SET sql_mode=ORACLE; +CREATE VIEW v1 AS SELECT 'foo'||NULL||'bar' AS test; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +SET sql_mode=DEFAULT; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +SET sql_mode=DEFAULT; +CREATE VIEW v1 AS SELECT CONCAT('foo',NULL,'bar') AS test; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +SET sql_mode=ORACLE; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + +SET sql_mode=DEFAULT; +CREATE VIEW v1 AS SELECT '0'||'1' AS test; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +SET sql_mode=ORACLE; +SHOW CREATE VIEW v1; +SELECT * FROM v1; +DROP VIEW v1; + + +--echo # +--echo # MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE +--echo # + +# Concatenation operator || has the same precedence with + +# (stronger than << and weaker than * ^) + +SELECT -1<<1||1 AS a FROM DUAL; +SELECT -1||0<<1 AS a FROM DUAL; + +EXPLAIN EXTENDED SELECT -1<<1||1 AS a FROM DUAL; +EXPLAIN EXTENDED SELECT -1||0<<1 AS a FROM DUAL; + +SELECT -1+1||1 AS a FROM DUAL; +SELECT -1||0+1 AS a FROM DUAL; + +EXPLAIN EXTENDED SELECT -1+1||1 AS a FROM DUAL; +EXPLAIN EXTENDED SELECT -1||0+1 AS a FROM DUAL; + +SELECT 1*1||-1 AS a FROM DUAL; +SELECT 1||1*-1 AS a FROM DUAL; + +EXPLAIN EXTENDED SELECT 1*1||-1 AS a FROM DUAL; +EXPLAIN EXTENDED SELECT 1||1*-1 AS a FROM DUAL; + +SELECT -1^1||1 AS a FROM DUAL; +SELECT -1||0^1 AS a FROM DUAL; + +EXPLAIN EXTENDED SELECT -1^1||1 AS a FROM DUAL; +EXPLAIN EXTENDED SELECT -1||0^1 AS a FROM DUAL; + + +--echo # +--echo # MDEV-17359 Concatenation operator || in like expression failed in sql_mode=ORACLE +--echo # + +SELECT 'abc' LIKE 'a'||'%'; +EXPLAIN EXTENDED SELECT 'abc' LIKE 'a'||'%'; + +SELECT 'x' FROM DUAL WHERE 11 LIKE 1||1; +SELECT 'x' FROM DUAL WHERE 1||1 LIKE 11; +SELECT 'x' FROM DUAL WHERE 1||1 LIKE 1||1; + +CREATE TABLE t1 (c1 VARCHAR(10),c2 VARCHAR(10), ord INTEGER); +INSERT INTO t1 VALUES ('a', 'ab' ,1); +INSERT INTO t1 VALUES ('ab', 'ab', 2); +INSERT INTO t1 VALUES ('abc', 'ab', 3); + +SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord; +EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE '%'||'b' ORDER BY ord; + +SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord; +EXPLAIN EXTENDED SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord; + +SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%'; +EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%'; + +SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1; +EXPLAIN EXTENDED SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1; + +CREATE VIEW v1 AS SELECT c1, c2, c1 LIKE c2||'_' FROM t1 ORDER BY ord; +EXPLAIN EXTENDED SELECT * FROM v1; + +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/columnstore/setup/regression_env_setup.test b/mysql-test/columnstore/setup/regression_env_setup.test index f184584e78..49c37618ec 100644 --- a/mysql-test/columnstore/setup/regression_env_setup.test +++ b/mysql-test/columnstore/setup/regression_env_setup.test @@ -7,6 +7,7 @@ # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc +--source ../include/detect_maxscale.inc # --disable_warnings DROP DATABASE IF EXISTS tpch1m;