mariadb/mysql-test/suite/compat/oracle/r
Aleksey Midenkov 10643cffe9 MDEV-37325 Incorrect results for INTERSECT ALL in ORACLE mode
Oracle mode has no priority between set-operators but the current
implementation with disable_index_if_needed() can not work with
arbitrary mix of distinct/non-distinct set-operators as the algorithm
is tied to the properly wrapped version of expression. Index can be
disabled only once and cannot be reenabled afterwards.

To adapt Oracle mode for the aforementioned implementation we
prioritize each set operator with parens in the order of
appearance. So the expression:

  S1 op1 S2 op2 S3 op3 S4

will be rewritten like this:

  (((S1 op1 S2) op2 S3) op3 S4).

The rewritten expression is valid for both Oracle and default mode and
renders the same result. Prioritizing is done with
create_priority_nest() but it was tweaked to work with derived to be
the first operand. Originally create_priority_nest() could wrap only
second operand, like this:

  S1 op1 S2 op2 S3 -> S1 op1 (S2 op2 S3).

Now this behaviour is kept by non-NULL attach_to argument. With NULL
attach_to argument it produces this transformation:

  S1 op1 S2 -> (S1 op1 S2), but to be strict it will look like this:
  SELECT .. FROM (S1 op1 S2).

This expression is treated as the first one in the select list, so
nothing to "attach to".

On importance of not making fake_select_lex after
create_priority_nest() in parsed_select_expr_start(). This will fail
nastily in Protocol::valid_handler() check in store_longlong() for
EXPLAIN. This happens because select_options are inherited from newly
made fake_select_lex but without SELECT_DESCRIBE flag which is meant
to be assigned by mysql_explain_union() but union_needs_tmp_table() is
false (because now top-level unit has no set-operator, it is just
select from derived), so SELECT_DESCRIBE assignment is
skipped. Depending on that flag send_result_set_metadata() is
conditionally executed in JOIN::exec_inner(). And originally it is
done via select_describe() branch for top-level select when there is
no set operator (it is select from derived as explained above), not
via direct send_result_set_metadata().

On IS_OR_WAS_ORACLE. Sql_mode_save_for_frm_handling removes MODE_ORACLE
when view is registered or opened. We cannot return it back as this
conflicts with MDEV-12478 (tested by compat/oracle.func_concat). So we
are temporarily adding WAS_ORACLE flag instead. WAS_MODE_ORACLE is for
testing both WAS_ORACLE and MODE_ORACLE simultaneously.
2025-12-23 14:02:55 +03:00
..
anonymous_derived.result MDEV-34679 ER_BAD_FIELD uses non-localizable substrings 2024-10-17 21:37:37 +02:00
binlog_ptr_mysqlbinlog.result MDEV-23108: Point in time recovery of binary log fails when sql_mode=ORACLE 2020-07-22 11:34:50 +05:30
binlog_stm_ps.result
binlog_stm_sp.result
binlog_stm_sp_package.result
column_compression.result Merge branch '10.5' into 10.6 2024-07-18 16:25:33 +02:00
custom_aggregate_functions.result
empty_string_literal.result MDEV-37325 Incorrect results for INTERSECT ALL in ORACLE mode 2025-12-23 14:02:55 +03:00
events.result fix tests for embedded 2022-05-18 01:22:29 +02:00
exception.result Merge 10.2 into 10.3 2020-05-25 19:41:58 +03:00
func_add_months.result MDEV-20025: ADD_MONTHS() Oracle function 2021-05-19 22:54:12 +02:00
func_case.result
func_concat.result MDEV-31910 ASAN memcpy-param-overlap upon CONCAT in ORACLE mode 2024-11-06 11:39:50 +04:00
func_decode.result MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE 2023-11-08 15:01:20 +04:00
func_length.result
func_misc.result MDEV-34679 ER_BAD_FIELD uses non-localizable substrings 2024-10-17 21:37:37 +02:00
func_pad.result MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE 2023-11-08 15:01:20 +04:00
func_qualified.result MDEV-29095 REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode 2024-01-24 10:59:17 +04:00
func_regexp_replace.result MDEV-29095 REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode 2024-01-24 10:59:17 +04:00
func_replace.result MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE 2023-11-08 15:01:20 +04:00
func_substr.result MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE 2023-11-08 15:01:20 +04:00
func_time.result
func_to_char.result MDEV-29152: Assertion failed ... upon TO_CHAR with wrong argument 2023-07-12 12:05:59 +03:00
func_trim.result MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE 2023-11-08 15:01:20 +04:00
gis-debug.result MDEV-20009 Add CAST(expr AS pluggable_type) 2019-07-10 11:55:16 +04:00
gis.result MDEV-33803 Error 4162 "Operator does not exists" is incorrectly-worded 2024-04-03 10:03:02 +11:00
information_schema_parameters.result MDEV-18092 Query with the table I_S.PARAMETERS stop working after a package is created 2019-04-18 08:34:08 +04:00
keywords.result MDEV-17363 - Compressed columns cannot be restored from dump 2019-06-18 07:48:08 +04:00
minus.result MDEV-37325 Incorrect results for INTERSECT ALL in ORACLE mode 2025-12-23 14:02:55 +03:00
misc.result An additional patch for MDEV-27690 Crash on CHARACTER SET csname COLLATE DEFAULT in column definition 2022-04-14 12:22:28 +04:00
mysqldump_restore.result MDEV-17363 - Compressed columns cannot be restored from dump 2019-06-18 07:48:08 +04:00
mysqldump_restore_func_qualified.result MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump) 2025-01-17 15:39:55 +04:00
parser.result MDEV-31616 Problems with a stored function EMPTY() on upgrade to 10.6. 2024-01-24 09:59:55 +04:00
plugin.result
ps.result MDEV-34679 ER_BAD_FIELD uses non-localizable substrings 2024-10-17 21:37:37 +02:00
rpl_mariadb_date.result MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
rpl_sp_package.result MDEV-30662 SQL/PL package body does not appear in I_S.ROUTINES.ROUTINE_DEFINITION 2023-07-14 13:26:26 +04:00
rpl_sp_package_variables.result
sequence.result
sp-anchor-row-type-table.result MDEV-29062 Wrong result set metadata for a mix of INT+ENUM 2022-07-08 15:29:23 +04:00
sp-anonymous.result
sp-code.result MDEV-19639 + MDEV-19640 fix + preparatory changes for WL#4179 2019-06-04 06:21:22 +04:00
sp-cursor-decl.result Merge 10.2 into 10.3 2020-04-15 09:56:03 +03:00
sp-cursor-rowtype.result MDEV-34679 ER_BAD_FIELD uses non-localizable substrings 2024-10-17 21:37:37 +02:00
sp-cursor.result A clean-up for MDEV-10654 add support IN, OUT, INOUT parameter qualifiers for stored functions 2022-01-24 19:46:27 +04:00
sp-expr.result
sp-goto-debug.result MDEV-20667 Server crash on pop_cursor 2019-12-12 16:25:16 +04:00
sp-goto.result MDEV-20667 Server crash on pop_cursor 2019-12-12 16:25:16 +04:00
sp-inout.result MDEV-10654 add support IN, OUT, INOUT parameter qualifiers for stored functions 2022-01-24 19:46:27 +04:00
sp-memory-leak.result MDEV-26186 280 Bytes lost in mysys/array.c, mysys/hash.c, sql/sp.cc, sql/sp.cc, sql/item_create.cc, sql/item_create.cc, sql/sql_yacc.yy:10748 when using oracle sql_mode 2023-07-18 12:19:16 +04:00
sp-package-code.result
sp-package-concurrent-dml-db.result
sp-package-concurrent-dml-package.result
sp-package-concurrent-dml-trigger.result
sp-package-concurrent-dml-view.result
sp-package-i_s.result MDEV-30662 SQL/PL package body does not appear in I_S.ROUTINES.ROUTINE_DEFINITION 2023-07-14 13:26:26 +04:00
sp-package-innodb.result
sp-package-mdl.result
sp-package-mysqldump.result also protect the /*!999999 sandbox comment 2024-07-17 21:25:40 +02:00
sp-package-security.result MDEV-20076: SHOW GRANTS does not quote role names properly 2020-02-05 17:22:26 +01:00
sp-package.result Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
sp-param.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
sp-row.result Merge 10.6 into 10.7 2022-09-21 09:33:07 +03:00
sp-security.result MDEV-28548: ER_TABLEACCESS_DENIED_ERROR is missing information about DB 2022-09-30 08:48:57 +02:00
sp.result Merge 10.9 into 10.10 2022-09-21 10:59:56 +03:00
statement-expr.result MDEV-20634 Report disallowed subquery errors as such (instead of parse error) 2019-09-20 10:36:20 +04:00
table_value_constr.result MDEV-37325 Incorrect results for INTERSECT ALL in ORACLE mode 2025-12-23 14:02:55 +03:00
trigger.result
truncate.result
type_blob.result MDEV-20263 sql_mode=ORACLE: BLOB(65535) should not translate to LONGBLOB 2019-08-06 18:02:03 +04:00
type_clob.result
type_date.result Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
type_number.result
type_raw.result
type_varchar.result
type_varchar2.result
update.result MDEV-27769 Assertion failed in Field::ptr_in_record upon UPDATE in ORACLE mode 2025-01-26 16:15:46 +01:00
update_innodb.result MDEV-19535 sql_mode=ORACLE: 'SELECT INTO @var FOR UPDATE' does not lock the table 2019-05-21 14:22:49 +04:00
variables.result
vcol.result
vcol_innodb.result MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE 2023-11-08 15:01:20 +04:00
versioning.result
win.result