mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.6' into 10.11
This commit is contained in:
@@ -1772,6 +1772,85 @@ Level Code Message
|
||||
Note 1003 select trim(both ' ' from 'a') AS "oracle_schema.TRIM(BOTH ' ' FROM 'a')"
|
||||
Warnings:
|
||||
Note 1003 select trim(both ' ' from 'a') AS "oracle_schema.TRIM(BOTH ' ' FROM 'a')"
|
||||
CALL p3('REGEXP_REPLACE(''test'',''t'','''')');
|
||||
----------
|
||||
sql_mode='' qualifier=''
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT REGEXP_REPLACE('test','t','')
|
||||
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 regexp_replace('test','t','') AS `REGEXP_REPLACE('test','t','')`
|
||||
----------
|
||||
sql_mode='' qualifier='unknown_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT unknown_schema.REGEXP_REPLACE('test','t','')
|
||||
errmsg
|
||||
ERROR: FUNCTION unknown_schema.REGEXP_REPLACE does not exist
|
||||
----------
|
||||
sql_mode='' qualifier='mariadb_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT mariadb_schema.REGEXP_REPLACE('test','t','')
|
||||
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 regexp_replace('test','t','') AS `mariadb_schema.REGEXP_REPLACE('test','t','')`
|
||||
----------
|
||||
sql_mode='' qualifier='maxdb_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT maxdb_schema.REGEXP_REPLACE('test','t','')
|
||||
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 regexp_replace('test','t','') AS `maxdb_schema.REGEXP_REPLACE('test','t','')`
|
||||
----------
|
||||
sql_mode='' qualifier='oracle_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT oracle_schema.REGEXP_REPLACE('test','t','')
|
||||
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.regexp_replace('test','t','') AS `oracle_schema.REGEXP_REPLACE('test','t','')`
|
||||
----------
|
||||
sql_mode='ORACLE' qualifier=''
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT REGEXP_REPLACE('test','t','')
|
||||
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 regexp_replace('test','t','') AS "REGEXP_REPLACE('test','t','')"
|
||||
----------
|
||||
sql_mode='ORACLE' qualifier='unknown_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT unknown_schema.REGEXP_REPLACE('test','t','')
|
||||
errmsg
|
||||
ERROR: FUNCTION unknown_schema.REGEXP_REPLACE does not exist
|
||||
----------
|
||||
sql_mode='ORACLE' qualifier='mariadb_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT mariadb_schema.REGEXP_REPLACE('test','t','')
|
||||
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.regexp_replace('test','t','') AS "mariadb_schema.REGEXP_REPLACE('test','t','')"
|
||||
----------
|
||||
sql_mode='ORACLE' qualifier='maxdb_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT maxdb_schema.REGEXP_REPLACE('test','t','')
|
||||
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.regexp_replace('test','t','') AS "maxdb_schema.REGEXP_REPLACE('test','t','')"
|
||||
----------
|
||||
sql_mode='ORACLE' qualifier='oracle_schema.'
|
||||
query
|
||||
EXPLAIN EXTENDED SELECT oracle_schema.REGEXP_REPLACE('test','t','')
|
||||
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 regexp_replace('test','t','') AS "oracle_schema.REGEXP_REPLACE('test','t','')"
|
||||
Warnings:
|
||||
Note 1003 select regexp_replace('test','t','') AS "oracle_schema.REGEXP_REPLACE('test','t','')"
|
||||
CALL p3('CONCAT_OPERATOR_ORACLE(''a'')');
|
||||
----------
|
||||
sql_mode='' qualifier=''
|
||||
|
34
mysql-test/suite/compat/oracle/r/func_regexp_replace.result
Normal file
34
mysql-test/suite/compat/oracle/r/func_regexp_replace.result
Normal file
@@ -0,0 +1,34 @@
|
||||
SET sql_mode=ORACLE;
|
||||
#
|
||||
# MDEV-29095 REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode
|
||||
#
|
||||
CREATE TABLE t1 (replacement VARCHAR(10));
|
||||
INSERT INTO t1 VALUES (NULL), ('');
|
||||
SELECT replacement, REGEXP_REPLACE('abba','a',replacement) FROM t1 ORDER BY replacement;
|
||||
replacement REGEXP_REPLACE('abba','a',replacement)
|
||||
NULL bb
|
||||
bb
|
||||
DROP TABLE t1;
|
||||
SELECT REGEXP_REPLACE('abba','a',null);
|
||||
REGEXP_REPLACE('abba','a',null)
|
||||
bb
|
||||
EXPLAIN EXTENDED SELECT REPLACE('abba','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('abba','a',NULL) AS "REPLACE('abba','a',null)"
|
||||
CREATE VIEW v1 AS SELECT REPLACE('abba','a',null) ;
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE VIEW "v1" AS select replace('abba','a',NULL) AS "REPLACE('abba','a',null)" latin1 latin1_swedish_ci
|
||||
SELECT * FROM v1;
|
||||
REPLACE('abba','a',null)
|
||||
bb
|
||||
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 oracle_schema.replace('abba','a',NULL) AS `REPLACE('abba','a',null)` latin1 latin1_swedish_ci
|
||||
SELECT * FROM v1;
|
||||
REPLACE('abba','a',null)
|
||||
bb
|
||||
DROP VIEW v1;
|
@@ -84,7 +84,7 @@ DECLARE history INT; BEGIN history:=10; SELECT history; END
|
||||
SELECT history FROM t1
|
||||
SELECT history 'alias' FROM t1
|
||||
SELECT history()
|
||||
Error 1064 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 1630 FUNCTION test.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT history.history()
|
||||
Error 1630 FUNCTION history.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT history DATE FROM t1
|
||||
@@ -106,7 +106,7 @@ DECLARE next INT; BEGIN next:=10; SELECT next; END
|
||||
SELECT next FROM t1
|
||||
SELECT next 'alias' FROM t1
|
||||
SELECT next()
|
||||
Error 1064 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 1630 FUNCTION test.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT next.next()
|
||||
Error 1630 FUNCTION next.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT next DATE FROM t1
|
||||
@@ -151,7 +151,7 @@ DECLARE previous INT; BEGIN previous:=10; SELECT previous; END
|
||||
SELECT previous FROM t1
|
||||
SELECT previous 'alias' FROM t1
|
||||
SELECT previous()
|
||||
Error 1064 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 1630 FUNCTION test.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT previous.previous()
|
||||
Error 1630 FUNCTION previous.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT previous DATE FROM t1
|
||||
@@ -174,7 +174,7 @@ DECLARE system INT; BEGIN system:=10; SELECT system; END
|
||||
SELECT system FROM t1
|
||||
SELECT system 'alias' FROM t1
|
||||
SELECT system()
|
||||
Error 1064 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 1630 FUNCTION test.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT system.system()
|
||||
Error 1630 FUNCTION system.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT system DATE FROM t1
|
||||
@@ -196,7 +196,7 @@ DECLARE system_time INT; BEGIN system_time:=10; SELECT system_time; END
|
||||
SELECT system_time FROM t1
|
||||
SELECT system_time 'alias' FROM t1
|
||||
SELECT system_time()
|
||||
Error 1064 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 1630 FUNCTION test.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT system_time.system_time()
|
||||
Error 1630 FUNCTION system_time.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT system_time DATE FROM t1
|
||||
@@ -264,7 +264,7 @@ DECLARE transaction INT; BEGIN transaction:=10; SELECT transaction; END
|
||||
SELECT transaction FROM t1
|
||||
SELECT transaction 'alias' FROM t1
|
||||
SELECT transaction()
|
||||
Error 1064 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 1630 FUNCTION test.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT transaction.transaction()
|
||||
Error 1630 FUNCTION transaction.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT transaction DATE FROM t1
|
||||
@@ -308,7 +308,7 @@ DECLARE versioning INT; BEGIN versioning:=10; SELECT versioning; END
|
||||
SELECT versioning FROM t1
|
||||
SELECT versioning 'alias' FROM t1
|
||||
SELECT versioning()
|
||||
Error 1064 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 1630 FUNCTION test.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT versioning.versioning()
|
||||
Error 1630 FUNCTION versioning.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT versioning DATE FROM t1
|
||||
@@ -330,7 +330,7 @@ DECLARE without INT; BEGIN without:=10; SELECT without; END
|
||||
SELECT without FROM t1
|
||||
SELECT without 'alias' FROM t1
|
||||
SELECT without()
|
||||
Error 1064 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 1630 FUNCTION test.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT without.without()
|
||||
Error 1630 FUNCTION without.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
|
||||
SELECT without DATE FROM t1
|
||||
|
@@ -165,6 +165,7 @@ CALL p3('TRIM(1,2)');
|
||||
CALL p3('TRIM(''a'')');
|
||||
CALL p3('TRIM(BOTH '' '' FROM ''a'')');
|
||||
|
||||
CALL p3('REGEXP_REPLACE(''test'',''t'','''')');
|
||||
|
||||
# Deprecated compatibility XXX_ORACLE functions.
|
||||
# These functions are implemented as simple native functions
|
||||
|
26
mysql-test/suite/compat/oracle/t/func_regexp_replace.test
Normal file
26
mysql-test/suite/compat/oracle/t/func_regexp_replace.test
Normal file
@@ -0,0 +1,26 @@
|
||||
SET sql_mode=ORACLE;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29095 REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode
|
||||
--echo #
|
||||
|
||||
#SELECT REGEXP_REPLACE(null,'a','b') ;
|
||||
#SELECT REGEXP_REPLACE('ab',null,'b') ;
|
||||
#SELECT REGEXP_REPLACE('ab','a',null) ;
|
||||
#SELECT REGEXP_REPLACE('ab',null,null) ;
|
||||
|
||||
CREATE TABLE t1 (replacement VARCHAR(10));
|
||||
INSERT INTO t1 VALUES (NULL), ('');
|
||||
SELECT replacement, REGEXP_REPLACE('abba','a',replacement) FROM t1 ORDER BY replacement;
|
||||
DROP TABLE t1;
|
||||
|
||||
SELECT REGEXP_REPLACE('abba','a',null);
|
||||
EXPLAIN EXTENDED SELECT REPLACE('abba','a',null) ;
|
||||
|
||||
CREATE VIEW v1 AS SELECT REPLACE('abba','a',null) ;
|
||||
SHOW CREATE VIEW v1;
|
||||
SELECT * FROM v1;
|
||||
SET sql_mode=DEFAULT;
|
||||
SHOW CREATE VIEW v1;
|
||||
SELECT * FROM v1;
|
||||
DROP VIEW v1;
|
Reference in New Issue
Block a user