Skip to content

incremental: prepared statement arg count for update is changing #488

@ghost

Description

Test case

drop table if exists a.a488;
create table a.a488 (id int, val int);
insert into a.a488 values (1, null);
insert into a.a488 values (2, 2);

-- do full copy.
-- run following incr

update a.a488 set id=11 where id = 1; -- ok
update a.a488 set id=12 where id = 2; -- cause job dead

-- error: sql: expected 3 arguments, got 4

Reason: the first update generate a PS

update `a`.`a488`
set `id`=?, `val`=?
where ((`id` = ?) and (`val` is NULL))
limit 1

which is not suitable for the second update.

The second update requires

update `a`.`a488`
set `id`=?, `val`=?
where ((`id` = ?) and (`val` = ?))
limit 1

The same thing applies to a delete.

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