[ODBC-51] SQLTables fails with HY090 "Invalid string or buffer length" Created: 2016-09-02 Updated: 2016-09-08 Resolved: 2016-09-08 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | 2.0.11 |
| Fix Version/s: | 2.0.12 |
| Type: | Bug | Priority: | Major |
| Reporter: | Anders Karlsson | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux x86_64 CentOS 6.5 |
||
| Description |
|
Calling SQLTables fails with an error on invalid string error. It seems that it's the TABLE_COMMENT / REMARK column that fails in MADB_ConvertAnsi2Unicode. This has been tested and reproduces with MariaDB 10.2.1 and with MariaDB ColumnStore 1.0.2, but not on MariaDB 10.1.16. Looking at the ODBC Driver sources, I see that the REMARK column is sometimes mapped to NULL and sometimes to TABLE_COMMENT. As the ODBC driver is really important for MariaDB ColumnStore, this is significant. Running Business Objects on MariaDB CS is, due to this issue, not possible at this point in time.The following code illustrates the issue.
|
| Comments |
| Comment by Lawrin Novitsky [ 2016-09-04 ] |
|
I could repeat it with 10.1.17. So it is not 10.2 specific |
| Comment by Anders Karlsson [ 2016-09-04 ] |
|
Good. There sure seems to be something odd with this in that it appears sometimes and sometimes not. Might it be an issue with C/C even? I have done a fair amount of testing with this and it seems that mysql_stmt_bind_result returns odd data for the TABLE_COMMENT column. |
| Comment by Lawrin Novitsky [ 2016-09-04 ] |
|
Well, my first intention was to answer "no, that is own c/odbc problem", but then had decided to leave some chances for c/c as well |
| Comment by Lawrin Novitsky [ 2016-09-08 ] |
|
Refined description is "If application binds column as SQL_C_WCHAR, connector would return error on fetch operation if that column contained empty string". The patch and testcase have been pushed. Next release is 2.0.12. Not sure if SQLGetData was affected, but testcase covers it, too. Patch also fixes tangent problem with SQL_C_WCHAR buffer binding. In case application didn't provide buffer or passes its length is 0, e.g. wanting to get length of available data first, connector would return 0 in StrLen pointer. |