Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.0.15
-
None
-
None
-
DB2 linuxamd64
MariaDB v10
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);
insert into table values(9223372036854809);
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)
HSTMT 0x0069f960
ENTER SQLGetDiagRec
SQLSMALLINT 3
SQLHANDLE 0x0069f960
SQLSMALLINT 1
SQLCHAR * 0x5c2c285e (NYI)
SQLINTEGER * 0x5c2c2058
SQLCHAR * 0x5c2c205c (NYI)
SQLSMALLINT 1025
SQLSMALLINT * 0x5c2c1f12
EXIT SQLGetDiagRec with return code 0 (SQL_SUCCESS)
SQLSMALLINT 3
SQLHANDLE 0x0069f960
SQLSMALLINT 1
SQLCHAR * 0x5c2c285e [ 5] "01004"
SQLINTEGER * 0x5c2c2058 (0)
SQLCHAR * 0x5c2c205c [ 56] "[ma-2.0.15][10.0.31-MariaDB]String data, right-truncated"
SQLSMALLINT 1025
SQLSMALLINT * 0x5c2c1f12 (56)
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
Attachments
Issue Links
- blocks
-
MDEV-13857 Use the 10.2 libmariadb in 10.3
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue blocks |
Fix Version/s | 2.0.16 [ 22643 ] | |
Fix Version/s | 3.0.2 [ 22603 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB connectors [ 82714 ] | MariaDB v3 [ 84070 ] |
Labels | need_feedback |
Workflow | MariaDB v3 [ 84070 ] | MariaDB v4 [ 135443 ] |
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.
The fix and the testcase have been pushed to the odbc-2.0 branch as commit 69d2299ed5c0182b3a5e32b3d268ac05050011ff, and to the odbc-3.0 - as f7904119868ed012cfca30f186d1c3fe5c750548