提交 bcae6372 authored 作者: Thomas Mueller's avatar Thomas Mueller

Trying to convert a value could throw the wrong exception.

上级 aab03e23
...@@ -44,6 +44,7 @@ public class TestPreparedStatement extends TestBase { ...@@ -44,6 +44,7 @@ public class TestPreparedStatement extends TestBase {
deleteDb("preparedStatement"); deleteDb("preparedStatement");
Connection conn = getConnection("preparedStatement"); Connection conn = getConnection("preparedStatement");
testExecuteUpdateCall(conn);
testPrepareExecute(conn); testPrepareExecute(conn);
testUUID(conn); testUUID(conn);
testScopedGeneratedKey(conn); testScopedGeneratedKey(conn);
...@@ -77,6 +78,15 @@ public class TestPreparedStatement extends TestBase { ...@@ -77,6 +78,15 @@ public class TestPreparedStatement extends TestBase {
deleteDb("preparedStatement"); deleteDb("preparedStatement");
} }
private void testExecuteUpdateCall(Connection conn) throws SQLException {
Statement stat = conn.createStatement();
try {
stat.executeUpdate("CALL HASH('SHA256', STRINGTOUTF8('Password'), 1000)");
} catch (SQLException e) {
assertEquals(ErrorCode.DATA_CONVERSION_ERROR_1, e.getErrorCode());
}
}
private void testPrepareExecute(Connection conn) throws SQLException { private void testPrepareExecute(Connection conn) throws SQLException {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("prepare test(int, int) as select ?1*?2"); stat.execute("prepare test(int, int) as select ?1*?2");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论