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

dblook garbles string literals in views, triggers and check constraints

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

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.10.1.1
    • None
    • Tools
    • None
    • Repro attached
    • Wrong query result

    Description

      dblooks replaces newlines with spaces in CHECK constraints, VIEWs and TRIGGERs. That is not the right thing to do if the newline is part of a string literal or an identifier. Look for callers of dblook.removeNewlines().

      For example, create a view like this:

      create view v as values 'Line #1
      Line #2
      Line #3';

      Then run dblook on the database, and you'll see the following:

      – ----------------------------------------------
      – DDL Statements for views
      – ----------------------------------------------

      SET SCHEMA "APP";
      create view v as values 'Line #1 Line #2 Line #3';

      Notice that the string literal has been transformed from three lines to a single line, so it's not an equivalent view.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            knutanders Knut Anders Hatlen

            Dates

              Created:
              Updated:

              Slack

                Issue deployment