last_insert_id()返回错误

明白你的意思了,可以看下这个insert on duplicate key update does not return Last Insert ID in the case of an update · Issue #23914 · pingcap/tidb · GitHub
executor: set last insert id in the duplicated update statement by jackysp · Pull Request #6345 · pingcap/tidb · GitHub
insert on duplicate key update 在更新的情况下没有返回 Last Insert ID