Derby
  1. Derby
  2. DERBY-5161

Cannot rollback after syntax error in internal statement

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.8.1.2
    • Component/s: SQL
    • Labels:
      None

      Description

      To reproduce, execute the statements below in ij. Can only be reproduced this way before DERBY-5157. I don't know how to reproduce it when that bug is fixed.

      ij version 10.7
      ij> connect 'jdbc:derby:db;create=true';
      ij> autocommit off;
      ij> create table t(x int);
      0 rows inserted/updated/deleted
      ij> alter table t add column """" int default 42;
      ERROR 42X01: Syntax error: Encountered "\"" at line 1, column 22.
      Issue the 'help' command for general information on IJ command syntax.
      Any unrecognized commands are treated as potential SQL commands and executed directly.
      Consult your DBMS server reference documentation for details of the SQL syntax supported by your server.
      ij> rollback;
      ERROR X0Y67: Cannot issue rollback in a nested connection when there is a pending operation in the parent connection.

      The error message implies that we've called rollback() on a nested transaction, whereas we're in fact called it on the parent transaction.

      Expected result: The rollback statement should abort the transaction without raising any errors.

      1. finally.diff
        0.7 kB
        Knut Anders Hatlen
      2. cleanupOnError.diff
        0.5 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development