Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.5.1
-
None
-
Docker, NodeJS
Description
I have a simple table :
create table MYTABLE ( |
id varchar( 50) not null, |
payload text not null default ('{}'), |
constraint MYTABLE_PK primary key (id) |
) engine=innodb;
|
I perform a simple update using batch mode with only two parameters, the first containing an item with a variable length (given by dataLength variable):
await tx.batch(
|
'update MYTABLE set payload=? where id=?', |
[
|
[
|
''.padStart(dataLength, 'X'), // generates a string with 'dataLength' length |
'1' |
],
|
[
|
'X', |
'2' |
]
|
]
|
);
|
The update works fine with almost every dataLength values, except several discret ones :
- if dataLength = 16365 : success
- if dataLength = 16366 : failure (SqlError: (conn=302, no: 1210, SQLState: HY000) Incorrect arguments to mysqld_stmt_bulk_execute)
- if dataLength = 16367 : success
The problem also occurs with : 131053, 131055, 1048557, 1048559 & 16777194 bytes
A ready to use testcase is avaliable here : https://gitlab.com/jean-francois.brazeau/mariadb-batch-failure/-/tree/simplifiedversion