[
https://issues.apache.org/jira/browse/PHOENIX-1500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14233819#comment-14233819
]
Hudson commented on PHOENIX-1500:
---------------------------------
SUCCESS: Integrated in Phoenix-master #512 (See
[https://builds.apache.org/job/Phoenix-master/512/])
PHOENIX-1500 Disallow mutations and queries using using
PhoenixPreparedStatement.executeQuery() and executeUpdate() respectively
(Samarth Jain) (jamestaylor: rev ceded2266166c935414d83bbe9c6fdefa5272893)
*
phoenix-core/src/main/java/org/apache/phoenix/schema/ExecuteQueryNotApplicableException.java
* phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
*
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixPreparedStatement.java
*
phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixPreparedStatementTest.java
*
phoenix-core/src/main/java/org/apache/phoenix/schema/ExecuteUpdateNotApplicableException.java
* phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java
> Disallow mutations and queries using PhoenixPreparedStatement.executeQuery()
> and executeUpdate() respectively.
> --------------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-1500
> URL: https://issues.apache.org/jira/browse/PHOENIX-1500
> Project: Phoenix
> Issue Type: Bug
> Reporter: Samarth Jain
> Assignee: Samarth Jain
> Fix For: 4.3, 3.3, 3.2.2, 4.2.2
>
> Attachments: PHOENIX-1500.patch, PHOENIX-1500_3.0.patch,
> PHOENIX-1500_v2.patch, PHOENIX-1500_v3.patch
>
>
> {code}
> @Test
> public void deleteUsingPreparedStatement() throws Exception {
> Connection conn = DriverManager.getConnection(getUrl());
> initTableValues(conn);
> assertTableCount(conn, "IntIntKeyTest", NUMBER_OF_ROWS);
> String deleteStmt = "DELETE FROM IntIntKeyTest WHERE j = ?";
> PreparedStatement stmt = conn.prepareStatement(deleteStmt);
> stmt.setInt(1, 20);
> stmt.executeQuery();
> conn.commit();
> assertTableCount(conn, "IntIntKeyTest", NUMBER_OF_ROWS - 1);
> }
> java.lang.ClassCastException: org.apache.phoenix.compile.DeleteCompiler$3
> cannot be cast to org.apache.phoenix.compile.QueryPlan
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:221)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:1)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:216)
> at
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeQuery(PhoenixPreparedStatement.java:183)
> at
> org.apache.phoenix.end2end.DeleteIT.deleteUsingPreparedStatement(DeleteIT.java:484)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)