Skip to content
  1. Nov 30, 2017
  2. Nov 16, 2017
  3. Nov 10, 2017
    • gmantele's avatar
      [ADQL] Fix escaping of double quotes in delimited identifiers. · 239c7178
      gmantele authored
      A delimited identifier is any sequence of characters between a pair of
      double quotes. For instance: "123 I am a delimited identifier!".
      
      It is of course possible to have double quotes inside this kind of identifier,
      but they have to be doubled in order to not be mistaken with the end of the
      identifier. For instance: "Cool ""identifier""".
      
      However, this escape option was not taken into account by the ADQL library,
      though the same mechanism was already in place for string contants.
      239c7178
  4. Sep 27, 2017
    • gmantele's avatar
      [UWS] Fix missing xlink:type (though it is optional) in jobRef (in XML job list). · 6ad03a80
      gmantele authored
      This commit also includes the 2 following points:
      
          - for (really really tiny) optimisation purpose, replace String by a
      	  char when there is only one character to append to a StringBuffer
      
      	- add a bit more details about Result.type in the Javadoc (it should be
      	  a xlink:type and not a random custom type)
      6ad03a80
    • gmantele's avatar
      [UWS] Fix HTTP request for job destruction. · 81c567c8
      gmantele authored
      Until now, it was possible to destroy the job by posting ACTION=DELETE
      with a URL like below:
      
          {root-uws}/{job-list}/{job-id}/foo/bar
      
      That is completely wrong. The correct URL for this action must always be:
      
          {root-uws}/{job-list}/{job-id}
      
      This commit fixes this error in UWSServlet and UWSService.
      81c567c8
    • gmantele's avatar
      [UWS] Fix bug with the configuration of the destruction controller. · fdf1d1ea
      gmantele authored
      The configuration of the DestructionTimeController was never effective
      in the UWSServlet with a configuration file: the wrong instance was set.
      fdf1d1ea
    • gmantele's avatar
      [UWS] Fix bug with JobObserver. The notification of all observers was not · f7071abb
      gmantele authored
      synchronized although the collection of observers is synchronized (Vector) ;
      using an Iterator ensures the synchronization and avoids concurrency problems.
      f7071abb
    • gmantele's avatar
      [TAP,UWS] Add a protocol version number for UWS and TAP: · 70dc3a14
      gmantele authored
        - uws.service.UWS.VERSION  (static final)
        - tap.resource.TAP.VERSION (static final)
      
      Dealing with several protocol versions in the same time is quite difficult and
      may significantly alter the libraries API in an unstable way. That's why, for
      the TAP and UWS libraries, only one version is implemented (i.e. the last one).
      To use a older version of the protocol, one must use an older version of the
      corresponding library.
      
      About the versioning of the ADQL standard, there is no need to set any version
      number somewhere because a different ADQL version implies a different grammar.
      It means that a different parser is required for each ADQL version. For the
      moment, there is only one version, so no need to change anything to the ADQL
      library about ADQL version. Later, ADQLParser should become an interface and
      a factory will have to be used in order to get the parser corresponding to the
      desired ADQL version.
      70dc3a14
  5. Sep 26, 2017
    • gmantele's avatar
      [TAP] Auto-detect the RegTAP datamodel from the schemas and tables declared · 8102b083
      gmantele authored
      in TAP_SCHEMA.
      
      RegTAP is detected successfully if the schema 'rr' exists (case sensitive)
      and contains at least the following tables (names also case sensitive):
      	- capability
      	- interface
      	- intf_param
      	- relationship
      	- res_date
      	- res_detail
      	- res_role
      	- res_schema
      	- res_subject
      	- res_table
      	- resource
      	- table_column
      	- validation
      
      The table name can be prefixed by 'rr' (case sensitive) or not. For instance:
      'rr.capability' and 'capability' are both detected successfully.
      
      All these constraints (including the case sensitive one) are based on the
      requirements of the RegTAP-1.0 standard document. They are set in order
      to not declare the RegTAP DM by accident AND to provide a first low
      validation of the RegTAP schema and tables. Low validation because
      columns (as well as datatype, utypes, indices and UDF functions) are
      never checked.
      
      This commit resolves the GitHub issue #51
      8102b083
    • gmantele's avatar
    • gmantele's avatar
      [TAP] The additional table TAP_SCHEMA.coossys must not be be returned as a · 93c36a09
      gmantele authored
      standard table. The same for the additional column
      TAP_SCHEMA.columns.coosys_id.
      93c36a09
  6. Sep 25, 2017
  7. Sep 15, 2017
  8. Sep 13, 2017
    • gmantele's avatar
      [ADQL] Also append an HINT message in the ParseException message when a SQL · fe4c3e97
      gmantele authored
      reserved word is encountered instead of a column/table/schema name/alias.
      
      On the contrary to the previous commit, this time a list of SQL reserved words
      has been added into the ADQL grammar. In this way, the parser will ensure that
      no word of this list is used in an ADQL query. The raised error is then enriched
      of an HINT message stating that this word is part of SQL, is not supported
      by ADQL and must be written between double quotes if used as an identifier.
      
      The list of SQL reserved words comes from the ADQL-2.0 standard, after removal
      of all potentially used ADQL words, in order to avoid a conflict with the
      already existing tokens in the ADQL grammar.
      fe4c3e97
    • gmantele's avatar
      [ADQL] Append an HINT message in the ParseException message when an ADQL · db0dfdad
      gmantele authored
      reserved word is encountered instead of a column/table/schema name/alias.
      
      No list of ADQL reserved words has been added into the ADQL grammar.
      
      However, the ADQL grammar has been slightly changed in order to provide a more
      precise location of the REAL wrong part of the query.
      
      Before this commit, if an ADQL reserved word (e.g. 'point') was encountered
      outside of its normal syntax (e.g. 'point' no followed by an opening
      parenthesis), the next token was highlighted instead of this one. Hence a
      confusing error message.
      
      For instance, the following ADQL query:
      
      ```sql
      SELECT point
      FROM aTable
      ```
      
      returned the following error message:
      
      > Encountered "FROM". Was expecting: "("
      
      Now, it will return the following one:
      
      > Encountered "point". Was expecting one of: "*" <QUANTIFIER> "TOP" [...]
      > (HINT: "point" is a reserved ADQL word. To use it as a column/table/schema name/alias, write it between double quotes.)
      
      This error message highlights exactly the source of the problem and even provide
      to the user a clear explanation of why the query did not parse and how it could
      be solved.
      db0dfdad
    • gmantele's avatar
  9. Sep 11, 2017
  10. Sep 08, 2017
    • gmantele's avatar
      [ADQL] Fix the transformation of NATURAL JOIN and JOIN...USING of MS-SQLServer. · e03e5725
      gmantele authored
      In the resulting SQL query, if there are an alias on the joined tables, these
      aliases must be used in the ON clause (instead of the full table name).
      
      For instance, the following ADQL query:
      
      ```sql
        SELECT *
        FROM tableA AS a NATURAL JOIN tableB AS b;
      ```
      
      should be translated into the following SQL:
      
      ```sql
        SELECT *
        FROM tableA AS a
          INNER JOIN tableB AS b
            ON a.id = b.id
      ```
      
      This commit complete the resolution of the Pull Request #16
      (more details about the issue can be got in there)
      e03e5725
    • gmantele's avatar
      [ADQL] Fix return type of some math. functions for MS-SQLServer. · 73630130
      gmantele authored
      In MS-SQLServer, the following functions return a value of the same
      type as the given argument:
        - abs
        - ceiling
        - degrees
        - floor
        - radians
        - round.
      
      Since ADQL requires that these functions return a DOUBLE
      (i.e. a float in MS-SQLServer), it must be ensured that the given
      argument is a float.
      
      This commit partially fixes the Pull Request #16
      73630130
    • gmantele's avatar
      [ADQL] Throwing a ParseException instead of an Error · a382b251
      gmantele authored
      when an incorrect character that can not be interpreted by
      the JavaCC Token Manager is encountered.
      
      Actually, the TokenMgrError thrown by JavaCC is caught by all
      ADQLParser.parseQuery(...) functions, wrapped inside a ParseException
      which is finally thrown instead of the TokenMgrError. In this way,
      ADQL-Lib users just have to care about a single Throwable:
      ParseException.
      
      Besides the error message has been slightly modified from:
      
      > Lexical error at line 1, column 10.  Encountered: "\u00e9" (233), after : \"\"
      
      to:
      
      > Incorrect character encountered at l.1, c.10: \"\\u00e9\" ('é'), after : \"\"
      
      Thus, the error is more user-friendly, more easy to understand by users.
      Additionally, the incorrect character is displayed, as before, in its unicode
      expression, but also in its character form (instead of an integer value that
      nobody can really understand).
      
      This commit fixes the GitHub issue #17
      a382b251
  11. Aug 24, 2017
  12. Aug 02, 2017
    • gmantele's avatar
      [ADQL,TAP] Basic MySQL support. · cf721ff2
      gmantele authored
      On the contrary to other DBMS, MySQL supports schemas, but as databases.
      Which means that JDBCConnection gets from the JDBC driver that MySQL does
      not support schemas and so it tries to access TAP_SCHEMA tables with a
      'TAP_SCHEMA_' prefix instead of 'TAP_SCHEMA.' one. Since MySQL does
      behave like it supports schemas, JDBCConnection.supportsSchema must be
      set to 'true' if the DBMS is MySQL.
      
      Besides, since no schemas are returned by the JDBC driver
      (cf DatabaseMetadata.listSchema(...)), the function
      JDBCConnection.isSchemaExisting(String, DatabaseMetaData) must always assume
      that the specified schema exists if the DBMS is MySQL. This is particularly
      important when the existence of 'TAP_UPLOAD' must be checked, because if the
      function returns 'false' the library will attempt to create the database/schema
      'TAP_UPLOAD' and will obviously fail due to a lack of permissions. Of course,
      it means that the TAP implementor must create manually the schema/database
      'TAP_UPLOAD' him-/her-self.
      
      The second particularity of MySQL is the quote character for identifiers.
      It is a back-quote (`) instead of a double quote ("). To reflect this
      difference, JDBCTranslator.appendIdentifier(...) has been overwritten in a new
      JDBCTranslator extension: MySQLTranslator.
      
      The translation of all SQL types and mathematical functions have been adapted to
      MySQL according to the online documentation. Few tests have been done locally
      with a tiny database. This seems to work but further testing should be
      performed in order to ensure the stability of this implementation.
      cf721ff2
  13. Jul 05, 2017
  14. Jul 04, 2017
  15. Jun 19, 2017
  16. Jun 01, 2017
    • gmantele's avatar
      [ADQL] Fix nasty infinite loop when wrapping matches with SimpleReplaceHandler. · 66304427
      gmantele authored
      This infinite loop occured only when the replacement object is just
      a wrapping of the matching object ; after replacement, the new object was
      inspected for matching objects.
      
      Example: infinite loop if we want to wrap all foo(...) functions with
               the function ROUND in the following query:
          SELECT foo(foo(123)) FROM myTable
      	     Expected result:
          SELECT ROUND(foo(ROUND(foo(123)))) FROM myTable
      	     But generated result was:
          SELECT ROUND(ROUND(ROUND(......foo(foo(123))))) FROM myTable
      66304427
  17. May 10, 2017
  18. Apr 25, 2017