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

--no commit message

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