Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6769

Underscores in values of FIQL search expressions are incorrectly escaped

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.6, 3.0.9, 3.2.0
    • Component/s: JAX-RS
    • Labels:
      None
    • Environment:

      Webapp deployed to WildFly 10

    • Estimated Complexity:
      Unknown

      Description

      We are basically "just" using FIQLParser and SQLPrinterVisitor like this:

      final FiqlParser<SearchBean> fiqlParser = new FiqlParser<>(SearchBean.class);
      final SearchCondition<SearchBean> searchCondition = fiqlParser.parse(search);
      final SQLPrinterVisitor<SearchBean> visitor = new SQLPrinterVisitor<SearchBean>(table);
      searchCondition.accept(visitor);
      final String sql = visitor.getQuery();

      A search expression like this:

      text==VAL_UE

      yields an SQL query like this:

      SELECT * FROM some_table WHERE text = 'VAL[backslash]_UE'

      (Note [backslash] is supposed to mean a literal "\" which is swallowed here)

      If the table contains a row with text "VAL_UE", the query returns no results because the underscore in the value was preceded with a backslash.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              dode Torsten Römer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: