Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.4.5
-
None
-
Windows
Description
I have found the following problem:
When in a SQL-Statement there is a commentline and between the '--' and the text there is no ein space, then I get the error ERROR 1064 (42000)....
e.g.
select *
|
from information_schema.columns
|
where TABLE_NAME = 'ALL_PLUGINS' |
--and data_type = 'varchar' |
;
|
Error:
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 'and data_type = 'varchar'' at line 4
select *
|
from information_schema.columns
|
where TABLE_NAME = 'ALL_PLUGINS' |
-- and data_type = 'varchar' |
;
|
then I get no error and get the correct result.
Attachments
Issue Links
- duplicates
-
MDEV-12087 sql_mode=ORACLE: a new option to make dash-dash to start a comment
-
- Open
-
This is not a bug, a comment requires the second dash to be followed by at least one whitespace or control character (such as a space, tab, newline, and so on) (https://mariadb.com/kb/en/library/comment-syntax/ ) to prevent problems with negative numbers
MariaDB [test]> select ---1;
+------+
| ---1 |
+------+
| -1 |
+------+
1 row in set (0.00 sec)