insert on duplicate语句不带列字段时出现空指针问题

问题描述

不带列字段时出现空指针,如insert into t values(1,1,1) on duplicate key update a = 2;

发生的情况

If there is an exception, please attach the exception trace: 定位到时在通过插入的数据构造前置镜像时,recognizer.getInsertColumns返回了null,在遍历时出现空指针问题;此时应该根据values构造主键查询列,参考BaseInsertExecutor#parsePKValuesFromStatement

提问12.png

原提问者GitHub用户renliangyu857

展开
收起
学习娃 2023-06-14 16:57:25 77 分享 版权
1 条回答
写回答
取消 提交回答
  • insert into t_nounique values(3,3) on duplicate key update b = 5 这种sql需要根据matedata信息读到列的顺序去找到主键

    原回答者GitHub用户a364176773

    2023-06-14 17:28:13
    赞同 展开评论
问答标签:
问答地址: