[ODBC-64] Out of Memory using Connector with ADO Created: 2016-11-02 Updated: 2017-02-26 Resolved: 2017-02-26 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | 2.0.12, 2.0.13 |
| Fix Version/s: | 2.0.14, 3.0.1 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Markus | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | ADO, BLOB, LONGBLOB, OLEDB | ||
| Environment: |
Windows 32-bit |
||
| Attachments: |
|
| Description |
|
I've tried to migrate an C++/ADO (not ADO.NET) project from MySQL to MariaDB. While it was easy to replace the MySQL server, I've found a problem with the MariaDB ODBC connector. Access to the MariaDB is done by the OLEDB to ODBC bridge (MSDASQL). The ADO connection string is something like "Provider=MSDASQL;DSN=TestMariaOdbc". While querying tables with simple fields works as expected, I wasn't able to read values from LONGBLOB columns. The table in question has two columns: id (int), data (longblob). Selecting a row by the id with a data-value of about 2000 bytes leads to the following error:
While performing the query, the memory consumed by the process rapidly grows to more then 1 GB. The same worked with the latest MySQL ODBC driver (5.3.6). I guess that MariaDB ODBC Connector reports at some point the column size (4GB) instead of the actual data size (2KB) and the ODBC bridge tries to allocate an appropriate buffer... |
| Comments |
| Comment by Lawrin Novitsky [ 2016-11-02 ] |
|
Thank you for your report! |
| Comment by Markus [ 2016-11-03 ] |
|
I've attached a small demo project (Visual Studio 10). The project contains an SQL script to create the table and insert a record. You could use a DSN or DSN-less connection to the database. With this project, It should be easy to create an ODBC trace. Unfortunately there is no documentation about tracing:
|
| Comment by Lawrin Novitsky [ 2017-02-26 ] |
|
Sorry, I have finally got back to your bug report. Running your testcase against latest repository version of MariaDB C/ODBC, I get "Unsupported Variant Type: 8209" exception in the getAsString, while I can see "Hello world" inside variant value. And I in the ODBC trace(of running your testcase) there is nothing suspicious - it shows, that the application could safely SQLGetData 11 bytes of "Hello world" from the connector. |
| Comment by Lawrin Novitsky [ 2017-02-26 ] |
|
As for connector's debug log. In dsn-less connection it is turned on by setting bit 4 of OPTION/OPTIONS connection string option. It is stored in ENV {TMP}or ENV {USERPROFILE}(on WIndows). But it's not intended for wide use. What I asked you, and that is sufficient in 99% of cases, is ODBC trace, that can be turned on in ODBC Data Source Administrator on the tab Tracing. |