Thread: psqlodbc 09.05.0210 commit "Don't do premature execution." Numeric Filter issue?

I've been using in production psqlodbc 09.02.0100 (unicode, 32-bit)  for the
last three years. A couple of weeks ago after upgrading a client's server to
the latest PostgreSQL 9.5.2 (32-bit) I thought I would test the latest
psqlodbc 09.05.0210 (unicode, 32-bit) on one of their machines. I hadn't
found any issues with it in my testing, but of course the client found one
straight away...

These are all Windows machines. And I've tested with PostgreSQL 9.4.6
(32-bit) too--no difference.

The issue is when exporting records. Where the older driver 09.02.0100 would
get two records with the given filter, the new driver 09.05.0210 would get
all the records (4419). Nothing different code or data-wise; just switching
the driver version made the difference.

So I went back to the git repository and by dividing and conquering
(download a version, compile, install, test) determined the exact commit
that changed the behavior:

"Don't do premature execution."
https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=e5e048509bada06c61f05901904ddbdda070bd10
<https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=e5e048509bada06c61f05901904ddbdda070bd10>

For testing, I took the latest from git (
https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=f7d5623f538cb94c8e717e3447ab8be93b9cecfb
<https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=f7d5623f538cb94c8e717e3447ab8be93b9cecfb>
), and reverted from it the above commit ("Don't do premature execution.").
That made it easy to test, since doing that put back in the option to
allow/disable premature execution. By leaving "Disable Premature Execution"
unchecked all worked as before.

But note I would have the same issue with older drivers when I went back to
test with them by simply checking the "Disable Premature Execution" box.

I'm hoping someone can examine the two mylogs and see what the problem is. I
suspect a precision issue of some kind, since the filter to export the
records uses datetime columns expressed as a 12-digit pdecimal(12,0) on the
client side, which is stored as numeric(14,0) on the PostgreSQL side. I
tried changing it to numeric(12,0) on the PostgreSQL side, and decimal(12,0)
on the client side too, but no difference.

Compressed the two mylogs are almost 31MB--I can put them somewhere for
download. Each is created by doing a client session to export the records.
The version of the psqlodbc driver used to generate the mylogs is in the
filename.

mylog_psqlodbc_09_02_0100.log exports the two records (using the old
premature execution enabled by default)
mylog_psqlodbc_09_05_0210.log exports 4419 records instead of the expected 2
(premature execution no longer an option)

Thanks...jack



--
View this message in context:
http://postgresql.nabble.com/psqlodbc-09-05-0210-commit-Don-t-do-premature-execution-Numeric-Filter-issue-tp5907625.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


Hi Jack,

On 2016/06/14 5:14, ljwilson wrote:
> I've been using in production psqlodbc 09.02.0100 (unicode, 32-bit)  for the
> last three years. A couple of weeks ago after upgrading a client's server to
> the latest PostgreSQL 9.5.2 (32-bit) I thought I would test the latest
> psqlodbc 09.05.0210 (unicode, 32-bit) on one of their machines. I hadn't
> found any issues with it in my testing, but of course the client found one
> straight away...
>
> These are all Windows machines. And I've tested with PostgreSQL 9.4.6
> (32-bit) too--no difference.
>
> The issue is when exporting records. Where the older driver 09.02.0100 would
> get two records with the given filter, the new driver 09.05.0210 would get
> all the records (4419). Nothing different code or data-wise; just switching
> the driver version made the difference.
>
> So I went back to the git repository and by dividing and conquering
> (download a version, compile, install, test) determined the exact commit
> that changed the behavior:
>
> "Don't do premature execution."
> https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=e5e048509bada06c61f05901904ddbdda070bd10
> <https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=e5e048509bada06c61f05901904ddbdda070bd10>
>
> For testing, I took the latest from git (
> https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=f7d5623f538cb94c8e717e3447ab8be93b9cecfb
> <https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=f7d5623f538cb94c8e717e3447ab8be93b9cecfb>
> ), and reverted from it the above commit ("Don't do premature execution.").
> That made it easy to test, since doing that put back in the option to
> allow/disable premature execution. By leaving "Disable Premature Execution"
> unchecked all worked as before.
>
> But note I would have the same issue with older drivers when I went back to
> test with them by simply checking the "Disable Premature Execution" box.
>
> I'm hoping someone can examine the two mylogs and see what the problem is. I
> suspect a precision issue of some kind, since the filter to export the
> records uses datetime columns expressed as a 12-digit pdecimal(12,0) on the
> client side, which is stored as numeric(14,0) on the PostgreSQL side. I
> tried changing it to numeric(12,0) on the PostgreSQL side, and decimal(12,0)
> on the client side too, but no difference.
>
> Compressed the two mylogs are almost 31MB--I can put them somewhere for
> download.

Could you put them somewhere for download?

regards,
Hiroshi Inoue


Hi Jack,

On 2016/06/14 5:14, ljwilson wrote:
> I've been using in production psqlodbc 09.02.0100 (unicode, 32-bit)  for the
> last three years. A couple of weeks ago after upgrading a client's server to
> the latest PostgreSQL 9.5.2 (32-bit) I thought I would test the latest
> psqlodbc 09.05.0210 (unicode, 32-bit) on one of their machines. I hadn't
> found any issues with it in my testing, but of course the client found one
> straight away...
>
> These are all Windows machines. And I've tested with PostgreSQL 9.4.6
> (32-bit) too--no difference.
>
> The issue is when exporting records. Where the older driver 09.02.0100 would
> get two records with the given filter, the new driver 09.05.0210 would get
> all the records (4419). Nothing different code or data-wise; just switching
> the driver version made the difference.

>
> So I went back to the git repository and by dividing and conquering
> (download a version, compile, install, test) determined the exact commit
> that changed the behavior:
>
> "Don't do premature execution."
> https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=e5e048509bada06c61f05901904ddbdda070bd10
> <https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=e5e048509bada06c61f05901904ddbdda070bd10>
>
> For testing, I took the latest from git (
> https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=f7d5623f538cb94c8e717e3447ab8be93b9cecfb
> <https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=commit;h=f7d5623f538cb94c8e717e3447ab8be93b9cecfb>
> ), and reverted from it the above commit ("Don't do premature execution.").
> That made it easy to test, since doing that put back in the option to
> allow/disable premature execution. By leaving "Disable Premature Execution"
> unchecked all worked as before.
>
> But note I would have the same issue with older drivers when I went back to
> test with them by simply checking the "Disable Premature Execution" box.
>
> I'm hoping someone can examine the two mylogs and see what the problem is. I
> suspect a precision issue of some kind, since the filter to export the
> records uses datetime columns expressed as a 12-digit pdecimal(12,0) on the
> client side, which is stored as numeric(14,0) on the PostgreSQL side. I
> tried changing it to numeric(12,0) on the PostgreSQL side, and decimal(12,0)
> on the client side too, but no difference.
>
> Compressed the two mylogs are almost 31MB--I can put them somewhere for
> download. Each is created by doing a client session to export the records.
> The version of the psqlodbc driver used to generate the mylogs is in the
> filename.
>
> mylog_psqlodbc_09_02_0100.log exports the two records (using the old
> premature execution enabled by default)
> mylog_psqlodbc_09_05_0210.log exports 4419 records instead of the expected 2
> (premature execution no longer an option)

As far as I see the logs, 9.05.0210 seems right.
Is 9.02.0100 really right?

regards,
Hiroshi Inoue


Correct:

9.02.0100 returns 2 records, which is correct (the filter works).
9.05.0210 returns all records (the filter doesn't work).

Thanks...jack



--
View this message in context:
http://postgresql.nabble.com/psqlodbc-09-05-0210-commit-Don-t-do-premature-execution-Numeric-Filter-issue-tp5907625p5908545.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.