-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.5.3不能正常使用mysql的自增主键 报错 Generated keys not requested. #360
Comments
信息不足,请提供可供重现的代码。 |
我同样遇到的是 :在插入非分片表时,报了这样的错: |
请一次性将所需信息提供完善吧。这样沟通成本太高,一天就这么过去了。 |
我用的spring mybatis ,插入的mapper.xml配置如下: |
请参见之前的信息: 请一次性提供所需信息,不然实在不易定位 |
您这样的代码片段对于我们定位bug并无实质用途。请按照之前交流所写。提供我们需要的信息。 |
由于您没提供可重现的代码,并自行关闭了issue。 |
dup #370 |
Please answer these questions before submitting your issue. Thanks!
Which version of Sharding-Jdbc do you using?
1.5.3
Expected behavior
1.5.2可以正常使用mysql的自增主键
Actual behavior
Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
Steps to reproduce the behavior
CREATE TABLE
sequence
(id
int(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (
id
)) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
public Long getSequence() {
Sequence sequence = new Sequence();
testDao.getSequence(sequence);
return sequence.getId();
}
insert into sequence() values()
Please provide the reproduce example codes (such as github link) if possible.
The text was updated successfully, but these errors were encountered: