[MDEV-16464] Oracle Comp.: Sql-Error on "SELECT name, comment FROM mysql.proc" Created: 2018-06-11  Updated: 2018-06-13  Resolved: 2018-06-13

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.3.7
Fix Version/s: 10.3.8

Type: Bug Priority: Major
Reporter: Mebo Assignee: Alexander Barkov
Resolution: Fixed Votes: 1
Labels: None


 Description   

After

SET sql_mode = 'oracle';

an error occurs with the following sql:

SELECT name, comment FROM mysql.proc

SQL Error [1064] [42000]: (conn:8) 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 'comment FROM mysql.proc
LIMIT 0, 200' at line 1
Query is : SELECT name, comment FROM mysql.proc

The problem is that this is used by several database IDEs (e.g. DBeaver, dbForge, etc.). They cannot list any packages with this error.



 Comments   
Comment by Elena Stepanova [ 2018-06-11 ]

Apparently comment is a reserved word in SQL mode, so it has to be quoted.

MariaDB [test]> set sql_mode='oracle';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> SELECT name, `comment` FROM mysql.proc;
+--------------------+---------+
| name               | comment |
+--------------------+---------+
| AddGeometryColumn  |         |
| DropGeometryColumn |         |
+--------------------+---------+
2 rows in set (0.00 sec)

Assigning to bar to confirm whether it's intentional.

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