[CONJS-150] SQL Error 1210 in batch update Created: 2020-11-06  Updated: 2021-02-16  Resolved: 2021-02-16

Status: Closed
Project: MariaDB Connector/node.js
Component/s: batch
Affects Version/s: 2.5.1
Fix Version/s: 2.5.2

Type: Bug Priority: Major
Reporter: Jean-Francois Brazeau Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

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


Generated at Thu Feb 08 03:23:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.