Uploaded image for project: 'Hibernate ORM'
  1. HHH-10446

Comment delimiters not "escaped" within (VAR)CHAR literals within native queries

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.1.0, 5.0.8
    • Component/s: hibernate-core
    • Labels:
      None
    • Environment:
      Spring4, Hibernate 5.1.0
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      The original description has a lot of superfluous noise. The attached test cases are good indications of what happens. Basically we do not properly handle the case where a "line comment" delimiter occurs within a (VAR)CHAR literal. For example, from the test case:

      "select coalesce(i.name, '--NONE--') as itname  from Item i where i.intVal=?"
      

      we see the - at the start of -NONE as the start of a line comment.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 0.55h
                  0.55h