#300 closed defect (fixed)
Unknow data type bigint in ODBC to MySQL
Reported by: | Javier Portugal | Owned by: | danirus |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | DataBase | Version: | head |
Severity: | normal | Keywords: | |
Cc: |
Description
When consulting over a field of type bigint from a MySql database, TOL raises
a warning:
create table prueba
(
campoUno bigint NOT NULL
);
insert into prueba(45);
In TOL
Set DBTable("select campoUno from prueba");
Gives next warning:
Warning: (Funcion DBTable) La consulta debería devolver un texto, una fecha o
un número en el campo 1
Change History (5)
comment:1 Changed 20 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 20 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Over the same table if we do the next query
Set DBTable("select sum(campoUno) from prueba");
TOL gives the same warning
Warning: (Funcion DBTable) La consulta debería devolver un texto, una fecha o
un número en el campo 1
In this case MySQL type is decimal(41,0) and for 'select const' or select
count(*) used type was bigint.
I know this because of this:
insert into table kk
select sum(campoUno) as res from prueba;
Ant type of fields res in new table kk is decimal(41,0)
comment:3 Changed 20 years ago by
Hi Javier, I just try it on Linux and it works successfully.
Tol Console outputs:
tol> Real DBOpen("TolMySQL", "tol", "tol$0mysql4");
1.000000
tol> Set DBTable("select sum(campoUno) from prueba");
[[ 987654321.000000 ? ]]
Let's see what happens under Windows.
comment:4 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
This bug was fixed a long time ago.
To increase the information around, this is a problem under Windows, using the
TolODBC library.
Under gnu/Linux the problem is also there, but not using TolMySQL Library. We
should check what is wrong using TolMySQL Library under Windows. The performance
is quite under the rate anybody would expect.
Anyway, the bug has been resolved for TolODBC Library.
The error was mainly in a wrong use of targetType parameter, in SQLGetData function.
For BIGINT column type it should be SQL_C_SBIGINT neither SQL_C_DEFAULT, because
of the size of the target type.
Cheers,
Daniel