Bug #59577 data modelling - create diagram from script - syntax error
Submitted: 18 Jan 2011 9:31 Modified: 21 Jun 2011 18:16
Reporter: Patrick Hill Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S1 (Critical)
Version:5.2 CE OS:Windows (Win7)
Assigned to: CPU Architecture:Any
Tags: error, import, script, syntax

[18 Jan 2011 9:31] Patrick Hill
Description:
So I start workbench clicking
"Create EER Model from SQL Script"
I'm planning to import an utf8 encoded textfile containing a single statement:

CREATE TABLE IF NOT EXISTS demotable (
	id INT UNSIGNED NOT NULL AUTO_INCREMENT,
	name varchar(20) NOT NULL,
	primary key(id)
) ENGINE=InnoDB;

This query works perfectly on a MySQL 5.1 DB server.
After I opened the file workbench parses it and displays the following messages:

Operation has completed with errors. Please see logs for details
Finished parsing MySQL SQL-script.
Message Log
Started parsing MySQL SQL script.
Created MySQL Schema: default_schema
ERROR: Line 1: SQL syntax error near 'CREATE TABLE IF NOT EXISTS demotable (
	id INT NOT NULL AUTO_INCREMENT,
	na'. Statement skipped.
Finished parsing MySQL SQL script. Totally processed statements: successful (0), errors (1), warnings (0).

I also created a demotable using workbench, exported that schema to a sql-textfile. Trying to reimport that very same file into a new Workbench project gives me the same error. 

I postet this on the forum.
( http://forums.mysql.com/read.php?152,403344,403473#msg-403473 )

Mike Lischke, Senior Software Engineer MySQL Developer Tools, asked me to make a BUG report out of this ("Can you file a bug report (http://bugs.mysql.com) with highest severity? We have to fix this asap.").

How to repeat:
Save this query to a textfile and try to create a diagram out of it.

CREATE TABLE IF NOT EXISTS demotable (
	id INT UNSIGNED NOT NULL AUTO_INCREMENT,
	name varchar(20) NOT NULL,
	primary key(id)
) ENGINE=InnoDB;

You should get errors parsing even easiest script files.
[19 Apr 2011 1:09] Alfredo Kojima
I can't repeat this and from the error message you pasted, the file contains some extraneous character before the create table. Can you check the file?
Please attach the file if it looks ok.
[27 May 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[21 Jun 2011 18:16] Paul DuBois
Noted in 5.2.34 changelog.

Create EER Model from SQL Script reported a syntax error when 
importing legal SQL scripts.