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.
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 sthroughmysql2/promiseconnection.querysometimes prints2 617instead of2 hi.mysql_native_passworduser and 0 of 15 with acaching_sha2_passworduser. Node was correct every time.encodings/utf7.jstable usenew Array(256). With that change, main showed the wrong value in 7 of 10 runs. So this is not caused by the mysql2 segfaults in createConnection on Linux (3.24.4 / 3.23.2, compiled from source) #11335 fix.Pool, and a pool-connection transaction.generate-function/new Function. Perry runs these in the runtime interpreter (runtime: dynamic code evaluation (new Function) for schema-codegen libs (ajv / fast-json-stringify / find-my-way) — blocks kimi-code #6559), so that is the first place I would look.Repro:
The user was created with
CREATE USER 'perry_native'@'%' IDENTIFIED WITH mysql_native_password BY 'perry'. The build wasPERRY_NO_AUTO_OPTIMIZE=1, and the program was run in a loop. I have not reduced it further.