Skip to content

在dble里执行insert语句常见报错汇总 #3285

Discussion options

You must be logged in to vote

问题1

配置er表,子表执行insert语句插入多条数据时,返回报错:

ChildTable multi insert not provided

sharding.xml:

<shardingTable name="er_parent" shardingNode="dn1,dn2,dn3,dn4" function="hash-four" shardingColumn="id">
     <childTable name="er_child" joinColumn="id" parentColumn="id" />
</shardingTable>

执行语句:

mysql> insert into er_child values (1,'name1'),(2,'name2');
ERROR 1064 (HY000): ChildTable multi insert not provided

说明:显式配置的父子表,在子表插入数据时,不能多值插入
原因 : 子表插入数据时,如有parentkey不是父表的拆分列。需要去对应父表的拆分结点中反向查询路由规则,如果此时是多值插入,就会变成多值反查,查询功能较难完成,即使完成,性能也会很差。
相关issue : #12

问题2

INSERT自增序列表时,返回报错:

In insert Syntax, you can't set value for Autoincrement column! Or column count doesn't match value count

sharding.xml:

<shardin…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by PanternBao
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants