Details

      Description

      The JDBC escape syntax scalar conversion functions are technically optional but there are inconsistencies and only partial support in the MariaDB Connector/J:

      • The no args override org.mariadb.jdbc.MariaDbDatabaseMetaData#supportsConvert() always returns true
      • However the overloaded and also overridden org.mariadb.jdbc.MariaDbDatabaseMetaData#supportsConvert(int, int) returns false for all from/to SQL types
      • Appendix C.5 of the JDBC 4.2 specification lists several (optional) Conversion Function SQL types
      • org.mariadb.jdbc.internal.util.Utils#replaceFunctionParameter actually does handle implement some of the JDBC convert implementations, primarily by stripping "SQL_" from the SQL type parameter, and then only supporting the server side version of convert()

      Ideally more of the JDBC Conversion Function SQL types could be supported, such as {fn convert(SomeColumn, VARCHAR)} being replaced client side with something like CONCAT(SomeColumn).

      The above was discovered trying to use Lightbend's Slick MySQLProfile with the MariaDB Connector/J. The Slick method .asColumnOf[String] is what invokes the JDBC escape syntax conversion function with a SQL type of VARCHAR.

        Attachments

          Activity

            People

            • Assignee:
              diego dupin Diego Dupin
              Reporter:
              kshakir Khalid Shakir
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: