[ODBC-115] Message wrong. Numeric data type report "String data, right-truncated" Created: 2017-09-22 Updated: 2020-12-08 Resolved: 2017-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | None |
| Affects Version/s: | 2.0.15 |
| Fix Version/s: | 3.0.2, 2.0.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | haijun | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
DB2 linuxamd64 |
||
| Issue Links: |
|
||||||||
| Description |
|
When DB2 using mariadb-connector-odbc-2.0.15-ga-rhel6-x86_64.tar.gz connect to Mariadb 10.0.31, we create a bigint unsigned on maraidb table, insert a data larger than DB2 bigint 9223372036854807, such as 9223372036854809 create table table(col1 bigint unsigned); select * form table(on DB2 which is connected with maraidb via odbc connector) ODBC trace is as following: EXIT SQLFetch with return code 1 (SQL_SUCCESS_WITH_INFO) ENTER SQLGetDiagRec EXIT SQLGetDiagRec with return code 0 (SQL_SUCCESS) We think the error message is wrong, it should be 22003, because the datatype is numeric not Sting data. https://mariadb.com/kb/en/library/sql-99/error-sqlstates/ 22003 data exception-numeric value out of range Suggested error message: "the numeric value <> is too big to fit in the target <>". Often this is the result of an arithmetic overflow — for example, "UPDATE ... SET SMALLINT_COLUMN = 9999999999", or you're trying to retrieve a value of 5 billion into a host variable defined in Pascal as "Word". Fractional truncation won't cause this error, see SQLSTATE 01S07 |
| Comments |
| Comment by Lawrin Novitsky [ 2017-10-04 ] |
|
For numeric overflow we now set SQL state 22003, and return corresponding to this state SQL_ERROR. Also for fractional truncation the sql state is 01S07 now. |