[MDEV-12977] sql_mode=oracle: errors "Undefined CURSOR" AND "check ... right syntax to use near '%" Created: 2017-06-02  Updated: 2017-06-02  Resolved: 2017-06-02

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Andrii Nikitin (Inactive) Assignee: Alexander Barkov
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-10582 sql_mode=ORACLE: Explicit cursor attr... Closed
Relates
relates to MDEV-12962 Testing MDEV-10142 (PL/SQL parser) Open

 Description   

set sql_mode=oracle;
MariaDB [test]> SELECT 5%5 from 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 '%5 from dual' at line 1
MariaDB [test]> wait_timeout:=102411111%1023;
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 '%1023' at line 1
MariaDB [test]> select 1 from seq_1_to_2 where seq % 5;
ERROR 1324 (42000): Undefined CURSOR: seq

Without oracle mode it works properly:

MariaDB [test]> select 1 from seq_1_to_2 where seq % 5;
+---+
| 1 |
+---+
| 1 |
| 1 |
+---+
2 rows in set (0.00 sec)
 
MariaDB [test]> SELECT 5%5;
+------+
| 5%5  |
+------+
|    0 |
+------+
1 row in set (0.00 sec)



 Comments   
Comment by Andrii Nikitin (Inactive) [ 2017-06-02 ]

It looks oracle doesn't have arithmetical operator '%', so such behavior is probably expected.

Generated at Thu Feb 08 08:01:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.