[MDEV-10312] Some reserved keywords (like OPTION) are not enforced Created: 2016-06-30  Updated: 2016-06-30  Resolved: 2016-06-30

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

Type: Bug Priority: Minor
Reporter: Joffrey MICHAIE (Inactive) Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

Hi,

some reserved keywords from https://mariadb.com/kb/en/mariadb/reserved-words/ don't seem to be enforced.

Following query works in MariaDB:

MariaDB [test]> CREATE table OPTION (OPTION int);
Query OK, 0 rows affected (0.01 sec)

... and fails in MySQL (5.6 tested):

mysql> CREATE table OPTION (OPTION int);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION (OPTION int)' at line 1

This can cause compatibility problems (ex: I develop on MariaDB, and production is on MySQL)
Is this intended ?

List of reserved keywords that are not enforced:

  • GENERAL
  • IGNORE_SERVER_IDS
  • MASTER_HEARTBEAT_PERIOD
  • OPTION
  • SLOW

Thanks in advance,
Joffrey



 Comments   
Comment by Sergei Golubchik [ 2016-06-30 ]

The logic is — only keywords that are required by the grammar to be reserved are reserved.

Reserving keywords unnecessary means adding arbitrary limitations to the grammar, and is considered a bug, we don't do that.

If MySQL reserves some keywords unnecessary, you can report a bug at bugs.mysql.com and they might unreserve them.

Comment by Joffrey MICHAIE (Inactive) [ 2016-06-30 ]

Hi Sergei and thanks for your comment.

MariaDB is supposed to be a fork of MySQL, and OPTION is reserved since MySQL 4.0 or earlier.
I don't think this problem is on MySQL side as MariaDB is breaking compatibility here.

Joffrey

Comment by Sergei Golubchik [ 2016-06-30 ]

Yes, but reserving a keyword unnecessary is a bug, and we've fixed it. MariaDB does not offer bug compatibility with MySQL, we fix bugs that MySQL doesn't.

We also add features that MySQL doesn't — for example, CREATE ROLE works in MariaDB but fails in MySQL. Only MySQL can provide perfect 1:1 compatibility with MySQL. And not even any MySQL, MariaDB is often more compatible with MySQL version X.Y, than MySQL version X.(Y+1).

Generated at Thu Feb 08 07:41:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.