diff --git a/query_classifier/test/CMakeLists.txt b/query_classifier/test/CMakeLists.txt index abea676a4..26cd98af7 100644 --- a/query_classifier/test/CMakeLists.txt +++ b/query_classifier/test/CMakeLists.txt @@ -49,6 +49,7 @@ if (BUILD_QC_MYSQLEMBEDDED) add_test(TestQC_Oracle-func_case compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/func_case.test) add_test(TestQC_Oracle-func_concat compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/func_concat.test) add_test(TestQC_Oracle-func_decode compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/func_decode.test) + add_test(TestQC_Oracle-func_length compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/func_length.test) add_test(TestQC_Oracle-func_misc compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/func_misc.test) add_test(TestQC_Oracle-misc compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/misc.test) add_test(TestQC_Oracle-ps compare -v 2 ${CMAKE_CURRENT_SOURCE_DIR}/oracle/ps.test) diff --git a/query_classifier/test/oracle/binlog_stm_ps.test b/query_classifier/test/oracle/binlog_stm_ps.test index 9e6de0121..42a54553b 100644 --- a/query_classifier/test/oracle/binlog_stm_ps.test +++ b/query_classifier/test/oracle/binlog_stm_ps.test @@ -2,7 +2,7 @@ --source include/have_binlog_format_statement.inc --disable_query_log -//qc_sqlite: reset master; # get rid of previous tests binlog +#qc_sqlite: reset master; # get rid of previous tests binlog --enable_query_log SET sql_mode=ORACLE; diff --git a/query_classifier/test/oracle/func_length.test b/query_classifier/test/oracle/func_length.test new file mode 100644 index 000000000..7b76d33a0 --- /dev/null +++ b/query_classifier/test/oracle/func_length.test @@ -0,0 +1,18 @@ +SET sql_mode=ORACLE; + +--echo # +--echo # MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB() +--echo # +# +# Testing LENGTH / LENGTHB +# +# LENGTH : return the length of char +# LENGTHB : return the length of byte + + +SELECT LENGTH(null), LENGTH('a'), LENGTH(123); +SELECT LENGTHB(null), LENGTHB('a'), LENGTHB(123); + +SELECT LENGTH(_utf8 0xC39F), LENGTH(CHAR(14844588 USING utf8)); +SELECT LENGTHB(_utf8 0xC39F), LENGTHB(CHAR(14844588 USING utf8)); +EXPLAIN EXTENDED SELECT LENGTH('a'), LENGTHB('a'); diff --git a/query_classifier/test/oracle/func_misc.test b/query_classifier/test/oracle/func_misc.test index a356d7040..c5b42134f 100644 --- a/query_classifier/test/oracle/func_misc.test +++ b/query_classifier/test/oracle/func_misc.test @@ -329,3 +329,18 @@ DROP TABLE t1; --echo # --echo # End of MDEV-10578 sql_mode=ORACLE: SP control functions SQLCODE, SQLERRM --echo # + +--echo # +--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions +--echo # + +--enable_metadata +--disable_ps_protocol +DELIMITER $$; +BEGIN + SELECT SQLCODE; +END +$$ +DELIMITER ;$$ +--enable_ps_protocol +--disable_metadata diff --git a/query_classifier/test/oracle/sp-cursor-decl.test b/query_classifier/test/oracle/sp-cursor-decl.test index dd90cd8b8..21683dd42 100644 --- a/query_classifier/test/oracle/sp-cursor-decl.test +++ b/query_classifier/test/oracle/sp-cursor-decl.test @@ -272,3 +272,24 @@ $$ DELIMITER ;$$ CALL p1(); DROP PROCEDURE p1; + + +--echo # +--echo # MDEV-12916 Wrong column data type for an INT field of a cursor-anchored ROW variable +--echo # + +DELIMITER $$; +CREATE PROCEDURE p1 +AS + a INT DEFAULT 10; + CURSOR cur1 IS SELECT a; + rec1 cur1%ROWTYPE; +BEGIN + CREATE TABLE t1 AS SELECT rec1.a; + SHOW CREATE TABLE t1; + DROP TABLE t1; +END; +$$ +DELIMITER ;$$ +CALL p1(); +DROP PROCEDURE p1; diff --git a/query_classifier/test/oracle/sp-cursor-rowtype.test b/query_classifier/test/oracle/sp-cursor-rowtype.test index ad81d4ebc..3061577ae 100644 --- a/query_classifier/test/oracle/sp-cursor-rowtype.test +++ b/query_classifier/test/oracle/sp-cursor-rowtype.test @@ -982,6 +982,7 @@ BEGIN OPEN cur; FETCH cur INTO rec; CLOSE cur; + # qc_sqlite: SELECT rec.a, rec."CONCAT(a,'a')", rec."CONCAT(a,'ö')"; SELECT rec.a, rec.CONCAT(a,'a'), rec.CONCAT(a,'ö'); END; END; diff --git a/query_classifier/test/oracle/sp-cursor.test b/query_classifier/test/oracle/sp-cursor.test index ff9ad78e6..5a8b7b69f 100644 --- a/query_classifier/test/oracle/sp-cursor.test +++ b/query_classifier/test/oracle/sp-cursor.test @@ -929,3 +929,26 @@ DELIMITER ;$$ CALL p1(); DROP PROCEDURE p1; DROP TABLE t1; + +--echo # +--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions +--echo # + +--enable_metadata +--disable_ps_protocol +DELIMITER $$; +DECLARE + CURSOR c IS SELECT 1 AS c FROM DUAL; +BEGIN + OPEN c; + SELECT + c%ISOPEN, + c%NOTFOUND, + c%FOUND, + c%ROWCOUNT; + CLOSE c; +END; +$$ +DELIMITER ;$$ +--enable_ps_protocol +--disable_metadata diff --git a/query_classifier/test/oracle/sp.test b/query_classifier/test/oracle/sp.test index 9e1374058..4717ebef8 100644 --- a/query_classifier/test/oracle/sp.test +++ b/query_classifier/test/oracle/sp.test @@ -2120,3 +2120,14 @@ CALL p3; DROP PROCEDURE p3; DROP PROCEDURE p2; DROP PROCEDURE p1; + + +--echo # +--echo # MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions +--echo # + +--enable_metadata +--disable_ps_protocol +SELECT SQL%ROWCOUNT; +--enable_ps_protocol +--disable_metadata