From: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-odbc@postgresql.org
Subject: Re: SQL_DATA_AT_EXEC processing broken for large objects in nightly git
Date: Tue, 17 Nov 2015 11:35:07 +0900
Message-ID: <564A925B.9040809@dream.email.ne.jp> (raw)
In-Reply-To: <5643255C.2060207@dream.email.ne.jp>
References: <561F954E.7020808@serena.com>
<5639B85F.7030408@dream.email.ne.jp>
<5639E621.1020505@iki.fi>
<563A159A.5080104@dream.email.ne.jp>
<5640892B.7060700@iki.fi>
<5643255C.2060207@dream.email.ne.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
Hi Heikki,
The attached patch seems to fix all but I don't understand
sqltype_to_bind_pgtype() well.
Comments?
regards,
Hiroshi Inoue
On 2015/11/11 20:24, Inoue, Hiroshi wrote:
> On 2015/11/09 20:53, Heikki Linnakangas wrote:
>> On 11/04/2015 04:26 PM, Inoue, Hiroshi wrote:
>>>
>>>
>>> On 2015/11/04 20:04, Heikki Linnakangas wrote:
>>>> On 11/04/2015 09:48 AM, Inoue, Hiroshi wrote:
>>>>> Hi,
>>>>> To
>>>>> I was able to reproduce it here.
>>>>> Because I can't understand the current code at once, please give
>>>>> me some
>>>>> time
>>>>> to solve the problem.
>>>>
>>>> I also started looking at this last week, and came up with a patch
>>>> that I think fixes it, but I got distracted before completing it and
>>>> replying here. So here's what I came up with...
>>>
>>> The solution seems to generate 2 transactions for 1 insertion.
>>
>> Hmm, you're right, although that doesn't seem to be a new issue. The
>> 09.03.0400 driver does the same, see attached logs from
>> log_statements=all. Would be nice to fix that, but it's a separate
>> issue.
>
> Oh you are right. I will examine it.
>
>>
>>
>>> The insertion seems to be rejected when ByteaAsLongVarBinary=1.
>>
>> Oh. It works for me. How are you testing that?
>
> I define LO type and set ByteaAsLongVarBinary=1.
> The failure is #ERROR: column "large_data" is of type LO but
> expression is type "bytea" .
>
> 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-odbcAttachments:lobj.patch (text/x-diff, 1.6K) downloaddiff --git a/convert.c b/convert.cindex 8802e6e..6756276 100644--- a/convert.c+++ b/convert.c@@ -4116,14 +4116,12 @@ inolog("ipara=%p paramType=%d %d proc_return=%d\n", ipara, ipara ? ipara->paramT
}
else if (!handling_large_object)
{
- CVT_APPEND_CHAR(qb, '?');- return SQL_SUCCESS;+ /* shouldn't happen */+ qb->errormsg = "unexpected NULL parameter value";+ qb->errornumber = STMT_EXEC_ERROR;+ return SQL_ERROR;
}
- /* shouldn't happen */- qb->errormsg = "unexpected NULL parameter value";- qb->errornumber = STMT_EXEC_ERROR;- return SQL_ERROR;
}
/* replace DEFAULT with something we can use */
diff --git a/execute.c b/execute.cindex 111230b..2e0977a 100644--- a/execute.c+++ b/execute.c@@ -1340,17 +1340,6 @@ PGAPI_ParamData(HSTMT hstmt,
if (estmt->lobj_fd >= 0)
{
odbc_lo_close(conn, estmt->lobj_fd);
-- /* commit transaction if needed */- if (!CC_cursor_count(conn) && CC_does_autocommit(conn))- {- if (!CC_commit(conn))- {- SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction", func);- retval = SQL_ERROR;- goto cleanup;- }- }
estmt->lobj_fd = -1;
}
diff --git a/pgtypes.c b/pgtypes.cindex 167966f..b90e69b 100644--- a/pgtypes.c+++ b/pgtypes.c@@ -1285,13 +1285,6 @@ sqltype_to_bind_pgtype(const ConnectionClass *conn, SQLSMALLINT fSqlType)
pgType = PG_TYPE_INT4;
break;
- case SQL_LONGVARBINARY:- if (ci->bytea_as_longvarbinary)- pgType = PG_TYPE_BYTEA;- else- pgType = conn->lobj_type;- break;-
case SQL_REAL:
pgType = PG_TYPE_FLOAT4;
break;
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, hlinnaka@iki.fi
Subject: Re: SQL_DATA_AT_EXEC processing broken for large objects in nightly git
In-Reply-To: <564A925B.9040809@dream.email.ne.jp>
References: <561F954E.7020808@serena.com> <5639B85F.7030408@dream.email.ne.jp> <5639E621.1020505@iki.fi> <563A159A.5080104@dream.email.ne.jp> <5640892B.7060700@iki.fi> <5643255C.2060207@dream.email.ne.jp> <564A925B.9040809@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