[ODBC-356] Unsused variable leads to unnecessary if condition in ma_string.c (and possibly bugs) Created: 2022-03-16 Updated: 2022-04-25 Resolved: 2022-04-25 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | General |
| Affects Version/s: | 3.1.15 |
| Fix Version/s: | 3.1.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | Robert Pellmann | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
In the file https://github.com/mariadb-corporation/mariadb-connector-odbc/blob/master/ma_string.c there a two lines who contradict each other: As far as i can tell the value of flag should depend on the values of PrimaryCount and/or UniqueCount, to avoid to compare all columns and not just the primary key/unique columns. A quick fix is to set the value of Flag prior to the for loop (line 262):
I have attached a "corrected" version of ma_string.c for comparison. |
| Comments |
| Comment by Lawrin Novitsky [ 2022-03-22 ] |
|
Thank you for your report. I suspect that was at some deliberately left like this. But it's apparently the time to fix it |
| Comment by Lawrin Novitsky [ 2022-03-23 ] |
|
Exactly as I remembered - some tests are failing. So, it's not just this. |
| Comment by Lawrin Novitsky [ 2022-04-25 ] |
|
Fixed support of unique indexes for positioned operations The report is talking only about code creating WHERE clause, but that was not enough to make it work. Some optimizations ere done along the way to reduce number of calls to collect required metadata. Index information is also preserved for that purpose(reducing number of queries to collect metadata). |