Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.11.18
-
None
-
RHEL 8
MariaDB 10.11.18
-
Not for Release Notes
Description
After Upgrade from 10.5.29 to 10.11.18, the SQL execution behaviour changed in Oracle mode, UNION treat same alias name column as different and returned two columns.
Version 10.11.18:
SET SQL_MODE='ORACLE'; |
SELECT '1' AS NEWCOLUMN, T.* FROM TABLE_A T |
UNION
|
SELECT '2' AS NEWCOLUMN, T.* FROM TABLE_A T; |
|
|
+-----------+-----------+-------------+-----+
|
| NEWCOLUMN | NEWCOLUMN | FUNC_ID | GRP |
|
+-----------+-----------+-------------+-----+
|
| 1 | 1 | 100 | S | |
| 1 | 1 | 200 | S | |
| 1 | 1 | 300 | S | |
| 2 | 2 | 100 | S | |
| 2 | 2 | 200 | S | |
| 2 | 2 | 300 | S | |
+-----------+-----------+-------------+-----+
|
Version 10.5.29:
SET SQL_MODE='ORACLE'; |
SELECT '1' AS NEWCOLUMN, T.* FROM TABLE_A T |
UNION
|
SELECT '2' AS NEWCOLUMN, T.* FROM TABLE_A T; |
|
|
+-----------+-------------+-----+
|
| NEWCOLUMN | FUNC_ID | GRP |
|
+-----------+-------------+-----+
|
| 1 | 100 | S | |
| 1 | 200 | S | |
| 1 | 300 | S | |
| 2 | 100 | S | |
| 2 | 200 | S | |
| 2 | 300 | S | |
+-----------+-------------+-----+
|
The same SQL return only one NEWCOLUMN in non-Oracle mode for both 10.5.29 and 10.11.18, is it a bug or known issue?
Attachments
Issue Links
- duplicates
-
MDEV-39522 Query with UNION fails in Oracle sql_mode with ER_BAD_FIELD_ERROR/ER_UNKNOWN_TABLE
-
- Closed
-