mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.5' into 10.6
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;
|
@@ -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;
|
@@ -10,7 +10,7 @@ performance_schema
|
||||
sys
|
||||
test
|
||||
USE DATABASE nond6;
|
||||
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 'DATABASE nond6' at line 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 'nond6' at line 1
|
||||
DROP DATABASE d6;
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
|
@@ -1,5 +1,16 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
select @@rpl_semi_sync_master_enabled;
|
||||
@@rpl_semi_sync_master_enabled
|
||||
0
|
||||
connection slave;
|
||||
select @@rpl_semi_sync_slave_enabled;
|
||||
@@rpl_semi_sync_slave_enabled
|
||||
0
|
||||
show status like "rpl_semi_sync_slave_status";
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_slave_status OFF
|
||||
connection master;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'test.t1'
|
||||
|
@@ -120,7 +120,6 @@ Filename::tab#.ibd
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Freshly allocated page | -
|
||||
#::# | Freshly allocated page | -
|
||||
# Variables used by page type dump for ibdata1
|
||||
|
||||
Variables (--variable-name=value)
|
||||
@@ -154,7 +153,6 @@ Filename::tab#.ibd
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Freshly allocated page | -
|
||||
#::# | Freshly allocated page | -
|
||||
[6]: check the valid lower bound values for option
|
||||
# allow-mismatches,page,start-page,end-page
|
||||
[9]: check the both short and long options "page" and "start-page" when
|
||||
|
@@ -38,8 +38,9 @@ connection master;
|
||||
include/rpl_start_server.inc [server_number=1]
|
||||
# Master has restarted successfully
|
||||
connection slave;
|
||||
include/wait_for_slave_io_to_start.inc
|
||||
include/wait_for_slave_sql_to_start.inc
|
||||
include/stop_slave_sql.inc
|
||||
include/stop_slave_io.inc
|
||||
include/start_slave.inc
|
||||
select * from ti;
|
||||
a
|
||||
1
|
||||
|
@@ -3,7 +3,8 @@ include/master-slave.inc
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @save_dbug= @@GLOBAL.debug_dbug;
|
||||
SET @@global.debug_dbug="+d,pause_sql_thread_on_fde,negate_clock_diff_with_master";
|
||||
SET @@global.debug_dbug="+d,pause_sql_thread_on_relay_fde_after_trans";
|
||||
SET @@global.debug_dbug="+d,negate_clock_diff_with_master";
|
||||
include/start_slave.inc
|
||||
# Future events must be logged at least 2 seconds after
|
||||
# the slave starts
|
||||
@@ -15,11 +16,6 @@ insert into t1 values (1);
|
||||
# event in its relay log
|
||||
flush logs;
|
||||
connection slave;
|
||||
# Ignore FDEs that happen before the CREATE/INSERT commands
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_fde';
|
||||
SET DEBUG_SYNC='now SIGNAL sql_thread_continue';
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_fde';
|
||||
SET DEBUG_SYNC='now SIGNAL sql_thread_continue';
|
||||
# On the next FDE, the slave should have the master CREATE/INSERT events
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_fde';
|
||||
select count(*)=1 from t1;
|
||||
|
@@ -67,10 +67,26 @@ connection master;
|
||||
save_master_pos;
|
||||
|
||||
--connection slave
|
||||
|
||||
# Left to its own devices, the IO thread may or may not stop in error,
|
||||
# depending on what it is doing when its connection to the primary is killed
|
||||
# (e.g. a failed read results in an error, whereas if the IO thread is idly
|
||||
# waiting for events when the connection dies, it will enter into a reconnect
|
||||
# loop and reconnect). So we manually stop/start the IO thread to ensure it is
|
||||
# in a consistent state
|
||||
#
|
||||
# FIXME: We shouldn't need to stop/start the SQL thread here, but due to
|
||||
# MDEV-33268, we have to. So after fixing 33268, this should only stop/start
|
||||
# the IO thread. Note the SQL thread must be stopped first due to an invalid
|
||||
# DBUG_ASSERT in the IO thread's stop logic that depends on the state of the
|
||||
# SQL thread (also reported and to be fixed in the same ticket).
|
||||
#
|
||||
--source include/stop_slave_sql.inc
|
||||
--let rpl_allow_error=1
|
||||
--source include/wait_for_slave_io_to_start.inc
|
||||
--source include/stop_slave_io.inc
|
||||
--let rpl_allow_error=
|
||||
--source include/wait_for_slave_sql_to_start.inc
|
||||
--source include/start_slave.inc
|
||||
|
||||
sync_with_master;
|
||||
select * from ti;
|
||||
select * from tm;
|
||||
|
@@ -27,7 +27,8 @@
|
||||
--connection slave
|
||||
--source include/stop_slave.inc
|
||||
SET @save_dbug= @@GLOBAL.debug_dbug;
|
||||
SET @@global.debug_dbug="+d,pause_sql_thread_on_fde,negate_clock_diff_with_master";
|
||||
SET @@global.debug_dbug="+d,pause_sql_thread_on_relay_fde_after_trans";
|
||||
SET @@global.debug_dbug="+d,negate_clock_diff_with_master";
|
||||
--source include/start_slave.inc
|
||||
|
||||
--let $sleep_time=2
|
||||
@@ -46,12 +47,6 @@ insert into t1 values (1);
|
||||
flush logs;
|
||||
|
||||
--connection slave
|
||||
--echo # Ignore FDEs that happen before the CREATE/INSERT commands
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_fde';
|
||||
SET DEBUG_SYNC='now SIGNAL sql_thread_continue';
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_fde';
|
||||
SET DEBUG_SYNC='now SIGNAL sql_thread_continue';
|
||||
|
||||
--echo # On the next FDE, the slave should have the master CREATE/INSERT events
|
||||
SET DEBUG_SYNC='now WAIT_FOR paused_on_fde';
|
||||
select count(*)=1 from t1;
|
||||
@@ -132,6 +127,7 @@ while (!$caught_up)
|
||||
}
|
||||
sleep 0.1;
|
||||
}
|
||||
set debug_sync="RESET";
|
||||
--enable_query_log
|
||||
|
||||
--connection master
|
||||
|
Reference in New Issue
Block a user