close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 20 years ago

Closed 18 years ago

Last modified 13 years ago

#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 danirus

Resolution: fixed
Status: newclosed

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

comment:2 Changed 20 years ago by Javier Portugal

Resolution: fixed
Status: closedreopened

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 danirus

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 danirus

Resolution: fixed
Status: reopenedclosed

This bug was fixed a long time ago.

comment:5 Changed 13 years ago by Jorge

(In [4537]) fixes #1503, refs #1022,#983,#300,#296, BIGINT is returned as SQL_C_CHAR then converted to Real

Note: See TracTickets for help on using tickets.