Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1500

Disallow mutations and queries using PhoenixPreparedStatement.executeQuery() and executeUpdate() respectively.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.3.0, 3.3.0, 3.2.2, 4.2.2
    • None
    • None

    Description

      @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)
      
      

      Attachments

        1. PHOENIX-1500.patch
          5 kB
          Samarth Jain
        2. PHOENIX-1500_v3.patch
          10 kB
          Samarth Jain
        3. PHOENIX-1500_v2.patch
          4 kB
          Samarth Jain
        4. PHOENIX-1500_3.0.patch
          9 kB
          Samarth Jain

        Activity

          People

            samarthjain Samarth Jain
            samarthjain Samarth Jain
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: