Skip to content

Cannot use more than one query in on_connect.sql with MySQL #132

@nanawel

Description

@nanawel

Introduction

Using on_connect.sql as described in the documentation does not seem to work if more that one query is used.

To Reproduce

✔️ Working

select 1;

❌ Not working

select 1;
select 2;

Actual behavior

App logs:

[INFO  sqlpage::webserver::database::connect] Connecting to database: mysql://user:password@myhost/mydb
[INFO  sqlpage::webserver::database::connect] Creating a custom SQL database connection handler from "/var/www/sqlpage/on_connect.sql"
[ERROR sqlx_core_oldapi::pool::inner] error returned from after_connect: Database(MySqlDatabaseError { code: Some("42000"), number: 1064, message: "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 'select 2' at line 33" })

Expected behavior

One should be able to use any number of properly terminated queries in the on_connect.sql bootstrap file.

Version information

  • Database: MySQL 8
  • SQLPage Version: 0.15.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions