Hi there,
I’ve debugging for hours and struggling with a BigInt column in MySQL which (sometimes) returns wrong value.
I hope someone has an idea !
This is the table (partial) definition:
CREATE TABLE `product` (
`id` bigint NOT NULL,
`supplierId` bigint DEFAULT '-1',
`typeId` bigint DEFAULT '-1’,
`categId` bigint DEFAULT '-1’,
. . .
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Looking at the data with MySQLWorkbench or with Navicat I have the following values in the table:
id= 948008
supplierId= 16008
typeId= 1000
categId= -1
This is how I read the value:
Dim sql As String = "SELECT * FROM product WHERE id=?"
Dim rs As RowSet
Try
rs = db.SelectSQL(sql, 948008)
. . .
Catch error As DatabaseException
. . .
End Try
Dim id As Integer = rs.Column("id").Int64Value
Dim supplierId As Integer = rs.Column("supplierId").Int64Value
Dim typeId As Integer = rs.Column("typeId").Int64Value
Dim categoryId As Integer = rs.Column("categoryId").Int64Value
. . .
After reading the values, the result is:
id= 948008
supplierId= 16008
typeId= 0 <------ !!
categId= -1
AFAIK the error occurs for this column, in this table only, but DB has over 200 tables, with plenty of BigInt columns, and millions of records, there are probably other similar errors.
My config:
macOS 10.15.7 (Catalina)
MySQL DB version: 8.0.27 (MySQL Community Server - GPL), on dev system (localhost)
Xojo 2021r3.1
Xojo MySQL plugin using API 2 (not using MBS here)
Build for macOS x86 64-bit
Thanks for reading so far