pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedFetch next with ODBC driver 09.05.0100 yields wrong/duplicate results
2+ messages / 2 participants
[nested] [flat]
* Fetch next with ODBC driver 09.05.0100 yields wrong/duplicate results
@ 2016-07-01 16:35 Koenig, Michael <Michael.Koenig@blue-yonder.com>
0 siblings, 1 reply; 2+ messages in thread
From: Koenig, Michael @ 2016-07-01 16:35 UTC (permalink / raw)
To: pgsql-odbc
Hi there!
While developing turbodbc, a Python database driver for unixodbc, I encountered some difficulties when testing it with PostgreSQL.
System: Ubuntu 14.04
PostgreSQL ODBC driver version: 09.05.0100-2.pgdg14.04+1 (following instructions from http://tecadmin.net/install-postgresql-server-on-ubuntu/)
PostgreSQL server version: psql 9.5.3, server 9.3.13
Debug log: Cannot manage to activate it… (TraceFile does not work)
What I do (summary):
· Create a table on the database with 102 ascending integers (1-102)
· Connect to PostgreSQL via unixodbc 2.2.14
· Prepare and execute a statement
· Bind a buffer which holds 1000 64 bit integer elements
· Bind variable to hold number of returned elements
· Use SQLFetchScroll to fetch data with SQL_FETCH_NEXT
The test should return a total of 102 values.
What I get:
All tests ran on Ubuntu 14.04.
Output with odbc-postgresql package in version odbc-postgresql=1:09.02.0100-2ubuntu1 (Ubuntu official mirror):
102 elements
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102]
Output with odbc-postgresql=1:09.05.0100-2.pgdg14.04+1 (following instructions from http://tecadmin.net/install-postgresql-server-on-ubuntu/):
203 elements
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102]
In between the runs, the only difference is that I run sudo apt-get install odbc-postgresql=1:09.05.0100-2.pgdg14.04+1 to upgrade the ODBC driver.
The magic numbers used here (102 integers, 100 element buffer) are not too important. I can reproduce the error (with slightly different outcome) with other buffer sizes, including some smaller than the size of the result set. 12 is the smallest buffer size to reproduce the error. I need at least 102 integers to reproduce the problem.
Here is some output with 102 integers and a buffer size of 12:
108 elements
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1, 2, 3, 4, 5, 6, 7]
I have tested my code with a number of databases and a number of ODBC drivers on a number of Linux systems, and this ODBC driver is the only one which shows the problem.
Hope you can help me or point me to an entry in the change log which explains the changed behavior.
Kind regards
Michael
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Fetch next with ODBC driver 09.05.0100 yields wrong/duplicate results
@ 2016-07-02 02:03 Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
parent: Koenig, Michael <Michael.Koenig@blue-yonder.com>
0 siblings, 0 replies; 2+ messages in thread
From: Inoue, Hiroshi @ 2016-07-02 02:03 UTC (permalink / raw)
To: Koenig, Michael <Michael.Koenig@blue-yonder.com>; +Cc: pgsql-odbc
Hi Michael,
Could you please try 9.05.0200 or later?
regards,
Hiroshi inoue
On 2016/07/02 1:35, Koenig, Michael wrote:
>
> Hi there!
>
> While developing turbodbc, a Python database driver for unixodbc, I
> encountered some difficulties when testing it with PostgreSQL.
>
> System: Ubuntu 14.04
>
> PostgreSQL ODBC driver version: 09.05.0100-2.pgdg14.04+1 (following
> instructions from
> http://tecadmin.net/install-postgresql-server-on-ubuntu/)
> <http://tecadmin.net/install-postgresql-server-on-ubuntu/%29;
>
> PostgreSQL server version: psql 9.5.3, server 9.3.13
>
> Debug log: Cannot manage to activate it… (TraceFile does not work)
>
> What I do (summary):
>
> ·Create a table on the database with 102 ascending integers (1-102)
>
> ·Connect to PostgreSQL via unixodbc 2.2.14
>
> ·Prepare and execute a statement
>
> ·Bind a buffer which holds 1000 64 bit integer elements
>
> ·Bind variable to hold number of returned elements
>
> ·Use SQLFetchScroll to fetch data with SQL_FETCH_NEXT
>
> The test should return a total of 102 values.
>
> What I get:
>
> All tests ran on Ubuntu 14.04.
>
> Output with odbc-postgresql package in version
> odbc-postgresql=1:09.02.0100-2ubuntu1 (Ubuntu official mirror):
> 102 elements
>
> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
> 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
> 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
> 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
> 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
> 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102]
>
> Output with odbc-postgresql=1:09.05.0100-2.pgdg14.04+1 (following
> instructions from
> http://tecadmin.net/install-postgresql-server-on-ubuntu/)
> <http://tecadmin.net/install-postgresql-server-on-ubuntu/%29;:
>
> 203 elements
>
> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
> 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
> 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
> 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
> 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
> 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1, 2, 3, 4,
> 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
> 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
> 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
> 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
> 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102]
>
> In between the runs, the only difference is that I run sudo apt-get
> install odbc-postgresql=1:09.05.0100-2.pgdg14.04+1 to upgrade the ODBC
> driver.
>
> The magic numbers used here (102 integers, 100 element buffer) are not
> too important. I can reproduce the error (with slightly different
> outcome) with other buffer sizes, including some smaller than the size
> of the result set. 12 is the smallest buffer size to reproduce the
> error. I need at least 102 integers to reproduce the problem.
>
> Here is some output with 102 integers and a buffer size of 12:
>
> 108 elements
>
> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
> 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
> 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
> 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
> 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
> 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1, 2, 3, 4,
> 5, 6, 7]
>
> I have tested my code with a number of databases and a number of ODBC
> drivers on a number of Linux systems, and this ODBC driver is the only
> one which shows the problem.
>
> Hope you can help me or point me to an entry in the change log which
> explains the changed behavior.
>
> Kind regards
>
> Michael
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-07-02 02:03 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01 16:35 Fetch next with ODBC driver 09.05.0100 yields wrong/duplicate results Koenig, Michael <Michael.Koenig@blue-yonder.com>
2016-07-02 02:03 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox