Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-760

Cannot insert into a table named "position"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Cannot Reproduce
    • 2.5.4
    • N/A
    • MySQL compatibility
    • None
    • Linux, Java 11, Spring/JPA/Hibernate

    Description

      We are using a MySQL 5.6 compatible DB (AWS Aurora Serverless 5.6.10a) and have a table named "position".
      Until now, we used the MySQL connector and had no issues accessing that table.
      Recently we tried to switch to MariaDB Connector/J 2.5.4 and encountered a surprising issue:

      While selecting from or updating that table works fine using MariaDB Connector/J, inserting into the "position" table raises the error:

      java.sql.SQLSyntaxErrorException: (conn=106) 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 'position (asset_name, [...]

      The issue is that the table is named "position", though "position" does not seem to be a reserved keyword in either MariaDB or MySQL (according to online docs). Also it's weird that selecting and updating works but not inserting...

      We could of course work around this by putting position in ticks (`position`) or by renaming the table but it struck us as weird and maybe it's a bug in MariaDB Connector/J.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            sbrandt Sebastian Brandt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.