Skip to content

Bug with $db->setQueryOption('IGNORE')->insertMulti  #770

Open
@LunarDevelopment

Description

@LunarDevelopment

Hello, I'm trying to use IGNORE with insertMulti but getting duplicate key errors, code and error below, with the only notable oddity being the table being inserted into has a compound primary key - that shouldn't affect IGNORE though :

        $records = $db->setQueryOption('IGNORE')->insertMulti('table', $array_of_arrays);

        if(!$records) {
            echo 'insert failed: ' . $db->getLastError();
        } else {
            echo 'new records inserted with following id\'s: ' . implode(', ', $records);
        }
insert failed: Duplicate entry 'recordname-2018-07-05' for key 'PRIMARY'

Results of $db->getLastQuery()

INSERT  INTO table... 

composer.json :

    "joshcam/mysqli-database-class": "dev-master",

Also tried on v2.9.2 with same error messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions