Skip to content

mysql2: a text column intermittently reads back as a wrong value (617 for 'hi') with a mysql_native_password user #11341

Description

@proggeramlug

Found while validating #11335 on perrymaster (Linux x86_64) against a private MySQL 8.0.46, with mysql2 3.24.4. The oracle is Node 26.5.1.

A string column sometimes comes back as the wrong value. SELECT 1 + 1 AS two, 'hi' AS s through mysql2/promise connection.query sometimes prints 2 617 instead of 2 hi.

Repro:

import mysql from "mysql2/promise";
const c = await mysql.createConnection({ host: "127.0.0.1", port: 43306, user: "perry_native", password: "perry", database: "perry_test" });
const [r] = (await c.query("SELECT 1 + 1 AS two, 'hi' AS s")) as any;
console.log(r[0].two, r[0].s); // node: 2 hi
await c.end();

The user was created with CREATE USER 'perry_native'@'%' IDENTIFIED WITH mysql_native_password BY 'perry'. The build was PERRY_NO_AUTO_OPTIMIZE=1, and the program was run in a loop. I have not reduced it further.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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