[DBIx-Class-Devel] [dbsrgits/sql-translator] `SQL::Translator::Parser::MySQL` doesn't accept `character set` in `create` (#101)

Boris Däppen notifications at github.com
Mon Mar 5 10:20:38 GMT 2018


This statement:

`sqlt-graph   -f MySQL -o fail.png -t png fail.sql`

produces the following error:

```
       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:
```sql
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.

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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/issues/101
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20180305/442653db/attachment.htm>


More information about the DBIx-Class-Devel mailing list