提交 76edf89a authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 f5f26b7a
......@@ -443,7 +443,6 @@ public class Select extends Query {
if (SysProperties.CHECK && checkInit) {
throw Message.getInternalError();
}
checkInit = true;
expandColumnList();
visibleColumnCount = expressions.size();
ObjectArray expressionSQL;
......@@ -510,6 +509,7 @@ public class Select extends Query {
condition.mapColumns(f, 0);
}
}
checkInit = true;
}
public void prepare() throws SQLException {
......@@ -520,7 +520,6 @@ public class Select extends Query {
if (SysProperties.CHECK && !checkInit) {
throw Message.getInternalError("not initialized");
}
isPrepared = true;
if (orderList != null) {
sort = prepareOrder(expressions, orderList);
orderList = null;
......@@ -582,6 +581,7 @@ public class Select extends Query {
}
}
}
isPrepared = true;
}
public double getCost() {
......
......@@ -31,6 +31,7 @@ public class TestPreparedStatement extends TestBase {
deleteDb("preparedStatement");
Connection conn = getConnection("preparedStatement");
testExecuteErrorTwice(conn);
testTempView(conn);
testInsertFunction(conn);
testPrepareRecompile(conn);
......@@ -57,6 +58,23 @@ public class TestPreparedStatement extends TestBase {
testParameterMetaData(conn);
conn.close();
}
private void testExecuteErrorTwice(Connection conn) throws Exception {
PreparedStatement prep = conn.prepareStatement("CREATE TABLE BAD AS SELECT A");
try {
prep.execute();
error("Unexpected success");
} catch (SQLException e) {
checkNotGeneralException(e);
}
try {
prep.execute();
error("Unexpected success");
} catch (SQLException e) {
checkNotGeneralException(e);
}
}
private void testTempView(Connection conn) throws Exception {
Statement stat = conn.createStatement();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论