ERROR (line 3): Invalid statement: Was expecting comment, or use, or
set, or drop, or create, or alter, or insert, or
delimiter, or empty statement
Error: translate: Error with parser 'SQL::Translator::Parser::MySQL': no results at ~/perl5/perlbrew/perls/perl-5.22.4/bin/sqlt-graph line 195.
The following SQL was used to produce the error:
SET NAMES 'utf8';
CREATE DATABASE example CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE example;
CREATE TABLE articel (
id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
When I remove CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci from the create statement, it parses just fine.
Note: The character set for the table does not produce an error.
I'll might give it a try and create a patch, if someone with a good amount of background knowledge on MySQL (or somebody from the devs of sqlfairy) can confirm that this is a valid issue.
This statement:
sqlt-graph -f MySQL -o fail.png -t png fail.sql
produces the following error:
The following SQL was used to produce the error:
When I remove
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
from the create statement, it parses just fine.Note: The character set for the table does not produce an error.
According to https://dev.mysql.com/doc/refman/5.7/en/charset-database.html the used syntax for a character set in
create
should be valid.