Issue Details (XML | Word | Printable)

Key: ODBC-133
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Alexander Potapchenko
Reporter: Gregori Arjona
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ODBC Driver

ODBC v 2.0.0151 returns wrong type of colum in calculated field.

Created: 24/Nov/11 06:28 PM   Updated: 31/May/12 04:55 PM
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.0.1

File Attachments: 1. File SQL.LOG (37 kB)
2. File SQL3.LOG (24 kB)
3. File test.prg (0.9 kB)

Environment: Firebird 2.1.5 (snapshot build) ,Windows 2003 32bit Server, Windows XP Client, Visual Foxpro 8, ODBC 2.0.0151


 Description  « Hide
Test table:

CREATE TABLE TEST (
    ID INTEGER NOT NULL,
    QUANTITY1 INTEGER NOT NULL,
    QUANTITY2 SMALLINT NOT NULL,
    QUANTITY3 NUMERIC(15,2) NOT NULL,
    QUANTITY4 DOUBLE PRECISION NOT NULL
);

data:


INSERT INTO TEST (ID, QUANTITY1, QUANTITY2, QUANTITY3, QUANTITY4) VALUES (1, 1, 2, 3, 4);
INSERT INTO TEST (ID, QUANTITY1, QUANTITY2, QUANTITY3, QUANTITY4) VALUES (2, 22, 34, 23, 12);

Calling this select, odbc returns wrong type of column Q1 and Q2

SELECT SUM(QUANTITY1) AS Q1,SUM(QUANTITY2) AS Q2,SUM(QUANTITY3) AS Q3,SUM(QUANTITY4) AS Q4 FROM TEST

Obc returns q1 and q2 as string

This workaround fix this problem.

SELECT CAST(SUM(QUANTITY1) AS INTEGER) AS Q1,CAST(SUM(QUANTITY2) AS INTEGER) AS Q2,SUM(QUANTITY3) AS Q3,SUM(QUANTITY4) AS Q4 FROM TEST





 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Gregori Arjona added a comment - 24/Nov/11 06:29 PM
ODBC trace

Gregori Arjona made changes - 24/Nov/11 06:29 PM
Field Original Value New Value
Attachment SQL3.LOG [ 12057 ]
Alexander Potapchenko added a comment - 25/Nov/11 01:13 PM
Give me ODBC trace for query
"SELECT CAST(SUM(QUANTITY1) AS INTEGER) AS Q1,CAST(SUM(QUANTITY2) AS INTEGER) AS Q2,SUM(QUANTITY3) AS Q3,SUM(QUANTITY4) AS Q4 FROM TEST" too.
How execute SQL scripts in VF? I have downloaded VF 8 but I can't understand how to reproduce this problem...


Gregori Arjona added a comment - 25/Nov/11 02:57 PM
New ODBC trace doing cast in calculated fields

Gregori Arjona made changes - 25/Nov/11 02:57 PM
Attachment SQL.LOG [ 12058 ]
Gregori Arjona added a comment - 25/Nov/11 02:59 PM
VisualFoxpro 8 sample code

Gregori Arjona made changes - 25/Nov/11 02:59 PM
Attachment test.prg [ 12059 ]
Alexander Potapchenko added a comment - 25/Nov/11 08:57 PM
The type of sum(INTEGER field) is BIGINT In Firebird. VF8 doesn't support BIGINT (for ODBC: SQL_BIGINT) type and it returns this type as string .
You can add BIGINT field and check type without aggregates.

Gregori Arjona added a comment - 28/Nov/11 02:35 PM
Thanks for the info Alexander.

Easysoft ODBC driver and also the mysql driver can adjust the precision for agregated fields, it would be possible to add this option in the ODBC driver for Firebird?

Tanks in advance.

Alexander Potapchenko added a comment - 02/Dec/11 08:34 AM
I don't understand what you want. Give an example please.

Gregori Arjona added a comment - 02/Dec/11 09:30 AM
In mysql odbc controller there is an option called FLAG_NO_BIGINT , this changes BIGINT columns to INT columns because some applications can't handle BIGINT.

http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-connection-parameters.html

Thanks, and sorry for my bad english.

Alexander Potapchenko added a comment - 05/Jan/12 08:37 AM
FLAG_NO_BIGINT is not for following release.

Alexander Potapchenko made changes - 05/Jan/12 08:37 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.0.1 [ 10430 ]
Resolution Won't Fix [ 2 ]
Alexander Potapchenko made changes - 31/May/12 04:55 PM
Status Resolved [ 5 ] Closed [ 6 ]