Bug #54969 View validation error
Submitted: 2 Jul 2010 20:31 Modified: 17 Sep 2010 15:54
Reporter: Christopher Gribble Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.25 SE Revision 6303 OS:Windows (Version 7)
Assigned to: Sergei Tkachenko CPU Architecture:Any

[2 Jul 2010 20:31] Christopher Gribble
Description:
If a view is created for an existing schema (say, view1) and the blue marker is present, indicating that its syntax is correct and then from the Model menu, Validate (SQL) is selected and either Validate All or Check Syntax is chosen, then an error message is displayed in the Output window of the form:

"Syntax error in view 'view1'. View code is 'CREATE VIEW ...'"

How to repeat:
See Description.
[7 Jul 2010 11:15] Susanne Ebrecht
Many thanks for writing a bug report.

Verified as described.

How to test:

MySQL CLI:

DROP SCHEMA IF EXISTS bug54969;
CREATE SCHEMA bug54969;
USE bug54969;

CREATE TABLE t(i SERIAL, j INTEGER, v VARCHAR(100))ENGINE=INNODB;

Workbench:

CREATE MODEL FROM EXISTING DATABASE
Choose schema bug54969
Add new view to EER model
Double click view

Editor should have something like:

CREATE CREATE VIEW `bug54969`.`view1` AS

Finish it like this:

CREATE CREATE VIEW `bug54969`.`view1` AS
SELECT * FROM t;

Model -> Validation (MySQL) -> Validate ALL

Result:
12:58:07 Validating tables
12:58:07 Validating views
12:58:07 Validating routines
12:58:07 Validating tables
12:58:07 Invalid default value 'NULL' fir column `t`.`j`:.
12:58:07 Validating views
12:58:07 Syntax error in view 'view1'. View code is 'CREATE VIEW `bug54969`.`view1` AS...'
12:58:07 Validating routines
12:58:07 Operation 'MySQL specific validate all' finished with 1 error and 1 warning
[16 Sep 2010 23:49] Johannes Taxacher
fix confirmed in repository
[17 Sep 2010 15:54] Tony Bedford
An entry has been added to the 5.2.28 changelog:

If a view was created (for example view1) for an existing schema, with correct syntax, and then Model menu, Validate (SQL) was selected, and either Validate All or Check Syntax was selected, then the following error message was generated in the Output window:

Syntax error in view 'view1'. View code is 'CREATE VIEW ...'