Skip to content

Query running in async mode, without it being specified. #723

Open
@64kramsystem

Description

@64kramsystem

I'm loading my rails structure.sql file via the mysql2 gem, but the query executes asynchronously, withoutasync: true being specified.

The sql file contains the typical rails content,with the exception of including trigger definitions, resulting in the sequence (CREATE TABLEs... CREATE TRIGGERs... INSERT INTO schema_migrations's).

The connection is established using Mysql2::Client::MULTI_STATEMENTS.

The problem is that when I execute Mysql2::Client#query(), nil is returned immediately, while I can see the sql being executed in the background.
Out of curiosity, I've tried adding async: true and waiting for client.async_result to return some value, but even when the background work was finished, such call was returning nil.

Based on what I see in the gem documentation, this should not happen.

My O/S is an Ubuntu 64 15.10, with the standard libmysqlclient packages installed.
I've tried with the 0.3.17 and 0.4.2, and the behavior is the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions