[ODBC-100] Get wrong BaseTableName for first column in result with inner join Created: 2017-05-31 Updated: 2018-07-17 |
|
| Status: | Open |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | 2.0.15 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Johannes Wezel | Assignee: | Lawrin Novitsky |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | ADO.NET, BaseTableName, INNER, JOIN, ODBC | ||
| Environment: |
Windows 10 |
||
| Attachments: |
|
| Description |
|
*SQL: * 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: * 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. |
| Comments |
| Comment by Lawrin Novitsky [ 2017-05-31 ] |
|
Thank you for your bug report! Would it be possible to provide ODBC trace for the problem you observe? Or the test case? |
| Comment by Johannes Wezel [ 2017-06-01 ] |
|
I've uploaded the Windows ODBC logfile with the last 2 statements. The second block is my test case with the 'dummy' field. I hope that's the tracefile you want. If not so please let me know. Thank you for your efforts. |
| Comment by Lawrin Novitsky [ 2017-06-01 ] |
|
Hi, |
| Comment by Johannes Wezel [ 2017-06-01 ] |
|
I've tried it with the ODBC 2.0.13, 2.0.14, 2.0.15 and 3.0.0. I have the same issue in all versions. I use currently the 3.0.0 for development because the performance of the 2.0.15 is extremely bad. The DataReader in version 2.0.14 needs for a certain query 10 seconds and the 2.0.15 for the same query 60 seconds. That's the reason why I'm using the 3.0.0 or 2.0.14. I've tried to rename the mawa_device.id to mawa_device.id_d and it works fine. Maybe there is a problem with the JOINs of more tables with same columnnames? Maybe the base table name become filled based on column name only? I've attached a small testcase with 3 tables and test data. The query I used is: SELECT d., g. FROM mawa_device_group_assign as a For mawa_device.id i get the base table name "mawa_group". I hope you can repeat the issue. |
| Comment by Lawrin Novitsky [ 2017-06-01 ] |
|
I would appreciate if you reported that 2.0.15 performance regression in separate jira issue! |
| Comment by Johannes Wezel [ 2017-06-02 ] |
|
You will find the zip-file with the short C# .NET test-application in the attachment. I'm using the following version of visual studio for debugging: Microsoft Visual Studio Professional 2015 My debugger is configured for "Any CPU x64". |
| Comment by Lawrin Novitsky [ 2017-06-02 ] |
|
Thanks! |
| Comment by Lawrin Novitsky [ 2017-06-06 ] |
|
Strange. Connector returns correct BaseTableName, but at the end it is wrong. It has smth to do with same name of columns in device and group tables(id) - if rename it in one of fields, your test passes without errors. |