pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
To: Walter Willmertinger <willmis@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: New 9.5.0100 does not work properly
Date: Mon, 18 Jan 2016 21:38:27 +0900
Message-ID: <569CDCC3.8000104@dream.email.ne.jp> (raw)
In-Reply-To: <CAHbMG0UhFZ8eKJYzPcDH2aAHyDC63dNOELGZDNzK293Jcwq5mQ@mail.gmail.com>
References: <CAHbMG0VOFzJgfLp9EAegRaa7PvP3yhT72_-t18miSyOQn4bn-A@mail.gmail.com>
	<569438B3.10509@aklaver.com>
	<CAHbMG0UhFZ8eKJYzPcDH2aAHyDC63dNOELGZDNzK293Jcwq5mQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

Hi Walter and Heikki,

Probably I found the cause.

On 2016/01/12 17:36, Walter Willmertinger wrote:
> The "Write Conflict" is independent of the setting "row versioning". 
> When I strted it was switched off. I switched to "On", but the same 
> result.
>
> _Here is an excerpt from mylog:_
>
> /[7.065]conn=000001F55B153090, query='SELECT 
> "KundenCode","DatumEreignis","AufnahmeDurchPersonalNr","WeiterAnPersonalNr","Status","Notiz","KdID","Prioritaet","ProgErledigt","update_cs","ZuletztBearbeitetPersonalNr" 
> FROM "public"."Notizen" WHERE "KundenCode" = E'1' AND "KdID" = 83'
> /

Doesn't the target table contain boolean items?
Then the driver has to handle parse and describe message before 
executing the
update query.

> /[8.455]ParseAndDescribeWithLibpq: plan_name= query=UPDATE 
> "public"."Notizen" SET "Notiz"=$1 WHERE "KundenCode" = $2 AND "KdID" = 
> $3 AND "DatumEreignis" = $4 AND "AufnahmeDurchPersonalNr" = $5 AND 
> "WeiterAnPersonalNr" = $6 AND "Status" = $7 AND "Prioritaet" IS NULL 
> AND "ProgErledigt" = $8 AND "update_cs" = $9 AND 
> "ZuletztBearbeitetPersonalNr" IS NULL
> [8.456]conn=000001F55B153090, query='BEGIN'
> [8.457]ParseWithLibpq: plan_name= query=UPDATE "public"."Notizen" SET 
> "Notiz"=$1 WHERE "KundenCode" = $2 AND "KdID" = $3 AND "DatumEreignis" 
> = $4 AND "AufnahmeDurchPersonalNr" = $5 AND "WeiterAnPersonalNr" = $6 
> AND "Status" = $7 AND "Prioritaet" IS NULL AND "ProgErledigt" = $8 AND 
> "update_cs" = $9 AND "ZuletztBearbeitetPersonalNr" IS NULL
> /

But a simple query is issued without using extended protocol because the
*Server side prepare* option is turned off.

> /[8.460]conn=000001F55B153090, query='UPDATE "public"."Notizen" SET 
> "Notiz"=E'Test xxx' WHERE "KundenCode" = E'1' AND "KdID" = 83 AND 
> "DatumEreignis" = E'2015-09-30 13:48:13'::timestamp AND 
> "AufnahmeDurchPersonalNr" = 80 AND "WeiterAnPersonalNr" = 80 AND 
> "Status" = E'E' AND "Prioritaet" IS NULL AND "ProgErledigt" = E'0' AND 
> "update_cs" = E'2015-09-30 13:48:15'::timestamp AND 
> "ZuletztBearbeitetPersonalNr" IS NULL'
> /

/Though this update returns the response 'UPDATE 1', SQLRowCount() doesn't
work as expected due to SC_set_Result() in prepareParameters().

/
> /[8.464]conn=000001F55B153090, query='ROLLBACK'/


*/_One way to avoid the bug is to turn on the *Server side prepare*
option.
Though an appropriate bug fix is not clear to me, the attached
patch is an example.

regards,
Hiroshi Inoue
_/*

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Attachments:

execute.diff (text/plain, 488B) download diff --git a/execute.c b/execute.c index 50abb88..d310ed2 100644 --- a/execute.c +++ b/execute.c @@ -966,6 +966,11 @@ PGAPI_Execute(HSTMT hstmt, UWORD flag) } mylog("prepareParameters was %s called, prepare state:%d\n", shouldParse == nCallParse ? "" : "not", stmt->prepare); + if (shouldParse == nCallParse && + PREPARE_BY_THE_DRIVER == stmt->prepare) + { + SC_set_Result(stmt, NULL); + } if (ipdopts->param_processed_ptr) *ipdopts->param_processed_ptr = 0; /*

view thread (13+ messages)  latest in thread

Message-ID: <569CDCC3.8000104@dream.email.ne.jp>
Permalink:  ../569CDCC3.8000104@dream.email.ne.jp/
Also on:    postgresql.org/message-id/569CDCC3.8000104@dream.email.ne.jp

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: h-inoue@dream.email.ne.jp, willmis@gmail.com, hlinnaka@iki.fi, adrian.klaver@aklaver.com
  Subject: Re: New 9.5.0100 does not work properly
  In-Reply-To: <569CDCC3.8000104@dream.email.ne.jp>
  References: <CAHbMG0VOFzJgfLp9EAegRaa7PvP3yhT72_-t18miSyOQn4bn-A@mail.gmail.com> <569438B3.10509@aklaver.com> <CAHbMG0UhFZ8eKJYzPcDH2aAHyDC63dNOELGZDNzK293Jcwq5mQ@mail.gmail.com> <569CDCC3.8000104@dream.email.ne.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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