Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4822

DropSchemaConstantAction: could reuse the current connection provided by the available activation object

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.7.1.1
    • 10.7.1.1
    • SQL
    • None
    • Newcomer

    Description

      In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.

      Regards, --Martin

      Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
      ===================================================================
      — java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
      +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
      @@ -27,6 +27,7 @@
      import org.apache.derby.iapi.sql.dictionary.DataDictionary;
      import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
      import org.apache.derby.iapi.sql.execute.ConstantAction;
      +import org.apache.derby.iapi.store.access.TransactionController;

      /**

      • This class describes actions that are ALWAYS performed for a
        @@ -82,6 +83,7 @@
        {
        LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
        DataDictionary dd = lcc.getDataDictionary();
        + TransactionController tc = lcc.getTransactionExecute();

      /*

        • Inform the data dictionary that we are about to write to it.
          @@ -94,7 +96,7 @@
          */
          dd.startWriting(lcc);
      • SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
        + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);

      sd.drop(lcc, activation);

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            kristwaa Kristian Waagan
            monperrus Martin Monperrus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment