Skip to content

Support for old versions of mysql #434

@gingermusketeer

Description

@gingermusketeer

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions