This is an automated email from the git hooks/post-receive script. ebourg-guest pushed a commit to tag REL8_2_507 in repository libpostgresql-jdbc-java.
commit 53c168210c9bb9f18b261bb9515f6736cc0a784e Author: Kris Jurka <[email protected]> Date: Mon Sep 24 12:34:15 2007 +0000 When doing batch execution we can have multiple Parse and DescribeStatement messages on the wire at the same time. When we finally get around to collecting the DescribeStatement results we must check whether they still apply to the currently parsed query. Otherwise we'll overwrite our type information with stale data that will cause failures down the line. With debugging assistance from Eric Faulhaber. --- org/postgresql/core/v3/QueryExecutorImpl.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/org/postgresql/core/v3/QueryExecutorImpl.java b/org/postgresql/core/v3/QueryExecutorImpl.java index 2734c12..bb75d89 100644 --- a/org/postgresql/core/v3/QueryExecutorImpl.java +++ b/org/postgresql/core/v3/QueryExecutorImpl.java @@ -4,7 +4,7 @@ * Copyright (c) 2004, Open Cloud Limited. * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v 1.32 2006/11/02 15:31:14 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v 1.33 2006/12/01 08:53:45 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -920,7 +920,7 @@ public class QueryExecutorImpl implements QueryExecutor { pgStream.Send(encodedStatementName); // Statement name pgStream.SendChar(0); // end message - pendingDescribeStatementQueue.add(new Object[]{query, params, new Boolean(describeOnly)}); + pendingDescribeStatementQueue.add(new Object[]{query, params, new Boolean(describeOnly), query.getStatementName()}); } private void sendExecute(Query query, Portal portal, int limit) throws IOException { @@ -1194,13 +1194,22 @@ public class QueryExecutorImpl implements QueryExecutor { SimpleQuery query = (SimpleQuery)describeData[0]; SimpleParameterList params = (SimpleParameterList)describeData[1]; boolean describeOnly = ((Boolean)describeData[2]).booleanValue(); + String origStatementName = (String)describeData[3]; int numParams = pgStream.ReceiveIntegerR(2); for (int i=1; i<=numParams; i++) { int typeOid = pgStream.ReceiveIntegerR(4); params.setResolvedType(i, typeOid); } - query.setStatementTypes((int[])params.getTypeOIDs().clone()); + + // Since we can issue multiple Parse and DescribeStatement + // messages in a single network trip, we need to make + // sure the describe results we requested are still + // applicable to the latest parsed query. + // + if ((origStatementName == null && query.getStatementName() == null) || (origStatementName != null && origStatementName.equals(query.getStatementName()))) { + query.setStatementTypes((int[])params.getTypeOIDs().clone()); + } if (describeOnly) doneAfterRowDescNoData = true; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

