Skip to content

MySQL 8.0, Auto-increment value in UPDATE conflicts with internally generated values #268

Closed
@alfuckk

Description

@alfuckk

database version: mysql8
gorm: latest
casbin: v2
gorm-adapter: v3
The scenario is to implement full batch addition based on Mysql8. The business is actually very simple. First delete a batch of old data, and then add a batch. In this process, it is found that ON DUPLICATE KEY UPDATEid=id`` appears at the end of the printed sql

This problem is directly reported, and the error displayed is Error 1869 (HY000): Auto-increment value in UPDATE conflicts with internally generated values.

It looks like a problem with the casbin_rule table structure, but this casbin_rule table is generated by casbin/gorm-adapter/v3. So how should I solve this problem?

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