Skip to content
  1. Sep 11, 2017
  2. 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
  3. Aug 24, 2017
  4. 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
  5. Jul 05, 2017
  6. Jul 04, 2017
  7. Jun 19, 2017
  8. 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
  9. May 10, 2017
  10. Apr 25, 2017
  11. Apr 20, 2017
  12. Apr 04, 2017
  13. Apr 03, 2017
  14. Mar 29, 2017
  15. Mar 17, 2017
  16. Mar 16, 2017
  17. Mar 15, 2017
  18. Mar 13, 2017