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

Fix czar crash and improve error message for queries that select "dec"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Qserv
    • Labels:
      None

      Description

      "dec" is a reserved word in mysql, so queries like "SELECT dec FROM t" will never work, mysql will return syntax error, and not "unknown column"

      mysql> select dec from t;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec from t' at line 1

      select decll from t;
      ERROR 1054 (42S22): Unknown column 'decll' in 'field list'

      Qserv is having troubles in parser, and the error is:

      ERROR ccontrol.UserQueryFactory (build/ccontrol/UserQueryFactory.cc:109) - Invalid query: ParseException:Parse error(ANTLR):unexpected token: dec:

      It'd be nice to improve the error message, and fix the problem because it currently crashes czar!

        Attachments

          Issue Links

            Activity

            Hide
            fritzm Fritz Mueller added a comment -

            The error message was improved, and behavior is now correct wrt. quoting and column name qualification

            Show
            fritzm Fritz Mueller added a comment - The error message was improved, and behavior is now correct wrt. quoting and column name qualification

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              fritzm Fritz Mueller
              Watchers:
              Fritz Mueller, Jacek Becla
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.