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

Quotes around column names in SQL statements cause a parser error.

    XMLWordPrintable

Details

    • Bug
    • Status: Won't Fix
    • Resolution: Done
    • None
    • None
    • None

    Description

      > SELECT "ra",source_id FROM wise_00.Object WHERE qserv_areaspec_circle(9.469,-1.152,0.01);
      ERROR 4110 (Proxy): Query processing error: QI=?: Failed to instantiate query: ParseException:ValueFactorFactory::newColumnFactor with :"ra"
      

      Attachments

        Issue Links

          Activity

            jgates John Gates added a comment -

            The code did not handle the SqlSQL2TokenTypes::DELIMITED_ID case. Unfortunately, it will take some effort to handle this as sending the quoted "ra" as above to mysql results in output like that below. Getting this into a form that's agreable to both antlr and mysql will likely take significant effort.

              > select "ra", decl FROM Source WHERE objectId IN (386950783579546);
             +------+-------------------+
            | ra   | decl              |
            +------+-------------------+
            | ra   | -5.82522757382841 |
            | ra   | -5.82525653359452 |
            | ra   | -5.82521730993245 |
            

            jgates John Gates added a comment - The code did not handle the SqlSQL2TokenTypes::DELIMITED_ID case. Unfortunately, it will take some effort to handle this as sending the quoted "ra" as above to mysql results in output like that below. Getting this into a form that's agreable to both antlr and mysql will likely take significant effort. > select "ra", decl FROM Source WHERE objectId IN (386950783579546); +------+-------------------+ | ra | decl | +------+-------------------+ | ra | -5.82522757382841 | | ra | -5.82525653359452 | | ra | -5.82521730993245 |

            This ticket asks for quotes around column names to be supported; this does not work as I think is desired in mysql:

            MariaDB [qservTest_case01_mysql]> select "ra_PS" from Object limit 5;
            -------
            | ra_PS |
            -------
            | ra_PS |
            | ra_PS |
            | ra_PS |
            | ra_PS |
            | ra_PS |
            -------
            5 rows in set (0.01 sec)

            I think the desired behavior is as with backticks:

            MariaDB [qservTest_case01_mysql]> select `ra_PS` from Object limit 5;
            ------------------
            | ra_PS |
            ------------------
            | 1.13454822151113 |
            | 1.13454822151115 |
            | 359.337499495437 |
            | 359.161551380273 |
            | 358.710919511197 |
            ------------------
            5 rows in set (0.01 sec)

            Which works with qserv, at least with changes implemented in DM-16532.

             

             

            npease Nate Pease [X] (Inactive) added a comment - This ticket asks for quotes around column names to be supported; this does not work as I think is desired in mysql: MariaDB [qservTest_case01_mysql] > select "ra_PS" from Object limit 5; ------- | ra_PS | ------- | ra_PS | | ra_PS | | ra_PS | | ra_PS | | ra_PS | ------- 5 rows in set (0.01 sec) I think the desired behavior is as with backticks: MariaDB [qservTest_case01_mysql] > select `ra_PS` from Object limit 5; ------------------ | ra_PS | ------------------ | 1.13454822151113 | | 1.13454822151115 | | 359.337499495437 | | 359.161551380273 | | 358.710919511197 | ------------------ 5 rows in set (0.01 sec) Which works with qserv, at least with changes implemented in DM-16532 .    

            Wont fix this one because it's a duplicate.

            npease Nate Pease [X] (Inactive) added a comment - Wont fix this one because it's a duplicate.

            People

              npease Nate Pease [X] (Inactive)
              jgates John Gates
              John Gates, Nate Pease [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.