Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-15491

Parenthesis are ignored in the WHERE clause of qserv queries

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Qserv
    • Labels:
      None
    • Templates:
    • Story Points:
      8
    • Sprint:
      DB_F18_08
    • Team:
      Data Access and Database

      Description

      In a query such as 

      MariaDB [qservTest_case01_qserv]> select objectId, ra_PS from Object where objectId = 417853073271391 or objectId = 399294519599888;
      +-----------------+------------------+
      | objectId        | ra_PS            |
      +-----------------+------------------+
      | 399294519599888 | 359.337499495437 |
      | 417853073271391 | 359.894210551011 |
      +-----------------+------------------+
      2 rows in set (0.11 sec)MariaDB [qservTest_case01_qserv]> select objectId, ra_PS from Object where ra_PS > 359.5 and (objectId = 417853073271391 or  objectId = 399294519599888);
      +-----------------+------------------+
      | objectId        | ra_PS            |
      +-----------------+------------------+
      | 399294519599888 | 359.337499495437 |
      | 417853073271391 | 359.894210551011 |
      +-----------------+------------------+
      2 rows in set (0.11 sec) 

      the second query should have returned only objectId 417853073271391, because the ra_PS value for objectId 399294519599888 is below the comparison value (of 359.5).

      Based on initial research, it appears that the parenthesis are getting dropped from the query during processing in the Czar; the mysql-proxy-lua.log shows:

      (core/modules/qproc/QuerySession.cc:120) - Query Plugins applied:
       QuerySession description:
        original: select filterId,filterName from Filter where filterId > 2 and(filterName='y' or filterName='g')
        has chunks: 0
        chunks: []
        needs merge: 0
        1st parallel statement: SELECT filterId,filterName FROM qservTest_case01_qserv.Filter AS QST_1_ WHERE filterId>2 AND filterName='y' OR filterName='g' 

      (note that in "1st parallel statement", the parens are omitted)

       

       

        Attachments

          Container Issues

            Activity

              People

              • Assignee:
                npease Nate Pease
                Reporter:
                npease Nate Pease
                Reviewers:
                Andy Salnikov
                Watchers:
                Andy Salnikov, Fritz Mueller, Nate Pease, Vaikunth Thukral
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel