Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-100

Get wrong BaseTableName for first column in result with inner join

    XMLWordPrintable

    Details

      Description

      *SQL: *
      SELECT d., g.
      FROM device AS d
      INNER JOIN group_assign AS ass ON ass.device_id = d.id
      INNER JOIN group AS g ON ass.group_id = g.id;

      I get the wrong BaseTableName for the first column. In this case i get for the d.id the BaseTableName "group" and if I change the order "SELECT g., d. FROM ..." I get the BaseTableName "device" for the first column g.id.

      Workaround:

      *SQL: *
      SELECT d.id AS dummy, d., g.
      FROM device AS d
      INNER JOIN group_assign AS ass ON ass.device_id = d.id
      INNER JOIN group AS g ON ass.group_id = g.id;

      Now I get for column "dummy" the BaseTableName "group" (see attachment). I guess the first colmun in result always returns the BaseTableName of the second table of the select statement?!

      I tested it with the MySQL ODBC 5.2 driver and the newest MySQL ADO.NET driver and in it works fine in both cases.

        Attachments

        1. ODBC_test_application.zip
          32 kB
        2. ODBC.LOG
          300 kB
        3. testcase.sql
          2 kB
        4. VisualStudio_Screenshot.png
          VisualStudio_Screenshot.png
          31 kB

          Activity

            People

            Assignee:
            Lawrin Lawrin Novitsky
            Reporter:
            jwe Johannes Wezel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration