Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
SELECT * FROM dual; |
ERROR 1096 (HY000): No tables used |
The DUAL table has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X
https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries009.htm
select * from test join dual; |
ERROR 1064 (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 'dual' at line 1 |
|
select * from dual join test; |
ERROR 1064 (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 'join test' at line 1 |
So the "correct" results in oracle terms should be:
select * from `DUAL`; |
+-------+ |
| DUMMY |
|
+-------+ |
| X |
|
+-------+ |
|
select * from test join `DUAL`; |
+----+--------------+---------------------+-------+ |
| id | data | ts | DUMMY |
|
+----+--------------+---------------------+-------+ |
| 1 | Some bla bla | 2018-06-07 22:03:52 | X | |
+----+--------------+---------------------+-------+ |
|
select * from `DUAL` join test; |
+-------+----+--------------+---------------------+ |
| DUMMY | id | data | ts |
|
+-------+----+--------------+---------------------+ |
| X | 1 | Some bla bla | 2018-06-07 22:03:52 | |
+-------+----+--------------+---------------------+ |
This could matter because the dual table is fundamental in Oracle world and many internal and external queries may rely on exactly this behaviour...
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
SELECT * FROM dual;
ERROR 1096 (HY000): No tables used The DUAL table has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries009.htm select * from test join dual; ERROR 1064 (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 'dual' at line 1 select * from dual join test; ERROR 1064 (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 'join test' at line 1 So the "correct" results in oracle terms should be: select * from `DUAL`; +-------+ | DUMMY | +-------+ | X | +-------+ select * from test join `DUAL`; +----+--------------+---------------------+-------+ | id | data | ts | DUMMY | +----+--------------+---------------------+-------+ | 1 | Some bla bla | 2018-06-07 22:03:52 | X | +----+--------------+---------------------+-------+ select * from `DUAL` join test; +-------+----+--------------+---------------------+ | DUMMY | id | data | ts | +-------+----+--------------+---------------------+ | X | 1 | Some bla bla | 2018-06-07 22:03:52 | +-------+----+--------------+---------------------+ This could matter because the dual table is fundamental in Oracle world and many internal and external queries may rely on exactly this behaviour... |
{code:sql}
SELECT * FROM dual; ERROR 1096 (HY000): No tables used {code} The DUAL table has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries009.htm {code:sql} select * from test join dual; ERROR 1064 (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 'dual' at line 1 select * from dual join test; ERROR 1064 (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 'join test' at line 1 {code} So the "correct" results in oracle terms should be: {code:sql} select * from `DUAL`; +-------+ | DUMMY | +-------+ | X | +-------+ select * from test join `DUAL`; +----+--------------+---------------------+-------+ | id | data | ts | DUMMY | +----+--------------+---------------------+-------+ | 1 | Some bla bla | 2018-06-07 22:03:52 | X | +----+--------------+---------------------+-------+ select * from `DUAL` join test; +-------+----+--------------+---------------------+ | DUMMY | id | data | ts | +-------+----+--------------+---------------------+ | X | 1 | Some bla bla | 2018-06-07 22:03:52 | +-------+----+--------------+---------------------+ {code} This could matter because the dual table is fundamental in Oracle world and many internal and external queries may rely on exactly this behaviour... |
Labels | dual pl/sql, | dual pl/sql |
Affects Version/s | 10.3.7 [ 23005 ] | |
Environment | linux ubuntu 14.04 | |
Issue Type | Bug [ 1 ] | Task [ 3 ] |
Labels | dual pl/sql | compatibility; dual pl/sql |
Labels | compatibility; dual pl/sql | Compatibility dual pl/sql |
Workflow | MariaDB v3 [ 87737 ] | MariaDB v4 [ 130847 ] |
While documentation on DUAL is scarce both in MariaDB KB and MySQL manual, it appears that it currently works as initially intended:
So, I'm converting this to a feature request.