Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3876

Backslash characters are duplicated on PostgreSQL 9.1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: Database
    • Labels:
      None

      Description

      The backslash characters are duplicated on :

      • profile name
      • description of custom rule
      • rule parameter

      PostgreSQL 9.1 is more strict with SQL standard. It drops the "MySQLism" that accepts backslash as an escaping character. Only the single quote should be accepted regards to the standard.
      This behavior is defined by the postgres property "standard_conforming_strings". Its default value has been changed to "on" in 9.1.

      The problem is that Rails explicitely escapes \ with another \. It's inserted as it with postgresql 9.1 and it's correctly interpreted with 9.0. Note that escaping is correctly supported by the JDBC driver.

      A solution is to force the standard_conforming_strings to "on" in JDBC connections and to stop double-backslashing in rails. It allows to support both versions 9.0 and 9.1.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              simon.brandhof Simon Brandhof (Inactive)
              Reporter:
              simon.brandhof Simon Brandhof (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: