summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-04-04 14:50:21 +0400
committerAlexander Barkov <bar@mariadb.com>2022-04-22 15:35:16 +0400
commitd67c3f88883b616a9adf3abba43938c3a07a5eee (patch)
tree867038a8f48d10aec46f2f2f99d0d03f63f365e3
parent7355f7b1f5cec0f3db60053941d0c78288917c43 (diff)
downloadmariadb-git-bb-10.3-bar.tar.gz
MDEV-27744 InnoDB: Failing assertion: !cursor->index->is_committed() in row0ins.cc (from row_ins_sec_index_entry_by_modify) | Assertion `0' failed in row_upd_sec_index_entry (debug) | Corruptionbb-10.3-bar
The crash happened with an indexed virtual column whose value is evaluated using a function that has a different meaning in sql_mode='' vs sql_mode=ORACLE: - DECODE() - LTRIM() - RTRIM() - LPAD() - RPAD() - REPLACE() - SUBSTR() For example: CREATE TABLE t1 ( b VARCHAR(1), g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL, KEY g(g) ); So far we had replacement XXX_ORACLE() functions for all mentioned function, e.g. SUBSTR_ORACLE() for SUBSTR(). So it was possible to correctly re-parse SUBSTR_ORACLE() even in sql_mode=''. But it was not possible to re-parse the MariaDB version of SUBSTR() after switching to sql_mode=ORACLE. It was erroneously mis-interpreted as SUBSTR_ORACLE(). As a result, this combination worked fine: SET sql_mode=ORACLE; CREATE TABLE t1 ... g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL, ...; INSERT ... FLUSH TABLES; SET sql_mode=''; INSERT ... But the other way around it crashed: SET sql_mode=''; CREATE TABLE t1 ... g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL, ...; INSERT ... FLUSH TABLES; SET sql_mode=ORACLE; INSERT ... At CREATE time, SUBSTR was instantiated as Item_func_substr and printed in the FRM file as substr(). At re-open time with sql_mode=ORACLE, "substr()" was erroneously instantiated as Item_func_substr_oracle. Fix: The fix proposes a symmetric solution. It provides a way to re-parse reliably all sql_mode dependent functions to their original CREATE TABLE time meaning, no matter what the open-time sql_mode is. We take advantage of the same idea we previously used to resolve sql_mode dependent data types. Now all sql_mode dependent functions are printed by SHOW using a schema qualifier when the current sql_mode differs from the function sql_mode: SET sql_mode=''; CREATE TABLE t1 ... SUBSTR(a,b,c) ..; SET sql_mode=ORACLE; SHOW CREATE TABLE t1; -> mariadb_schema.substr(a,b,c) SET sql_mode=ORACLE; CREATE TABLE t2 ... SUBSTR(a,b,c) ..; SET sql_mode=''; SHOW CREATE TABLE t1; -> oracle_schema.substr(a,b,c) Old replacement names like substr_oracle() are still understood for backward compatibility and used in FRM files (for downgrade compatibility), but they are not printed by SHOW any more.
-rw-r--r--include/m_ctype.h3
-rw-r--r--mysql-test/main/ansi.result16
-rw-r--r--mysql-test/main/compare.result4
-rw-r--r--mysql-test/main/ctype_binary.result4
-rw-r--r--mysql-test/main/ctype_cp1250_ch.result8
-rw-r--r--mysql-test/main/ctype_cp1251.result2
-rw-r--r--mysql-test/main/ctype_latin1.result18
-rw-r--r--mysql-test/main/ctype_latin2_ch.result8
-rw-r--r--mysql-test/main/ctype_tis620.result16
-rw-r--r--mysql-test/main/ctype_uca.result20
-rw-r--r--mysql-test/main/ctype_ucs.result18
-rw-r--r--mysql-test/main/ctype_utf8.result20
-rw-r--r--mysql-test/main/func_like.result2
-rw-r--r--mysql-test/main/func_str.result36
-rw-r--r--mysql-test/main/keywords.result24
-rw-r--r--mysql-test/main/null.result4
-rw-r--r--mysql-test/main/order_by.result2
-rw-r--r--mysql-test/main/precedence.result124
-rw-r--r--mysql-test/main/selectivity.result4
-rw-r--r--mysql-test/main/subselect_mat.result10
-rw-r--r--mysql-test/main/subselect_sj_mat.result10
-rw-r--r--mysql-test/main/type_date.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/func_concat.result38
-rw-r--r--mysql-test/suite/compat/oracle/r/func_decode.result24
-rw-r--r--mysql-test/suite/compat/oracle/r/func_pad.result4
-rw-r--r--mysql-test/suite/compat/oracle/r/func_qualified.result2027
-rw-r--r--mysql-test/suite/compat/oracle/r/func_replace.result4
-rw-r--r--mysql-test/suite/compat/oracle/r/func_substr.result4
-rw-r--r--mysql-test/suite/compat/oracle/r/func_trim.result6
-rw-r--r--mysql-test/suite/compat/oracle/r/ps.result4
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/vcol_innodb.result51
-rw-r--r--mysql-test/suite/compat/oracle/t/func_decode.test8
-rw-r--r--mysql-test/suite/compat/oracle/t/func_qualified.test224
-rw-r--r--mysql-test/suite/compat/oracle/t/vcol_innodb.test43
-rw-r--r--plugin/versioning/versioning.cc6
-rw-r--r--sql/item.h12
-rw-r--r--sql/item_cmpfunc.cc17
-rw-r--r--sql/item_cmpfunc.h5
-rw-r--r--sql/item_create.cc323
-rw-r--r--sql/item_create.h53
-rw-r--r--sql/item_func.cc14
-rw-r--r--sql/item_func.h115
-rw-r--r--sql/item_strfunc.cc81
-rw-r--r--sql/item_strfunc.h87
-rw-r--r--sql/lex.h1
-rw-r--r--sql/mysqld.h15
-rw-r--r--sql/sql_class.h44
-rw-r--r--sql/sql_lex.cc189
-rw-r--r--sql/sql_lex.h37
-rw-r--r--sql/sql_partition.cc4
-rw-r--r--sql/sql_schema.cc94
-rw-r--r--sql/sql_schema.h32
-rw-r--r--sql/sql_show.cc3
-rw-r--r--sql/sql_view.cc43
-rw-r--r--sql/sql_yacc.yy126
-rw-r--r--sql/sql_yacc_ora.yy114
-rw-r--r--sql/structs.h24
-rw-r--r--sql/table.cc4
-rw-r--r--sql/unireg.cc4
60 files changed, 3569 insertions, 672 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 1cdff1f54cc..ddcefe84096 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -302,7 +302,8 @@ enum my_lex_states
MY_LEX_IDENT_OR_KEYWORD,
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
MY_LEX_STRING_OR_DELIMITER, MY_LEX_MINUS_OR_COMMENT, MY_LEX_PLACEHOLDER,
- MY_LEX_COMMA
+ MY_LEX_COMMA,
+ MY_LEX_IDENT_OR_QUALIFIED_SPECIAL_FUNC
};
struct charset_info_st;
diff --git a/mysql-test/main/ansi.result b/mysql-test/main/ansi.result
index 810168cc3bd..ee1aac5d221 100644
--- a/mysql-test/main/ansi.result
+++ b/mysql-test/main/ansi.result
@@ -60,12 +60,12 @@ 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"
+Note 1003 select -1 << mariadb_schema.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"
+Note 1003 select mariadb_schema.concat(-1,0) << 1 AS "a"
SELECT -1+1||1 AS a FROM DUAL;
a
10
@@ -76,12 +76,12 @@ 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"
+Note 1003 select -1 + mariadb_schema.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"
+Note 1003 select mariadb_schema.concat(-1,0) + 1 AS "a"
SELECT 1*1||-1 AS a FROM DUAL;
a
1
@@ -94,12 +94,12 @@ 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"
+Note 1003 select 1 * mariadb_schema.concat(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"
+Note 1003 select mariadb_schema.concat(1,1) * -1 AS "a"
SELECT -1^1||1 AS a FROM DUAL;
a
18446744073709551604
@@ -110,9 +110,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 -1 ^ concat(1,1) AS "a"
+Note 1003 select -1 ^ mariadb_schema.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"
+Note 1003 select mariadb_schema.concat(-1,0) ^ 1 AS "a"
diff --git a/mysql-test/main/compare.result b/mysql-test/main/compare.result
index c4650014326..bdfa8ede6f6 100644
--- a/mysql-test/main/compare.result
+++ b/mysql-test/main/compare.result
@@ -64,7 +64,7 @@ EXPLAIN EXTENDED SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`b` = 1 and concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = '0101'
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`b` = 1 and mariadb_schema.concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = '0101'
SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101';
b c
01 01
@@ -88,7 +88,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`>((/* select#2 */ select count(0) from `test`.`t1` where `test`.`t1`.`b` = `test`.`t2`.`a` and concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01'))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`>((/* select#2 */ select count(0) from `test`.`t1` where `test`.`t1`.`b` = `test`.`t2`.`a` and mariadb_schema.concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = mariadb_schema.concat('0',`test`.`t2`.`a`,'01'))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
DROP TABLE t1,t2;
CREATE TABLE t1 (a TIMESTAMP);
INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
diff --git a/mysql-test/main/ctype_binary.result b/mysql-test/main/ctype_binary.result
index 7904cade58e..929c1a6d45d 100644
--- a/mysql-test/main/ctype_binary.result
+++ b/mysql-test/main/ctype_binary.result
@@ -2874,7 +2874,7 @@ Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate
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(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
+Note 1003 select mariadb_schema.concat(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion
@@ -3015,7 +3015,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
diff --git a/mysql-test/main/ctype_cp1250_ch.result b/mysql-test/main/ctype_cp1250_ch.result
index 5799331f73e..3eeb5f8315f 100644
--- a/mysql-test/main/ctype_cp1250_ch.result
+++ b/mysql-test/main/ctype_cp1250_ch.result
@@ -129,7 +129,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -152,7 +152,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -175,7 +175,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -198,7 +198,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
diff --git a/mysql-test/main/ctype_cp1251.result b/mysql-test/main/ctype_cp1251.result
index 643fefef02b..e60c6040cbf 100644
--- a/mysql-test/main/ctype_cp1251.result
+++ b/mysql-test/main/ctype_cp1251.result
@@ -3283,7 +3283,7 @@ Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate
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(convert(v_LastPaymentDate@0 using cp1251),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
+Note 1003 select mariadb_schema.concat(convert(v_LastPaymentDate@0 using cp1251),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion
diff --git a/mysql-test/main/ctype_latin1.result b/mysql-test/main/ctype_latin1.result
index d4d4423220e..f2c4f413a2e 100644
--- a/mysql-test/main/ctype_latin1.result
+++ b/mysql-test/main/ctype_latin1.result
@@ -3592,7 +3592,7 @@ Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate
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(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
+Note 1003 select mariadb_schema.concat(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion
@@ -7738,7 +7738,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -7761,7 +7761,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -7784,7 +7784,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -7807,7 +7807,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -7859,7 +7859,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -7882,7 +7882,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -7905,7 +7905,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -7928,7 +7928,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
diff --git a/mysql-test/main/ctype_latin2_ch.result b/mysql-test/main/ctype_latin2_ch.result
index 962c29f7ab4..fbaa17ff6d9 100644
--- a/mysql-test/main/ctype_latin2_ch.result
+++ b/mysql-test/main/ctype_latin2_ch.result
@@ -71,7 +71,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -94,7 +94,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -117,7 +117,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -140,7 +140,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
diff --git a/mysql-test/main/ctype_tis620.result b/mysql-test/main/ctype_tis620.result
index d0c30a112e3..0fae6f99ed5 100644
--- a/mysql-test/main/ctype_tis620.result
+++ b/mysql-test/main/ctype_tis620.result
@@ -3145,7 +3145,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -3168,7 +3168,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -3191,7 +3191,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -3214,7 +3214,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -3367,7 +3367,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -3390,7 +3390,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -3413,7 +3413,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -3436,7 +3436,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
diff --git a/mysql-test/main/ctype_uca.result b/mysql-test/main/ctype_uca.result
index d4b242d035f..09d8ed88a2e 100644
--- a/mysql-test/main/ctype_uca.result
+++ b/mysql-test/main/ctype_uca.result
@@ -8428,7 +8428,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -8451,7 +8451,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -8474,7 +8474,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -8497,7 +8497,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -8559,7 +8559,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'ä' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'ae'
DROP TABLE IF EXISTS t1;
SET NAMES utf8 COLLATE utf8_german2_ci;
#
@@ -8586,7 +8586,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -8609,7 +8609,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -8632,7 +8632,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -8655,7 +8655,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -8721,7 +8721,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'ä' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'ae'
DROP TABLE IF EXISTS t1;
#
# MDEV-4929 Myanmar collation
diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result
index 419bb7ae9e0..cab2f89d3f1 100644
--- a/mysql-test/main/ctype_ucs.result
+++ b/mysql-test/main/ctype_ucs.result
@@ -4472,7 +4472,7 @@ Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate
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(convert(v_LastPaymentDate@0 using ucs2),convert(current_timestamp() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())`
+Note 1003 select mariadb_schema.concat(convert(v_LastPaymentDate@0 using ucs2),convert(current_timestamp() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion
@@ -5450,7 +5450,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -5473,7 +5473,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -5496,7 +5496,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -5519,7 +5519,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -5571,7 +5571,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -5594,7 +5594,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -5617,7 +5617,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -5640,7 +5640,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result
index 9a7bb2119ae..43b3d055c1a 100644
--- a/mysql-test/main/ctype_utf8.result
+++ b/mysql-test/main/ctype_utf8.result
@@ -5343,7 +5343,7 @@ Note 1003 select v_LastPaymentDate@0 < current_timestamp() AS `v_LastPaymentDate
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(convert(v_LastPaymentDate@0 using utf8),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
+Note 1003 select mariadb_schema.concat(convert(v_LastPaymentDate@0 using utf8),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion
@@ -6806,7 +6806,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -6829,7 +6829,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -6852,7 +6852,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -6875,7 +6875,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -6927,7 +6927,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'a' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'a '
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -6950,7 +6950,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a ' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -6973,7 +6973,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
@@ -6996,7 +6996,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = mariadb_schema.concat(`test`.`t1`.`c1`) and 'a' like mariadb_schema.concat(`test`.`t1`.`c1`)
DROP TABLE t1;
#
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
@@ -7058,7 +7058,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
+Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where mariadb_schema.concat(`test`.`t1`.`c1`) = 'ä' and mariadb_schema.concat(`test`.`t1`.`c1`) like 'ae'
DROP TABLE IF EXISTS t1;
#
# MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)
diff --git a/mysql-test/main/func_like.result b/mysql-test/main/func_like.result
index 69387b3bb11..d1a1b24623e 100644
--- a/mysql-test/main/func_like.result
+++ b/mysql-test/main/func_like.result
@@ -10,7 +10,7 @@ explain extended select * from t1 where a like concat('abc','%');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index a a 13 NULL 5 20.00 Using where; Using index
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like <cache>(concat('abc','%'))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like <cache>(mariadb_schema.concat('abc','%'))
select * from t1 where a like "abc%";
a
abc
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result
index a7168567115..cc31e7f07f2 100644
--- a/mysql-test/main/func_str.result
+++ b/mysql-test/main/func_str.result
@@ -867,7 +867,7 @@ explain extended select concat('*',space(5),'*');
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('*',space(5),'*') AS `concat('*',space(5),'*')`
+Note 1003 select mariadb_schema.concat('*',space(5),'*') AS `concat('*',space(5),'*')`
explain extended select reverse('abc');
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
@@ -877,22 +877,22 @@ explain extended select rpad('a',4,'1');
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 rpad('a',4,'1') AS `rpad('a',4,'1')`
+Note 1003 select mariadb_schema.rpad('a',4,'1') AS `rpad('a',4,'1')`
explain extended select lpad('a',4,'1');
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 lpad('a',4,'1') AS `lpad('a',4,'1')`
+Note 1003 select mariadb_schema.lpad('a',4,'1') AS `lpad('a',4,'1')`
explain extended select rpad('a',4);
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 rpad('a',4) AS `rpad('a',4)`
+Note 1003 select mariadb_schema.rpad('a',4) AS `rpad('a',4)`
explain extended select lpad('a',4);
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 lpad('a',4) AS `lpad('a',4)`
+Note 1003 select mariadb_schema.lpad('a',4) AS `lpad('a',4)`
explain extended select concat_ws(',','',NULL,'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
@@ -982,7 +982,7 @@ explain extended select concat('monty',' was here ','again');
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('monty',' was here ','again') AS `concat('monty',' was here ','again')`
+Note 1003 select mariadb_schema.concat('monty',' was here ','again') AS `concat('monty',' was here ','again')`
explain extended select length('hello');
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
@@ -1012,7 +1012,7 @@ explain extended select replace('aaaa','a','b');
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 replace('aaaa','a','b') AS `replace('aaaa','a','b')`
+Note 1003 select mariadb_schema.replace('aaaa','a','b') AS `replace('aaaa','a','b')`
explain extended select insert('txs',2,1,'hi');
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
@@ -1042,7 +1042,7 @@ explain extended select SUBSTR('abcdefg',3,2);
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 substr('abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`
+Note 1003 select mariadb_schema.substr('abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`
explain extended select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2);
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
@@ -1052,22 +1052,22 @@ explain extended select trim(_latin2' 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 trim(_latin2' a ') AS `trim(_latin2' a ')`
+Note 1003 select mariadb_schema.trim(_latin2' a ') AS `trim(_latin2' a ')`
explain extended select ltrim(_latin2' 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 ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`
+Note 1003 select mariadb_schema.ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`
explain extended select rtrim(_latin2' 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 rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`
+Note 1003 select mariadb_schema.rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`
explain extended select decode(encode(repeat("a",100000),"monty"),"monty");
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 decode(encode(repeat('a',100000),'monty'),'monty') AS `decode(encode(repeat("a",100000),"monty"),"monty")`
+Note 1003 select mariadb_schema.decode(encode(repeat('a',100000),'monty'),'monty') AS `decode(encode(repeat("a",100000),"monty"),"monty")`
SELECT lpad(12345, 5, "#");
lpad(12345, 5, "#")
12345
@@ -1316,27 +1316,27 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(`test`.`t1`.`s`) > 'ab'
+Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where mariadb_schema.trim(`test`.`t1`.`s`) > 'ab'
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(both 'y' from `test`.`t1`.`s`) > 'ab'
+Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where mariadb_schema.trim(both 'y' from `test`.`t1`.`s`) > 'ab'
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(leading 'y' from `test`.`t1`.`s`) > 'ab'
+Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where mariadb_schema.trim(leading 'y' from `test`.`t1`.`s`) > 'ab'
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(trailing 'y' from `test`.`t1`.`s`) > 'ab'
+Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where mariadb_schema.trim(trailing 'y' from `test`.`t1`.`s`) > 'ab'
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where trim(both 'y' from `test`.`t1`.`s`) > 'ab'
+Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where mariadb_schema.trim(both 'y' from `test`.`t1`.`s`) > 'ab'
DROP TABLE t1;
create table t1(f1 varchar(4));
explain extended select encode(f1,'zxcv') as 'enc' from t1;
@@ -1348,7 +1348,7 @@ explain extended select decode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found
Warnings:
-Note 1003 select decode(NULL,'zxcv') AS `enc` from `test`.`t1`
+Note 1003 select mariadb_schema.decode(NULL,'zxcv') AS `enc` from `test`.`t1`
drop table t1;
create table t1 (a bigint not null)engine=myisam;
insert into t1 set a = 1024*1024*1024*4;
diff --git a/mysql-test/main/keywords.result b/mysql-test/main/keywords.result
index 8db364ac156..1029d4f0966 100644
--- a/mysql-test/main/keywords.result
+++ b/mysql-test/main/keywords.result
@@ -500,21 +500,21 @@ SELECT @@global.rpad(); -- Unknown system variable 'rpad'
--------
SELECT @@global.adddate(); -- Unknown system variable 'adddate'
--------
-SELECT @@global.substr(); -- Unknown system variable 'substr'
+SELECT @@global.substr(); -- ..syntax.. near 'substr()' at line 1
--------
-SELECT @@global.substring(); -- Unknown system variable 'substring'
+SELECT @@global.substring(); -- ..syntax.. near 'substring()' at line 1
--------
SELECT @@global.trim_oracle(); -- Unknown system variable 'trim_oracle'
--------
SELECT @@global.ascii(); -- Unknown system variable 'ascii'
--------
-SELECT @@global.replace(); -- Unknown system variable 'replace'
+SELECT @@global.replace(); -- ..syntax.. near 'replace()' at line 1
--------
SELECT @@global.weight_string(); -- Unknown system variable 'weight_string'
--------
SELECT @@global.char(); -- Unknown system variable 'char'
--------
-SELECT @@global.trim(); -- Unknown system variable 'trim'
+SELECT @@global.trim(); -- ..syntax.. near 'trim()' at line 1
--------
SELECT @@global.year(); -- Unknown system variable 'year'
--------
@@ -558,21 +558,21 @@ SELECT test.rpad(); -- FUNCTION test.rpad does not exist
--------
SELECT test.adddate(); -- FUNCTION test.adddate does not exist. Ch
--------
-SELECT test.substr(); -- FUNCTION test.substr does not exist. Che
+SELECT test.substr(); -- ..syntax.. near ')' at line 1
--------
-SELECT test.substring(); -- FUNCTION test.substring does not exist.
+SELECT test.substring(); -- ..syntax.. near ')' at line 1
--------
SELECT test.trim_oracle(); -- FUNCTION test.trim_oracle does not exist
--------
SELECT test.ascii(); -- FUNCTION test.ascii does not exist. Chec
--------
-SELECT test.replace(); -- FUNCTION test.replace does not exist. Ch
+SELECT test.replace(); -- ..syntax.. near ')' at line 1
--------
SELECT test.weight_string(); -- FUNCTION test.weight_string does not exi
--------
SELECT test.char(); -- FUNCTION test.char does not exist. Check
--------
-SELECT test.trim(); -- FUNCTION test.trim does not exist. Check
+SELECT test.trim(); -- ..syntax.. near ')' at line 1
--------
SELECT test.year(); -- FUNCTION test.year does not exist. Check
--------
@@ -732,21 +732,21 @@ CREATE FUNCTION test.rpad() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
CREATE FUNCTION test.adddate() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
-CREATE FUNCTION test.substr() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
+CREATE FUNCTION test.substr() RETURNS OOPS; -- ..syntax.. near 'substr() RETURNS OOPS'
--------
-CREATE FUNCTION test.substring() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
+CREATE FUNCTION test.substring() RETURNS OOPS; -- ..syntax.. near 'substring() RETURNS OOP
--------
CREATE FUNCTION test.trim_oracle() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
CREATE FUNCTION test.ascii() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
-CREATE FUNCTION test.replace() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
+CREATE FUNCTION test.replace() RETURNS OOPS; -- ..syntax.. near 'replace() RETURNS OOPS'
--------
CREATE FUNCTION test.weight_string() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
CREATE FUNCTION test.char() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
-CREATE FUNCTION test.trim() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
+CREATE FUNCTION test.trim() RETURNS OOPS; -- ..syntax.. near 'trim() RETURNS OOPS' at
--------
CREATE FUNCTION test.year() RETURNS OOPS; -- ..syntax.. near 'OOPS' at line 1
--------
diff --git a/mysql-test/main/null.result b/mysql-test/main/null.result
index 2fa89a2d001..f5dfaa58f5e 100644
--- a/mysql-test/main/null.result
+++ b/mysql-test/main/null.result
@@ -1689,7 +1689,7 @@ SELECT * FROM t1 WHERE a=10 AND NULLIF(a,2011.1)=CONCAT('2011',RAND());
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 and (case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = concat('2011',rand())
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010 and (case when 2010 = 2011 then NULL else `test`.`t1`.`a` end) = mariadb_schema.concat('2011',rand())
DROP TABLE t1;
#
# MDEV-8754 Wrong result for SELECT..WHERE year_field=2020 AND NULLIF(year_field,2010)='2020'
@@ -1716,7 +1716,7 @@ SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)=CONCAT('2020',RAND());
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2020 and (case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = concat('2020',rand())
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2020 and (case when 2020 = 2010 then NULL else `test`.`t1`.`a` end) = mariadb_schema.concat('2020',rand())
DROP TABLE t1;
#
# MDEV-9181 (NULLIF(count(table.col)), 0) gives wrong result on 10.1.x
diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result
index 214d848981a..140aeb8f561 100644
--- a/mysql-test/main/order_by.result
+++ b/mysql-test/main/order_by.result
@@ -2994,7 +2994,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3a ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
1 PRIMARY t3b ref f3_key f3_key 6 test.t3a.f3 1 100.00 Using where; End temporary
Warnings:
-Note 1003 select concat('foo',`test`.`t2`.`f2`) AS `field` from `test`.`t2` semi join ((`test`.`t3` `t3a` join `test`.`t3` `t3b`)) where `test`.`t3a`.`f3` < 'foo' or `test`.`t3b`.`f3` <> 'foo' order by concat('foo',`test`.`t2`.`f2`)
+Note 1003 select mariadb_schema.concat('foo',`test`.`t2`.`f2`) AS `field` from `test`.`t2` semi join ((`test`.`t3` `t3a` join `test`.`t3` `t3b`)) where `test`.`t3a`.`f3` < 'foo' or `test`.`t3b`.`f3` <> 'foo' order by mariadb_schema.concat('foo',`test`.`t2`.`f2`)
DROP TABLE t1,t2,t3;
End of 5.5 tests
#
diff --git a/mysql-test/main/precedence.result b/mysql-test/main/precedence.result
index fc6579651b4..2ae909eed5a 100644
--- a/mysql-test/main/precedence.result
+++ b/mysql-test/main/precedence.result
@@ -7541,434 +7541,434 @@ set sql_mode=PIPES_AS_CONCAT;
create or replace view v1 as select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 or concat(3,3) AS `2 OR 3 || 3`,2 or concat(3,3) AS `2 OR (3 || 3)`,concat(2 or 3,3) AS `(2 OR 3) || 3`
+select 2 or mariadb_schema.concat(3,3) AS `2 OR 3 || 3`,2 or mariadb_schema.concat(3,3) AS `2 OR (3 || 3)`,mariadb_schema.concat(2 or 3,3) AS `(2 OR 3) || 3`
select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3 union select * from v1;
2 OR 3 || 3 2 OR (3 || 3) (2 OR 3) || 3
1 1 13
create or replace view v1 as select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) or 3 AS `2 || 3 OR 3`,concat(2,3 or 3) AS `2 || (3 OR 3)`,concat(2,3) or 3 AS `(2 || 3) OR 3`
+select mariadb_schema.concat(2,3) or 3 AS `2 || 3 OR 3`,mariadb_schema.concat(2,3 or 3) AS `2 || (3 OR 3)`,mariadb_schema.concat(2,3) or 3 AS `(2 || 3) OR 3`
select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3 union select * from v1;
2 || 3 OR 3 2 || (3 OR 3) (2 || 3) OR 3
1 21 1
create or replace view v1 as select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select !concat(2,3) AS `NOT 2 || 3`,!concat(2,3) AS `NOT (2 || 3)`,concat(!2,3) AS `(NOT 2) || 3`
+select !mariadb_schema.concat(2,3) AS `NOT 2 || 3`,!mariadb_schema.concat(2,3) AS `NOT (2 || 3)`,mariadb_schema.concat(!2,3) AS `(NOT 2) || 3`
select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3 union select * from v1;
NOT 2 || 3 NOT (2 || 3) (NOT 2) || 3
0 0 03
create or replace view v1 as select - '2 ' || 3, - ('2 ' || 3), (- '2 ') || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(-'2 ',3) AS `- '2 ' || 3`,-concat('2 ',3) AS `- ('2 ' || 3)`,concat(-'2 ',3) AS `(- '2 ') || 3`
+select mariadb_schema.concat(-'2 ',3) AS `- '2 ' || 3`,-mariadb_schema.concat('2 ',3) AS `- ('2 ' || 3)`,mariadb_schema.concat(-'2 ',3) AS `(- '2 ') || 3`
select - '2 ' || 3, - ('2 ' || 3), (- '2 ') || 3 union select * from v1;
- '2 ' || 3 - ('2 ' || 3) (- '2 ') || 3
-23 -2 -23
create or replace view v1 as select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(~2,3) AS `~ 2 || 3`,~concat(2,3) AS `~ (2 || 3)`,concat(~2,3) AS `(~ 2) || 3`
+select mariadb_schema.concat(~2,3) AS `~ 2 || 3`,~mariadb_schema.concat(2,3) AS `~ (2 || 3)`,mariadb_schema.concat(~2,3) AS `(~ 2) || 3`
select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3 union select * from v1;
~ 2 || 3 ~ (2 || 3) (~ 2) || 3
184467440737095516133 18446744073709551592 184467440737095516133
create or replace view v1 as select ! 2 || 3, ! (2 || 3), (! 2) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(!2,3) AS `! 2 || 3`,!concat(2,3) AS `! (2 || 3)`,concat(!2,3) AS `(! 2) || 3`
+select mariadb_schema.concat(!2,3) AS `! 2 || 3`,!mariadb_schema.concat(2,3) AS `! (2 || 3)`,mariadb_schema.concat(!2,3) AS `(! 2) || 3`
select ! 2 || 3, ! (2 || 3), (! 2) || 3 union select * from v1;
! 2 || 3 ! (2 || 3) (! 2) || 3
03 0 03
create or replace view v1 as select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) is false AS `2 || 3 IS FALSE`,concat(2,3 is false) AS `2 || (3 IS FALSE)`,concat(2,3) is false AS `(2 || 3) IS FALSE`
+select mariadb_schema.concat(2,3) is false AS `2 || 3 IS FALSE`,mariadb_schema.concat(2,3 is false) AS `2 || (3 IS FALSE)`,mariadb_schema.concat(2,3) is false AS `(2 || 3) IS FALSE`
select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE union select * from v1;
2 || 3 IS FALSE 2 || (3 IS FALSE) (2 || 3) IS FALSE
0 20 0
create or replace view v1 as select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10);
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(0,3) in (3,10) AS `0 || 3 IN (3,10)`,concat(0,3 in (3,10)) AS `0 || (3 IN (3,10))`,concat(0,3) in (3,10) AS `(0 || 3) IN (3,10)`
+select mariadb_schema.concat(0,3) in (3,10) AS `0 || 3 IN (3,10)`,mariadb_schema.concat(0,3 in (3,10)) AS `0 || (3 IN (3,10))`,mariadb_schema.concat(0,3) in (3,10) AS `(0 || 3) IN (3,10)`
select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10) union select * from v1;
0 || 3 IN (3,10) 0 || (3 IN (3,10)) (0 || 3) IN (3,10)
1 01 1
create or replace view v1 as select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(1,0) xor 1 AS `1 || 0 XOR 1`,concat(1,0 xor 1) AS `1 || (0 XOR 1)`,concat(1,0) xor 1 AS `(1 || 0) XOR 1`
+select mariadb_schema.concat(1,0) xor 1 AS `1 || 0 XOR 1`,mariadb_schema.concat(1,0 xor 1) AS `1 || (0 XOR 1)`,mariadb_schema.concat(1,0) xor 1 AS `(1 || 0) XOR 1`
select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1 union select * from v1;
1 || 0 XOR 1 1 || (0 XOR 1) (1 || 0) XOR 1
0 11 0
create or replace view v1 as select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(1,1) and 0 AS `1 || 1 AND 0`,concat(1,1 and 0) AS `1 || (1 AND 0)`,concat(1,1) and 0 AS `(1 || 1) AND 0`
+select mariadb_schema.concat(1,1) and 0 AS `1 || 1 AND 0`,mariadb_schema.concat(1,1 and 0) AS `1 || (1 AND 0)`,mariadb_schema.concat(1,1) and 0 AS `(1 || 1) AND 0`
select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0 union select * from v1;
1 || 1 AND 0 1 || (1 AND 0) (1 || 1) AND 0
0 10 0
create or replace view v1 as select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(1,1) and 0 AS `1 || 1 && 0`,concat(1,1 and 0) AS `1 || (1 && 0)`,concat(1,1) and 0 AS `(1 || 1) && 0`
+select mariadb_schema.concat(1,1) and 0 AS `1 || 1 && 0`,mariadb_schema.concat(1,1 and 0) AS `1 || (1 && 0)`,mariadb_schema.concat(1,1) and 0 AS `(1 || 1) && 0`
select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0 union select * from v1;
1 || 1 && 0 1 || (1 && 0) (1 || 1) && 0
0 10 0
create or replace view v1 as select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) = 3 AS `2 || 3 = 3`,concat(2,3 = 3) AS `2 || (3 = 3)`,concat(2,3) = 3 AS `(2 || 3) = 3`
+select mariadb_schema.concat(2,3) = 3 AS `2 || 3 = 3`,mariadb_schema.concat(2,3 = 3) AS `2 || (3 = 3)`,mariadb_schema.concat(2,3) = 3 AS `(2 || 3) = 3`
select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3 union select * from v1;
2 || 3 = 3 2 || (3 = 3) (2 || 3) = 3
0 21 0
create or replace view v1 as select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) <=> 3 AS `2 || 3 <=> 3`,concat(2,3 <=> 3) AS `2 || (3 <=> 3)`,concat(2,3) <=> 3 AS `(2 || 3) <=> 3`
+select mariadb_schema.concat(2,3) <=> 3 AS `2 || 3 <=> 3`,mariadb_schema.concat(2,3 <=> 3) AS `2 || (3 <=> 3)`,mariadb_schema.concat(2,3) <=> 3 AS `(2 || 3) <=> 3`
select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3 union select * from v1;
2 || 3 <=> 3 2 || (3 <=> 3) (2 || 3) <=> 3
0 21 0
create or replace view v1 as select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) >= 3 AS `2 || 3 >= 3`,concat(2,3 >= 3) AS `2 || (3 >= 3)`,concat(2,3) >= 3 AS `(2 || 3) >= 3`
+select mariadb_schema.concat(2,3) >= 3 AS `2 || 3 >= 3`,mariadb_schema.concat(2,3 >= 3) AS `2 || (3 >= 3)`,mariadb_schema.concat(2,3) >= 3 AS `(2 || 3) >= 3`
select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3 union select * from v1;
2 || 3 >= 3 2 || (3 >= 3) (2 || 3) >= 3
1 21 1
create or replace view v1 as select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) <= 0 AS `2 || 3 <= 0`,concat(2,3 <= 0) AS `2 || (3 <= 0)`,concat(2,3) <= 0 AS `(2 || 3) <= 0`
+select mariadb_schema.concat(2,3) <= 0 AS `2 || 3 <= 0`,mariadb_schema.concat(2,3 <= 0) AS `2 || (3 <= 0)`,mariadb_schema.concat(2,3) <= 0 AS `(2 || 3) <= 0`
select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0 union select * from v1;
2 || 3 <= 0 2 || (3 <= 0) (2 || 3) <= 0
0 20 0
create or replace view v1 as select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) < 0 AS `2 || 3 < 0`,concat(2,3 < 0) AS `2 || (3 < 0)`,concat(2,3) < 0 AS `(2 || 3) < 0`
+select mariadb_schema.concat(2,3) < 0 AS `2 || 3 < 0`,mariadb_schema.concat(2,3 < 0) AS `2 || (3 < 0)`,mariadb_schema.concat(2,3) < 0 AS `(2 || 3) < 0`
select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0 union select * from v1;
2 || 3 < 0 2 || (3 < 0) (2 || 3) < 0
0 20 0
create or replace view v1 as select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(0,3) <> 3 AS `0 || 3 <> 3`,concat(0,3 <> 3) AS `0 || (3 <> 3)`,concat(0,3) <> 3 AS `(0 || 3) <> 3`
+select mariadb_schema.concat(0,3) <> 3 AS `0 || 3 <> 3`,mariadb_schema.concat(0,3 <> 3) AS `0 || (3 <> 3)`,mariadb_schema.concat(0,3) <> 3 AS `(0 || 3) <> 3`
select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3 union select * from v1;
0 || 3 <> 3 0 || (3 <> 3) (0 || 3) <> 3
0 00 0
create or replace view v1 as select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) > 3 AS `2 || 3 > 3`,concat(2,3 > 3) AS `2 || (3 > 3)`,concat(2,3) > 3 AS `(2 || 3) > 3`
+select mariadb_schema.concat(2,3) > 3 AS `2 || 3 > 3`,mariadb_schema.concat(2,3 > 3) AS `2 || (3 > 3)`,mariadb_schema.concat(2,3) > 3 AS `(2 || 3) > 3`
select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3 union select * from v1;
2 || 3 > 3 2 || (3 > 3) (2 || 3) > 3
1 20 1
create or replace view v1 as select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(0,3) <> 3 AS `0 || 3 != 3`,concat(0,3 <> 3) AS `0 || (3 != 3)`,concat(0,3) <> 3 AS `(0 || 3) != 3`
+select mariadb_schema.concat(0,3) <> 3 AS `0 || 3 != 3`,mariadb_schema.concat(0,3 <> 3) AS `0 || (3 != 3)`,mariadb_schema.concat(0,3) <> 3 AS `(0 || 3) != 3`
select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3 union select * from v1;
0 || 3 != 3 0 || (3 != 3) (0 || 3) != 3
0 00 0
create or replace view v1 as select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) like 3 AS `2 || 3 LIKE 3`,concat(2,3 like 3) AS `2 || (3 LIKE 3)`,concat(2,3) like 3 AS `(2 || 3) LIKE 3`
+select mariadb_schema.concat(2,3) like 3 AS `2 || 3 LIKE 3`,mariadb_schema.concat(2,3 like 3) AS `2 || (3 LIKE 3)`,mariadb_schema.concat(2,3) like 3 AS `(2 || 3) LIKE 3`
select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3 union select * from v1;
2 || 3 LIKE 3 2 || (3 LIKE 3) (2 || 3) LIKE 3
0 21 0
create or replace view v1 as select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) regexp 3 AS `2 || 3 REGEXP 3`,concat(2,3 regexp 3) AS `2 || (3 REGEXP 3)`,concat(2,3) regexp 3 AS `(2 || 3) REGEXP 3`
+select mariadb_schema.concat(2,3) regexp 3 AS `2 || 3 REGEXP 3`,mariadb_schema.concat(2,3 regexp 3) AS `2 || (3 REGEXP 3)`,mariadb_schema.concat(2,3) regexp 3 AS `(2 || 3) REGEXP 3`
select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3 union select * from v1;
2 || 3 REGEXP 3 2 || (3 REGEXP 3) (2 || 3) REGEXP 3
1 21 1
create or replace view v1 as select 2 || ' 3' | 3, 2 || (' 3' | 3), (2 || ' 3') | 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,' 3') | 3 AS `2 || ' 3' | 3`,concat(2,' 3' | 3) AS `2 || (' 3' | 3)`,concat(2,' 3') | 3 AS `(2 || ' 3') | 3`
+select mariadb_schema.concat(2,' 3') | 3 AS `2 || ' 3' | 3`,mariadb_schema.concat(2,' 3' | 3) AS `2 || (' 3' | 3)`,mariadb_schema.concat(2,' 3') | 3 AS `(2 || ' 3') | 3`
select 2 || ' 3' | 3, 2 || (' 3' | 3), (2 || ' 3') | 3 union select * from v1;
2 || ' 3' | 3 2 || (' 3' | 3) (2 || ' 3') | 3
3 23 3
create or replace view v1 as select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(0,2) & 2 AS `0 || 2 & 2`,concat(0,2 & 2) AS `0 || (2 & 2)`,concat(0,2) & 2 AS `(0 || 2) & 2`
+select mariadb_schema.concat(0,2) & 2 AS `0 || 2 & 2`,mariadb_schema.concat(0,2 & 2) AS `0 || (2 & 2)`,mariadb_schema.concat(0,2) & 2 AS `(0 || 2) & 2`
select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2 union select * from v1;
0 || 2 & 2 0 || (2 & 2) (0 || 2) & 2
2 02 2
create or replace view v1 as select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) << 3 AS `2 || 3 << 3`,concat(2,3 << 3) AS `2 || (3 << 3)`,concat(2,3) << 3 AS `(2 || 3) << 3`
+select mariadb_schema.concat(2,3) << 3 AS `2 || 3 << 3`,mariadb_schema.concat(2,3 << 3) AS `2 || (3 << 3)`,mariadb_schema.concat(2,3) << 3 AS `(2 || 3) << 3`
select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3 union select * from v1;
2 || 3 << 3 2 || (3 << 3) (2 || 3) << 3
184 224 184
create or replace view v1 as select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) >> 3 AS `2 || 3 >> 3`,concat(2,3 >> 3) AS `2 || (3 >> 3)`,concat(2,3) >> 3 AS `(2 || 3) >> 3`
+select mariadb_schema.concat(2,3) >> 3 AS `2 || 3 >> 3`,mariadb_schema.concat(2,3 >> 3) AS `2 || (3 >> 3)`,mariadb_schema.concat(2,3) >> 3 AS `(2 || 3) >> 3`
select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3 union select * from v1;
2 || 3 >> 3 2 || (3 >> 3) (2 || 3) >> 3
2 20 2
create or replace view v1 as select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,'2000-01-01') + interval 1 day AS `2 || '2000-01-01' +INTERVAL 1 DAY`,concat(2,'2000-01-01' + interval 1 day) AS `2 || ('2000-01-01' +INTERVAL 1 DAY)`,concat(2,'2000-01-01') + interval 1 day AS `(2 || '2000-01-01') +INTERVAL 1 DAY`
+select mariadb_schema.concat(2,'2000-01-01') + interval 1 day AS `2 || '2000-01-01' +INTERVAL 1 DAY`,mariadb_schema.concat(2,'2000-01-01' + interval 1 day) AS `2 || ('2000-01-01' +INTERVAL 1 DAY)`,mariadb_schema.concat(2,'2000-01-01') + interval 1 day AS `(2 || '2000-01-01') +INTERVAL 1 DAY`
select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY union select * from v1;
2 || '2000-01-01' +INTERVAL 1 DAY 2 || ('2000-01-01' +INTERVAL 1 DAY) (2 || '2000-01-01') +INTERVAL 1 DAY
NULL 22000-01-02 NULL
create or replace view v1 as select 2 || ' 3' + 3, 2 || (' 3' + 3), (2 || ' 3') + 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,' 3') + 3 AS `2 || ' 3' + 3`,concat(2,' 3' + 3) AS `2 || (' 3' + 3)`,concat(2,' 3') + 3 AS `(2 || ' 3') + 3`
+select mariadb_schema.concat(2,' 3') + 3 AS `2 || ' 3' + 3`,mariadb_schema.concat(2,' 3' + 3) AS `2 || (' 3' + 3)`,mariadb_schema.concat(2,' 3') + 3 AS `(2 || ' 3') + 3`
select 2 || ' 3' + 3, 2 || (' 3' + 3), (2 || ' 3') + 3 union select * from v1;
2 || ' 3' + 3 2 || (' 3' + 3) (2 || ' 3') + 3
5 26 5
create or replace view v1 as select 2 || ' 3' - 3, 2 || (' 3' - 3), (2 || ' 3') - 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,' 3') - 3 AS `2 || ' 3' - 3`,concat(2,' 3' - 3) AS `2 || (' 3' - 3)`,concat(2,' 3') - 3 AS `(2 || ' 3') - 3`
+select mariadb_schema.concat(2,' 3') - 3 AS `2 || ' 3' - 3`,mariadb_schema.concat(2,' 3' - 3) AS `2 || (' 3' - 3)`,mariadb_schema.concat(2,' 3') - 3 AS `(2 || ' 3') - 3`
select 2 || ' 3' - 3, 2 || (' 3' - 3), (2 || ' 3') - 3 union select * from v1;
2 || ' 3' - 3 2 || (' 3' - 3) (2 || ' 3') - 3
-1 20 -1
create or replace view v1 as select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) * 3 AS `2 || 3 * 3`,concat(2,3 * 3) AS `2 || (3 * 3)`,concat(2,3) * 3 AS `(2 || 3) * 3`
+select mariadb_schema.concat(2,3) * 3 AS `2 || 3 * 3`,mariadb_schema.concat(2,3 * 3) AS `2 || (3 * 3)`,mariadb_schema.concat(2,3) * 3 AS `(2 || 3) * 3`
select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3 union select * from v1;
2 || 3 * 3 2 || (3 * 3) (2 || 3) * 3
69 29 69
create or replace view v1 as select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) / 3 AS `2 || 3 / 3`,concat(2,3 / 3) AS `2 || (3 / 3)`,concat(2,3) / 3 AS `(2 || 3) / 3`
+select mariadb_schema.concat(2,3) / 3 AS `2 || 3 / 3`,mariadb_schema.concat(2,3 / 3) AS `2 || (3 / 3)`,mariadb_schema.concat(2,3) / 3 AS `(2 || 3) / 3`
select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3 union select * from v1;
2 || 3 / 3 2 || (3 / 3) (2 || 3) / 3
7.666666666666667 21.0000 7.666666666666667
create or replace view v1 as select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) DIV 3 AS `2 || 3 DIV 3`,concat(2,3 DIV 3) AS `2 || (3 DIV 3)`,concat(2,3) DIV 3 AS `(2 || 3) DIV 3`
+select mariadb_schema.concat(2,3) DIV 3 AS `2 || 3 DIV 3`,mariadb_schema.concat(2,3 DIV 3) AS `2 || (3 DIV 3)`,mariadb_schema.concat(2,3) DIV 3 AS `(2 || 3) DIV 3`
select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3 union select * from v1;
2 || 3 DIV 3 2 || (3 DIV 3) (2 || 3) DIV 3
7 21 7
create or replace view v1 as select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(0,3) MOD 3 AS `0 || 3 MOD 3`,concat(0,3 MOD 3) AS `0 || (3 MOD 3)`,concat(0,3) MOD 3 AS `(0 || 3) MOD 3`
+select mariadb_schema.concat(0,3) MOD 3 AS `0 || 3 MOD 3`,mariadb_schema.concat(0,3 MOD 3) AS `0 || (3 MOD 3)`,mariadb_schema.concat(0,3) MOD 3 AS `(0 || 3) MOD 3`
select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3 union select * from v1;
0 || 3 MOD 3 0 || (3 MOD 3) (0 || 3) MOD 3
0 00 0
create or replace view v1 as select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(0,3) MOD 3 AS `0 || 3 % 3`,concat(0,3 MOD 3) AS `0 || (3 % 3)`,concat(0,3) MOD 3 AS `(0 || 3) % 3`
+select mariadb_schema.concat(0,3) MOD 3 AS `0 || 3 % 3`,mariadb_schema.concat(0,3 MOD 3) AS `0 || (3 % 3)`,mariadb_schema.concat(0,3) MOD 3 AS `(0 || 3) % 3`
select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3 union select * from v1;
0 || 3 % 3 0 || (3 % 3) (0 || 3) % 3
0 00 0
create or replace view v1 as select 2 || ' 3' ^ 3, 2 || (' 3' ^ 3), (2 || ' 3') ^ 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,' 3') ^ 3 AS `2 || ' 3' ^ 3`,concat(2,' 3' ^ 3) AS `2 || (' 3' ^ 3)`,concat(2,' 3') ^ 3 AS `(2 || ' 3') ^ 3`
+select mariadb_schema.concat(2,' 3') ^ 3 AS `2 || ' 3' ^ 3`,mariadb_schema.concat(2,' 3' ^ 3) AS `2 || (' 3' ^ 3)`,mariadb_schema.concat(2,' 3') ^ 3 AS `(2 || ' 3') ^ 3`
select 2 || ' 3' ^ 3, 2 || (' 3' ^ 3), (2 || ' 3') ^ 3 union select * from v1;
2 || ' 3' ^ 3 2 || (' 3' ^ 3) (2 || ' 3') ^ 3
1 20 1
create or replace view v1 as select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select concat(2,3) between 2 and 3 AS `2 || 3 BETWEEN 2 AND 3`,concat(2,3 between 2 and 3) AS `2 || (3 BETWEEN 2 AND 3)`,concat(2,3) between 2 and 3 AS `(2 || 3) BETWEEN 2 AND 3`
+select mariadb_schema.concat(2,3) between 2 and 3 AS `2 || 3 BETWEEN 2 AND 3`,mariadb_schema.concat(2,3 between 2 and 3) AS `2 || (3 BETWEEN 2 AND 3)`,mariadb_schema.concat(2,3) between 2 and 3 AS `(2 || 3) BETWEEN 2 AND 3`
select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3 union select * from v1;
2 || 3 BETWEEN 2 AND 3 2 || (3 BETWEEN 2 AND 3) (2 || 3) BETWEEN 2 AND 3
0 21 0
create or replace view v1 as select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 xor concat(3,3) AS `2 XOR 3 || 3`,2 xor concat(3,3) AS `2 XOR (3 || 3)`,concat(2 xor 3,3) AS `(2 XOR 3) || 3`
+select 2 xor mariadb_schema.concat(3,3) AS `2 XOR 3 || 3`,2 xor mariadb_schema.concat(3,3) AS `2 XOR (3 || 3)`,mariadb_schema.concat(2 xor 3,3) AS `(2 XOR 3) || 3`
select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3 union select * from v1;
2 XOR 3 || 3 2 XOR (3 || 3) (2 XOR 3) || 3
0 0 03
create or replace view v1 as select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 0 and concat(3,3) AS `0 AND 3 || 3`,0 and concat(3,3) AS `0 AND (3 || 3)`,concat(0 and 3,3) AS `(0 AND 3) || 3`
+select 0 and mariadb_schema.concat(3,3) AS `0 AND 3 || 3`,0 and mariadb_schema.concat(3,3) AS `0 AND (3 || 3)`,mariadb_schema.concat(0 and 3,3) AS `(0 AND 3) || 3`
select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3 union select * from v1;
0 AND 3 || 3 0 AND (3 || 3) (0 AND 3) || 3
0 0 03
create or replace view v1 as select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 0 and concat(3,3) AS `0 && 3 || 3`,0 and concat(3,3) AS `0 && (3 || 3)`,concat(0 and 3,3) AS `(0 && 3) || 3`
+select 0 and mariadb_schema.concat(3,3) AS `0 && 3 || 3`,0 and mariadb_schema.concat(3,3) AS `0 && (3 || 3)`,mariadb_schema.concat(0 and 3,3) AS `(0 && 3) || 3`
select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3 union select * from v1;
0 && 3 || 3 0 && (3 || 3) (0 && 3) || 3
0 0 03
create or replace view v1 as select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 = concat(3,3) AS `2 = 3 || 3`,2 = concat(3,3) AS `2 = (3 || 3)`,concat(2 = 3,3) AS `(2 = 3) || 3`
+select 2 = mariadb_schema.concat(3,3) AS `2 = 3 || 3`,2 = mariadb_schema.concat(3,3) AS `2 = (3 || 3)`,mariadb_schema.concat(2 = 3,3) AS `(2 = 3) || 3`
select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3 union select * from v1;
2 = 3 || 3 2 = (3 || 3) (2 = 3) || 3
0 0 03
create or replace view v1 as select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 <=> concat(3,3) AS `2 <=> 3 || 3`,2 <=> concat(3,3) AS `2 <=> (3 || 3)`,concat(2 <=> 3,3) AS `(2 <=> 3) || 3`
+select 2 <=> mariadb_schema.concat(3,3) AS `2 <=> 3 || 3`,2 <=> mariadb_schema.concat(3,3) AS `2 <=> (3 || 3)`,mariadb_schema.concat(2 <=> 3,3) AS `(2 <=> 3) || 3`
select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3 union select * from v1;
2 <=> 3 || 3 2 <=> (3 || 3) (2 <=> 3) || 3
0 0 03
create or replace view v1 as select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 >= concat(3,0) AS `2 >= 3 || 0`,2 >= concat(3,0) AS `2 >= (3 || 0)`,concat(2 >= 3,0) AS `(2 >= 3) || 0`
+select 2 >= mariadb_schema.concat(3,0) AS `2 >= 3 || 0`,2 >= mariadb_schema.concat(3,0) AS `2 >= (3 || 0)`,mariadb_schema.concat(2 >= 3,0) AS `(2 >= 3) || 0`
select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0 union select * from v1;
2 >= 3 || 0 2 >= (3 || 0) (2 >= 3) || 0
0 0 00
create or replace view v1 as select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 <= concat(3,3) AS `2 <= 3 || 3`,2 <= concat(3,3) AS `2 <= (3 || 3)`,concat(2 <= 3,3) AS `(2 <= 3) || 3`
+select 2 <= mariadb_schema.concat(3,3) AS `2 <= 3 || 3`,2 <= mariadb_schema.concat(3,3) AS `2 <= (3 || 3)`,mariadb_schema.concat(2 <= 3,3) AS `(2 <= 3) || 3`
select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3 union select * from v1;
2 <= 3 || 3 2 <= (3 || 3) (2 <= 3) || 3
1 1 13
create or replace view v1 as select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 < concat(3,3) AS `2 < 3 || 3`,2 < concat(3,3) AS `2 < (3 || 3)`,concat(2 < 3,3) AS `(2 < 3) || 3`
+select 2 < mariadb_schema.concat(3,3) AS `2 < 3 || 3`,2 < mariadb_schema.concat(3,3) AS `2 < (3 || 3)`,mariadb_schema.concat(2 < 3,3) AS `(2 < 3) || 3`
select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3 union select * from v1;
2 < 3 || 3 2 < (3 || 3) (2 < 3) || 3
1 1 13
create or replace view v1 as select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 1 <> concat(3,3) AS `1 <> 3 || 3`,1 <> concat(3,3) AS `1 <> (3 || 3)`,concat(1 <> 3,3) AS `(1 <> 3) || 3`
+select 1 <> mariadb_schema.concat(3,3) AS `1 <> 3 || 3`,1 <> mariadb_schema.concat(3,3) AS `1 <> (3 || 3)`,mariadb_schema.concat(1 <> 3,3) AS `(1 <> 3) || 3`
select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3 union select * from v1;
1 <> 3 || 3 1 <> (3 || 3) (1 <> 3) || 3
1 1 13
create or replace view v1 as select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 0 > concat(3,3) AS `0 > 3 || 3`,0 > concat(3,3) AS `0 > (3 || 3)`,concat(0 > 3,3) AS `(0 > 3) || 3`
+select 0 > mariadb_schema.concat(3,3) AS `0 > 3 || 3`,0 > mariadb_schema.concat(3,3) AS `0 > (3 || 3)`,mariadb_schema.concat(0 > 3,3) AS `(0 > 3) || 3`
select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3 union select * from v1;
0 > 3 || 3 0 > (3 || 3) (0 > 3) || 3
0 0 03
create or replace view v1 as select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 1 <> concat(3,3) AS `1 != 3 || 3`,1 <> concat(3,3) AS `1 != (3 || 3)`,concat(1 <> 3,3) AS `(1 != 3) || 3`
+select 1 <> mariadb_schema.concat(3,3) AS `1 != 3 || 3`,1 <> mariadb_schema.concat(3,3) AS `1 != (3 || 3)`,mariadb_schema.concat(1 <> 3,3) AS `(1 != 3) || 3`
select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3 union select * from v1;
1 != 3 || 3 1 != (3 || 3) (1 != 3) || 3
1 1 13
create or replace view v1 as select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 like concat(3,3) AS `2 LIKE 3 || 3`,2 like concat(3,3) AS `2 LIKE (3 || 3)`,concat(2 like 3,3) AS `(2 LIKE 3) || 3`
+select 2 like mariadb_schema.concat(3,3) AS `2 LIKE 3 || 3`,2 like mariadb_schema.concat(3,3) AS `2 LIKE (3 || 3)`,mariadb_schema.concat(2 like 3,3) AS `(2 LIKE 3) || 3`
select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3 union select * from v1;
2 LIKE 3 || 3 2 LIKE (3 || 3) (2 LIKE 3) || 3
0 0 03
create or replace view v1 as select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 regexp concat(3,3) AS `2 REGEXP 3 || 3`,2 regexp concat(3,3) AS `2 REGEXP (3 || 3)`,concat(2 regexp 3,3) AS `(2 REGEXP 3) || 3`
+select 2 regexp mariadb_schema.concat(3,3) AS `2 REGEXP 3 || 3`,2 regexp mariadb_schema.concat(3,3) AS `2 REGEXP (3 || 3)`,mariadb_schema.concat(2 regexp 3,3) AS `(2 REGEXP 3) || 3`
select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3 union select * from v1;
2 REGEXP 3 || 3 2 REGEXP (3 || 3) (2 REGEXP 3) || 3
0 0 03
create or replace view v1 as select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 | concat(3,3) AS `2 | 3 || 3`,2 | concat(3,3) AS `2 | (3 || 3)`,concat(2 | 3,3) AS `(2 | 3) || 3`
+select 2 | mariadb_schema.concat(3,3) AS `2 | 3 || 3`,2 | mariadb_schema.concat(3,3) AS `2 | (3 || 3)`,mariadb_schema.concat(2 | 3,3) AS `(2 | 3) || 3`
select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3 union select * from v1;
2 | 3 || 3 2 | (3 || 3) (2 | 3) || 3
35 35 33
create or replace view v1 as select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 & concat(3,3) AS `2 & 3 || 3`,2 & concat(3,3) AS `2 & (3 || 3)`,concat(2 & 3,3) AS `(2 & 3) || 3`
+select 2 & mariadb_schema.concat(3,3) AS `2 & 3 || 3`,2 & mariadb_schema.concat(3,3) AS `2 & (3 || 3)`,mariadb_schema.concat(2 & 3,3) AS `(2 & 3) || 3`
select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3 union select * from v1;
2 & 3 || 3 2 & (3 || 3) (2 & 3) || 3
0 0 23
create or replace view v1 as select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 << concat(3,3) AS `2 << 3 || 3`,2 << concat(3,3) AS `2 << (3 || 3)`,concat(2 << 3,3) AS `(2 << 3) || 3`
+select 2 << mariadb_schema.concat(3,3) AS `2 << 3 || 3`,2 << mariadb_schema.concat(3,3) AS `2 << (3 || 3)`,mariadb_schema.concat(2 << 3,3) AS `(2 << 3) || 3`
select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3 union select * from v1;
2 << 3 || 3 2 << (3 || 3) (2 << 3) || 3
17179869184 17179869184 163
create or replace view v1 as select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 >> concat(3,0) AS `2 >> 3 || 0`,2 >> concat(3,0) AS `2 >> (3 || 0)`,concat(2 >> 3,0) AS `(2 >> 3) || 0`
+select 2 >> mariadb_schema.concat(3,0) AS `2 >> 3 || 0`,2 >> mariadb_schema.concat(3,0) AS `2 >> (3 || 0)`,mariadb_schema.concat(2 >> 3,0) AS `(2 >> 3) || 0`
select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0 union select * from v1;
2 >> 3 || 0 2 >> (3 || 0) (2 >> 3) || 0
0 0 00
create or replace view v1 as select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 + concat(3,3) AS `2 + 3 || 3`,2 + concat(3,3) AS `2 + (3 || 3)`,concat(2 + 3,3) AS `(2 + 3) || 3`
+select 2 + mariadb_schema.concat(3,3) AS `2 + 3 || 3`,2 + mariadb_schema.concat(3,3) AS `2 + (3 || 3)`,mariadb_schema.concat(2 + 3,3) AS `(2 + 3) || 3`
select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3 union select * from v1;
2 + 3 || 3 2 + (3 || 3) (2 + 3) || 3
35 35 53
create or replace view v1 as select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 - concat(2,0) AS `2 - 2 || 0`,2 - concat(2,0) AS `2 - (2 || 0)`,concat(2 - 2,0) AS `(2 - 2) || 0`
+select 2 - mariadb_schema.concat(2,0) AS `2 - 2 || 0`,2 - mariadb_schema.concat(2,0) AS `2 - (2 || 0)`,mariadb_schema.concat(2 - 2,0) AS `(2 - 2) || 0`
select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0 union select * from v1;
2 - 2 || 0 2 - (2 || 0) (2 - 2) || 0
-18 -18 00
create or replace view v1 as select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 * concat(3,3) AS `2 * 3 || 3`,2 * concat(3,3) AS `2 * (3 || 3)`,concat(2 * 3,3) AS `(2 * 3) || 3`
+select 2 * mariadb_schema.concat(3,3) AS `2 * 3 || 3`,2 * mariadb_schema.concat(3,3) AS `2 * (3 || 3)`,mariadb_schema.concat(2 * 3,3) AS `(2 * 3) || 3`
select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3 union select * from v1;
2 * 3 || 3 2 * (3 || 3) (2 * 3) || 3
66 66 63
create or replace view v1 as select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 / concat(3,3) AS `2 / 3 || 3`,2 / concat(3,3) AS `2 / (3 || 3)`,concat(2 / 3,3) AS `(2 / 3) || 3`
+select 2 / mariadb_schema.concat(3,3) AS `2 / 3 || 3`,2 / mariadb_schema.concat(3,3) AS `2 / (3 || 3)`,mariadb_schema.concat(2 / 3,3) AS `(2 / 3) || 3`
select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3 union select * from v1;
2 / 3 || 3 2 / (3 || 3) (2 / 3) || 3
0.06060606060606061 0.06060606060606061 0.66673
create or replace view v1 as select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 DIV concat(3,3) AS `2 DIV 3 || 3`,2 DIV concat(3,3) AS `2 DIV (3 || 3)`,concat(2 DIV 3,3) AS `(2 DIV 3) || 3`
+select 2 DIV mariadb_schema.concat(3,3) AS `2 DIV 3 || 3`,2 DIV mariadb_schema.concat(3,3) AS `2 DIV (3 || 3)`,mariadb_schema.concat(2 DIV 3,3) AS `(2 DIV 3) || 3`
select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3 union select * from v1;
2 DIV 3 || 3 2 DIV (3 || 3) (2 DIV 3) || 3
0 0 03
create or replace view v1 as select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 MOD concat(3,3) AS `2 MOD 3 || 3`,2 MOD concat(3,3) AS `2 MOD (3 || 3)`,concat(2 MOD 3,3) AS `(2 MOD 3) || 3`
+select 2 MOD mariadb_schema.concat(3,3) AS `2 MOD 3 || 3`,2 MOD mariadb_schema.concat(3,3) AS `2 MOD (3 || 3)`,mariadb_schema.concat(2 MOD 3,3) AS `(2 MOD 3) || 3`
select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3 union select * from v1;
2 MOD 3 || 3 2 MOD (3 || 3) (2 MOD 3) || 3
2 2 23
create or replace view v1 as select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 MOD concat(3,3) AS `2 % 3 || 3`,2 MOD concat(3,3) AS `2 % (3 || 3)`,concat(2 MOD 3,3) AS `(2 % 3) || 3`
+select 2 MOD mariadb_schema.concat(3,3) AS `2 % 3 || 3`,2 MOD mariadb_schema.concat(3,3) AS `2 % (3 || 3)`,mariadb_schema.concat(2 MOD 3,3) AS `(2 % 3) || 3`
select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3 union select * from v1;
2 % 3 || 3 2 % (3 || 3) (2 % 3) || 3
2 2 23
create or replace view v1 as select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 ^ concat(3,3) AS `2 ^ 3 || 3`,2 ^ concat(3,3) AS `2 ^ (3 || 3)`,concat(2 ^ 3,3) AS `(2 ^ 3) || 3`
+select 2 ^ mariadb_schema.concat(3,3) AS `2 ^ 3 || 3`,2 ^ mariadb_schema.concat(3,3) AS `2 ^ (3 || 3)`,mariadb_schema.concat(2 ^ 3,3) AS `(2 ^ 3) || 3`
select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3 union select * from v1;
2 ^ 3 || 3 2 ^ (3 || 3) (2 ^ 3) || 3
35 35 13
create or replace view v1 as select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select 2 between 1 and concat(3,3) AS `2 BETWEEN 1 AND 3 || 3`,2 between 1 and concat(3,3) AS `2 BETWEEN 1 AND (3 || 3)`,concat(2 between 1 and 3,3) AS `(2 BETWEEN 1 AND 3) || 3`
+select 2 between 1 and mariadb_schema.concat(3,3) AS `2 BETWEEN 1 AND 3 || 3`,2 between 1 and mariadb_schema.concat(3,3) AS `2 BETWEEN 1 AND (3 || 3)`,mariadb_schema.concat(2 between 1 and 3,3) AS `(2 BETWEEN 1 AND 3) || 3`
select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3 union select * from v1;
2 BETWEEN 1 AND 3 || 3 2 BETWEEN 1 AND (3 || 3) (2 BETWEEN 1 AND 3) || 3
1 1 13
create or replace view v1 as select charset(2 LIKE 1 ESCAPE 3 || ''), charset(2 LIKE 1 ESCAPE (3 || '')), charset((2 LIKE 1 ESCAPE 3) || '');
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
view_definition
-select charset(2 like 1 escape concat(3,'')) AS `charset(2 LIKE 1 ESCAPE 3 || '')`,charset(2 like 1 escape concat(3,'')) AS `charset(2 LIKE 1 ESCAPE (3 || ''))`,charset(concat(2 like 1 escape 3,'')) AS `charset((2 LIKE 1 ESCAPE 3) || '')`
+select charset(2 like 1 escape mariadb_schema.concat(3,'')) AS `charset(2 LIKE 1 ESCAPE 3 || '')`,charset(2 like 1 escape mariadb_schema.concat(3,'')) AS `charset(2 LIKE 1 ESCAPE (3 || ''))`,charset(mariadb_schema.concat(2 like 1 escape 3,'')) AS `charset((2 LIKE 1 ESCAPE 3) || '')`
select charset(2 LIKE 1 ESCAPE 3 || ''), charset(2 LIKE 1 ESCAPE (3 || '')), charset((2 LIKE 1 ESCAPE 3) || '') union select * from v1;
charset(2 LIKE 1 ESCAPE 3 || '') charset(2 LIKE 1 ESCAPE (3 || '')) charset((2 LIKE 1 ESCAPE 3) || '')
binary binary latin1
diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result
index 4a39726fb91..f4d123f1d34 100644
--- a/mysql-test/main/selectivity.result
+++ b/mysql-test/main/selectivity.result
@@ -402,7 +402,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 SUBQUERY customer ALL NULL NULL NULL NULL 150 100.00 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2
-Note 1003 /* select#1 */ select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !<in_optimizer>(1,<expr_cache><`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2)
+Note 1003 /* select#1 */ select mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !<in_optimizer>(1,<expr_cache><`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2)
select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal
from (
select substr(c_phone, 1, 2) as cntrycode, c_acctbal
@@ -443,7 +443,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 SUBQUERY customer ALL NULL NULL NULL NULL 150 91.00 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2
-Note 1003 /* select#1 */ select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !<in_optimizer>(1,<expr_cache><`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2)
+Note 1003 /* select#1 */ select mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !<in_optimizer>(1,<expr_cache><`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by mariadb_schema.substr(`dbt3_s001`.`customer`.`c_phone`,1,2)
select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal
from (
select substr(c_phone, 1, 2) as cntrycode, c_acctbal
diff --git a/mysql-test/main/subselect_mat.result b/mysql-test/main/subselect_mat.result
index 898b1b69117..97adab8e503 100644
--- a/mysql-test/main/subselect_mat.result
+++ b/mysql-test/main/subselect_mat.result
@@ -629,7 +629,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where
2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <expr_cache><`test`.`t1_16`.`a1`>(<in_optimizer>(`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( <materialize> (/* select#2 */ select substr(`test`.`t2_16`.`b1`,1,16) from `test`.`t2_16` where `test`.`t2_16`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1_16`.`a1` in <temporary table> on distinct_key where `test`.`t1_16`.`a1` = `<subquery2>`.`substring(b1,1,16)`))))
+Note 1003 /* select#1 */ select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <expr_cache><`test`.`t1_16`.`a1`>(<in_optimizer>(`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( <materialize> (/* select#2 */ select mariadb_schema.substr(`test`.`t2_16`.`b1`,1,16) from `test`.`t2_16` where `test`.`t2_16`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1_16`.`a1` in <temporary table> on distinct_key where `test`.`t1_16`.`a1` = `<subquery2>`.`substring(b1,1,16)`))))
select left(a1,7), left(a2,7)
from t1_16
where a1 in (select substring(b1,1,16) from t2_16 where b1 > '0');
@@ -680,7 +680,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><concat(`test`.`t1`.`a1`,'x')>(<in_optimizer>(concat(`test`.`t1`.`a1`,'x'),<exists>(/* select#2 */ select left(`test`.`t1_16`.`a1`,8) from `test`.`t1_16` where <expr_cache><`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`>(<in_optimizer>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`),<exists>(/* select#3 */ select `test`.`t2_16`.`b1`,`test`.`t2_16`.`b2` from `test`.`t2_16` join `test`.`t2` where `test`.`t2`.`b2` = substr(`test`.`t2_16`.`b2`,1,6) and <expr_cache><`test`.`t2`.`b1`>(<in_optimizer>(`test`.`t2`.`b1`,`test`.`t2`.`b1` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c1` from `test`.`t3` where `test`.`t3`.`c2` > '0' ), <primary_index_lookup>(`test`.`t2`.`b1` in <temporary table> on distinct_key where `test`.`t2`.`b1` = `<subquery4>`.`c1`)))) and <cache>(`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1` and <cache>(`test`.`t1_16`.`a2`) = `test`.`t2_16`.`b2`))) and <cache>(concat(`test`.`t1`.`a1`,'x')) = left(`test`.`t1_16`.`a1`,8))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><mariadb_schema.concat(`test`.`t1`.`a1`,'x')>(<in_optimizer>(mariadb_schema.concat(`test`.`t1`.`a1`,'x'),<exists>(/* select#2 */ select left(`test`.`t1_16`.`a1`,8) from `test`.`t1_16` where <expr_cache><`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`>(<in_optimizer>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a2`),<exists>(/* select#3 */ select `test`.`t2_16`.`b1`,`test`.`t2_16`.`b2` from `test`.`t2_16` join `test`.`t2` where `test`.`t2`.`b2` = mariadb_schema.substr(`test`.`t2_16`.`b2`,1,6) and <expr_cache><`test`.`t2`.`b1`>(<in_optimizer>(`test`.`t2`.`b1`,`test`.`t2`.`b1` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c1` from `test`.`t3` where `test`.`t3`.`c2` > '0' ), <primary_index_lookup>(`test`.`t2`.`b1` in <temporary table> on distinct_key where `test`.`t2`.`b1` = `<subquery4>`.`c1`)))) and <cache>(`test`.`t1_16`.`a1`) = `test`.`t2_16`.`b1` and <cache>(`test`.`t1_16`.`a2`) = `test`.`t2_16`.`b2`))) and <cache>(mariadb_schema.concat(`test`.`t1`.`a1`,'x')) = left(`test`.`t1_16`.`a1`,8))))
drop table t1_16, t2_16, t3_16;
set @blob_len = 512;
set @suffix_len = @blob_len - @prefix_len;
@@ -742,7 +742,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where
2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <expr_cache><`test`.`t1_512`.`a1`>(<in_optimizer>(`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( <materialize> (/* select#2 */ select substr(`test`.`t2_512`.`b1`,1,512) from `test`.`t2_512` where `test`.`t2_512`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1_512`.`a1` in <temporary table> on distinct_key where `test`.`t1_512`.`a1` = `<subquery2>`.`substring(b1,1,512)`))))
+Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <expr_cache><`test`.`t1_512`.`a1`>(<in_optimizer>(`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( <materialize> (/* select#2 */ select mariadb_schema.substr(`test`.`t2_512`.`b1`,1,512) from `test`.`t2_512` where `test`.`t2_512`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1_512`.`a1` in <temporary table> on distinct_key where `test`.`t1_512`.`a1` = `<subquery2>`.`substring(b1,1,512)`))))
select left(a1,7), left(a2,7)
from t1_512
where a1 in (select substring(b1,1,512) from t2_512 where b1 > '0');
@@ -843,7 +843,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where
2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <expr_cache><`test`.`t1_1024`.`a1`>(<in_optimizer>(`test`.`t1_1024`.`a1`,<exists>(/* select#2 */ select substr(`test`.`t2_1024`.`b1`,1,1024) from `test`.`t2_1024` where `test`.`t2_1024`.`b1` > '0' and <cache>(`test`.`t1_1024`.`a1`) = substr(`test`.`t2_1024`.`b1`,1,1024))))
+Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <expr_cache><`test`.`t1_1024`.`a1`>(<in_optimizer>(`test`.`t1_1024`.`a1`,<exists>(/* select#2 */ select mariadb_schema.substr(`test`.`t2_1024`.`b1`,1,1024) from `test`.`t2_1024` where `test`.`t2_1024`.`b1` > '0' and <cache>(`test`.`t1_1024`.`a1`) = mariadb_schema.substr(`test`.`t2_1024`.`b1`,1,1024))))
select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0');
@@ -944,7 +944,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where
2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <expr_cache><`test`.`t1_1025`.`a1`>(<in_optimizer>(`test`.`t1_1025`.`a1`,<exists>(/* select#2 */ select substr(`test`.`t2_1025`.`b1`,1,1025) from `test`.`t2_1025` where `test`.`t2_1025`.`b1` > '0' and <cache>(`test`.`t1_1025`.`a1`) = substr(`test`.`t2_1025`.`b1`,1,1025))))
+Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <expr_cache><`test`.`t1_1025`.`a1`>(<in_optimizer>(`test`.`t1_1025`.`a1`,<exists>(/* select#2 */ select mariadb_schema.substr(`test`.`t2_1025`.`b1`,1,1025) from `test`.`t2_1025` where `test`.`t2_1025`.`b1` > '0' and <cache>(`test`.`t1_1025`.`a1`) = mariadb_schema.substr(`test`.`t2_1025`.`b1`,1,1025))))
select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0');
diff --git a/mysql-test/main/subselect_sj_mat.result b/mysql-test/main/subselect_sj_mat.result
index 8486d36c2ae..05b7f5149e7 100644
--- a/mysql-test/main/subselect_sj_mat.result
+++ b/mysql-test/main/subselect_sj_mat.result
@@ -651,7 +651,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 19 func 1 100.00 Using where
2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` > '0' and `test`.`t1_16`.`a1` = substr(`test`.`t2_16`.`b1`,1,16)
+Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` > '0' and `test`.`t1_16`.`a1` = mariadb_schema.substr(`test`.`t2_16`.`b1`,1,16)
select left(a1,7), left(a2,7)
from t1_16
where a1 in (select substring(b1,1,16) from t2_16 where b1 > '0');
@@ -703,7 +703,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where `test`.`t2`.`b1` = `test`.`t3`.`c1` and `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t2_16`.`b2` = `test`.`t1_16`.`a2` and `test`.`t2`.`b2` = substr(`test`.`t1_16`.`a2`,1,6) and `test`.`t3`.`c2` > '0' and concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8)
+Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where `test`.`t2`.`b1` = `test`.`t3`.`c1` and `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t2_16`.`b2` = `test`.`t1_16`.`a2` and `test`.`t2`.`b2` = mariadb_schema.substr(`test`.`t1_16`.`a2`,1,6) and `test`.`t3`.`c2` > '0' and mariadb_schema.concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8)
drop table t1_16, t2_16, t3_16;
set @blob_len = 512;
set @suffix_len = @blob_len - @prefix_len;
@@ -766,7 +766,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 516 func 1 100.00 Using where
2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` > '0' and `test`.`t1_512`.`a1` = substr(`test`.`t2_512`.`b1`,1,512)
+Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` > '0' and `test`.`t1_512`.`a1` = mariadb_schema.substr(`test`.`t2_512`.`b1`,1,512)
select left(a1,7), left(a2,7)
from t1_512
where a1 in (select substring(b1,1,512) from t2_512 where b1 > '0');
@@ -869,7 +869,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` > '0' and `test`.`t1_1024`.`a1` = substr(`test`.`t2_1024`.`b1`,1,1024)
+Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` > '0' and `test`.`t1_1024`.`a1` = mariadb_schema.substr(`test`.`t2_1024`.`b1`,1,1024)
select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0');
@@ -972,7 +972,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` > '0' and `test`.`t1_1025`.`a1` = substr(`test`.`t2_1025`.`b1`,1,1025)
+Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` > '0' and `test`.`t1_1025`.`a1` = mariadb_schema.substr(`test`.`t2_1025`.`b1`,1,1025)
select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0');
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result
index 78e17786461..631403c0fa9 100644
--- a/mysql-test/main/type_date.result
+++ b/mysql-test/main/type_date.result
@@ -596,7 +596,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect date value: '2001-01-01x'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' and <cache>(hex(DATE'2001-01-01')) <> concat('xx',rand())
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-01' and <cache>(hex(DATE'2001-01-01')) <> mariadb_schema.concat('xx',rand())
DROP TABLE t1;
CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
diff --git a/mysql-test/suite/compat/oracle/r/func_concat.result b/mysql-test/suite/compat/oracle/r/func_concat.result
index 392d579707a..62e1053d8f8 100644
--- a/mysql-test/suite/compat/oracle/r/func_concat.result
+++ b/mysql-test/suite/compat/oracle/r/func_concat.result
@@ -3,12 +3,12 @@ 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_operator_oracle(concat_operator_oracle('a','b'),'c') AS "'a'||'b'||'c'"
+Note 1003 select oracle_schema.concat(oracle_schema.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_operator_oracle(concat_operator_oracle(concat_operator_oracle('a','b'),'c')) AS "CONCAT('a'||'b'||'c')"
+Note 1003 select oracle_schema.concat(oracle_schema.concat(oracle_schema.concat('a','b'),'c')) AS "CONCAT('a'||'b'||'c')"
SELECT '' || '';
'' || ''
@@ -211,14 +211,14 @@ 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_operator_oracle(concat_operator_oracle('foo',NULL),'bar') AS "test" latin1 latin1_swedish_ci
+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=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select concat_operator_oracle(concat_operator_oracle('foo',NULL),'bar') AS `test` latin1 latin1_swedish_ci
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` 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
@@ -234,7 +234,7 @@ NULL
SET sql_mode=ORACLE;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE VIEW "v1" AS select concat('foo',NULL,'bar') AS "test" latin1 latin1_swedish_ci
+v1 CREATE VIEW "v1" AS select mariadb_schema.concat('foo',NULL,'bar') AS "test" latin1 latin1_swedish_ci
SELECT * FROM v1;
test
NULL
@@ -268,12 +268,12 @@ 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_operator_oracle(1,1) AS "a"
+Note 1003 select -1 << oracle_schema.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_operator_oracle(-1,0) << 1 AS "a"
+Note 1003 select oracle_schema.concat(-1,0) << 1 AS "a"
SELECT -1+1||1 AS a FROM DUAL;
a
01
@@ -284,12 +284,12 @@ 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_operator_oracle(-1 + 1,1) AS "a"
+Note 1003 select oracle_schema.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_operator_oracle(-1,0) + 1 AS "a"
+Note 1003 select oracle_schema.concat(-1,0) + 1 AS "a"
SELECT 1*1||-1 AS a FROM DUAL;
a
1-1
@@ -300,12 +300,12 @@ 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_operator_oracle(1 * 1,-1) AS "a"
+Note 1003 select oracle_schema.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_operator_oracle(1,1 * -1) AS "a"
+Note 1003 select oracle_schema.concat(1,1 * -1) AS "a"
SELECT -1^1||1 AS a FROM DUAL;
a
184467440737095516141
@@ -316,12 +316,12 @@ 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_operator_oracle(-1 ^ 1,1) AS "a"
+Note 1003 select oracle_schema.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_operator_oracle(-1,0 ^ 1) AS "a"
+Note 1003 select oracle_schema.concat(-1,0 ^ 1) AS "a"
#
# MDEV-17359 Concatenation operator || in like expression failed in sql_mode=ORACLE
#
@@ -332,7 +332,7 @@ 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_operator_oracle('a','%') AS "'abc' LIKE 'a'||'%'"
+Note 1003 select 'abc' like oracle_schema.concat('a','%') AS "'abc' LIKE 'a'||'%'"
SELECT 'x' FROM DUAL WHERE 11 LIKE 1||1;
x
x
@@ -353,7 +353,7 @@ 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 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like <cache>(concat_operator_oracle('%','b')) order by "test"."t1"."ord"
+Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like <cache>(oracle_schema.concat('%','b')) order by "test"."t1"."ord"
SELECT c1 FROM t1 WHERE c1 LIKE c2||'%'||'c' ORDER BY ord;
c1
abc
@@ -361,7 +361,7 @@ 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 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like concat_operator_oracle(concat_operator_oracle("test"."t1"."c2",'%'),'c') order by "test"."t1"."ord"
+Note 1003 select "test"."t1"."c1" AS "c1" from "test"."t1" where "test"."t1"."c1" like oracle_schema.concat(oracle_schema.concat("test"."t1"."c2",'%'),'c') order by "test"."t1"."ord"
SELECT 'x' FROM t1 WHERE c1||c2 LIKE 'aa%';
x
x
@@ -369,7 +369,7 @@ 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 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 select 'x' AS "x" from "test"."t1" where concat_operator_oracle("test"."t1"."c1","test"."t1"."c2") like 'aa%'
+Note 1003 select 'x' AS "x" from "test"."t1" where oracle_schema.concat("test"."t1"."c1","test"."t1"."c2") like 'aa%'
SELECT 'x' FROM t1 WHERE c1||c2 LIKE c2||c1;
x
x
@@ -377,7 +377,7 @@ 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 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 select 'x' AS "x" from "test"."t1" where concat_operator_oracle("test"."t1"."c1","test"."t1"."c2") like concat_operator_oracle("test"."t1"."c2","test"."t1"."c1")
+Note 1003 select 'x' AS "x" from "test"."t1" where oracle_schema.concat("test"."t1"."c1","test"."t1"."c2") like oracle_schema.concat("test"."t1"."c2","test"."t1"."c1")
CREATE VIEW v1 AS SELECT c1, c2, c1 LIKE c2||'_' FROM t1 ORDER BY ord;
SELECT * FROM v1;
c1 c2 c1 LIKE c2||'_'
@@ -388,6 +388,6 @@ EXPLAIN EXTENDED SELECT * FROM v1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using filesort
Warnings:
-Note 1003 select "test"."t1"."c1" AS "c1","test"."t1"."c2" AS "c2","test"."t1"."c1" like concat_operator_oracle("test"."t1"."c2",'_') AS "c1 LIKE c2||'_'" from "test"."t1" order by "test"."t1"."ord"
+Note 1003 select "test"."t1"."c1" AS "c1","test"."t1"."c2" AS "c2","test"."t1"."c1" like oracle_schema.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/suite/compat/oracle/r/func_decode.result b/mysql-test/suite/compat/oracle/r/func_decode.result
index b49bad93627..5200b733bab 100644
--- a/mysql-test/suite/compat/oracle/r/func_decode.result
+++ b/mysql-test/suite/compat/oracle/r/func_decode.result
@@ -1,8 +1,8 @@
SET sql_mode=ORACLE;
SELECT DECODE(10);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
SELECT DECODE(10,10);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
SELECT DECODE(10,10,'x10');
DECODE(10,10,'x10')
x10
@@ -28,40 +28,40 @@ EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11','def');
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 decode_oracle(12,10,'x10',11,'x11','def') AS "DECODE(12,10,'x10',11,'x11','def')"
+Note 1003 select oracle_schema.decode(12,10,'x10',11,'x11','def') AS "DECODE(12,10,'x10',11,'x11','def')"
CREATE TABLE decode (decode int);
DROP TABLE decode;
#
# MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent
#
SELECT DECODE(10);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
SELECT DECODE(10,10);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
SELECT DECODE_ORACLE(10);
-ERROR 42000: Incorrect parameter count in the call to native function 'DECODE_ORACLE'
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE_ORACLE'
SELECT DECODE_ORACLE(10,10);
-ERROR 42000: Incorrect parameter count in the call to native function 'DECODE_ORACLE'
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE_ORACLE'
EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11');
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 decode_oracle(12,10,'x10',11,'x11') AS "DECODE(12,10,'x10',11,'x11')"
+Note 1003 select oracle_schema.decode(12,10,'x10',11,'x11') AS "DECODE(12,10,'x10',11,'x11')"
EXPLAIN EXTENDED SELECT DECODE(12,10,'x10',11,'x11','def');
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 decode_oracle(12,10,'x10',11,'x11','def') AS "DECODE(12,10,'x10',11,'x11','def')"
+Note 1003 select oracle_schema.decode(12,10,'x10',11,'x11','def') AS "DECODE(12,10,'x10',11,'x11','def')"
EXPLAIN EXTENDED SELECT DECODE_ORACLE(12,10,'x10',11,'x11');
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 decode_oracle(12,10,'x10',11,'x11') AS "DECODE_ORACLE(12,10,'x10',11,'x11')"
+Note 1003 select oracle_schema.decode(12,10,'x10',11,'x11') AS "DECODE_ORACLE(12,10,'x10',11,'x11')"
EXPLAIN EXTENDED SELECT DECODE_ORACLE(12,10,'x10',11,'x11','def');
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 decode_oracle(12,10,'x10',11,'x11','def') AS "DECODE_ORACLE(12,10,'x10',11,'x11','def')"
+Note 1003 select oracle_schema.decode(12,10,'x10',11,'x11','def') AS "DECODE_ORACLE(12,10,'x10',11,'x11','def')"
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS
SELECT
@@ -72,7 +72,7 @@ DECODE_ORACLE(a,1,'x1',NULL,'xNULL','xELSE') AS d4
FROM t1;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE VIEW "v1" AS select decode_oracle("t1"."a",1,'x1',NULL,'xNULL') AS "d1",decode_oracle("t1"."a",1,'x1',NULL,'xNULL','xELSE') AS "d2",decode_oracle("t1"."a",1,'x1',NULL,'xNULL') AS "d3",decode_oracle("t1"."a",1,'x1',NULL,'xNULL','xELSE') AS "d4" from "t1" latin1 latin1_swedish_ci
+v1 CREATE VIEW "v1" AS select decode("t1"."a",1,'x1',NULL,'xNULL') AS "d1",decode("t1"."a",1,'x1',NULL,'xNULL','xELSE') AS "d2",decode("t1"."a",1,'x1',NULL,'xNULL') AS "d3",decode("t1"."a",1,'x1',NULL,'xNULL','xELSE') AS "d4" from "t1" latin1 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
SELECT DECODE(TIME'10:20:31','10:20:31','then1','10:20:32','then2','def');
diff --git a/mysql-test/suite/compat/oracle/r/func_pad.result b/mysql-test/suite/compat/oracle/r/func_pad.result
index ca7d52cd542..6ec2e7bda22 100644
--- a/mysql-test/suite/compat/oracle/r/func_pad.result
+++ b/mysql-test/suite/compat/oracle/r/func_pad.result
@@ -44,11 +44,11 @@ EXPLAIN EXTENDED SELECT RPAD('a',0,'.'), LPAD('a',0,'.'), LPAD(c1,c2,c3), LPAD(c
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using filesort
Warnings:
-Note 1003 select rpad_oracle('a',0,'.') AS "RPAD('a',0,'.')",lpad_oracle('a',0,'.') AS "LPAD('a',0,'.')",lpad_oracle("test"."t1"."c1","test"."t1"."c2","test"."t1"."c3") AS "LPAD(c1,c2,c3)",lpad_oracle("test"."t1"."c1","test"."t1"."c2") AS "LPAD(c1,c2)",rpad_oracle("test"."t1"."c1","test"."t1"."c2","test"."t1"."c3") AS "RPAD(c1,c2,c3)",rpad_oracle("test"."t1"."c1","test"."t1"."c2") AS "RPAD(c1,c2)" from "test"."t1" order by "test"."t1"."ord"
+Note 1003 select oracle_schema.rpad('a',0,'.') AS "RPAD('a',0,'.')",oracle_schema.lpad('a',0,'.') AS "LPAD('a',0,'.')",oracle_schema.lpad("test"."t1"."c1","test"."t1"."c2","test"."t1"."c3") AS "LPAD(c1,c2,c3)",oracle_schema.lpad("test"."t1"."c1","test"."t1"."c2") AS "LPAD(c1,c2)",oracle_schema.rpad("test"."t1"."c1","test"."t1"."c2","test"."t1"."c3") AS "RPAD(c1,c2,c3)",oracle_schema.rpad("test"."t1"."c1","test"."t1"."c2") AS "RPAD(c1,c2)" from "test"."t1" order by "test"."t1"."ord"
CREATE VIEW v1 AS SELECT RPAD('a',0,'.') AS "C1", LPAD('a',0,'.') AS "C2", LPAD(c1,c2,c3) AS "C3", LPAD(c1,c2) AS "C4", RPAD(c1,c2,c3) AS "C5", RPAD(c1,c2) AS "C6" FROM t1 ORDER BY ord;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE VIEW "v1" AS select rpad_oracle('a',0,'.') AS "C1",lpad_oracle('a',0,'.') AS "C2",lpad_oracle("t1"."c1","t1"."c2","t1"."c3") AS "C3",lpad_oracle("t1"."c1","t1"."c2") AS "C4",rpad_oracle("t1"."c1","t1"."c2","t1"."c3") AS "C5",rpad_oracle("t1"."c1","t1"."c2") AS "C6" from "t1" order by "t1"."ord" latin1 latin1_swedish_ci
+v1 CREATE VIEW "v1" AS select rpad('a',0,'.') AS "C1",lpad('a',0,'.') AS "C2",lpad("t1"."c1","t1"."c2","t1"."c3") AS "C3",lpad("t1"."c1","t1"."c2") AS "C4",rpad("t1"."c1","t1"."c2","t1"."c3") AS "C5",rpad("t1"."c1","t1"."c2") AS "C6" from "t1" order by "t1"."ord" latin1 latin1_swedish_ci
SELECT * FROM v1;
C1 C2 C3 C4 C5 C6
NULL NULL NULL a NULL a
diff --git a/mysql-test/suite/compat/oracle/r/func_qualified.result b/mysql-test/suite/compat/oracle/r/func_qualified.result
new file mode 100644
index 00000000000..ed34ce711fd
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/func_qualified.result
@@ -0,0 +1,2027 @@
+#
+# MDEV-27744 InnoDB: Failing assertion: !cursor->index->is_committed() in row0ins.cc (from row_ins_sec_index_entry_by_modify) | Assertion `0' failed in row_upd_sec_index_entry (debug) | Corruption
+#
+SET sql_mode=DEFAULT;
+SELECT decode_oracle(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.decode_oracle'
+SELECT DECODE_ORACLE(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE_ORACLE'
+SET sql_mode=ORACLE;
+SELECT decode_oracle(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.decode_oracle'
+SELECT DECODE_ORACLE(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE_ORACLE'
+SET sql_mode=DEFAULT;
+SELECT decode(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'mariadb_schema.decode'
+SELECT DECODE(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+SET sql_mode=ORACLE;
+SELECT decode(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.decode'
+SELECT DECODE(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
+SELECT mariadb_schema.decode(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'mariadb_schema.decode'
+SELECT mariadb_schema.DECODE(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+SELECT mariadb_schema.decode_oracle(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.decode_oracle'
+SELECT mariadb_schema.DECODE_ORACLE(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'oracle_schema.DECODE_ORACLE'
+SET sql_mode=DEFAULT;
+SELECT unknown.TRIM(1);
+ERROR HY000: Function 'unknown.TRIM' is not defined
+SELECT unknown.trim(1);
+ERROR HY000: Function 'unknown.trim' is not defined
+SELECT unknown.SUBSTR('a',1,2);
+ERROR HY000: Function 'unknown.SUBSTR' is not defined
+SELECT unknown.substr('a',1,2);
+ERROR HY000: Function 'unknown.substr' is not defined
+SELECT unknown.SUBSTRING('a',1,2);
+ERROR HY000: Function 'unknown.SUBSTRING' is not defined
+SELECT unknown.substring('a',1,2);
+ERROR HY000: Function 'unknown.substring' is not defined
+SELECT unknown.REPLACE('a','b','c');
+ERROR HY000: Function 'unknown.REPLACE' is not defined
+SELECT unknown.replace('a','b','c');
+ERROR HY000: Function 'unknown.replace' is not defined
+SET sql_mode=DEFAULT;
+CREATE PROCEDURE p1(sqlmode TEXT, qualifier TEXT, expr TEXT)
+BEGIN
+DECLARE query TEXT DEFAULT 'SELECT $(QUALIFIER)$(EXPR)';
+DECLARE errmsg TEXT DEFAULT NULL;
+DECLARE CONTINUE HANDLER FOR 1128, 1305, 1582
+BEGIN
+GET DIAGNOSTICS CONDITION 1 errmsg = MESSAGE_TEXT;
+END;
+SET sql_mode=sqlmode;
+SET query=REPLACE(query, '$(QUALIFIER)', qualifier);
+SET query=REPLACE(query, '$(EXPR)', expr);
+SET query= CONCAT('EXPLAIN EXTENDED ', query);
+SELECT CONCAT('sql_mode=''',sqlmode,'''', ' ',
+'qualifier=''',qualifier,'''') AS `----------`;
+SELECT query;
+EXECUTE IMMEDIATE query;
+IF errmsg IS NOT NULL THEN
+SELECT CONCAT('ERROR: ', errmsg) AS errmsg;
+ELSE
+SHOW WARNINGS;
+END IF;
+END;
+$$
+CREATE PROCEDURE p2(sqlmode TEXT, expr TEXT)
+BEGIN
+CALL p1(sqlmode, '', expr);
+CALL p1(sqlmode, 'unknown_schema.', expr);
+CALL p1(sqlmode, 'mariadb_schema.', expr);
+CALL p1(sqlmode, 'maxdb_schema.', expr);
+CALL p1(sqlmode, 'oracle_schema.', expr);
+END;
+$$
+CREATE PROCEDURE p3(expr TEXT)
+BEGIN
+CALL p2('', expr);
+CALL p2('ORACLE', expr);
+END;
+$$
+CALL p3('CONCAT(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT CONCAT('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
+Level Code Message
+Note 1003 select mariadb_schema.concat('a') AS `CONCAT('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.CONCAT('a')
+errmsg
+ERROR: FUNCTION unknown_schema.CONCAT does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.CONCAT('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
+Level Code Message
+Note 1003 select mariadb_schema.concat('a') AS `mariadb_schema.CONCAT('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.CONCAT('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
+Level Code Message
+Note 1003 select mariadb_schema.concat('a') AS `maxdb_schema.CONCAT('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.CONCAT('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS `oracle_schema.CONCAT('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT CONCAT('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS "CONCAT('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.CONCAT('a')
+errmsg
+ERROR: FUNCTION unknown_schema.CONCAT does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.CONCAT('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
+Level Code Message
+Note 1003 select mariadb_schema.concat('a') AS "mariadb_schema.CONCAT('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.CONCAT('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
+Level Code Message
+Note 1003 select mariadb_schema.concat('a') AS "maxdb_schema.CONCAT('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.CONCAT('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS "oracle_schema.CONCAT('a')"
+Warnings:
+Note 1003 select oracle_schema.concat('a') AS "oracle_schema.CONCAT('a')"
+CALL p3('DECODE(''1'',''2'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT DECODE('1','2')
+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
+Level Code Message
+Note 1003 select mariadb_schema.decode('1','2') AS `DECODE('1','2')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.DECODE('1','2')
+errmsg
+ERROR: FUNCTION unknown_schema.DECODE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.DECODE('1','2')
+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
+Level Code Message
+Note 1003 select mariadb_schema.decode('1','2') AS `mariadb_schema.DECODE('1','2')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.DECODE('1','2')
+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
+Level Code Message
+Note 1003 select mariadb_schema.decode('1','2') AS `maxdb_schema.DECODE('1','2')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.DECODE('1','2')
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT DECODE('1','2')
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.DECODE('1','2')
+errmsg
+ERROR: FUNCTION unknown_schema.DECODE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.DECODE('1','2')
+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
+Level Code Message
+Note 1003 select mariadb_schema.decode('1','2') AS "mariadb_schema.DECODE('1','2')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.DECODE('1','2')
+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
+Level Code Message
+Note 1003 select mariadb_schema.decode('1','2') AS "maxdb_schema.DECODE('1','2')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.DECODE('1','2')
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'oracle_schema.DECODE'
+CALL p3('DECODE(1,1,10)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT DECODE(1,1,10)
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.DECODE(1,1,10)
+errmsg
+ERROR: FUNCTION unknown_schema.DECODE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.DECODE(1,1,10)
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.DECODE(1,1,10)
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.DECODE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS `oracle_schema.DECODE(1,1,10)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT DECODE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS "DECODE(1,1,10)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.DECODE(1,1,10)
+errmsg
+ERROR: FUNCTION unknown_schema.DECODE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.DECODE(1,1,10)
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.DECODE(1,1,10)
+errmsg
+ERROR: Incorrect parameter count in the call to native function 'mariadb_schema.DECODE'
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.DECODE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS "oracle_schema.DECODE(1,1,10)"
+Warnings:
+Note 1003 select oracle_schema.decode(1,1,10) AS "oracle_schema.DECODE(1,1,10)"
+CALL p3('LTRIM(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.ltrim('a') AS `LTRIM('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LTRIM('a')
+errmsg
+ERROR: FUNCTION unknown_schema.LTRIM does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.ltrim('a') AS `mariadb_schema.LTRIM('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.ltrim('a') AS `maxdb_schema.LTRIM('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LTRIM('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS `oracle_schema.LTRIM('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LTRIM('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS "LTRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LTRIM('a')
+errmsg
+ERROR: FUNCTION unknown_schema.LTRIM does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.ltrim('a') AS "mariadb_schema.LTRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.ltrim('a') AS "maxdb_schema.LTRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LTRIM('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS "oracle_schema.LTRIM('a')"
+Warnings:
+Note 1003 select oracle_schema.ltrim('a') AS "oracle_schema.LTRIM('a')"
+CALL p3('RTRIM(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.rtrim('a') AS `RTRIM('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RTRIM('a')
+errmsg
+ERROR: FUNCTION unknown_schema.RTRIM does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.rtrim('a') AS `mariadb_schema.RTRIM('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.rtrim('a') AS `maxdb_schema.RTRIM('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RTRIM('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS `oracle_schema.RTRIM('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RTRIM('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS "RTRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RTRIM('a')
+errmsg
+ERROR: FUNCTION unknown_schema.RTRIM does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.rtrim('a') AS "mariadb_schema.RTRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RTRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.rtrim('a') AS "maxdb_schema.RTRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RTRIM('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS "oracle_schema.RTRIM('a')"
+Warnings:
+Note 1003 select oracle_schema.rtrim('a') AS "oracle_schema.RTRIM('a')"
+CALL p3('LPAD(''a'',3)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3) AS `LPAD('a',3)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LPAD('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.LPAD does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3) AS `mariadb_schema.LPAD('a',3)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3) AS `maxdb_schema.LPAD('a',3)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LPAD('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS `oracle_schema.LPAD('a',3)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LPAD('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS "LPAD('a',3)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LPAD('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.LPAD does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3) AS "mariadb_schema.LPAD('a',3)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3) AS "maxdb_schema.LPAD('a',3)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LPAD('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS "oracle_schema.LPAD('a',3)"
+Warnings:
+Note 1003 select oracle_schema.lpad('a',3) AS "oracle_schema.LPAD('a',3)"
+CALL p3('LPAD(''a'',3, '' '')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3,' ') AS `LPAD('a',3, ' ')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LPAD('a',3, ' ')
+errmsg
+ERROR: FUNCTION unknown_schema.LPAD does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3,' ') AS `mariadb_schema.LPAD('a',3, ' ')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3,' ') AS `maxdb_schema.LPAD('a',3, ' ')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3,' ') AS `oracle_schema.LPAD('a',3, ' ')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3,' ') AS "LPAD('a',3, ' ')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LPAD('a',3, ' ')
+errmsg
+ERROR: FUNCTION unknown_schema.LPAD does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3,' ') AS "mariadb_schema.LPAD('a',3, ' ')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.lpad('a',3,' ') AS "maxdb_schema.LPAD('a',3, ' ')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3,' ') AS "oracle_schema.LPAD('a',3, ' ')"
+Warnings:
+Note 1003 select oracle_schema.lpad('a',3,' ') AS "oracle_schema.LPAD('a',3, ' ')"
+CALL p3('RPAD(''a'',3)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3) AS `RPAD('a',3)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RPAD('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.RPAD does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3) AS `mariadb_schema.RPAD('a',3)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3) AS `maxdb_schema.RPAD('a',3)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RPAD('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS `oracle_schema.RPAD('a',3)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RPAD('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS "RPAD('a',3)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RPAD('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.RPAD does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3) AS "mariadb_schema.RPAD('a',3)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RPAD('a',3)
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3) AS "maxdb_schema.RPAD('a',3)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RPAD('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS "oracle_schema.RPAD('a',3)"
+Warnings:
+Note 1003 select oracle_schema.rpad('a',3) AS "oracle_schema.RPAD('a',3)"
+CALL p3('RPAD(''a'',3, '' '')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3,' ') AS `RPAD('a',3, ' ')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RPAD('a',3, ' ')
+errmsg
+ERROR: FUNCTION unknown_schema.RPAD does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3,' ') AS `mariadb_schema.RPAD('a',3, ' ')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3,' ') AS `maxdb_schema.RPAD('a',3, ' ')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3,' ') AS `oracle_schema.RPAD('a',3, ' ')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3,' ') AS "RPAD('a',3, ' ')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RPAD('a',3, ' ')
+errmsg
+ERROR: FUNCTION unknown_schema.RPAD does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3,' ') AS "mariadb_schema.RPAD('a',3, ' ')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select mariadb_schema.rpad('a',3,' ') AS "maxdb_schema.RPAD('a',3, ' ')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RPAD('a',3, ' ')
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3,' ') AS "oracle_schema.RPAD('a',3, ' ')"
+Warnings:
+Note 1003 select oracle_schema.rpad('a',3,' ') AS "oracle_schema.RPAD('a',3, ' ')"
+CALL p3('REPLACE(''a'',''b'',''c'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT REPLACE('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
+Level Code Message
+Note 1003 select mariadb_schema.replace('a','b','c') AS `REPLACE('a','b','c')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.REPLACE('a','b','c')
+errmsg
+ERROR: Function 'unknown_schema.REPLACE' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.REPLACE('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
+Level Code Message
+Note 1003 select mariadb_schema.replace('a','b','c') AS `mariadb_schema.REPLACE('a','b','c')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.REPLACE('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
+Level Code Message
+Note 1003 select mariadb_schema.replace('a','b','c') AS `maxdb_schema.REPLACE('a','b','c')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.REPLACE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS `oracle_schema.REPLACE('a','b','c')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT REPLACE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS "REPLACE('a','b','c')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.REPLACE('a','b','c')
+errmsg
+ERROR: Function 'unknown_schema.REPLACE' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.REPLACE('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
+Level Code Message
+Note 1003 select mariadb_schema.replace('a','b','c') AS "mariadb_schema.REPLACE('a','b','c')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.REPLACE('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
+Level Code Message
+Note 1003 select mariadb_schema.replace('a','b','c') AS "maxdb_schema.REPLACE('a','b','c')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.REPLACE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS "oracle_schema.REPLACE('a','b','c')"
+Warnings:
+Note 1003 select oracle_schema.replace('a','b','c') AS "oracle_schema.REPLACE('a','b','c')"
+CALL p3('SUBSTR(''a'',1,2)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS `SUBSTR('a',1,2)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTR('a',1,2)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTR' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS `mariadb_schema.SUBSTR('a',1,2)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS `maxdb_schema.SUBSTR('a',1,2)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS `oracle_schema.SUBSTR('a',1,2)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "SUBSTR('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTR('a',1,2)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTR' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS "mariadb_schema.SUBSTR('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS "maxdb_schema.SUBSTR('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTR('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "oracle_schema.SUBSTR('a',1,2)"
+Warnings:
+Note 1003 select oracle_schema.substr('a',1,2) AS "oracle_schema.SUBSTR('a',1,2)"
+CALL p3('SUBSTR(''a'' FROM 1)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS `SUBSTR('a' FROM 1)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTR('a' FROM 1)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTR' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS `mariadb_schema.SUBSTR('a' FROM 1)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS `maxdb_schema.SUBSTR('a' FROM 1)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1) AS `oracle_schema.SUBSTR('a' FROM 1)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1) AS "SUBSTR('a' FROM 1)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTR('a' FROM 1)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTR' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS "mariadb_schema.SUBSTR('a' FROM 1)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS "maxdb_schema.SUBSTR('a' FROM 1)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTR('a' FROM 1)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1) AS "oracle_schema.SUBSTR('a' FROM 1)"
+Warnings:
+Note 1003 select oracle_schema.substr('a',1) AS "oracle_schema.SUBSTR('a' FROM 1)"
+CALL p3('SUBSTRING(''a'',1,2)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS `SUBSTRING('a',1,2)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTRING('a',1,2)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTRING' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS `mariadb_schema.SUBSTRING('a',1,2)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS `maxdb_schema.SUBSTRING('a',1,2)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS `oracle_schema.SUBSTRING('a',1,2)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "SUBSTRING('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTRING('a',1,2)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTRING' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS "mariadb_schema.SUBSTRING('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1,2) AS "maxdb_schema.SUBSTRING('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTRING('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "oracle_schema.SUBSTRING('a',1,2)"
+Warnings:
+Note 1003 select oracle_schema.substr('a',1,2) AS "oracle_schema.SUBSTRING('a',1,2)"
+CALL p3('SUBSTRING(''a'' FROM 1)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS `SUBSTRING('a' FROM 1)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTRING('a' FROM 1)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTRING' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS `mariadb_schema.SUBSTRING('a' FROM 1)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS `maxdb_schema.SUBSTRING('a' FROM 1)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1) AS `oracle_schema.SUBSTRING('a' FROM 1)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1) AS "SUBSTRING('a' FROM 1)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTRING('a' FROM 1)
+errmsg
+ERROR: Function 'unknown_schema.SUBSTRING' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS "mariadb_schema.SUBSTRING('a' FROM 1)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select mariadb_schema.substr('a',1) AS "maxdb_schema.SUBSTRING('a' FROM 1)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTRING('a' FROM 1)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1) AS "oracle_schema.SUBSTRING('a' FROM 1)"
+Warnings:
+Note 1003 select oracle_schema.substr('a',1) AS "oracle_schema.SUBSTRING('a' FROM 1)"
+CALL p3('TRIM(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT TRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.trim('a') AS `TRIM('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.TRIM('a')
+errmsg
+ERROR: Function 'unknown_schema.TRIM' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.TRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.trim('a') AS `mariadb_schema.TRIM('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.TRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.trim('a') AS `maxdb_schema.TRIM('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.TRIM('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
+Level Code Message
+Note 1003 select oracle_schema.trim('a') AS `oracle_schema.TRIM('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT TRIM('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
+Level Code Message
+Note 1003 select oracle_schema.trim('a') AS "TRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.TRIM('a')
+errmsg
+ERROR: Function 'unknown_schema.TRIM' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.TRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.trim('a') AS "mariadb_schema.TRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.TRIM('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
+Level Code Message
+Note 1003 select mariadb_schema.trim('a') AS "maxdb_schema.TRIM('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.TRIM('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
+Level Code Message
+Note 1003 select oracle_schema.trim('a') AS "oracle_schema.TRIM('a')"
+Warnings:
+Note 1003 select oracle_schema.trim('a') AS "oracle_schema.TRIM('a')"
+CALL p3('TRIM(BOTH '' '' FROM ''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select mariadb_schema.trim(both ' ' from 'a') AS `TRIM(BOTH ' ' FROM 'a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.TRIM(BOTH ' ' FROM 'a')
+errmsg
+ERROR: Function 'unknown_schema.TRIM' is not defined
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select mariadb_schema.trim(both ' ' from 'a') AS `mariadb_schema.TRIM(BOTH ' ' FROM 'a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select mariadb_schema.trim(both ' ' from 'a') AS `maxdb_schema.TRIM(BOTH ' ' FROM 'a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select oracle_schema.trim(both ' ' from 'a') AS `oracle_schema.TRIM(BOTH ' ' FROM 'a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select oracle_schema.trim(both ' ' from 'a') AS "TRIM(BOTH ' ' FROM 'a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.TRIM(BOTH ' ' FROM 'a')
+errmsg
+ERROR: Function 'unknown_schema.TRIM' is not defined
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select mariadb_schema.trim(both ' ' from 'a') AS "mariadb_schema.TRIM(BOTH ' ' FROM 'a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select mariadb_schema.trim(both ' ' from 'a') AS "maxdb_schema.TRIM(BOTH ' ' FROM 'a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.TRIM(BOTH ' ' FROM '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
+Level Code Message
+Note 1003 select oracle_schema.trim(both ' ' from 'a') AS "oracle_schema.TRIM(BOTH ' ' FROM 'a')"
+Warnings:
+Note 1003 select oracle_schema.trim(both ' ' from 'a') AS "oracle_schema.TRIM(BOTH ' ' FROM 'a')"
+CALL p3('CONCAT_OPERATOR_ORACLE(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS `CONCAT_OPERATOR_ORACLE('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.CONCAT_OPERATOR_ORACLE('a')
+errmsg
+ERROR: FUNCTION unknown_schema.CONCAT_OPERATOR_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS `mariadb_schema.CONCAT_OPERATOR_ORACLE('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS `maxdb_schema.CONCAT_OPERATOR_ORACLE('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS `oracle_schema.CONCAT_OPERATOR_ORACLE('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS "CONCAT_OPERATOR_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.CONCAT_OPERATOR_ORACLE('a')
+errmsg
+ERROR: FUNCTION unknown_schema.CONCAT_OPERATOR_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS "mariadb_schema.CONCAT_OPERATOR_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS "maxdb_schema.CONCAT_OPERATOR_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.CONCAT_OPERATOR_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.concat('a') AS "oracle_schema.CONCAT_OPERATOR_ORACLE('a')"
+Warnings:
+Note 1003 select oracle_schema.concat('a') AS "oracle_schema.CONCAT_OPERATOR_ORACLE('a')"
+CALL p3('DECODE_ORACLE(1,1,10)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS `DECODE_ORACLE(1,1,10)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.DECODE_ORACLE(1,1,10)
+errmsg
+ERROR: FUNCTION unknown_schema.DECODE_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS `mariadb_schema.DECODE_ORACLE(1,1,10)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS `maxdb_schema.DECODE_ORACLE(1,1,10)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS `oracle_schema.DECODE_ORACLE(1,1,10)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS "DECODE_ORACLE(1,1,10)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.DECODE_ORACLE(1,1,10)
+errmsg
+ERROR: FUNCTION unknown_schema.DECODE_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS "mariadb_schema.DECODE_ORACLE(1,1,10)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS "maxdb_schema.DECODE_ORACLE(1,1,10)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.DECODE_ORACLE(1,1,10)
+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
+Level Code Message
+Note 1003 select oracle_schema.decode(1,1,10) AS "oracle_schema.DECODE_ORACLE(1,1,10)"
+Warnings:
+Note 1003 select oracle_schema.decode(1,1,10) AS "oracle_schema.DECODE_ORACLE(1,1,10)"
+CALL p3('LTRIM_ORACLE(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS `LTRIM_ORACLE('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LTRIM_ORACLE('a')
+errmsg
+ERROR: FUNCTION unknown_schema.LTRIM_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS `mariadb_schema.LTRIM_ORACLE('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS `maxdb_schema.LTRIM_ORACLE('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS `oracle_schema.LTRIM_ORACLE('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS "LTRIM_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LTRIM_ORACLE('a')
+errmsg
+ERROR: FUNCTION unknown_schema.LTRIM_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS "mariadb_schema.LTRIM_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS "maxdb_schema.LTRIM_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.ltrim('a') AS "oracle_schema.LTRIM_ORACLE('a')"
+Warnings:
+Note 1003 select oracle_schema.ltrim('a') AS "oracle_schema.LTRIM_ORACLE('a')"
+CALL p3('RTRIM_ORACLE(''a'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS `RTRIM_ORACLE('a')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RTRIM_ORACLE('a')
+errmsg
+ERROR: FUNCTION unknown_schema.RTRIM_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS `mariadb_schema.RTRIM_ORACLE('a')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS `maxdb_schema.RTRIM_ORACLE('a')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS `oracle_schema.RTRIM_ORACLE('a')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS "RTRIM_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RTRIM_ORACLE('a')
+errmsg
+ERROR: FUNCTION unknown_schema.RTRIM_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS "mariadb_schema.RTRIM_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS "maxdb_schema.RTRIM_ORACLE('a')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RTRIM_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.rtrim('a') AS "oracle_schema.RTRIM_ORACLE('a')"
+Warnings:
+Note 1003 select oracle_schema.rtrim('a') AS "oracle_schema.RTRIM_ORACLE('a')"
+CALL p3('LPAD_ORACLE(''a'',3)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS `LPAD_ORACLE('a',3)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LPAD_ORACLE('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.LPAD_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS `mariadb_schema.LPAD_ORACLE('a',3)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS `maxdb_schema.LPAD_ORACLE('a',3)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS `oracle_schema.LPAD_ORACLE('a',3)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS "LPAD_ORACLE('a',3)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.LPAD_ORACLE('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.LPAD_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS "mariadb_schema.LPAD_ORACLE('a',3)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS "maxdb_schema.LPAD_ORACLE('a',3)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.LPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.lpad('a',3) AS "oracle_schema.LPAD_ORACLE('a',3)"
+Warnings:
+Note 1003 select oracle_schema.lpad('a',3) AS "oracle_schema.LPAD_ORACLE('a',3)"
+CALL p3('RPAD_ORACLE(''a'',3)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS `RPAD_ORACLE('a',3)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RPAD_ORACLE('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.RPAD_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS `mariadb_schema.RPAD_ORACLE('a',3)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS `maxdb_schema.RPAD_ORACLE('a',3)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS `oracle_schema.RPAD_ORACLE('a',3)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS "RPAD_ORACLE('a',3)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.RPAD_ORACLE('a',3)
+errmsg
+ERROR: FUNCTION unknown_schema.RPAD_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS "mariadb_schema.RPAD_ORACLE('a',3)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS "maxdb_schema.RPAD_ORACLE('a',3)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.RPAD_ORACLE('a',3)
+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
+Level Code Message
+Note 1003 select oracle_schema.rpad('a',3) AS "oracle_schema.RPAD_ORACLE('a',3)"
+Warnings:
+Note 1003 select oracle_schema.rpad('a',3) AS "oracle_schema.RPAD_ORACLE('a',3)"
+CALL p3('REPLACE_ORACLE(''a'',''b'',''c'')');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS `REPLACE_ORACLE('a','b','c')`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.REPLACE_ORACLE('a','b','c')
+errmsg
+ERROR: FUNCTION unknown_schema.REPLACE_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS `mariadb_schema.REPLACE_ORACLE('a','b','c')`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS `maxdb_schema.REPLACE_ORACLE('a','b','c')`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS `oracle_schema.REPLACE_ORACLE('a','b','c')`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS "REPLACE_ORACLE('a','b','c')"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.REPLACE_ORACLE('a','b','c')
+errmsg
+ERROR: FUNCTION unknown_schema.REPLACE_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS "mariadb_schema.REPLACE_ORACLE('a','b','c')"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS "maxdb_schema.REPLACE_ORACLE('a','b','c')"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.REPLACE_ORACLE('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
+Level Code Message
+Note 1003 select oracle_schema.replace('a','b','c') AS "oracle_schema.REPLACE_ORACLE('a','b','c')"
+Warnings:
+Note 1003 select oracle_schema.replace('a','b','c') AS "oracle_schema.REPLACE_ORACLE('a','b','c')"
+CALL p3('SUBSTR_ORACLE(''a'',1,2)');
+----------
+sql_mode='' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS `SUBSTR_ORACLE('a',1,2)`
+----------
+sql_mode='' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTR_ORACLE('a',1,2)
+errmsg
+ERROR: FUNCTION unknown_schema.SUBSTR_ORACLE does not exist
+----------
+sql_mode='' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS `mariadb_schema.SUBSTR_ORACLE('a',1,2)`
+----------
+sql_mode='' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS `maxdb_schema.SUBSTR_ORACLE('a',1,2)`
+----------
+sql_mode='' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS `oracle_schema.SUBSTR_ORACLE('a',1,2)`
+----------
+sql_mode='ORACLE' qualifier=''
+query
+EXPLAIN EXTENDED SELECT SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "SUBSTR_ORACLE('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='unknown_schema.'
+query
+EXPLAIN EXTENDED SELECT unknown_schema.SUBSTR_ORACLE('a',1,2)
+errmsg
+ERROR: FUNCTION unknown_schema.SUBSTR_ORACLE does not exist
+----------
+sql_mode='ORACLE' qualifier='mariadb_schema.'
+query
+EXPLAIN EXTENDED SELECT mariadb_schema.SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "mariadb_schema.SUBSTR_ORACLE('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='maxdb_schema.'
+query
+EXPLAIN EXTENDED SELECT maxdb_schema.SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "maxdb_schema.SUBSTR_ORACLE('a',1,2)"
+----------
+sql_mode='ORACLE' qualifier='oracle_schema.'
+query
+EXPLAIN EXTENDED SELECT oracle_schema.SUBSTR_ORACLE('a',1,2)
+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
+Level Code Message
+Note 1003 select oracle_schema.substr('a',1,2) AS "oracle_schema.SUBSTR_ORACLE('a',1,2)"
+Warnings:
+Note 1003 select oracle_schema.substr('a',1,2) AS "oracle_schema.SUBSTR_ORACLE('a',1,2)"
+SELECT oracle_schema.SUBSTR_ORACLE('a' FROM 1 FOR 2);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM 1 FOR 2)' at line 1
+SELECT oracle_schema.SUBSTR('a' FROM 1 FOR 2);
+oracle_schema.SUBSTR('a' FROM 1 FOR 2)
+a
+SELECT oracle_schema.TRIM_ORACLE(LEADING ' ' FROM 'a');
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LEADING ' ' FROM 'a')' at line 1
+SELECT oracle_schema.TRIM(LEADING ' ' FROM 'a');
+oracle_schema.TRIM(LEADING ' ' FROM 'a')
+a
+SELECT oracle_schema.TRIM_ORACLE('a');
+ERROR HY000: Function 'TRIM_ORACLE' is not defined
+SELECT oracle_schema.TRIM('a');
+oracle_schema.TRIM('a')
+a
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+SET sql_mode='';
+CREATE VIEW v1 AS SELECT
+concat('a','b'),
+decode('1','2'),
+ltrim('1'),
+rtrim('1'),
+lpad('1','2', 3),
+rpad('1','2', 3),
+replace('1','2','3'),
+substr('a',1,2),
+trim(both 'a' FROM 'b');
+CREATE TABLE kv (v BLOB);
+LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv;
+SELECT v FROM kv WHERE v RLIKE '^(query|view_body_utf8)=' ORDER BY v;
+v
+query=select concat('a','b') AS `concat('a','b')`,decode('1','2') AS `decode('1','2')`,ltrim('1') AS `ltrim('1')`,rtrim('1') AS `rtrim('1')`,lpad('1','2',3) AS `lpad('1','2', 3)`,rpad('1','2',3) AS `rpad('1','2', 3)`,replace('1','2','3') AS `replace('1','2','3')`,substr('a',1,2) AS `substr('a',1,2)`,trim(both 'a' from 'b') AS `trim(both 'a' FROM 'b')`
+view_body_utf8=select mariadb_schema.concat('a','b') AS `concat('a','b')`,mariadb_schema.decode('1','2') AS `decode('1','2')`,mariadb_schema.ltrim('1') AS `ltrim('1')`,mariadb_schema.rtrim('1') AS `rtrim('1')`,mariadb_schema.lpad('1','2',3) AS `lpad('1','2', 3)`,mariadb_schema.rpad('1','2',3) AS `rpad('1','2', 3)`,mariadb_schema.replace('1','2','3') AS `replace('1','2','3')`,mariadb_schema.substr('a',1,2) AS `substr('a',1,2)`,mariadb_schema.trim(both 'a' from 'b') AS `trim(both 'a' FROM 'b')`
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1' AND TABLE_SCHEMA='test';
+VIEW_DEFINITION
+select mariadb_schema.concat('a','b') AS `concat('a','b')`,mariadb_schema.decode('1','2') AS `decode('1','2')`,mariadb_schema.ltrim('1') AS `ltrim('1')`,mariadb_schema.rtrim('1') AS `rtrim('1')`,mariadb_schema.lpad('1','2',3) AS `lpad('1','2', 3)`,mariadb_schema.rpad('1','2',3) AS `rpad('1','2', 3)`,mariadb_schema.replace('1','2','3') AS `replace('1','2','3')`,mariadb_schema.substr('a',1,2) AS `substr('a',1,2)`,mariadb_schema.trim(both 'a' from 'b') AS `trim(both 'a' FROM 'b')`
+DROP TABLE kv;
+DROP VIEW v1;
+SET sql_mode='ORACLE';
+CREATE VIEW v1 AS SELECT
+concat('a','b'),
+decode('1',2,3),
+ltrim('1'),
+rtrim('1'),
+lpad('1','2', 3),
+rpad('1','2', 3),
+replace('1','2','3'),
+substr('a',1,2),
+trim(both 'a' FROM 'b');
+CREATE TABLE kv (v BLOB);
+LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv;
+SELECT v FROM kv WHERE v RLIKE '^(query|view_body_utf8)=' ORDER BY v;
+v
+query=select concat_operator_oracle('a','b') AS `concat('a','b')`,decode_oracle('1',2,3) AS `decode('1',2,3)`,ltrim_oracle('1') AS `ltrim('1')`,rtrim_oracle('1') AS `rtrim('1')`,lpad_oracle('1','2',3) AS `lpad('1','2', 3)`,rpad_oracle('1','2',3) AS `rpad('1','2', 3)`,replace_oracle('1','2','3') AS `replace('1','2','3')`,substr_oracle('a',1,2) AS `substr('a',1,2)`,trim_oracle(both 'a' from 'b') AS `trim(both 'a' FROM 'b')`
+view_body_utf8=select oracle_schema.concat('a','b') AS `concat('a','b')`,oracle_schema.decode('1',2,3) AS `decode('1',2,3)`,oracle_schema.ltrim('1') AS `ltrim('1')`,oracle_schema.rtrim('1') AS `rtrim('1')`,oracle_schema.lpad('1','2',3) AS `lpad('1','2', 3)`,oracle_schema.rpad('1','2',3) AS `rpad('1','2', 3)`,oracle_schema.replace('1','2','3') AS `replace('1','2','3')`,oracle_schema.substr('a',1,2) AS `substr('a',1,2)`,oracle_schema.trim(both 'a' from 'b') AS `trim(both 'a' FROM 'b')`
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1' AND TABLE_SCHEMA='test';
+VIEW_DEFINITION
+select oracle_schema.concat('a','b') AS `concat('a','b')`,oracle_schema.decode('1',2,3) AS `decode('1',2,3)`,oracle_schema.ltrim('1') AS `ltrim('1')`,oracle_schema.rtrim('1') AS `rtrim('1')`,oracle_schema.lpad('1','2',3) AS `lpad('1','2', 3)`,oracle_schema.rpad('1','2',3) AS `rpad('1','2', 3)`,oracle_schema.replace('1','2','3') AS `replace('1','2','3')`,oracle_schema.substr('a',1,2) AS `substr('a',1,2)`,oracle_schema.trim(both 'a' from 'b') AS `trim(both 'a' FROM 'b')`
+DROP TABLE kv;
+DROP VIEW v1;
diff --git a/mysql-test/suite/compat/oracle/r/func_replace.result b/mysql-test/suite/compat/oracle/r/func_replace.result
index 02516096286..a5a999deb2b 100644
--- a/mysql-test/suite/compat/oracle/r/func_replace.result
+++ b/mysql-test/suite/compat/oracle/r/func_replace.result
@@ -21,11 +21,11 @@ EXPLAIN EXTENDED SELECT REPLACE('ab','a',null) ;
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 replace_oracle('ab','a',NULL) AS "REPLACE('ab','a',null)"
+Note 1003 select oracle_schema.replace('ab','a',NULL) AS "REPLACE('ab','a',null)"
CREATE VIEW v1 AS SELECT REPLACE('ab','a',null) ;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE VIEW "v1" AS select replace_oracle('ab','a',NULL) AS "REPLACE('ab','a',null)" latin1 latin1_swedish_ci
+v1 CREATE VIEW "v1" AS select replace('ab','a',NULL) AS "REPLACE('ab','a',null)" latin1 latin1_swedish_ci
SELECT * FROM v1;
REPLACE('ab','a',null)
b
diff --git a/mysql-test/suite/compat/oracle/r/func_substr.result b/mysql-test/suite/compat/oracle/r/func_substr.result
index 5d9fdd5f2b9..b347255c309 100644
--- a/mysql-test/suite/compat/oracle/r/func_substr.result
+++ b/mysql-test/suite/compat/oracle/r/func_substr.result
@@ -76,11 +76,11 @@ EXPLAIN EXTENDED SELECT SUBSTR('abc',2,1) ;
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 substr_oracle('abc',2,1) AS "SUBSTR('abc',2,1)"
+Note 1003 select oracle_schema.substr('abc',2,1) AS "SUBSTR('abc',2,1)"
CREATE VIEW v1 AS SELECT SUBSTR('abc',2,1) ;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE VIEW "v1" AS select substr_oracle('abc',2,1) AS "SUBSTR('abc',2,1)" latin1 latin1_swedish_ci
+v1 CREATE VIEW "v1" AS select substr('abc',2,1) AS "SUBSTR('abc',2,1)" latin1 latin1_swedish_ci
SELECT * FROM v1;
SUBSTR('abc',2,1)
b
diff --git a/mysql-test/suite/compat/oracle/r/func_trim.result b/mysql-test/suite/compat/oracle/r/func_trim.result
index bed8dadf97f..ca3a10505d6 100644
--- a/mysql-test/suite/compat/oracle/r/func_trim.result
+++ b/mysql-test/suite/compat/oracle/r/func_trim.result
@@ -116,13 +116,13 @@ TRIM(TRAILING 'a' FROM 'abc') ;
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 trim_oracle('abc') AS "TRIM('abc')",trim_oracle(both 'a' from 'abc') AS "TRIM(BOTH 'a' FROM 'abc')",trim_oracle(leading 'a' from 'abc') AS "TRIM(LEADING 'a' FROM 'abc')",trim_oracle(trailing 'a' from 'abc') AS "TRIM(TRAILING 'a' FROM 'abc')"
+Note 1003 select oracle_schema.trim('abc') AS "TRIM('abc')",oracle_schema.trim(both 'a' from 'abc') AS "TRIM(BOTH 'a' FROM 'abc')",oracle_schema.trim(leading 'a' from 'abc') AS "TRIM(LEADING 'a' FROM 'abc')",oracle_schema.trim(trailing 'a' from 'abc') AS "TRIM(TRAILING 'a' FROM 'abc')"
EXPLAIN EXTENDED SELECT RTRIM('abc'),
LTRIM('abc');
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 rtrim_oracle('abc') AS "RTRIM('abc')",ltrim_oracle('abc') AS "LTRIM('abc')"
+Note 1003 select oracle_schema.rtrim('abc') AS "RTRIM('abc')",oracle_schema.ltrim('abc') AS "LTRIM('abc')"
CREATE VIEW v1 AS SELECT ord,TRIM('abc'),RTRIM('abc'),LTRIM('abc'),
'['||c1||']',
TRIM(LEADING 'a' FROM c1),
@@ -133,7 +133,7 @@ RTRIM(c1)
FROM t1 ORDER BY ord ;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
-v1 CREATE VIEW "v1" AS select "t1"."ord" AS "ord",trim_oracle('abc') AS "TRIM('abc')",rtrim_oracle('abc') AS "RTRIM('abc')",ltrim_oracle('abc') AS "LTRIM('abc')",concat_operator_oracle(concat_operator_oracle('[',"t1"."c1"),']') AS "'['||c1||']'",trim_oracle(leading 'a' from "t1"."c1") AS "TRIM(LEADING 'a' FROM c1)",trim_oracle(trailing 'a' from "t1"."c1") AS "TRIM(TRAILING 'a' FROM c1)",trim_oracle(both 'a' from "t1"."c1") AS "TRIM(BOTH 'a' FROM c1)",ltrim_oracle("t1"."c1") AS "LTRIM(c1)",rtrim_oracle("t1"."c1") AS "RTRIM(c1)" from "t1" order by "t1"."ord" latin1 latin1_swedish_ci
+v1 CREATE VIEW "v1" AS select "t1"."ord" AS "ord",trim('abc') AS "TRIM('abc')",rtrim('abc') AS "RTRIM('abc')",ltrim('abc') AS "LTRIM('abc')",concat(concat('[',"t1"."c1"),']') AS "'['||c1||']'",trim(leading 'a' from "t1"."c1") AS "TRIM(LEADING 'a' FROM c1)",trim(trailing 'a' from "t1"."c1") AS "TRIM(TRAILING 'a' FROM c1)",trim(both 'a' from "t1"."c1") AS "TRIM(BOTH 'a' FROM c1)",ltrim("t1"."c1") AS "LTRIM(c1)",rtrim("t1"."c1") AS "RTRIM(c1)" from "t1" order by "t1"."ord" latin1 latin1_swedish_ci
SELECT * FROM v1;
ord TRIM('abc') RTRIM('abc') LTRIM('abc') '['||c1||']' TRIM(LEADING 'a' FROM c1) TRIM(TRAILING 'a' FROM c1) TRIM(BOTH 'a' FROM c1) LTRIM(c1) RTRIM(c1)
1 abc abc abc [abc] bc abc bc abc abc
diff --git a/mysql-test/suite/compat/oracle/r/ps.result b/mysql-test/suite/compat/oracle/r/ps.result
index 158d15e9f90..e94e823bdb7 100644
--- a/mysql-test/suite/compat/oracle/r/ps.result
+++ b/mysql-test/suite/compat/oracle/r/ps.result
@@ -178,9 +178,9 @@ EXECUTE IMMEDIATE 'SELECT :1 FROM DUAL' USING 10;
# Testing erroneous and diallowed prepare source
#
EXECUTE IMMEDIATE _latin1'SELECT 1 AS c FROM ' || _latin2 'DUAL';
-ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_operator_oracle'
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat'
PREPARE stmt FROM _latin1'SELECT 1 AS c FROM ' || _latin2 'DUAL';
-ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_operator_oracle'
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat'
EXECUTE IMMEDIATE (SELECT 'SELECT 1');
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 'SELECT 1')' at line 1
PREPARE stmt FROM (SELECT 'SELECT 1');
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
index a60bbc38883..05450485e57 100644
--- a/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor-rowtype.result
@@ -758,7 +758,7 @@ END;
END;
$$
CALL p1();
-ERROR HY000: Illegal mix of collations (latin1_bin,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat_operator_oracle'
+ERROR HY000: Illegal mix of collations (latin1_bin,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat'
DROP PROCEDURE p1;
#
# Non-existing field
diff --git a/mysql-test/suite/compat/oracle/r/vcol_innodb.result b/mysql-test/suite/compat/oracle/r/vcol_innodb.result
new file mode 100644
index 00000000000..9fa97c75c10
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/vcol_innodb.result
@@ -0,0 +1,51 @@
+SET @table_open_cache=@@GLOBAL.table_open_cache;
+SET sql_mode='';
+CREATE TABLE t (d INT,b VARCHAR(1),c CHAR(1),g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,PRIMARY KEY(b),KEY g(g)) ENGINE=InnoDB;
+INSERT INTO t VALUES (0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SET sql_mode='ORACLE';
+INSERT INTO t SET c=REPEAT (1,0);
+Warnings:
+Warning 1364 Field 'b' doesn't have a default value
+ALTER TABLE t CHANGE COLUMN a b INT;
+ERROR 42S22: Unknown column 'a' in 't'
+DELETE FROM t;
+SET sql_mode='';
+SET GLOBAL table_open_cache=DEFAULT;
+INSERT INTO t SET c='0';
+Warnings:
+Warning 1364 Field 'b' doesn't have a default value
+DROP TABLE t;
+SET GLOBAL table_open_cache=@table_open_cache;
+SET sql_mode='';
+CREATE TABLE t (a INT(1),d INT(1),b VARCHAR(1),c CHAR(1),vadc INT(1) GENERATED ALWAYS AS ( (a + length (d))) STORED,vbc CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,vbidxc CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,PRIMARY KEY(b (1),a,d),KEY d (d),KEY a (a),KEY c_renamed (c (1),b (1)),KEY b (b (1),c (1),a),KEY vbidxc (vbidxc),KEY a_2 (a,vbidxc),KEY vbidxc_2 (vbidxc,d)) DEFAULT CHARSET=latin1 ENGINE=InnoDB;
+INSERT INTO t VALUES (0,0,1,0,1,0,1,0,0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SET SESSION sql_mode='ORACLE';
+INSERT INTO t SET c=REPEAT (1,0);
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+Warning 1364 Field 'd' doesn't have a default value
+Warning 1364 Field 'b' doesn't have a default value
+ALTER TABLE t CHANGE COLUMN a b CHAR(1);
+ERROR 42S21: Duplicate column name 'b'
+DELETE FROM t;
+SET SESSION sql_mode=DEFAULT;
+DROP TABLE t;
+SET sql_mode='';
+CREATE TABLE t1 (d INT,b VARCHAR(1),c CHAR(1),g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,PRIMARY KEY(b),KEY g(g)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0);
+ERROR 21S01: Column count doesn't match value count at row 1
+SET sql_mode='ORACLE';
+INSERT INTO t1 SET c=REPEAT (1,0);
+Warnings:
+Warning 1364 Field 'b' doesn't have a default value
+ALTER TABLE t1 CHANGE COLUMN a b INT;
+ERROR 42S22: Unknown column 'a' in 't1'
+DELETE FROM t1;
+SET sql_mode='';
+FLUSH TABLES;
+INSERT INTO t1 SET c='0';
+Warnings:
+Warning 1364 Field 'b' doesn't have a default value
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/func_decode.test b/mysql-test/suite/compat/oracle/t/func_decode.test
index 1d49cdd2102..b8be7178570 100644
--- a/mysql-test/suite/compat/oracle/t/func_decode.test
+++ b/mysql-test/suite/compat/oracle/t/func_decode.test
@@ -1,8 +1,8 @@
SET sql_mode=ORACLE;
---error ER_PARSE_ERROR
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
SELECT DECODE(10);
---error ER_PARSE_ERROR
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
SELECT DECODE(10,10);
SELECT DECODE(10,10,'x10');
@@ -25,9 +25,9 @@ DROP TABLE decode;
--echo # MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent
--echo #
---error ER_PARSE_ERROR
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
SELECT DECODE(10);
---error ER_PARSE_ERROR
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
SELECT DECODE(10,10);
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
diff --git a/mysql-test/suite/compat/oracle/t/func_qualified.test b/mysql-test/suite/compat/oracle/t/func_qualified.test
new file mode 100644
index 00000000000..dd9db1b1d00
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/func_qualified.test
@@ -0,0 +1,224 @@
+--let $MYSQLD_DATADIR= `select @@datadir`
+
+--echo #
+--echo # MDEV-27744 InnoDB: Failing assertion: !cursor->index->is_committed() in row0ins.cc (from row_ins_sec_index_entry_by_modify) | Assertion `0' failed in row_upd_sec_index_entry (debug) | Corruption
+--echo #
+
+#
+# Testing that the error message for DECODE preserves
+# the exact letter case as typed by the user
+#
+
+SET sql_mode=DEFAULT;
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT decode_oracle(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT DECODE_ORACLE(1);
+
+SET sql_mode=ORACLE;
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT decode_oracle(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT DECODE_ORACLE(1);
+
+SET sql_mode=DEFAULT;
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT decode(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT DECODE(1);
+
+SET sql_mode=ORACLE;
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT decode(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT DECODE(1);
+
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT mariadb_schema.decode(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT mariadb_schema.DECODE(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT mariadb_schema.decode_oracle(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT mariadb_schema.DECODE_ORACLE(1);
+
+#
+# Testing that REPLACE, SUBSTR, TRIM print the exact name
+# as typed by the user in "Function .. is not defined"
+#
+
+SET sql_mode=DEFAULT;
+
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.TRIM(1);
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.trim(1);
+
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.SUBSTR('a',1,2);
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.substr('a',1,2);
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.SUBSTRING('a',1,2);
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.substring('a',1,2);
+
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.REPLACE('a','b','c');
+--error ER_FUNCTION_NOT_DEFINED
+SELECT unknown.replace('a','b','c');
+
+#
+# Testing EXPLAIN EXTENDED SELECT
+#
+
+SET sql_mode=DEFAULT;
+DELIMITER $$;
+CREATE PROCEDURE p1(sqlmode TEXT, qualifier TEXT, expr TEXT)
+BEGIN
+ DECLARE query TEXT DEFAULT 'SELECT $(QUALIFIER)$(EXPR)';
+ DECLARE errmsg TEXT DEFAULT NULL;
+ DECLARE CONTINUE HANDLER FOR 1128, 1305, 1582
+ BEGIN
+ GET DIAGNOSTICS CONDITION 1 errmsg = MESSAGE_TEXT;
+ END;
+
+ SET sql_mode=sqlmode;
+ SET query=REPLACE(query, '$(QUALIFIER)', qualifier);
+ SET query=REPLACE(query, '$(EXPR)', expr);
+ SET query= CONCAT('EXPLAIN EXTENDED ', query);
+ SELECT CONCAT('sql_mode=''',sqlmode,'''', ' ',
+ 'qualifier=''',qualifier,'''') AS `----------`;
+ SELECT query;
+ EXECUTE IMMEDIATE query;
+ IF errmsg IS NOT NULL THEN
+ SELECT CONCAT('ERROR: ', errmsg) AS errmsg;
+ ELSE
+ SHOW WARNINGS;
+ END IF;
+END;
+$$
+CREATE PROCEDURE p2(sqlmode TEXT, expr TEXT)
+BEGIN
+ CALL p1(sqlmode, '', expr);
+ CALL p1(sqlmode, 'unknown_schema.', expr);
+ CALL p1(sqlmode, 'mariadb_schema.', expr);
+ CALL p1(sqlmode, 'maxdb_schema.', expr);
+ CALL p1(sqlmode, 'oracle_schema.', expr);
+END;
+$$
+CREATE PROCEDURE p3(expr TEXT)
+BEGIN
+ CALL p2('', expr);
+ CALL p2('ORACLE', expr);
+END;
+$$
+DELIMITER ;$$
+
+CALL p3('CONCAT(''a'')');
+
+# MariaDB style
+CALL p3('DECODE(''1'',''2'')');
+# Oracle style
+CALL p3('DECODE(1,1,10)');
+
+CALL p3('LTRIM(''a'')');
+CALL p3('RTRIM(''a'')');
+
+CALL p3('LPAD(''a'',3)');
+CALL p3('LPAD(''a'',3, '' '')');
+
+CALL p3('RPAD(''a'',3)');
+CALL p3('RPAD(''a'',3, '' '')');
+
+CALL p3('REPLACE(''a'',''b'',''c'')');
+
+CALL p3('SUBSTR(''a'',1,2)');
+CALL p3('SUBSTR(''a'' FROM 1)');
+
+CALL p3('SUBSTRING(''a'',1,2)');
+CALL p3('SUBSTRING(''a'' FROM 1)');
+
+CALL p3('TRIM(''a'')');
+CALL p3('TRIM(BOTH '' '' FROM ''a'')');
+
+
+# Deprecated compatibility XXX_ORACLE functions.
+# These functions are implemented as simple native functions
+# and have no special grammar rules in sql_yacc.yy.
+# So they support the qualified syntax automatically,
+# which is not absolutely required, but is not harmful.
+
+CALL p3('CONCAT_OPERATOR_ORACLE(''a'')');
+CALL p3('DECODE_ORACLE(1,1,10)');
+CALL p3('LTRIM_ORACLE(''a'')');
+CALL p3('RTRIM_ORACLE(''a'')');
+CALL p3('LPAD_ORACLE(''a'',3)');
+CALL p3('RPAD_ORACLE(''a'',3)');
+CALL p3('REPLACE_ORACLE(''a'',''b'',''c'')');
+CALL p3('SUBSTR_ORACLE(''a'',1,2)');
+
+
+# Deprecated compatibility XXX_ORACLE variants for functions
+# with a special syntax in sql_yacc.yy.
+# These compatibility functions do not support qualified syntax.
+# One should use a qualified variant without the _ORACLE suffix instead.
+
+--error ER_PARSE_ERROR
+SELECT oracle_schema.SUBSTR_ORACLE('a' FROM 1 FOR 2);
+# Use this instead:
+SELECT oracle_schema.SUBSTR('a' FROM 1 FOR 2);
+
+--error ER_PARSE_ERROR
+SELECT oracle_schema.TRIM_ORACLE(LEADING ' ' FROM 'a');
+# Use this instead:
+SELECT oracle_schema.TRIM(LEADING ' ' FROM 'a');
+
+--error ER_FUNCTION_NOT_DEFINED
+SELECT oracle_schema.TRIM_ORACLE('a');
+# Use this instead:
+SELECT oracle_schema.TRIM('a');
+
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+
+
+SET sql_mode='';
+CREATE VIEW v1 AS SELECT
+ concat('a','b'),
+ decode('1','2'),
+ ltrim('1'),
+ rtrim('1'),
+ lpad('1','2', 3),
+ rpad('1','2', 3),
+ replace('1','2','3'),
+ substr('a',1,2),
+ trim(both 'a' FROM 'b');
+CREATE TABLE kv (v BLOB);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv;
+SELECT v FROM kv WHERE v RLIKE '^(query|view_body_utf8)=' ORDER BY v;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1' AND TABLE_SCHEMA='test';
+DROP TABLE kv;
+DROP VIEW v1;
+
+SET sql_mode='ORACLE';
+CREATE VIEW v1 AS SELECT
+ concat('a','b'),
+ decode('1',2,3),
+ ltrim('1'),
+ rtrim('1'),
+ lpad('1','2', 3),
+ rpad('1','2', 3),
+ replace('1','2','3'),
+ substr('a',1,2),
+ trim(both 'a' FROM 'b');
+CREATE TABLE kv (v BLOB);
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv;
+SELECT v FROM kv WHERE v RLIKE '^(query|view_body_utf8)=' ORDER BY v;
+SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v1' AND TABLE_SCHEMA='test';
+DROP TABLE kv;
+DROP VIEW v1;
diff --git a/mysql-test/suite/compat/oracle/t/vcol_innodb.test b/mysql-test/suite/compat/oracle/t/vcol_innodb.test
new file mode 100644
index 00000000000..4be7b1091c6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/vcol_innodb.test
@@ -0,0 +1,43 @@
+--source include/have_innodb.inc
+
+SET @table_open_cache=@@GLOBAL.table_open_cache;
+SET sql_mode='';
+CREATE TABLE t (d INT,b VARCHAR(1),c CHAR(1),g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,PRIMARY KEY(b),KEY g(g)) ENGINE=InnoDB;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t VALUES (0);
+SET sql_mode='ORACLE';
+INSERT INTO t SET c=REPEAT (1,0);
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t CHANGE COLUMN a b INT;
+DELETE FROM t;
+SET sql_mode='';
+SET GLOBAL table_open_cache=DEFAULT;
+INSERT INTO t SET c='0';
+DROP TABLE t;
+SET GLOBAL table_open_cache=@table_open_cache;
+
+SET sql_mode='';
+CREATE TABLE t (a INT(1),d INT(1),b VARCHAR(1),c CHAR(1),vadc INT(1) GENERATED ALWAYS AS ( (a + length (d))) STORED,vbc CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,vbidxc CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,PRIMARY KEY(b (1),a,d),KEY d (d),KEY a (a),KEY c_renamed (c (1),b (1)),KEY b (b (1),c (1),a),KEY vbidxc (vbidxc),KEY a_2 (a,vbidxc),KEY vbidxc_2 (vbidxc,d)) DEFAULT CHARSET=latin1 ENGINE=InnoDB;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t VALUES (0,0,1,0,1,0,1,0,0);
+SET SESSION sql_mode='ORACLE';
+INSERT INTO t SET c=REPEAT (1,0);
+--error ER_DUP_FIELDNAME
+ALTER TABLE t CHANGE COLUMN a b CHAR(1);
+DELETE FROM t;
+SET SESSION sql_mode=DEFAULT;
+DROP TABLE t;
+
+SET sql_mode='';
+CREATE TABLE t1 (d INT,b VARCHAR(1),c CHAR(1),g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,PRIMARY KEY(b),KEY g(g)) ENGINE=InnoDB;
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 VALUES (0);
+SET sql_mode='ORACLE';
+INSERT INTO t1 SET c=REPEAT (1,0);
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t1 CHANGE COLUMN a b INT;
+DELETE FROM t1;
+SET sql_mode='';
+FLUSH TABLES;
+INSERT INTO t1 SET c='0';
+DROP TABLE t1;
diff --git a/plugin/versioning/versioning.cc b/plugin/versioning/versioning.cc
index fd0e7099666..08a949a9d02 100644
--- a/plugin/versioning/versioning.cc
+++ b/plugin/versioning/versioning.cc
@@ -140,7 +140,7 @@ Create_func_trt_trx_sees<X> Create_func_trt_trx_sees<X>::s_singleton;
#define BUILDER(F) & F::s_singleton
-static Native_func_registry func_array[] =
+static const Native_func_registry func_array_vers[] =
{
{ { C_STRING_WITH_LEN("TRT_BEGIN_TS") }, BUILDER(Create_func_trt<TR_table::FLD_BEGIN_TS>)},
{ { C_STRING_WITH_LEN("TRT_COMMIT_ID") }, BUILDER(Create_func_trt<TR_table::FLD_COMMIT_ID>)},
@@ -164,7 +164,7 @@ static int versioning_plugin_init(void *p __attribute__ ((unused)))
{
DBUG_ENTER("versioning_plugin_init");
// No need in locking since we so far single-threaded
- int res= item_create_append(func_array);
+ int res= item_create_append(func_array_vers);
if (res)
{
my_message(ER_PLUGIN_IS_NOT_LOADED, "Can't append function array" , MYF(0));
@@ -177,7 +177,7 @@ static int versioning_plugin_init(void *p __attribute__ ((unused)))
static int versioning_plugin_deinit(void *p __attribute__ ((unused)))
{
DBUG_ENTER("versioning_plugin_deinit");
- (void) item_create_remove(func_array);
+ (void) item_create_remove(func_array_vers);
DBUG_RETURN(0);
}
diff --git a/sql/item.h b/sql/item.h
index 44717a520d6..c594edbd73a 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -28,6 +28,7 @@
#include "field.h" /* Derivation */
#include "sql_type.h"
#include "sql_time.h"
+#include "sql_schema.h"
#include "mem_root_array.h"
C_MODE_START
@@ -1477,7 +1478,8 @@ public:
QT_ITEM_IDENT_SKIP_DB_NAMES |
QT_ITEM_IDENT_SKIP_TABLE_NAMES |
QT_NO_DATA_EXPANSION |
- QT_TO_SYSTEM_CHARSET),
+ QT_TO_SYSTEM_CHARSET |
+ QT_FOR_FRM),
LOWEST_PRECEDENCE);
}
virtual void print(String *str, enum_query_type query_type);
@@ -4823,6 +4825,14 @@ public:
return (this->*processor)(arg);
}
/*
+ Built-in schema, e.g. mariadb_schema, oracle_schema, maxdb_schema
+ */
+ virtual const Schema *schema() const
+ {
+ // A function does not belong to a built-in schema by default
+ return NULL;
+ }
+ /*
This method is used for debug purposes to print the name of an
item to the debug log. The second use of this method is as
a helper function of print() and error messages, where it is
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index f41414f8ae9..0f5c7519d07 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -3292,9 +3292,24 @@ void Item_func_case_simple::print(String *str, enum_query_type query_type)
}
+Item_func_decode_oracle *
+Item_func_decode_oracle::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (unlikely(!item_list || item_list->elements < 3))
+ {
+ wrong_param_count_error(oracle_schema_ref.name(), name);
+ return NULL;
+ }
+ return new (thd->mem_root) Item_func_decode_oracle(thd, *item_list);
+}
+
+
void Item_func_decode_oracle::print(String *str, enum_query_type query_type)
{
- str->append(func_name());
+ print_sql_mode_dependent_name(str, query_type,
+ oracle_schema_ref,
+ Item_func_decode_oracle::func_name());
str->append('(');
args[0]->print(str, query_type);
for (uint i= 1, count= when_count() ; i <= count; i++)
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index f3d3be44b62..b7d9f667a89 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -2236,7 +2236,10 @@ public:
Item_func_decode_oracle(THD *thd, List<Item> &list)
:Item_func_case_simple(thd, list)
{ }
- const char *func_name() const { return "decode_oracle"; }
+ static Item_func_decode_oracle *create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *list);
+ const Schema *schema() const { return &oracle_schema_ref; }
+ const char *func_name() const { return "decode"; }
void print(String *str, enum_query_type query_type);
bool fix_length_and_dec();
Item *find_item();
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 52e0312f89b..c75e8ce3032 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -598,12 +598,28 @@ protected:
};
+class Create_func_decode : public Create_native_func
+{
+public:
+ virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
+ List<Item> *item_list)
+ {
+ return Item_func_decode::create(thd, *name, item_list);
+ }
+
+ static Create_func_decode s_singleton;
+
+protected:
+ Create_func_decode() {}
+ virtual ~Create_func_decode() {}
+};
+
+
class Create_func_decode_oracle : public Create_native_func
{
public:
virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list);
-
static Create_func_decode_oracle s_singleton;
protected:
@@ -2267,29 +2283,23 @@ public:
virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- return thd->variables.sql_mode & MODE_ORACLE ?
- create_native_oracle(thd, name, item_list) :
- create_native_std(thd, name, item_list);
+ return Item_func_lpad::create(thd, *name, item_list);
}
static Create_func_lpad s_singleton;
protected:
Create_func_lpad() {}
virtual ~Create_func_lpad() {}
- Item *create_native_std(THD *thd, const LEX_CSTRING *name,
- List<Item> *items);
- Item *create_native_oracle(THD *thd, const LEX_CSTRING *name,
- List<Item> *items);
};
-class Create_func_lpad_oracle : public Create_func_lpad
+class Create_func_lpad_oracle : public Create_native_func
{
public:
Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- return create_native_oracle(thd, name, item_list);
+ return Item_func_lpad_oracle::create(thd, *name, item_list);
}
static Create_func_lpad_oracle s_singleton;
};
@@ -2745,29 +2755,23 @@ public:
virtual Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- return thd->variables.sql_mode & MODE_ORACLE ?
- create_native_oracle(thd, name, item_list) :
- create_native_std(thd, name, item_list);
+ return Item_func_rpad::create(thd, *name, item_list);
}
static Create_func_rpad s_singleton;
protected:
Create_func_rpad() {}
virtual ~Create_func_rpad() {}
- Item *create_native_std(THD *thd, const LEX_CSTRING *name,
- List<Item> *items);
- Item *create_native_oracle(THD *thd, const LEX_CSTRING *name,
- List<Item> *items);
};
-class Create_func_rpad_oracle : public Create_func_rpad
+class Create_func_rpad_oracle : public Create_native_func
{
public:
Item *create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- return create_native_oracle(thd, name, item_list);
+ return Item_func_rpad_oracle::create(thd, *name, item_list);
}
static Create_func_rpad_oracle s_singleton;
};
@@ -3990,22 +3994,10 @@ Item*
Create_func_concat::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- int arg_count= 0;
-
- if (item_list != NULL)
- arg_count= item_list->elements;
-
- if (unlikely(arg_count < 1))
- {
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- return NULL;
- }
-
- return thd->variables.sql_mode & MODE_ORACLE ?
- new (thd->mem_root) Item_func_concat_operator_oracle(thd, *item_list) :
- new (thd->mem_root) Item_func_concat(thd, *item_list);
+ return Item_func_concat::create(thd, *name, item_list);
}
+
Create_func_concat_operator_oracle
Create_func_concat_operator_oracle::s_singleton;
@@ -4013,18 +4005,7 @@ Item*
Create_func_concat_operator_oracle::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- int arg_count= 0;
-
- if (item_list != NULL)
- arg_count= item_list->elements;
-
- if (unlikely(arg_count < 1))
- {
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- return NULL;
- }
-
- return new (thd->mem_root) Item_func_concat_operator_oracle(thd, *item_list);
+ return Item_func_concat_operator_oracle::create(thd, *name, item_list);
}
Create_func_decode_histogram Create_func_decode_histogram::s_singleton;
@@ -4035,21 +4016,19 @@ Create_func_decode_histogram::create_2_arg(THD *thd, Item *arg1, Item *arg2)
return new (thd->mem_root) Item_func_decode_histogram(thd, arg1, arg2);
}
+
+Create_func_decode Create_func_decode::s_singleton;
+
Create_func_decode_oracle Create_func_decode_oracle::s_singleton;
Item*
Create_func_decode_oracle::create_native(THD *thd, const LEX_CSTRING *name,
List<Item> *item_list)
{
- uint arg_count= item_list ? item_list->elements : 0;
- if (unlikely(arg_count < 3))
- {
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- return NULL;
- }
- return new (thd->mem_root) Item_func_decode_oracle(thd, *item_list);
+ return Item_func_decode_oracle::create(thd, *name, item_list);
}
+
Create_func_concat_ws Create_func_concat_ws::s_singleton;
Item*
@@ -5852,10 +5831,7 @@ Create_func_length Create_func_length::s_singleton;
Item*
Create_func_length::create_1_arg(THD *thd, Item *arg1)
{
- if (thd->variables.sql_mode & MODE_ORACLE)
- return new (thd->mem_root) Item_func_char_length(thd, arg1);
- else
- return new (thd->mem_root) Item_func_octet_length(thd, arg1);
+ return new (thd->mem_root) Item_func_octet_length(thd, arg1);
}
Create_func_octet_length Create_func_octet_length::s_singleton;
@@ -6008,72 +5984,12 @@ Create_func_lpad Create_func_lpad::s_singleton;
Create_func_lpad_oracle Create_func_lpad_oracle::s_singleton;
-Item*
-Create_func_lpad::create_native_std(THD *thd, const LEX_CSTRING *name,
- List<Item> *item_list)
-{
- Item *func= NULL;
- int arg_count= item_list ? item_list->elements : 0;
-
- switch (arg_count) {
- case 2:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- func= new (thd->mem_root) Item_func_lpad(thd, param_1, param_2);
- break;
- }
- case 3:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- Item *param_3= item_list->pop();
- func= new (thd->mem_root) Item_func_lpad(thd, param_1, param_2, param_3);
- break;
- }
- default:
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- break;
- }
-
- return func;
-}
-
-
-Item*
-Create_func_lpad::create_native_oracle(THD *thd, const LEX_CSTRING *name,
- List<Item> *item_list)
-{
- int arg_count= item_list ? item_list->elements : 0;
- switch (arg_count) {
- case 2:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- return new (thd->mem_root) Item_func_lpad_oracle(thd, param_1, param_2);
- }
- case 3:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- Item *param_3= item_list->pop();
- return new (thd->mem_root) Item_func_lpad_oracle(thd, param_1,
- param_2, param_3);
- }
- default:
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- break;
- }
- return NULL;
-}
-
-
Create_func_ltrim Create_func_ltrim::s_singleton;
Item*
Create_func_ltrim::create_1_arg(THD *thd, Item *arg1)
{
- return Lex_trim(TRIM_LEADING, arg1).make_item_func_trim(thd);
+ return Lex_trim(TRIM_LEADING, arg1).make_item_func_trim_std(thd);
}
@@ -6544,72 +6460,12 @@ Create_func_rpad Create_func_rpad::s_singleton;
Create_func_rpad_oracle Create_func_rpad_oracle::s_singleton;
-Item*
-Create_func_rpad::create_native_std(THD *thd, const LEX_CSTRING *name,
- List<Item> *item_list)
-{
- Item *func= NULL;
- int arg_count= item_list ? item_list->elements : 0;
-
- switch (arg_count) {
- case 2:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- func= new (thd->mem_root) Item_func_rpad(thd, param_1, param_2);
- break;
- }
- case 3:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- Item *param_3= item_list->pop();
- func= new (thd->mem_root) Item_func_rpad(thd, param_1, param_2, param_3);
- break;
- }
- default:
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- break;
- }
-
- return func;
-}
-
-
-Item*
-Create_func_rpad::create_native_oracle(THD *thd, const LEX_CSTRING *name,
- List<Item> *item_list)
-{
- int arg_count= item_list ? item_list->elements : 0;
- switch (arg_count) {
- case 2:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- return new (thd->mem_root) Item_func_rpad_oracle(thd, param_1, param_2);
- }
- case 3:
- {
- Item *param_1= item_list->pop();
- Item *param_2= item_list->pop();
- Item *param_3= item_list->pop();
- return new (thd->mem_root) Item_func_rpad_oracle(thd, param_1,
- param_2, param_3);
- }
- default:
- my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
- break;
- }
- return NULL;
-}
-
-
Create_func_rtrim Create_func_rtrim::s_singleton;
Item*
Create_func_rtrim::create_1_arg(THD *thd, Item *arg1)
{
- return Lex_trim(TRIM_TRAILING, arg1).make_item_func_trim(thd);
+ return Lex_trim(TRIM_TRAILING, arg1).make_item_func_trim_std(thd);
}
@@ -7120,7 +6976,7 @@ Create_func_year_week::create_native(THD *thd, const LEX_CSTRING *name,
- keep 1 line per entry, it makes grep | sort easier
*/
-Native_func_registry func_array[] =
+const Native_func_registry func_array[] =
{
{ { STRING_WITH_LEN("ABS") }, BUILDER(Create_func_abs)},
{ { STRING_WITH_LEN("ACOS") }, BUILDER(Create_func_acos)},
@@ -7170,6 +7026,7 @@ Native_func_registry func_array[] =
{ { STRING_WITH_LEN("DAYOFMONTH") }, BUILDER(Create_func_dayofmonth)},
{ { STRING_WITH_LEN("DAYOFWEEK") }, BUILDER(Create_func_dayofweek)},
{ { STRING_WITH_LEN("DAYOFYEAR") }, BUILDER(Create_func_dayofyear)},
+ { { STRING_WITH_LEN("DECODE") }, BUILDER(Create_func_decode)},
{ { STRING_WITH_LEN("DEGREES") }, BUILDER(Create_func_degrees)},
{ { STRING_WITH_LEN("DECODE_HISTOGRAM") }, BUILDER(Create_func_decode_histogram)},
{ { STRING_WITH_LEN("DECODE_ORACLE") }, BUILDER(Create_func_decode_oracle)},
@@ -7474,9 +7331,25 @@ Native_func_registry func_array[] =
{ {0, 0}, NULL}
};
-size_t func_array_length= sizeof(func_array) / sizeof(Native_func_registry) - 1;
-static HASH native_functions_hash;
+const Native_func_registry func_array_oracle_overrides[] =
+{
+ { { STRING_WITH_LEN("CONCAT") }, BUILDER(Create_func_concat_operator_oracle)},
+ { { STRING_WITH_LEN("DECODE") }, BUILDER(Create_func_decode_oracle)},
+ { { STRING_WITH_LEN("LENGTH") }, BUILDER(Create_func_char_length)},
+ { { STRING_WITH_LEN("LPAD") }, BUILDER(Create_func_lpad_oracle)},
+ { { STRING_WITH_LEN("LTRIM") }, BUILDER(Create_func_ltrim_oracle)},
+ { { STRING_WITH_LEN("RPAD") }, BUILDER(Create_func_rpad_oracle)},
+ { { STRING_WITH_LEN("RTRIM") }, BUILDER(Create_func_rtrim_oracle)},
+
+ { {0, 0}, NULL}
+};
+
+
+const size_t func_array_length= sizeof(func_array) / sizeof(Native_func_registry) - 1;
+
+Native_functions_hash native_functions_hash;
+Native_functions_hash native_functions_hash_oracle_overrides;
extern "C" uchar*
get_native_fct_hash_key(const uchar *buff, size_t *length,
@@ -7493,85 +7366,89 @@ get_native_fct_hash_key(const uchar *buff, size_t *length,
startup only (before going multi-threaded)
*/
-int item_create_init()
+bool Native_functions_hash::init(size_t count)
{
- DBUG_ENTER("item_create_init");
+ DBUG_ENTER("Native_functions_hash::item");
- if (my_hash_init(& native_functions_hash,
+ if (my_hash_init(this,
system_charset_info,
- array_elements(func_array),
+ (ulong) count,
0,
0,
(my_hash_get_key) get_native_fct_hash_key,
NULL, /* Nothing to free */
MYF(0)))
- DBUG_RETURN(1);
+ DBUG_RETURN(true);
- DBUG_RETURN(item_create_append(func_array));
+ DBUG_RETURN(false);
}
-int item_create_append(Native_func_registry array[])
+
+bool Native_functions_hash::append(const Native_func_registry array[])
{
- Native_func_registry *func;
+ const Native_func_registry *func;
- DBUG_ENTER("item_create_append");
+ DBUG_ENTER("Native_functions_hash::append");
for (func= array; func->builder != NULL; func++)
{
- if (my_hash_insert(& native_functions_hash, (uchar*) func))
- DBUG_RETURN(1);
+ if (my_hash_insert(this, (uchar*) func))
+ DBUG_RETURN(true);
}
#ifndef DBUG_OFF
- for (uint i=0 ; i < native_functions_hash.records ; i++)
+ for (uint i=0 ; i < records ; i++)
{
- func= (Native_func_registry*) my_hash_element(& native_functions_hash, i);
+ func= (Native_func_registry*) my_hash_element(this, i);
DBUG_PRINT("info", ("native function: %s length: %u",
func->name.str, (uint) func->name.length));
}
#endif
- DBUG_RETURN(0);
+ DBUG_RETURN(false);
}
-int item_create_remove(Native_func_registry array[])
+
+bool Native_functions_hash::remove(const Native_func_registry array[])
{
- Native_func_registry *func;
+ const Native_func_registry *func;
- DBUG_ENTER("item_create_remove");
+ DBUG_ENTER("Native_functions_hash::remove");
for (func= array; func->builder != NULL; func++)
{
- if (my_hash_delete(& native_functions_hash, (uchar*) func))
- DBUG_RETURN(1);
+ if (my_hash_delete(this, (uchar*) func))
+ DBUG_RETURN(true);
}
- DBUG_RETURN(0);
+ DBUG_RETURN(false);
}
+
/*
Empty the hash table for native functions.
Note: this code is not thread safe, and is intended to be used at server
shutdown only (after thread requests have been executed).
*/
-void item_create_cleanup()
+void Native_functions_hash::cleanup()
{
- DBUG_ENTER("item_create_cleanup");
- my_hash_free(& native_functions_hash);
+ DBUG_ENTER("Native_functions_hash::cleanup");
+ my_hash_free(this);
DBUG_VOID_RETURN;
}
+
Create_func *
-find_native_function_builder(THD *thd, const LEX_CSTRING *name)
+Native_functions_hash::find(THD *thd, const LEX_CSTRING &name) const
{
Native_func_registry *func;
Create_func *builder= NULL;
/* Thread safe */
- func= (Native_func_registry*) my_hash_search(&native_functions_hash,
- (uchar*) name->str,
- name->length);
+ func= (Native_func_registry*) my_hash_search(this,
+ (uchar*) name.str,
+ name.length);
if (func)
{
@@ -7581,6 +7458,36 @@ find_native_function_builder(THD *thd, const LEX_CSTRING *name)
return builder;
}
+
+int item_create_init()
+{
+ return
+ native_functions_hash.init(func_array, array_elements(func_array)) ||
+ native_functions_hash_oracle_overrides.init(
+ func_array_oracle_overrides,
+ array_elements(func_array_oracle_overrides));
+}
+
+
+int item_create_append(const Native_func_registry array[])
+{
+ return native_functions_hash.append(array);
+}
+
+
+int item_create_remove(const Native_func_registry array[])
+{
+ return native_functions_hash.remove(array);
+}
+
+
+void item_create_cleanup()
+{
+ native_functions_hash.cleanup();
+ native_functions_hash_oracle_overrides.cleanup();
+}
+
+
Create_qfunc *
find_qualified_function_builder(THD *thd)
{
diff --git a/sql/item_create.h b/sql/item_create.h
index 894e9777b8d..3fadaecb090 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -145,16 +145,6 @@ protected:
/**
- Find the native function builder associated with a given function name.
- @param thd The current thread
- @param name The native function name
- @return The native function builder associated with the name, or NULL
-*/
-extern Create_func *find_native_function_builder(THD *thd,
- const LEX_CSTRING *name);
-
-
-/**
Find the function builder for qualified functions.
@param thd The current thread
@return A function builder for qualified functions
@@ -215,9 +205,48 @@ struct Native_func_registry
Create_func *builder;
};
+
+class Native_functions_hash: public HASH
+{
+public:
+ Native_functions_hash()
+ {
+ bzero(this, sizeof(*this));
+ }
+ ~Native_functions_hash()
+ {
+ /*
+ No automatic free.
+ The the upper level code should call cleanup() explicitly.
+ */
+ DBUG_ASSERT(!records);
+ }
+ bool init(size_t count);
+ bool init(const Native_func_registry array[], size_t count)
+ {
+ return init(count) || append(array);
+ }
+ bool append(const Native_func_registry array[]);
+ bool remove(const Native_func_registry array[]);
+ void cleanup();
+ /**
+ Find the native function builder associated with a given function name.
+ @param thd The current thread
+ @param name The native function name
+ @return The native function builder associated with the name, or NULL
+ */
+ Create_func *find(THD *thd, const LEX_CSTRING &name) const;
+};
+
+extern Native_functions_hash native_functions_hash;
+extern Native_functions_hash native_functions_hash_oracle_overrides;
+
+extern const Native_func_registry func_array[];
+extern const size_t func_array_length;
+
int item_create_init();
-int item_create_append(Native_func_registry array[]);
-int item_create_remove(Native_func_registry array[]);
+int item_create_append(const Native_func_registry array[]);
+int item_create_remove(const Native_func_registry array[]);
void item_create_cleanup();
Item *create_func_dyncol_create(THD *thd, List<DYNCALL_CREATE_DEF> &list);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index cb6fee34d48..e8c1049cdf1 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -128,6 +128,16 @@ Item_args::Item_args(THD *thd, const Item_args *other)
}
+void Item_func::wrong_param_count_error(const LEX_CSTRING &schema_name,
+ const LEX_CSTRING &func_name)
+{
+ DBUG_ASSERT(schema_name.length);
+ Database_qualified_name qname(schema_name, func_name);
+ my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0),
+ ErrConvDQName(&qname).ptr());
+}
+
+
void Item_func::sync_with_sum_func_and_with_field(List<Item> &list)
{
List_iterator_fast<Item> li(list);
@@ -595,9 +605,7 @@ table_map Item_func::not_null_tables() const
void Item_func::print(String *str, enum_query_type query_type)
{
str->append(func_name());
- str->append('(');
- print_args(str, 0, query_type);
- str->append(')');
+ print_args_parenthesized(str, query_type);
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 754b1cd1eb2..52bf7f661d1 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -56,8 +56,117 @@ protected:
bool check_argument_types_can_return_text(uint start, uint end) const;
bool check_argument_types_can_return_date(uint start, uint end) const;
bool check_argument_types_can_return_time(uint start, uint end) const;
+
+ void print_schema_qualified_name(String *to,
+ const LEX_CSTRING &schema_name,
+ const char *function_name) const
+ {
+ // e.g. oracle_schema.func()
+ to->append(schema_name);
+ to->append('.');
+ to->append(function_name);
+ }
+
+ void print_name_with_optional_suffix(String *to,
+ const char *function_name,
+ const LEX_CSTRING &suffix) const
+ {
+ // e.g. func_oracle()
+ to->append(function_name);
+ if (suffix.length)
+ {
+ to->append("_");
+ to->append(suffix);
+ }
+ }
+
+ void print_sql_mode_dependent_name(String *to, enum_query_type query_type,
+ const Schema &schema,
+ const char *function_name,
+ const LEX_CSTRING &suffix) const
+ {
+ if (query_type & QT_ITEM_FUNC_FORCE_SCHEMA_NAME)
+ {
+ DBUG_ASSERT((query_type & QT_FOR_FRM) == 0);
+ print_schema_qualified_name(to, schema.name(), function_name);
+ }
+ else if (query_type & QT_FOR_FRM)
+ {
+ // e.g. substr_oracle()
+ DBUG_ASSERT((query_type & QT_ITEM_FUNC_FORCE_SCHEMA_NAME) == 0);
+ print_name_with_optional_suffix(to, function_name, suffix);
+ }
+ else if (&schema != Schema::find_implied(current_thd))
+ print_schema_qualified_name(to, schema.name(), function_name);
+ else
+ to->append(function_name);
+ }
+
+ void print_sql_mode_dependent_name(String *to, enum_query_type query_type,
+ const Schema &schema,
+ const char *function_name) const
+ {
+ static const LEX_CSTRING oracle= {STRING_WITH_LEN("oracle")};
+ static const LEX_CSTRING empty= {NULL, 0};
+ const LEX_CSTRING suffix= &schema == &oracle_schema_ref ? oracle : empty;
+ print_sql_mode_dependent_name(to, query_type,
+ schema, function_name, suffix);
+ }
+ void print_sql_mode_dependent_name(String *to, enum_query_type query_type,
+ const char *function_name) const
+ {
+ print_sql_mode_dependent_name(to, query_type, *schema(), function_name);
+ }
+ void print_sql_mode_dependent(String *to, enum_query_type query_type)
+ {
+ print_sql_mode_dependent_name(to, query_type, func_name());
+ print_args_parenthesized(to, query_type);
+ }
public:
+ // Print an error message for a builtin-schema qualified function call
+ static void wrong_param_count_error(const LEX_CSTRING &schema_name,
+ const LEX_CSTRING &func_name);
+
+ // Check that the number of arguments is greater or equal to "expected"
+ static bool create_check_args_ge(const LEX_CSTRING &name,
+ const List<Item> *item_list,
+ uint expected)
+ {
+ DBUG_ASSERT(expected > 0);
+ if (!item_list || item_list->elements < expected)
+ {
+ my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
+ return true;
+ }
+ return false;
+ }
+
+ // Check that the number of arguments is less or equal to "expected"
+ static bool create_check_args_le(const LEX_CSTRING &name,
+ const List<Item> *item_list,
+ uint expected)
+ {
+ DBUG_ASSERT(expected > 0);
+ if (!item_list || item_list->elements > expected)
+ {
+ my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
+ return true;
+ }
+ return false;
+ }
+
+ // Check that the number of arguments is in the allowed range
+ static bool create_check_args_between(const LEX_CSTRING &name,
+ const List<Item> *item_list,
+ uint min_arg_count,
+ uint max_arg_count)
+ {
+ DBUG_ASSERT(min_arg_count < max_arg_count);
+ return create_check_args_ge(name, item_list, min_arg_count) ||
+ create_check_args_le(name, item_list, max_arg_count);
+ }
+
table_map not_null_tables_cache;
enum Functype { UNKNOWN_FUNC,EQ_FUNC,EQUAL_FUNC,NE_FUNC,LT_FUNC,LE_FUNC,
@@ -174,6 +283,12 @@ public:
virtual void print(String *str, enum_query_type query_type);
void print_op(String *str, enum_query_type query_type);
void print_args(String *str, uint from, enum_query_type query_type);
+ void print_args_parenthesized(String *str, enum_query_type query_type)
+ {
+ str->append('(');
+ print_args(str, 0, query_type);
+ str->append(')');
+ }
inline bool get_arg0_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
DBUG_ASSERT(!(fuzzy_date & TIME_TIME_ONLY));
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 75abd9906cd..6bf54cb4c84 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -574,6 +574,27 @@ String *Item_func_decode_histogram::val_str(String *str)
///////////////////////////////////////////////////////////////////////////////
+Item_func_concat *
+Item_func_concat::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (create_check_args_ge(name, item_list, 1))
+ return NULL;
+ return new (thd->mem_root) Item_func_concat(thd, *item_list);
+}
+
+
+Item_func_concat_operator_oracle *
+Item_func_concat_operator_oracle::create(THD *thd,
+ const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (create_check_args_ge(name, item_list, 1))
+ return NULL;
+ return new (thd->mem_root) Item_func_concat_operator_oracle(thd, *item_list);
+}
+
+
/*
Realloc the result buffer.
NOTE: We should be prudent in the initial allocation unit -- the
@@ -2161,11 +2182,10 @@ void Item_func_trim::print(String *str, enum_query_type query_type)
{
if (arg_count == 1)
{
- Item_func::print(str, query_type);
+ print_sql_mode_dependent(str, query_type);
return;
}
- str->append(Item_func_trim::func_name());
- str->append(func_name_ext());
+ print_sql_mode_dependent_name(str, query_type, Item_func_trim::func_name());
str->append('(');
str->append(mode_name());
str->append(' ');
@@ -2379,6 +2399,20 @@ void Item_func_decode::crypto_transform(String *res)
}
+Item_func_decode *Item_func_decode::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (unlikely(!item_list || item_list->elements != 2))
+ {
+ wrong_param_count_error(mariadb_schema.name(), name);
+ return NULL;
+ }
+ Item_args args(thd, *item_list);
+ return new (thd->mem_root) Item_func_decode(thd, args.arguments()[0],
+ args.arguments()[1]);
+}
+
+
String *Item_func_database::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
@@ -3204,6 +3238,47 @@ static String *default_pad_str(String *pad_str, CHARSET_INFO *collation)
return pad_str;
}
+
+Item_func_lpad*
+Item_func_lpad::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (create_check_args_between(name, item_list, 2, 3))
+ return NULL;
+ return new (thd->mem_root) Item_func_lpad(thd, *item_list);
+}
+
+
+Item_func_lpad_oracle*
+Item_func_lpad_oracle::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (create_check_args_between(name, item_list, 2, 3))
+ return NULL;
+ return new (thd->mem_root) Item_func_lpad_oracle(thd, *item_list);
+}
+
+
+Item_func_rpad*
+Item_func_rpad::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (create_check_args_between(name, item_list, 2, 3))
+ return NULL;
+ return new (thd->mem_root) Item_func_rpad(thd, *item_list);
+}
+
+
+Item_func_rpad_oracle*
+Item_func_rpad_oracle::create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list)
+{
+ if (create_check_args_between(name, item_list, 2, 3))
+ return NULL;
+ return new (thd->mem_root) Item_func_rpad_oracle(thd, *item_list);
+}
+
+
bool Item_func_pad::fix_length_and_dec()
{
if (arg_count == 3)
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index cd50da3dd3a..3ecf9b8c487 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -259,8 +259,15 @@ protected:
public:
Item_func_concat(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
Item_func_concat(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
+ static Item_func_concat* create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *list);
String *val_str(String *);
bool fix_length_and_dec();
+ const Schema *schema() const { return &mariadb_schema; }
+ void print(String *str, enum_query_type query_type)
+ {
+ print_sql_mode_dependent(str, query_type);
+ }
const char *func_name() const { return "concat"; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_concat>(thd, this); }
@@ -280,8 +287,20 @@ public:
Item_func_concat_operator_oracle(THD *thd, Item *a, Item *b)
:Item_func_concat(thd, a, b)
{ }
+ static Item_func_concat_operator_oracle* create(THD *thd,
+ const LEX_CSTRING &name,
+ List<Item> *list);
String *val_str(String *);
- const char *func_name() const { return "concat_operator_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
+ void print(String *str, enum_query_type query_type)
+ {
+ static const LEX_CSTRING suffix= {STRING_WITH_LEN("operator_oracle")};
+ print_sql_mode_dependent_name(str, query_type,
+ oracle_schema_ref,
+ Item_func_concat::func_name(),
+ suffix);
+ print_args_parenthesized(str, query_type);
+ }
Item *get_copy(THD *thd)
{
return get_item_copy<Item_func_concat_operator_oracle>(thd, this);
@@ -342,6 +361,11 @@ public:
String *val_str(String *to) { return val_str_internal(to, NULL); };
bool fix_length_and_dec();
String *val_str_internal(String *str, String *empty_string_for_null);
+ const Schema *schema() const { return &mariadb_schema; }
+ void print(String *str, enum_query_type query_type)
+ {
+ print_sql_mode_dependent(str, query_type);
+ }
const char *func_name() const { return "replace"; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_replace>(thd, this); }
@@ -355,7 +379,7 @@ public:
Item_func_replace_oracle(THD *thd, Item *org, Item *find, Item *replace):
Item_func_replace(thd, org, find, replace) {}
String *val_str(String *to) { return val_str_internal(to, &tmp_emtpystr); };
- const char *func_name() const { return "replace_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_replace_oracle>(thd, this); }
};
@@ -493,6 +517,11 @@ public:
Item_str_func(thd, a, b, c) {}
String *val_str(String *);
bool fix_length_and_dec();
+ const Schema *schema() const { return &mariadb_schema; }
+ void print(String *str, enum_query_type query_type)
+ {
+ print_sql_mode_dependent(str, query_type);
+ }
const char *func_name() const { return "substr"; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_substr>(thd, this); }
@@ -516,7 +545,7 @@ public:
maybe_null= true;
return res;
}
- const char *func_name() const { return "substr_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_substr_oracle>(thd, this); }
};
@@ -559,13 +588,13 @@ protected:
{
return trimmed_value(res, 0, res->length());
}
- virtual const char *func_name_ext() const { return ""; }
public:
Item_func_trim(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
Item_func_trim(THD *thd, Item *a): Item_str_func(thd, a) {}
Sql_mode_dependency value_depends_on_sql_mode() const;
String *val_str(String *);
bool fix_length_and_dec();
+ const Schema *schema() const { return &mariadb_schema; }
const char *func_name() const { return "trim"; }
void print(String *str, enum_query_type query_type);
virtual const char *mode_name() const { return "both"; }
@@ -579,12 +608,11 @@ class Item_func_trim_oracle :public Item_func_trim
protected:
String *make_empty_result()
{ null_value= 1; return NULL; }
- const char *func_name_ext() const { return "_oracle"; }
public:
Item_func_trim_oracle(THD *thd, Item *a, Item *b):
Item_func_trim(thd, a, b) {}
Item_func_trim_oracle(THD *thd, Item *a): Item_func_trim(thd, a) {}
- const char *func_name() const { return "trim_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
bool fix_length_and_dec()
{
bool res= Item_func_trim::fix_length_and_dec();
@@ -606,6 +634,7 @@ public:
return Item_func::value_depends_on_sql_mode();
}
String *val_str(String *);
+ const Schema *schema() const { return &mariadb_schema; }
const char *func_name() const { return "ltrim"; }
const char *mode_name() const { return "leading"; }
Item *get_copy(THD *thd)
@@ -618,12 +647,11 @@ class Item_func_ltrim_oracle :public Item_func_ltrim
protected:
String *make_empty_result()
{ null_value= 1; return NULL; }
- const char *func_name_ext() const { return "_oracle"; }
public:
Item_func_ltrim_oracle(THD *thd, Item *a, Item *b):
Item_func_ltrim(thd, a, b) {}
Item_func_ltrim_oracle(THD *thd, Item *a): Item_func_ltrim(thd, a) {}
- const char *func_name() const { return "ltrim_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
bool fix_length_and_dec()
{
bool res= Item_func_ltrim::fix_length_and_dec();
@@ -641,6 +669,7 @@ public:
Item_func_rtrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {}
Item_func_rtrim(THD *thd, Item *a): Item_func_trim(thd, a) {}
String *val_str(String *);
+ const Schema *schema() const { return &mariadb_schema; }
const char *func_name() const { return "rtrim"; }
const char *mode_name() const { return "trailing"; }
Item *get_copy(THD *thd)
@@ -653,12 +682,11 @@ class Item_func_rtrim_oracle :public Item_func_rtrim
protected:
String *make_empty_result()
{ null_value= 1; return NULL; }
- const char *func_name_ext() const { return "_oracle"; }
public:
Item_func_rtrim_oracle(THD *thd, Item *a, Item *b):
Item_func_rtrim(thd, a, b) {}
Item_func_rtrim_oracle(THD *thd, Item *a): Item_func_rtrim(thd, a) {}
- const char *func_name() const { return "rtrim_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
bool fix_length_and_dec()
{
bool res= Item_func_rtrim::fix_length_and_dec();
@@ -820,6 +848,13 @@ class Item_func_decode :public Item_func_encode
{
public:
Item_func_decode(THD *thd, Item *a, Item *seed_arg): Item_func_encode(thd, a, seed_arg) {}
+ static Item_func_decode *create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list);
+ const Schema *schema() const { return &mariadb_schema; }
+ void print(String *str, enum_query_type query_type)
+ {
+ print_sql_mode_dependent(str, query_type);
+ }
const char *func_name() const { return "decode"; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_decode>(thd, this); }
@@ -1125,6 +1160,8 @@ public:
Item_str_func(thd, arg1, arg2, arg3) {}
Item_func_pad(THD *thd, Item *arg1, Item *arg2):
Item_str_func(thd, arg1, arg2) {}
+ Item_func_pad(THD *thd, List<Item> &list):
+ Item_str_func(thd,list) {}
bool fix_length_and_dec();
};
@@ -1136,7 +1173,16 @@ public:
Item_func_pad(thd, arg1, arg2, arg3) {}
Item_func_rpad(THD *thd, Item *arg1, Item *arg2):
Item_func_pad(thd, arg1, arg2) {}
+ Item_func_rpad(THD *thd, List<Item> &list):
+ Item_func_pad(thd,list) {}
+ static Item_func_rpad *create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list);
String *val_str(String *);
+ const Schema *schema() const { return &mariadb_schema; }
+ void print(String *str, enum_query_type query_type)
+ {
+ print_sql_mode_dependent(str, query_type);
+ }
const char *func_name() const { return "rpad"; }
Sql_mode_dependency value_depends_on_sql_mode() const;
Item *get_copy(THD *thd)
@@ -1153,13 +1199,17 @@ public:
Item_func_rpad(thd, arg1, arg2, arg3) {}
Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2):
Item_func_rpad(thd, arg1, arg2) {}
+ Item_func_rpad_oracle(THD *thd, List<Item> &list):
+ Item_func_rpad(thd,list) {}
+ static Item_func_rpad_oracle *create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list);
bool fix_length_and_dec()
{
bool res= Item_func_rpad::fix_length_and_dec();
maybe_null= true;
return res;
}
- const char *func_name() const { return "rpad_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_rpad_oracle>(thd, this); }
};
@@ -1172,7 +1222,16 @@ public:
Item_func_pad(thd, arg1, arg2, arg3) {}
Item_func_lpad(THD *thd, Item *arg1, Item *arg2):
Item_func_pad(thd, arg1, arg2) {}
+ Item_func_lpad(THD *thd, List<Item> &list):
+ Item_func_pad(thd,list) {}
+ static Item_func_lpad *create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list);
String *val_str(String *);
+ const Schema *schema() const { return &mariadb_schema; }
+ void print(String *str, enum_query_type query_type)
+ {
+ print_sql_mode_dependent(str, query_type);
+ }
const char *func_name() const { return "lpad"; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_lpad>(thd, this); }
@@ -1188,13 +1247,17 @@ public:
Item_func_lpad(thd, arg1, arg2, arg3) {}
Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2):
Item_func_lpad(thd, arg1, arg2) {}
+ Item_func_lpad_oracle(THD *thd, List<Item> &list):
+ Item_func_lpad(thd,list) {}
+ static Item_func_lpad_oracle *create(THD *thd, const LEX_CSTRING &name,
+ List<Item> *item_list);
bool fix_length_and_dec()
{
bool res= Item_func_lpad::fix_length_and_dec();
maybe_null= true;
return res;
}
- const char *func_name() const { return "lpad_oracle"; }
+ const Schema *schema() const { return &oracle_schema_ref; }
Item *get_copy(THD *thd)
{ return get_item_copy<Item_func_lpad_oracle>(thd, this); }
};
diff --git a/sql/lex.h b/sql/lex.h
index 823e95bb863..1f8089c2359 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -739,7 +739,6 @@ SYMBOL sql_functions[] = {
{ "DATE_ADD", SYM(DATE_ADD_INTERVAL)},
{ "DATE_SUB", SYM(DATE_SUB_INTERVAL)},
{ "DATE_FORMAT", SYM(DATE_FORMAT_SYM)},
- { "DECODE", SYM(DECODE_MARIADB_SYM)},
{ "DENSE_RANK", SYM(DENSE_RANK_SYM)},
{ "EXTRACT", SYM(EXTRACT_SYM)},
{ "FIRST_VALUE", SYM(FIRST_VALUE_SYM)},
diff --git a/sql/mysqld.h b/sql/mysqld.h
index d40e1d170d0..54069c3cd5a 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -741,12 +741,25 @@ enum enum_query_type
QT_ITEM_SUBSELECT_ID_ONLY,
QT_SHOW_SELECT_NUMBER= (1<<10),
+
+ //QT_ITEM_IDENT_DISABLE_DB_TABLE_NAMES= (1 <<11), -- this is taken in 10.5
+
+ /// Print sql_mode-dependent functions with the schema qualifier
+ /// even if the currently implied (by sql_mode) schema is equal to
+ /// to the function schema, e.g. mariadb_schema.concat('a').
+ QT_ITEM_FUNC_FORCE_SCHEMA_NAME= (1 << 12),
+
+ /// Print for FRM file. Focus on parse-back.
+ /// e.g. VIEW expressions and virtual column expressions
+ QT_FOR_FRM= (1 << 13),
+
/// This is used for EXPLAIN EXTENDED extra warnings / Be more detailed
/// Be more detailed than QT_EXPLAIN.
/// Perhaps we should eventually include QT_ITEM_IDENT_SKIP_CURRENT_DATABASE
/// here, as it would give better readable results
QT_EXPLAIN_EXTENDED= QT_TO_SYSTEM_CHARSET|
- QT_SHOW_SELECT_NUMBER,
+ QT_SHOW_SELECT_NUMBER|
+ QT_ITEM_FUNC_FORCE_SCHEMA_NAME,
// If an expression is constant, print the expression, not the value
// it evaluates to. Should be used for error messages, so that they
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 8268ebe0bcd..6b988938f0b 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -6589,6 +6589,50 @@ class Sql_mode_save
sql_mode_t old_mode; // SQL mode saved at construction time.
};
+
+/*
+ Save the current sql_mode. Switch off sql_mode flags which can prevent
+ normal parsing of VIEWs, expressions in generated columns.
+ Restore the old sql_mode on destructor.
+*/
+class Sql_mode_save_for_frm_handling: public Sql_mode_save
+{
+public:
+ Sql_mode_save_for_frm_handling(THD *thd)
+ :Sql_mode_save(thd)
+ {
+ /*
+ - MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
+ + MODE_PIPES_AS_CONCAT affect expression parsing
+ + MODE_ANSI_QUOTES affect expression parsing
+ + MODE_IGNORE_SPACE affect expression parsing
+ - MODE_IGNORE_BAD_TABLE_OPTIONS affect only CREATE/ALTER TABLE parsing
+ * MODE_ONLY_FULL_GROUP_BY affect execution
+ * MODE_NO_UNSIGNED_SUBTRACTION affect execution
+ - MODE_NO_DIR_IN_CREATE affect table creation only
+ - MODE_POSTGRESQL compounded from other modes
+ - MODE_ORACLE affects Item creation (e.g for CONCAT)
+ - MODE_MSSQL compounded from other modes
+ - MODE_DB2 compounded from other modes
+ - MODE_MAXDB affect only CREATE TABLE parsing
+ - MODE_NO_KEY_OPTIONS affect only SHOW
+ - MODE_NO_TABLE_OPTIONS affect only SHOW
+ - MODE_NO_FIELD_OPTIONS affect only SHOW
+ - MODE_MYSQL323 affect only SHOW
+ - MODE_MYSQL40 affect only SHOW
+ - MODE_ANSI compounded from other modes
+ (+ transaction mode)
+ ? MODE_NO_AUTO_VALUE_ON_ZERO affect UPDATEs
+ + MODE_NO_BACKSLASH_ESCAPES affect expression parsing
+ + MODE_EMPTY_STRING_IS_NULL affect expression parsing
+ */
+ thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
+ MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES |
+ MODE_ORACLE | MODE_EMPTY_STRING_IS_NULL);
+ };
+};
+
+
class Abort_on_warning_instant_set
{
THD *m_thd;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 7f1b362d91d..6b0a351f76e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -827,7 +827,7 @@ Yacc_state::~Yacc_state()
}
int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd,
- uint len, bool function)
+ uint len, bool function) const
{
const char *tok= m_tok_start;
@@ -847,7 +847,6 @@ int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd,
case CLOB_MARIADB_SYM: return CLOB_ORACLE_SYM;
case CONTINUE_MARIADB_SYM: return CONTINUE_ORACLE_SYM;
case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
- case DECODE_MARIADB_SYM: return DECODE_ORACLE_SYM;
case ELSEIF_MARIADB_SYM: return ELSEIF_ORACLE_SYM;
case ELSIF_MARIADB_SYM: return ELSIF_ORACLE_SYM;
case EXCEPTION_MARIADB_SYM: return EXCEPTION_ORACLE_SYM;
@@ -917,7 +916,7 @@ bool is_lex_native_function(const LEX_CSTRING *name)
bool is_native_function(THD *thd, const LEX_CSTRING *name)
{
- if (find_native_function_builder(thd, name))
+ if (mariadb_schema.find_native_function_builder(thd, *name))
return true;
if (is_lex_native_function(name))
@@ -1542,7 +1541,18 @@ int Lex_input_stream::lex_one_token(YYSTYPE *yylval, THD *thd)
if (lex->parsing_options.lookup_keywords_after_qualifier)
next_state= MY_LEX_IDENT_OR_KEYWORD;
else
- next_state= MY_LEX_IDENT_START; // Next is ident (not keyword)
+ {
+ /*
+ Next is:
+ - A qualified func with a special syntax:
+ mariadb_schema.REPLACE('a','b','c')
+ mariadb_schema.SUSTRING('a',1,2)
+ mariadb_schema.TRIM('a')
+ - Or an identifier otherwise. No keyword lookup is done,
+ all keywords are treated as identifiers.
+ */
+ next_state= MY_LEX_IDENT_OR_QUALIFIED_SPECIAL_FUNC;
+ }
if (!ident_map[(uchar) yyPeek()]) // Probably ` or "
next_state= MY_LEX_START;
return((int) c);
@@ -1986,7 +1996,12 @@ int Lex_input_stream::lex_one_token(YYSTYPE *yylval, THD *thd)
We should now be able to handle:
[(global | local | session) .]variable_name
*/
- return scan_ident_sysvar(thd, &yylval->ident_cli);
+ return scan_ident_common(thd, &yylval->ident_cli,
+ GENERAL_KEYWORD_OR_FUNC_LPAREN);
+
+ case MY_LEX_IDENT_OR_QUALIFIED_SPECIAL_FUNC:
+ return scan_ident_common(thd, &yylval->ident_cli,
+ QUALIFIED_SPECIAL_FUNC_LPAREN);
}
}
}
@@ -2008,7 +2023,59 @@ bool Lex_input_stream::get_7bit_or_8bit_ident(THD *thd, uchar *last_char)
}
-int Lex_input_stream::scan_ident_sysvar(THD *thd, Lex_ident_cli_st *str)
+/*
+ Resolve special SQL functions that have a qualified syntax in sql_yacc.yy.
+ These functions are not listed in the native function registry
+ because of a special syntax, or a reserved keyword:
+
+ mariadb_schema.SUBSTRING('a' FROM 1 FOR 2) -- Special syntax
+ mariadb_schema.TRIM(BOTH ' ' FROM 'a') -- Special syntax
+ mariadb_schema.REPLACE('a','b','c') -- Verb keyword
+*/
+
+int Lex_input_stream::find_keyword_qualified_special_func(Lex_ident_cli_st *str,
+ uint length) const
+{
+ /*
+ There are many other special functions, see the following grammar rules:
+ function_call_keyword
+ function_call_nonkeyword
+ Here we resolve only those that have a qualified syntax to handle
+ different behavior in different @@sql_mode settings.
+
+ Other special functions do not work in qualified context:
+ SELECT mariadb_schema.year(now()); -- Function year is not defined
+ SELECT mariadb_schema.now(); -- Function now is not defined
+
+ We don't resolve TRIM_ORACLE here, because it does not have
+ a qualified syntax yet. Search for "trim_operands" in sql_yacc.yy
+ to find more comments.
+ */
+ static LEX_CSTRING funcs[]=
+ {
+ {STRING_WITH_LEN("SUBSTRING")},
+ {STRING_WITH_LEN("SUBSTR")},
+ {STRING_WITH_LEN("TRIM")},
+ {STRING_WITH_LEN("REPLACE")}
+ };
+
+ int tokval= find_keyword(str, length, true);
+ if (!tokval)
+ return 0;
+ for (size_t i= 0; i < array_elements(funcs); i++)
+ {
+ CHARSET_INFO *cs= system_charset_info;
+ if (!cs->coll->strnncollsp(cs,
+ (const uchar *) m_tok_start, length,
+ (const uchar *) funcs[i].str, funcs[i].length))
+ return tokval;
+ }
+ return 0;
+}
+
+
+int Lex_input_stream::scan_ident_common(THD *thd, Lex_ident_cli_st *str,
+ Ident_mode mode)
{
uchar last_char;
uint length;
@@ -2022,10 +2089,41 @@ int Lex_input_stream::scan_ident_sysvar(THD *thd, Lex_ident_cli_st *str)
next_state= MY_LEX_IDENT_SEP;
if (!(length= yyLength()))
return ABORT_SYM; // Names must be nonempty.
- if ((tokval= find_keyword(str, length, 0)))
- {
- yyUnget(); // Put back 'c'
- return tokval; // Was keyword
+
+ switch (mode) {
+ case GENERAL_KEYWORD_OR_FUNC_LPAREN:
+ /*
+ We can come here inside a system variable after "@@",
+ e.g. @@global.character_set_client.
+ We resolve all general purpose keywords here.
+
+ We can come here when LEX::parsing_options.lookup_keywords_after_qualifier
+ is true, i.e. within the "field_spec" Bison rule.
+ We need to resolve functions that have special rules inside sql_yacc.yy,
+ such as SUBSTR, REPLACE, TRIM, to make this work:
+ c2 varchar(4) GENERATED ALWAYS AS (mariadb_schema.substr(c1,1,4))
+ */
+ if ((tokval= find_keyword(str, length, last_char == '(')))
+ {
+ yyUnget(); // Put back 'c'
+ return tokval; // Was keyword
+ }
+ break;
+ case QUALIFIED_SPECIAL_FUNC_LPAREN:
+ /*
+ We come here after '.' in various contexts:
+ SELECT @@global.character_set_client;
+ SELECT t1.a FROM t1;
+ SELECT test.f1() FROM t1;
+ SELECT mariadb_schema.trim('a');
+ */
+ if (last_char == '(' &&
+ (tokval= find_keyword_qualified_special_func(str, length)))
+ {
+ yyUnget(); // Put back 'c'
+ return tokval; // Was keyword
+ }
+ break;
}
yyUnget(); // ptr points now after last token char
@@ -2075,9 +2173,9 @@ int Lex_input_stream::scan_ident_start(THD *thd, Lex_ident_cli_st *str)
{
is_8bit= get_7bit_or_8bit_ident(thd, &c);
}
+
if (c == '.' && ident_map[(uchar) yyPeek()])
next_state= MY_LEX_IDENT_SEP;// Next is '.'
-
uint length= yyLength();
yyUnget(); // ptr points now after last token char
str->set_ident(m_tok_start, length, is_8bit);
@@ -8035,30 +8133,49 @@ bool LEX::add_grant_command(THD *thd, enum_sql_command sql_command_arg,
}
-Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b, Item *c)
+const Schema *
+LEX::find_func_schema_by_name_or_error(const Lex_ident_sys &schema,
+ const Lex_ident_sys &func)
{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- new (thd->mem_root) Item_func_substr_oracle(thd, a, b, c) :
- new (thd->mem_root) Item_func_substr(thd, a, b, c);
+ Schema *res= Schema::find_by_name(schema);
+ if (res)
+ return res;
+ Database_qualified_name qname(schema, func);
+ my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), ErrConvDQName(&qname).ptr());
+ return NULL;
}
-Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b)
+Item *LEX::make_item_func_substr(THD *thd,
+ const Lex_ident_cli_st &schema_name_cli,
+ const Lex_ident_cli_st &func_name_cli,
+ const Lex_substring_spec_st &spec)
{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- new (thd->mem_root) Item_func_substr_oracle(thd, a, b) :
- new (thd->mem_root) Item_func_substr(thd, a, b);
+ Lex_ident_sys schema_name(thd, &schema_name_cli);
+ Lex_ident_sys func_name(thd, &func_name_cli);
+ if (schema_name.is_null() || func_name.is_null())
+ return NULL; // EOM
+ const Schema *schema= find_func_schema_by_name_or_error(schema_name,
+ func_name);
+ return schema ? schema->make_item_func_substr(thd, spec) : NULL;
}
Item *LEX::make_item_func_replace(THD *thd,
+ const Lex_ident_cli_st &schema_name_cli,
+ const Lex_ident_cli_st &func_name_cli,
Item *org,
Item *find,
Item *replace)
{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- new (thd->mem_root) Item_func_replace_oracle(thd, org, find, replace) :
- new (thd->mem_root) Item_func_replace(thd, org, find, replace);
+ Lex_ident_sys schema_name(thd, &schema_name_cli);
+ Lex_ident_sys func_name(thd, &func_name_cli);
+ if (schema_name.is_null() || func_name.is_null())
+ return NULL; // EOM
+ const Schema *schema= find_func_schema_by_name_or_error(schema_name,
+ func_name);
+ return schema ? schema->make_item_func_replace(thd, org, find, replace) :
+ NULL;
}
@@ -8140,11 +8257,18 @@ Item *Lex_trim_st::make_item_func_trim_oracle(THD *thd) const
}
-Item *Lex_trim_st::make_item_func_trim(THD *thd) const
+Item *Lex_trim_st::make_item_func_trim(THD *thd,
+ const Lex_ident_cli_st &schema_name_cli,
+ const Lex_ident_cli_st &func_name_cli)
+ const
{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- make_item_func_trim_oracle(thd) :
- make_item_func_trim_std(thd);
+ Lex_ident_sys schema_name(thd, &schema_name_cli);
+ Lex_ident_sys func_name(thd, &func_name_cli);
+ if (schema_name.is_null() || func_name.is_null())
+ return NULL; // EOM
+ const Schema *schema= LEX::find_func_schema_by_name_or_error(schema_name,
+ func_name);
+ return schema ? schema->make_item_func_trim(thd, *this) : NULL;
}
@@ -8176,6 +8300,19 @@ Item *LEX::make_item_func_call_generic(THD *thd, Lex_ident_cli_st *cdb,
if (check_routine_name(&name))
return NULL;
+ return make_item_func_call_generic(thd, db, name, args);
+}
+
+
+Item *LEX::make_item_func_call_generic(THD *thd,
+ const Lex_ident_sys &db,
+ const Lex_ident_sys &name,
+ List<Item> *args)
+{
+ const Schema *schema= Schema::find_by_name(db);
+ if (schema)
+ return schema->make_item_func_call_native(thd, name, args);
+
Create_qfunc *builder= find_qualified_function_builder(thd);
DBUG_ASSERT(builder);
return builder->create_with_db(thd, &db, &name, true, args);
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index b5cc9604a8f..c7a3c692a6e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -2239,6 +2239,15 @@ public:
void reduce_digest_token(uint token_left, uint token_right);
private:
+
+ enum Ident_mode
+ {
+ GENERAL_KEYWORD_OR_FUNC_LPAREN,
+ QUALIFIED_SPECIAL_FUNC_LPAREN
+ };
+
+ int scan_ident_common(THD *thd, Lex_ident_cli_st *str, Ident_mode mode);
+
/**
Set the echo mode.
@@ -2436,7 +2445,7 @@ public:
}
/** Get the raw query buffer. */
- const char *get_buf()
+ const char *get_buf() const
{
return m_buf;
}
@@ -2448,7 +2457,7 @@ public:
}
/** Get the end of the raw query buffer. */
- const char *get_end_of_query()
+ const char *get_end_of_query() const
{
return m_end_of_query;
}
@@ -2492,7 +2501,7 @@ public:
Get the token end position in the pre-processed buffer,
with trailing spaces removed.
*/
- const char *get_cpp_tok_end_rtrim()
+ const char *get_cpp_tok_end_rtrim() const
{
const char *p;
for (p= m_cpp_tok_end;
@@ -2564,9 +2573,9 @@ private:
bool consume_comment(int remaining_recursions_permitted);
int lex_one_token(union YYSTYPE *yylval, THD *thd);
- int find_keyword(Lex_ident_cli_st *str, uint len, bool function);
+ int find_keyword(Lex_ident_cli_st *str, uint len, bool function) const;
+ int find_keyword_qualified_special_func(Lex_ident_cli_st *str, uint len) const;
LEX_CSTRING get_token(uint skip, uint length);
- int scan_ident_sysvar(THD *thd, Lex_ident_cli_st *str);
int scan_ident_start(THD *thd, Lex_ident_cli_st *str);
int scan_ident_middle(THD *thd, Lex_ident_cli_st *str,
CHARSET_INFO **cs, my_lex_states *);
@@ -3695,12 +3704,24 @@ public:
const Lex_ident_cli_st *var_name,
const Lex_ident_cli_st *field_name);
- Item *make_item_func_replace(THD *thd, Item *org, Item *find, Item *replace);
- Item *make_item_func_substr(THD *thd, Item *a, Item *b, Item *c);
- Item *make_item_func_substr(THD *thd, Item *a, Item *b);
+ static const Schema *
+ find_func_schema_by_name_or_error(const Lex_ident_sys &schema_name,
+ const Lex_ident_sys &func_name);
+ Item *make_item_func_replace(THD *thd,
+ const Lex_ident_cli_st &schema_name,
+ const Lex_ident_cli_st &func_name,
+ Item *org, Item *find, Item *replace);
+ Item *make_item_func_substr(THD *thd,
+ const Lex_ident_cli_st &schema_name,
+ const Lex_ident_cli_st &func_name,
+ const Lex_substring_spec_st &spec);
Item *make_item_func_call_generic(THD *thd, Lex_ident_cli_st *db,
Lex_ident_cli_st *name, List<Item> *args);
Item *make_item_func_call_generic(THD *thd,
+ const Lex_ident_sys &db,
+ const Lex_ident_sys &name,
+ List<Item> *args);
+ Item *make_item_func_call_generic(THD *thd,
Lex_ident_cli_st *db,
Lex_ident_cli_st *pkg,
Lex_ident_cli_st *name,
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 59d2ea60715..8e83ee02782 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -2591,11 +2591,9 @@ char *generate_partition_syntax_for_frm(THD *thd, partition_info *part_info,
HA_CREATE_INFO *create_info,
Alter_info *alter_info)
{
- sql_mode_t old_mode= thd->variables.sql_mode;
- thd->variables.sql_mode &= ~MODE_ANSI_QUOTES;
+ Sql_mode_save_for_frm_handling sql_mode_save(thd);
char *res= generate_partition_syntax(thd, part_info, buf_length,
true, create_info, alter_info);
- thd->variables.sql_mode= old_mode;
return res;
}
diff --git a/sql/sql_schema.cc b/sql/sql_schema.cc
index 0bf4a63c2f8..e2993f51c6d 100644
--- a/sql/sql_schema.cc
+++ b/sql/sql_schema.cc
@@ -32,6 +32,16 @@ public:
return thd->type_handler_for_datetime();
return src;
}
+
+ Create_func *find_native_function_builder(THD*, const LEX_CSTRING&) const;
+
+ Item *make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const;
+ Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const;
+ Item *make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const;
};
@@ -56,6 +66,7 @@ Schema mariadb_schema(Lex_cstring(STRING_WITH_LEN("mariadb_schema")));
Schema_oracle oracle_schema(Lex_cstring(STRING_WITH_LEN("oracle_schema")));
Schema_maxdb maxdb_schema(Lex_cstring(STRING_WITH_LEN("maxdb_schema")));
+const Schema &oracle_schema_ref= oracle_schema;
Schema *Schema::find_by_name(const LEX_CSTRING &name)
{
@@ -78,3 +89,86 @@ Schema *Schema::find_implied(THD *thd)
return &maxdb_schema;
return &mariadb_schema;
}
+
+
+Create_func *
+Schema::find_native_function_builder(THD *thd, const LEX_CSTRING &name) const
+{
+ return native_functions_hash.find(thd, name);
+}
+
+
+Create_func *
+Schema_oracle::find_native_function_builder(THD *thd,
+ const LEX_CSTRING &name) const
+{
+ Create_func *create= native_functions_hash_oracle_overrides.find(thd, name);
+ if (create)
+ return create;
+ return native_functions_hash.find(thd, name);
+}
+
+
+Item *Schema::make_item_func_call_native(THD *thd,
+ const Lex_ident_sys &name,
+ List<Item> *args) const
+{
+ Create_func *builder= find_native_function_builder(thd, name);
+ if (builder)
+ return builder->create_func(thd, &name, args);
+ my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), name.str);
+ return NULL;
+}
+
+
+Item *Schema::make_item_func_trim(THD *thd, const Lex_trim_st &spec) const
+{
+ return spec.make_item_func_trim_std(thd);
+}
+
+
+Item *Schema::make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const
+{
+ return spec.m_for ?
+ new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from,
+ spec.m_for) :
+ new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from);
+}
+
+
+Item *Schema_oracle::make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const
+{
+ return spec.m_for ?
+ new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject,
+ spec.m_from,
+ spec.m_for) :
+ new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject,
+ spec.m_from);
+}
+
+
+Item *Schema_oracle::make_item_func_trim(THD *thd,
+ const Lex_trim_st &spec) const
+{
+ return spec.make_item_func_trim_oracle(thd);
+}
+
+
+Item *Schema::make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const
+{
+ return new (thd->mem_root) Item_func_replace(thd, subj, find, replace);
+}
+
+
+Item *Schema_oracle::make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const
+{
+ return new (thd->mem_root) Item_func_replace_oracle(thd, subj, find, replace);
+}
diff --git a/sql/sql_schema.h b/sql/sql_schema.h
index 7c8f284d526..36914e36990 100644
--- a/sql/sql_schema.h
+++ b/sql/sql_schema.h
@@ -19,6 +19,9 @@
#include "mysqld.h"
#include "lex_string.h"
+class Lex_ident_sys;
+class Create_func;
+
class Schema
{
LEX_CSTRING m_name;
@@ -33,6 +36,34 @@ public:
{
return src;
}
+
+
+ /**
+ Find the native function builder associated with a given function name.
+ @param thd The current thread
+ @param name The native function name
+ @return The native function builder associated with the name, or NULL
+ */
+ virtual Create_func *find_native_function_builder(THD *thd,
+ const LEX_CSTRING &name)
+ const;
+ /**
+ Find a native function builder, return an error if not found,
+ build an Item otherwise.
+ */
+ Item *make_item_func_call_native(THD *thd,
+ const Lex_ident_sys &name,
+ List<Item> *args) const;
+
+ // Builders for native SQL function with a special syntax in sql_yacc.yy
+ virtual Item *make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const;
+
+ virtual Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const;
+ virtual Item *make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const;
/*
For now we have *hard-coded* compatibility schemas:
schema_mariadb, schema_oracle, schema_maxdb.
@@ -66,5 +97,6 @@ public:
extern Schema mariadb_schema;
+extern const Schema &oracle_schema_ref;
#endif // SQL_SCHEMA_H_INCLUDED
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 2a3dbceb4cb..c8a78649696 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -74,9 +74,6 @@ extern size_t symbols_length;
extern SYMBOL sql_functions[];
extern size_t sql_functions_length;
-extern Native_func_registry func_array[];
-extern size_t func_array_length;
-
enum enum_i_s_events_fields
{
ISE_EVENT_CATALOG= 0,
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index b6787a1cb8b..4a4545eea59 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -940,16 +940,15 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view_query.length(0);
is_query.length(0);
{
- sql_mode_t sql_mode= thd->variables.sql_mode & MODE_ANSI_QUOTES;
- thd->variables.sql_mode&= ~MODE_ANSI_QUOTES;
+ Sql_mode_save_for_frm_handling sql_mode_save(thd);
- lex->unit.print(&view_query, enum_query_type(QT_VIEW_INTERNAL |
+ lex->unit.print(&view_query, enum_query_type(QT_FOR_FRM |
+ QT_VIEW_INTERNAL |
QT_ITEM_ORIGINAL_FUNC_NULLIF));
- lex->unit.print(&is_query, enum_query_type(QT_TO_SYSTEM_CHARSET |
+ lex->unit.print(&is_query, enum_query_type(QT_ITEM_FUNC_FORCE_SCHEMA_NAME |
+ QT_TO_SYSTEM_CHARSET |
QT_WITHOUT_INTRODUCERS |
QT_ITEM_ORIGINAL_FUNC_NULLIF));
-
- thd->variables.sql_mode|= sql_mode;
}
DBUG_PRINT("info", ("View: %.*s", view_query.length(), view_query.ptr()));
@@ -1372,35 +1371,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
view_select= &lex->select_lex;
view_select->select_number= ++thd->lex->stmt_lex->current_select_number;
- sql_mode_t saved_mode= thd->variables.sql_mode;
- /* switch off modes which can prevent normal parsing of VIEW
- - MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
- + MODE_PIPES_AS_CONCAT affect expression parsing
- + MODE_ANSI_QUOTES affect expression parsing
- + MODE_IGNORE_SPACE affect expression parsing
- - MODE_IGNORE_BAD_TABLE_OPTIONS affect only CREATE/ALTER TABLE parsing
- * MODE_ONLY_FULL_GROUP_BY affect execution
- * MODE_NO_UNSIGNED_SUBTRACTION affect execution
- - MODE_NO_DIR_IN_CREATE affect table creation only
- - MODE_POSTGRESQL compounded from other modes
- - MODE_ORACLE affects Item creation (e.g for CONCAT)
- - MODE_MSSQL compounded from other modes
- - MODE_DB2 compounded from other modes
- - MODE_MAXDB affect only CREATE TABLE parsing
- - MODE_NO_KEY_OPTIONS affect only SHOW
- - MODE_NO_TABLE_OPTIONS affect only SHOW
- - MODE_NO_FIELD_OPTIONS affect only SHOW
- - MODE_MYSQL323 affect only SHOW
- - MODE_MYSQL40 affect only SHOW
- - MODE_ANSI compounded from other modes
- (+ transaction mode)
- ? MODE_NO_AUTO_VALUE_ON_ZERO affect UPDATEs
- + MODE_NO_BACKSLASH_ESCAPES affect expression parsing
- */
- thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
- MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES |
- MODE_ORACLE);
-
+ Sql_mode_save_for_frm_handling sql_mode_save(thd);
/* Parse the query. */
parse_status= parse_sql(thd, & parser_state, table->view_creation_ctx);
@@ -1411,8 +1382,6 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
(old_lex->sql_command == SQLCOM_SHOW_CREATE))
lex->sql_command= old_lex->sql_command;
- thd->variables.sql_mode= saved_mode;
-
if (dbchanged && mysql_change_db(thd, &old_db, TRUE))
goto err;
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 3770488f3f4..e0bafc75a36 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -802,6 +802,7 @@ Virtual_column_info *add_virtual_expression(THD *thd, Item *expr)
Lex_for_loop_st for_loop;
Lex_for_loop_bounds_st for_loop_bounds;
Lex_trim_st trim;
+ Lex_substring_spec_st substring_spec;
vers_history_point_t vers_history_point;
/* pointers */
@@ -1137,7 +1138,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token RELEASE_SYM /* SQL-2003-R */
%token RENAME
%token REPEAT_SYM /* MYSQL-FUNC */
-%token REPLACE /* MYSQL-FUNC */
%token REQUIRE_SYM
%token RESIGNAL_SYM /* SQL-2003-R */
%token RESTRICT
@@ -1177,7 +1177,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token STDDEV_SAMP_SYM /* SQL-2003-N */
%token STD_SYM
%token STRAIGHT_JOIN
-%token SUBSTRING /* SQL-2003-N */
%token SUM_SYM /* SQL-2003-N */
%token SYSDATE
%token TABLE_REF_PRIORITY
@@ -1191,7 +1190,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token TO_SYM /* SQL-2003-R */
%token TRAILING /* SQL-2003-R */
%token TRIGGER_SYM /* SQL-2003-R */
-%token TRIM /* SQL-2003-N */
%token TRUE_SYM /* SQL-2003-R */
%token ULONGLONG_NUM
%token UNDERSCORE_CHARSET
@@ -1243,6 +1241,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> ROWTYPE_MARIADB_SYM // PLSQL-R
/*
+ SQL functions with a special syntax
+*/
+%token <kwd> REPLACE /* MYSQL-FUNC */
+%token <kwd> SUBSTRING /* SQL-2003-N */
+%token <kwd> TRIM /* SQL-2003-N */
+
+
+/*
Non-reserved keywords
*/
@@ -1328,8 +1334,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> DATE_SYM /* SQL-2003-R, Oracle-R, PLSQL-R */
%token <kwd> DAY_SYM /* SQL-2003-R */
%token <kwd> DEALLOCATE_SYM /* SQL-2003-R */
-%token <kwd> DECODE_MARIADB_SYM /* Function, non-reserved */
-%token <kwd> DECODE_ORACLE_SYM /* Function, non-reserved */
%token <kwd> DEFINER_SYM
%token <kwd> DELAYED_SYM
%token <kwd> DELAY_KEY_WRITE_SYM
@@ -1974,7 +1978,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%type <item_list>
expr_list opt_udf_expr_list udf_expr_list when_list when_list_opt_else
ident_list ident_list_arg opt_expr_list
- decode_when_list_oracle
%type <sp_cursor_stmt>
sp_cursor_stmt_lex
@@ -2172,6 +2175,7 @@ END_OF_INPUT
%type <for_loop> sp_for_loop_index_and_bounds
%type <for_loop_bounds> sp_for_loop_bounds
%type <trim> trim_operands
+%type <substring_spec> substring_operands
%type <num> opt_sp_for_loop_direction
%type <spvar_mode> sp_opt_inout
%type <index_hint> index_hint_type
@@ -10639,7 +10643,8 @@ function_call_keyword:
}
| TRIM '(' trim_operands ')'
{
- if (unlikely(!($$= $3.make_item_func_trim(thd))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_trim(thd, $3))))
MYSQL_YYABORT;
}
| USER_SYM '(' ')'
@@ -10658,6 +10663,26 @@ function_call_keyword:
}
;
+substring_operands:
+ expr ',' expr ',' expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3, $5);
+ }
+ | expr ',' expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3);
+ }
+ | expr FROM expr FOR_SYM expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3, $5);
+ }
+ | expr FROM expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3);
+ }
+ ;
+
+
/*
Function calls using non reserved keywords, with special syntaxic forms.
Dedicated grammar rules are needed because of the syntax,
@@ -10722,18 +10747,6 @@ function_call_nonkeyword:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | DECODE_MARIADB_SYM '(' expr ',' expr ')'
- {
- $$= new (thd->mem_root) Item_func_decode(thd, $3, $5);
- if (unlikely($$ == NULL))
- MYSQL_YYABORT;
- }
- | DECODE_ORACLE_SYM '(' expr ',' decode_when_list_oracle ')'
- {
- $5->push_front($3, thd->mem_root);
- if (unlikely(!($$= new (thd->mem_root) Item_func_decode_oracle(thd, *$5))))
- MYSQL_YYABORT;
- }
| EXTRACT_SYM '(' interval FROM expr ')'
{
$$=new (thd->mem_root) Item_extract(thd, $3, $5);
@@ -10772,24 +10785,10 @@ function_call_nonkeyword:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | SUBSTRING '(' expr ',' expr ',' expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr ',' expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
+ | SUBSTRING '(' substring_operands ')'
{
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr FROM expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_substr(thd, $3))))
MYSQL_YYABORT;
}
| SYSDATE opt_time_precision
@@ -11005,7 +11004,8 @@ function_call_conflict:
}
| REPLACE '(' expr ',' expr ',' expr ')'
{
- if (unlikely(!($$= Lex->make_item_func_replace(thd, $3, $5, $7))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_replace(thd, $3, $5, $7))))
MYSQL_YYABORT;
}
| REVERSE_SYM '(' expr ')'
@@ -11193,7 +11193,8 @@ function_call_generic:
This will be revised with WL#2128 (SQL PATH)
*/
- builder= find_native_function_builder(thd, &$1);
+ builder= Schema::find_implied(thd)->
+ find_native_function_builder(thd, $1);
if (builder)
{
item= builder->create_func(thd, &$1, $4);
@@ -11235,6 +11236,34 @@ function_call_generic:
if (unlikely(!($$= Lex->make_item_func_call_generic(thd, &$1, &$3, &$5, $7))))
MYSQL_YYABORT;
}
+ | ident_cli '.' REPLACE '(' expr ',' expr ',' expr ')'
+ {
+ if (unlikely(!($$= Lex->make_item_func_replace(thd, $1, $3,
+ $5, $7, $9))))
+ MYSQL_YYABORT;
+ }
+ | ident_cli '.' SUBSTRING '(' substring_operands ')'
+ {
+ if (unlikely(!($$= Lex->make_item_func_substr(thd, $1, $3, $5))))
+ MYSQL_YYABORT;
+ }
+ | ident_cli '.' TRIM '(' trim_operands ')'
+ {
+ if (unlikely(!($$= $5.make_item_func_trim(thd, $1, $3))))
+ MYSQL_YYABORT;
+ }
+ /*
+ We don't add a qualified syntax for TRIM_ORACLE here,
+ as this syntax is not absolutely required:
+ SELECT mariadb_schema.TRIM_ORACLE(..);
+ What absolutely required is only:
+ SELECT mariadb_schema.TRIM(..);
+ Adding a qualified syntax for TRIM_ORACLE would be tricky because
+ it is a non-reserved keyword. To avoid new shift/reduce conflicts
+ it would require grammar changes, like introducing a new rule
+ ident_step2_cli (which would include everything that ident_cli
+ includes but TRIM_ORACLE).
+ */
;
fulltext_options:
@@ -11902,25 +11931,6 @@ when_list_opt_else:
}
;
-decode_when_list_oracle:
- expr ',' expr
- {
- $$= new (thd->mem_root) List<Item>;
- if (unlikely($$ == NULL) ||
- unlikely($$->push_back($1, thd->mem_root)) ||
- unlikely($$->push_back($3, thd->mem_root)))
- MYSQL_YYABORT;
-
- }
- | decode_when_list_oracle ',' expr
- {
- $$= $1;
- if (unlikely($$->push_back($3, thd->mem_root)))
- MYSQL_YYABORT;
- }
- ;
-
-
/* Equivalent to <table reference> in the SQL:2003 standard. */
/* Warning - may return NULL in case of incomplete SELECT */
table_ref:
@@ -16115,8 +16125,6 @@ keyword_sp_var_and_label:
| DATAFILE_SYM
| DATE_FORMAT_SYM
| DAY_SYM
- | DECODE_MARIADB_SYM
- | DECODE_ORACLE_SYM
| DEFINER_SYM
| DELAY_KEY_WRITE_SYM
| DES_KEY_FILE
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index f0e6b5b54c7..b5c8a987454 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -195,6 +195,7 @@ void ORAerror(THD *thd, const char *s)
Lex_for_loop_st for_loop;
Lex_for_loop_bounds_st for_loop_bounds;
Lex_trim_st trim;
+ Lex_substring_spec_st substring_spec;
vers_history_point_t vers_history_point;
/* pointers */
@@ -531,7 +532,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token RELEASE_SYM /* SQL-2003-R */
%token RENAME
%token REPEAT_SYM /* MYSQL-FUNC */
-%token REPLACE /* MYSQL-FUNC */
%token REQUIRE_SYM
%token RESIGNAL_SYM /* SQL-2003-R */
%token RESTRICT
@@ -571,7 +571,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token STDDEV_SAMP_SYM /* SQL-2003-N */
%token STD_SYM
%token STRAIGHT_JOIN
-%token SUBSTRING /* SQL-2003-N */
%token SUM_SYM /* SQL-2003-N */
%token SYSDATE
%token TABLE_REF_PRIORITY
@@ -585,7 +584,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token TO_SYM /* SQL-2003-R */
%token TRAILING /* SQL-2003-R */
%token TRIGGER_SYM /* SQL-2003-R */
-%token TRIM /* SQL-2003-N */
%token TRUE_SYM /* SQL-2003-R */
%token ULONGLONG_NUM
%token UNDERSCORE_CHARSET
@@ -637,6 +635,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> ROWTYPE_MARIADB_SYM // PLSQL-R
/*
+ SQL functions with a special syntax
+*/
+%token <kwd> REPLACE /* MYSQL-FUNC */
+%token <kwd> SUBSTRING /* SQL-2003-N */
+%token <kwd> TRIM /* SQL-2003-N */
+
+
+/*
Non-reserved keywords
*/
@@ -722,8 +728,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> DATE_SYM /* SQL-2003-R, Oracle-R, PLSQL-R */
%token <kwd> DAY_SYM /* SQL-2003-R */
%token <kwd> DEALLOCATE_SYM /* SQL-2003-R */
-%token <kwd> DECODE_MARIADB_SYM /* Function, non-reserved */
-%token <kwd> DECODE_ORACLE_SYM /* Function, non-reserved */
%token <kwd> DEFINER_SYM
%token <kwd> DELAYED_SYM
%token <kwd> DELAY_KEY_WRITE_SYM
@@ -1375,7 +1379,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%type <item_list>
expr_list opt_udf_expr_list udf_expr_list when_list when_list_opt_else
ident_list ident_list_arg opt_expr_list
- decode_when_list_oracle
%type <sp_cursor_stmt>
sp_cursor_stmt_lex
@@ -1593,6 +1596,7 @@ END_OF_INPUT
%type <for_loop> sp_for_loop_index_and_bounds
%type <for_loop_bounds> sp_for_loop_bounds
%type <trim> trim_operands
+%type <substring_spec> substring_operands
%type <num> opt_sp_for_loop_direction
%type <spvar_mode> sp_opt_inout
%type <index_hint> index_hint_type
@@ -10596,7 +10600,8 @@ function_call_keyword:
}
| TRIM '(' trim_operands ')'
{
- if (unlikely(!($$= $3.make_item_func_trim(thd))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_trim(thd, $3))))
MYSQL_YYABORT;
}
| USER_SYM '(' ')'
@@ -10615,6 +10620,26 @@ function_call_keyword:
}
;
+substring_operands:
+ expr ',' expr ',' expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3, $5);
+ }
+ | expr ',' expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3);
+ }
+ | expr FROM expr FOR_SYM expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3, $5);
+ }
+ | expr FROM expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3);
+ }
+ ;
+
+
/*
Function calls using non reserved keywords, with special syntaxic forms.
Dedicated grammar rules are needed because of the syntax,
@@ -10679,18 +10704,6 @@ function_call_nonkeyword:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | DECODE_MARIADB_SYM '(' expr ',' expr ')'
- {
- $$= new (thd->mem_root) Item_func_decode(thd, $3, $5);
- if (unlikely($$ == NULL))
- MYSQL_YYABORT;
- }
- | DECODE_ORACLE_SYM '(' expr ',' decode_when_list_oracle ')'
- {
- $5->push_front($3, thd->mem_root);
- if (unlikely(!($$= new (thd->mem_root) Item_func_decode_oracle(thd, *$5))))
- MYSQL_YYABORT;
- }
| EXTRACT_SYM '(' interval FROM expr ')'
{
$$=new (thd->mem_root) Item_extract(thd, $3, $5);
@@ -10729,24 +10742,10 @@ function_call_nonkeyword:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | SUBSTRING '(' expr ',' expr ',' expr ')'
+ | SUBSTRING '(' substring_operands ')'
{
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr ',' expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr FROM expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_substr(thd, $3))))
MYSQL_YYABORT;
}
| SYSDATE opt_time_precision
@@ -10962,7 +10961,8 @@ function_call_conflict:
}
| REPLACE '(' expr ',' expr ',' expr ')'
{
- if (unlikely(!($$= Lex->make_item_func_replace(thd, $3, $5, $7))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_replace(thd, $3, $5, $7))))
MYSQL_YYABORT;
}
| REVERSE_SYM '(' expr ')'
@@ -11150,7 +11150,8 @@ function_call_generic:
This will be revised with WL#2128 (SQL PATH)
*/
- builder= find_native_function_builder(thd, &$1);
+ builder= Schema::find_implied(thd)->
+ find_native_function_builder(thd, $1);
if (builder)
{
item= builder->create_func(thd, &$1, $4);
@@ -11192,6 +11193,22 @@ function_call_generic:
if (unlikely(!($$= Lex->make_item_func_call_generic(thd, &$1, &$3, &$5, $7))))
MYSQL_YYABORT;
}
+ | ident_cli '.' REPLACE '(' expr ',' expr ',' expr ')'
+ {
+ if (unlikely(!($$= Lex->make_item_func_replace(thd, $1, $3,
+ $5, $7, $9))))
+ MYSQL_YYABORT;
+ }
+ | ident_cli '.' SUBSTRING '(' substring_operands ')'
+ {
+ if (unlikely(!($$= Lex->make_item_func_substr(thd, $1, $3, $5))))
+ MYSQL_YYABORT;
+ }
+ | ident_cli '.' TRIM '(' trim_operands ')'
+ {
+ if (unlikely(!($$= $5.make_item_func_trim(thd, $1, $3))))
+ MYSQL_YYABORT;
+ }
;
fulltext_options:
@@ -11859,25 +11876,6 @@ when_list_opt_else:
}
;
-decode_when_list_oracle:
- expr ',' expr
- {
- $$= new (thd->mem_root) List<Item>;
- if (unlikely($$ == NULL) ||
- unlikely($$->push_back($1, thd->mem_root)) ||
- unlikely($$->push_back($3, thd->mem_root)))
- MYSQL_YYABORT;
-
- }
- | decode_when_list_oracle ',' expr
- {
- $$= $1;
- if (unlikely($$->push_back($3, thd->mem_root)))
- MYSQL_YYABORT;
- }
- ;
-
-
/* Equivalent to <table reference> in the SQL:2003 standard. */
/* Warning - may return NULL in case of incomplete SELECT */
table_ref:
@@ -16131,8 +16129,6 @@ keyword_sp_var_and_label:
| DATAFILE_SYM
| DATE_FORMAT_SYM
| DAY_SYM
- | DECODE_MARIADB_SYM
- | DECODE_ORACLE_SYM
| DEFINER_SYM
| DELAY_KEY_WRITE_SYM
| DES_KEY_FILE
diff --git a/sql/structs.h b/sql/structs.h
index 46947b50502..c5f955c10be 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -32,6 +32,7 @@ struct TABLE;
class Type_handler;
class Field;
class Index_statistics;
+struct Lex_ident_cli_st;
class THD;
@@ -763,7 +764,9 @@ public:
}
Item *make_item_func_trim_std(THD *thd) const;
Item *make_item_func_trim_oracle(THD *thd) const;
- Item *make_item_func_trim(THD *thd) const;
+ Item *make_item_func_trim(THD *thd,
+ const Lex_ident_cli_st &schema_name,
+ const Lex_ident_cli_st &func_name) const;
};
@@ -774,6 +777,25 @@ public:
};
+class Lex_substring_spec_st
+{
+public:
+ Item *m_subject;
+ Item *m_from;
+ Item *m_for;
+ static Lex_substring_spec_st init(Item *subject,
+ Item *from,
+ Item *xfor= NULL)
+ {
+ Lex_substring_spec_st res;
+ res.m_subject= subject;
+ res.m_from= from;
+ res.m_for= xfor;
+ return res;
+ }
+};
+
+
class Load_data_param
{
protected:
diff --git a/sql/table.cc b/sql/table.cc
index 08d91678b25..549ef9a36b2 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1024,7 +1024,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
Field **vfield_ptr= table->vfield;
Field **dfield_ptr= table->default_field;
Virtual_column_info **check_constraint_ptr= table->check_constraints;
- sql_mode_t saved_mode= thd->variables.sql_mode;
+ Sql_mode_save_for_frm_handling sql_mode_save(thd);
Query_arena backup_arena;
Virtual_column_info *vcol= 0;
StringBuffer<MAX_FIELD_WIDTH> expr_str;
@@ -1051,7 +1051,6 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
thd->stmt_arena= table->expr_arena;
thd->update_charset(&my_charset_utf8mb4_general_ci, table->s->table_charset);
expr_str.append(&parse_vcol_keyword);
- thd->variables.sql_mode &= ~(MODE_NO_BACKSLASH_ESCAPES | MODE_EMPTY_STRING_IS_NULL);
while (pos < end)
{
@@ -1179,7 +1178,6 @@ end:
thd->stmt_arena= backup_stmt_arena_ptr;
if (save_character_set_client)
thd->update_charset(save_character_set_client, save_collation);
- thd->variables.sql_mode= saved_mode;
DBUG_RETURN(res);
}
diff --git a/sql/unireg.cc b/sql/unireg.cc
index efbb5e773b4..3b37944afa5 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -189,10 +189,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING *table,
create_info->null_bits++;
data_offset= (create_info->null_bits + 7) / 8;
- sql_mode_t save_sql_mode= thd->variables.sql_mode;
- thd->variables.sql_mode &= ~MODE_ANSI_QUOTES;
error= pack_vcols(&vcols, create_fields, create_info->check_constraint_list);
- thd->variables.sql_mode= save_sql_mode;
if (unlikely(error))
DBUG_RETURN(frm);
@@ -652,6 +649,7 @@ static bool pack_expression(String *buf, Virtual_column_info *vcol,
static bool pack_vcols(String *buf, List<Create_field> &create_fields,
List<Virtual_column_info> *check_constraint_list)
{
+ Sql_mode_save_for_frm_handling sql_mode_save(current_thd);
List_iterator<Create_field> it(create_fields);
Create_field *field;