DDC-2555: Syntax Error when column is "separator" #3205

Closed
opened 2026-01-22 14:15:25 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 16, 2013).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user dallas62:

I had to made a column called "separator", 'Create Table' works, but when 'insert into':

SQLSTATE[42000]: Syntax error or access violation: 1064 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 'separator) VALUES ('Test', 'Test', 'a:1:{i:0;s:4:"test";}', 'a:5:{s:10:"http-' at line 1

After some searches ... Separator used by MySQL, so i changed the name:

php app/console d:s:u --force
Updating database schema...

[Doctrine\DBAL\DBALException]
An exception occurred while executing 'ALTER TABLE seo CHANGE separator link_separator VARCHAR(255) DEFAULT NULL':

SQLSTATE[42000]: Syntax error or access violation: 1064 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 'separator link_separator VARCHAR(255) DEFAULT NULL' at line 1

[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'separator link_separator VARCHAR(255) DEFAULT NULL' at line 1

Same Error... I will manualy update but for me it's a bug ...

Originally created by @doctrinebot on GitHub (Jul 16, 2013). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user dallas62: I had to made a column called "separator", 'Create Table' works, but when 'insert into': SQLSTATE[42000]: Syntax error or access violation: 1064 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 'separator) VALUES ('Test', 'Test', 'a:1:{i:0;s:4:\"test\";}', 'a:5:{s:10:\"http-' at line 1 After some searches ... Separator used by MySQL, so i changed the name: php app/console d:s:u --force Updating database schema... [Doctrine\DBAL\DBALException] An exception occurred while executing 'ALTER TABLE seo CHANGE separator link_separator VARCHAR(255) DEFAULT NULL': SQLSTATE[42000]: Syntax error or access violation: 1064 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 'separator link_separator VARCHAR(255) DEFAULT NULL' at line 1 [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1064 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 'separator link_separator VARCHAR(255) DEFAULT NULL' at line 1 Same Error... I will manualy update but for me it's a bug ...
admin added the Bug label 2026-01-22 14:15:25 +01:00
admin closed this issue 2026-01-22 14:15:26 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 16, 2013):

Comment created by @ocramius:

Reserved SQL keywords need manual escaping by either using a custom quoting strategy or by marking the table name with backticks in mappings, such as: "separator"

The ORM is not responsible for escaping identifiers out of the box.

@doctrinebot commented on GitHub (Jul 16, 2013): Comment created by @ocramius: Reserved SQL keywords need manual escaping by either using a custom quoting strategy or by marking the table name with backticks in mappings, such as: `"`separator`"` The ORM is not responsible for escaping identifiers out of the box.
Author
Owner

@doctrinebot commented on GitHub (Jul 16, 2013):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jul 16, 2013): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Jul 16, 2013):

Comment created by dallas62:

I have never writen any SQL Request for this error
Only Doctrine, I re-use the request with ` but Doctrine create the table, the insert and alter the table

Create table: no error
Insert into: error
Alter table: error

use Doctrine\ORM\Mapping as ORM;
[...]
/****

  • @ORM\Column(name="separator", type="string", nullable=true)
    */
@doctrinebot commented on GitHub (Jul 16, 2013): Comment created by dallas62: I have never writen any SQL Request for this error Only Doctrine, I re-use the request with ` but Doctrine create the table, the insert and alter the table Create table: no error Insert into: error Alter table: error use Doctrine\ORM\Mapping as ORM; [...] /**** - @ORM\Column(name="separator", type="string", nullable=true) */
Author
Owner

@doctrinebot commented on GitHub (Jul 16, 2013):

Comment created by @ocramius:

[~dallas62] that's actually a problem in the DBAL layer. it should have failed during DDL execution

@doctrinebot commented on GitHub (Jul 16, 2013): Comment created by @ocramius: [~dallas62] that's actually a problem in the DBAL layer. it should have failed during DDL execution
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3205