-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Hi,
I am just starting using rust and I am using this library to connect to an old version of mysql. The version is 5.0.37. With more recent versions such as 5.6 this library works great. However when trying to connect to the older version 5.0.37 I get the following error:
Error: error returned from database: 1064 (42000): You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near ';
SET time_zone = '+00:00'' at line 1
Running the commands one by one from
sqlx/sqlx-core/src/mysql/connection/mod.rs
Lines 128 to 130 in f85920a
| SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE')); | |
| SET time_zone = '+00:00'; | |
| SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; |
I discovered that SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci; does not work because utf8mb4 was added in mysql 5.3.
Removing this line I also discovered that the other lines do not work as they are now. It appears that mysql does not support multiple statements in the same call to execute.
Is this something that sqlx could support? Completely understand if this is not something you want to support given the age of the database.