[MDEV-13067] Statement delimiters within executable comments throw ERROR 1064 Created: 2017-06-13  Updated: 2017-07-03  Resolved: 2017-07-03

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Parser
Affects Version/s: 5.5, 10.0, 10.1, 10.1.24, 10.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Rich Theobald Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: upstream
Environment:

Ubuntu 14.04



 Description   

Example

MariaDB [(none)]> /*M!100100 select 1 ; */  
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 '' at line 1
    ->

MariaDB [(none)]> /*M!120000 select 1 ; */  
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 '/*M!110100 select 1' at line 1
    -> 

Regular comments work fine:

MariaDB [(none)]> /* select 1 ; */  
MariaDB [(none)]> 



 Comments   
Comment by Elena Stepanova [ 2017-06-25 ]

It has always been so, in MySQL and MariaDB. There are two sides in it – client and server. The client simply splits the line when it encounters the delimiter as it always does; to avoid it you need to change the delimiter.

For the server, it's not really obvious from the MySQL manual whether it should work or not, it says "MySQL Server parses and executes the code within the comment as it would any other SQL statement" – it does not say there can be multiple statements. MariaDB documentation is even more obscure about it.

Assigning to serg first to decide whether we want to do anything about it in the code; if not, it should end up in documentation.

Comment by Sergei Golubchik [ 2017-06-30 ]

It's a documentation bug.

Comment by Ian Gilfillan [ 2017-07-03 ]

Specified in the docs, with example:
https://mariadb.com/kb/en/mariadb/comment-syntax/

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