mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1996 - MySQLSyntaxErrorException when update in bulk.
This commit is contained in:
@@ -98,6 +98,27 @@ public class UpdateQueryTest extends BaseTestCase {
|
||||
assertSql(sql.get(0)).contains("update o_customer set status = status where id > ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void query_asUpdate_idIn() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
int rows = server().find(Customer.class)
|
||||
.where()
|
||||
.in("id", 1000, 1001, 1002)
|
||||
.asUpdate()
|
||||
.setRaw("status = ?", "A")
|
||||
.setLabel("asUpdateByIds")
|
||||
.update();
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(rows).isEqualTo(0);
|
||||
|
||||
assertSql(sql.get(0)).contains("update o_customer set status = ? where id in (?,?,?)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void update_withTransactionBatch() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user