refinery icon indicating copy to clipboard operation
refinery copied to clipboard

MySQL migration succeeds despite syntax error in `.sql` file

Open zackangelo opened this issue 1 year ago • 3 comments

When running an initial migration to execute a series of CREATE TABLE statements for MySQL, I noticed that I was missing a semicolon. The migration reported as a success even though the .sql migration file had a syntax error. It just created a couple of the tables in the file and ignored the rest.

When I pipe the .sql file directly into mysql it reports the syntax error as expected. Is this intended behavior? Am I organizing my migration files wrong?

zackangelo avatar Jul 10 '24 18:07 zackangelo

Upon some further inspection, it seems this is only a problem with the mysql driver. It reports the syntax error correctly and fails the migration when I use mysql_async.

zackangelo avatar Jul 10 '24 18:07 zackangelo

Same issue when mysql and CREATE TABLE.

failable avatar Jul 14 '24 13:07 failable

Hi, and thanks for the interest! Interesting, does the sql query also succeed if you run it directly with mysql ?

jxs avatar Aug 02 '24 13:08 jxs