[ODBC-322] Binding floating point value as SQL_NUMERIC errors on fetch Created: 2021-06-09 Updated: 2021-06-09 |
|
| Status: | Open |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | 3.1.12 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Tom Hughes | Assignee: | Lawrin Novitsky |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Taking SQL like this:
and binding the result column as SQL_NUMERIC with a scale of 1 causes the subsequent fetch to fail with:
debugging the driver it seems that the server considers that column as floating point and the error is being triggered here: https://github.com/mariadb-corporation/mariadb-connector-odbc/blob/master/ma_statement.c#L1861 the value of buffer_length is 40 set internally by the driver based on the maximum length it expects for a numeric when written as a string while max_length is 300. This happens with both MariaDB and MySQL as the server but only with the MariaDB ODBC driver - it doesn't happen with either database with the MySQL driver. |