提交 c7c92a09 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix TestCases and TestMvcc2

上级 be50e127
......@@ -280,7 +280,7 @@ public class TestCases extends TestDb {
stat.execute("create table test(id int primary key)");
assertThrows(ErrorCode.COLUMN_IS_REFERENCED_1, stat).
execute("alter table test alter column id " +
"set default ifnull((select max(id) from test for update)+1, 0)");
"set default ifnull((select max(id) from test)+1, 0)");
stat.execute("drop table test");
conn.close();
}
......
......@@ -126,22 +126,14 @@ public class TestMvcc2 extends TestDb {
}
private void testSelectForUpdate() throws SQLException {
Connection conn = getConnection("mvcc2;SELECT_FOR_UPDATE_MVCC=true");
Connection conn2 = getConnection("mvcc2;SELECT_FOR_UPDATE_MVCC=true");
Connection conn = getConnection("mvcc2");
Connection conn2 = getConnection("mvcc2");
Statement stat = conn.createStatement();
stat.execute("create table test(id int primary key, name varchar)");
conn.setAutoCommit(false);
stat.execute("insert into test select x, 'Hello' from system_range(1, 10)");
stat.execute("select * from test where id = 3 for update");
conn.commit();
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).
execute("select sum(id) from test for update");
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).
execute("select distinct id from test for update");
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).
execute("select id from test group by id for update");
assertThrows(ErrorCode.FEATURE_NOT_SUPPORTED_1, stat).
execute("select t1.id from test t1, test t2 for update");
stat.execute("select * from test where id = 3 for update");
conn2.setAutoCommit(false);
conn2.createStatement().execute("select * from test where id = 4 for update");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论