vapor / mysql-nio

🐬 Non-blocking, event-driven Swift client for MySQL.
MIT License
87 stars 28 forks source link

Mariadb 10.1 fatalError #21

Closed bottlehall closed 3 years ago

bottlehall commented 4 years ago

I am using v10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04 on a Raspberry Pi. Simply running the project works and the initial view is displayed. However if I try to do a Migration to create a Model/table, project crashes:

Migrate Command: Prepare [ INFO ] query read _fluent_migrations Fatal error: file /Users/npr/rv4/.build/checkouts/mysql-nio/Sources/MySQLNIO/MySQLQueryCommand.swift, line 128

Simply running 'Vapor-beta run migrate' causes the error. Debug shows that the error happens before any attempt execute a migration.

[Not sure if it is relevant but an initial problem was that the default collation of the database was utf8mb4_general_ci. This worked fine with Vapor 3, but caused the attempt to create a unique index on the 'name' field in '_fluent_migrations' to fail because the key length was too great. Changing collation to utf8_general_ci fixed this issue.]

bottlehall commented 4 years ago

Tested same migrations and routes against MySQL 5.7 and all is good, so specifically MariaDB.