Bug #61393 Incorrect SQL syntax in Forward Engineer
Submitted: 3 Jun 2011 8:02 Modified: 29 Nov 2011 14:23
Reporter: mam tud Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.34 , Revision 7780 OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: erorr;SQL;syntax;export;forward engineer;phpmyadmin

[3 Jun 2011 8:02] mam tud
Description:
When exporting to sql file or 'Copy SQL to clipboard' I get the wrong syntax, only if I have comment and no engine or charset selected 

CREATE  TABLE IF NOT EXISTS `tax` (
  `tax_id` INT(11) NOT NULL AUTO_INCREMENT ,
  `tax_type` VARCHAR(100) NOT NULL ,
  `tax_percentage` DECIMAL(10,2) NOT NULL ,
  PRIMARY KEY (`tax_id`) ), /*error*/
COMMENT = 'Table of tax';

phpMyAdmin error:
#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 ' COMMENT = 'Table of tax'' at line 5

How to repeat:
Create new table
add some fields
add table comment
collation: Schema default
engine: Server default
copy sql to clipboard or export
[3 Jun 2011 8:12] mam tud
wrong category
[3 Jun 2011 8:48] Valeriy Kravchuk
I've got the following:

CREATE  TABLE `test`.`new_table` (
  `idnew_table` INT NOT NULL ,
  `c1` VARCHAR(45) NULL ,
  PRIMARY KEY (`idnew_table`) ), 
COMMENT = 'comment' ;

on Windows XP when connected to local 5.1.56 server version. Works OK in Modeling part.
[3 Jun 2011 9:16] mam tud
it should be this:

CREATE  TABLE `test`.`new_table` (
  `idnew_table` INT NOT NULL ,
  `c1` VARCHAR(45) NULL ,
  PRIMARY KEY (`idnew_table`) )
COMMENT = 'comment' ;
[10 Jun 2011 12:34] Alfredo Kojima
bug #61476 is a duplicate
[29 Nov 2011 14:23] Philip Olson
Fixed as of 5.2.36:
+        Exporting SQL for tables that included comments would generate
+        invalid SQL statements. A comma was missing immediately before
+        the <literal>COMMENT</literal>.