Some basic datatypes and functions in oracle compatibility mode do not work (MDEV-19162)

[MDEV-20036] sql_mode="oracle" A simple comment in the Code using “--” gives error Created: 2019-07-10  Updated: 2024-01-12

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.3, 10.4, 10.5
Fix Version/s: None

Type: Technical task Priority: Major
Reporter: Faisal Saeed (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: Compatibility


 Description   

A simple comment in the Code using “--” gives error while compiling the procedure if it has no spaces after the comment character!
--CONFLICT KITCHEN
Works fine when changed to MariaDB standard single line comment “#”
#--CONFLICT KITCHEN
Or adding a space after the “--” also works
– CONFLICT KITCHEN



 Comments   
Comment by Michael Widenius [ 2020-05-19 ]

I am not sure if this can be fixed as the – is ambiguous

For example, this is valid SQL:

SELECT 1--1;

This is same as 1 - (-1)

I think this is better to be changed in the application as SELECT 1 – 1 will work both for Oracle and MariaDB (adding space after--) and should be trivial to do.

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