pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jure Koren <jure@hehe.si>
To: pgsql-jdbc@postgresql.org
Subject: Re: dollar quoting
Date: Tue, 3 Oct 2006 19:03:32 +0200
Message-ID: <200610031903.32618.jure@hehe.si> (raw)
In-Reply-To: <200610031900.26121.jure@hehe.si>
References: <200610031754.38595.jure@hehe.si>
	<200610031900.26121.jure@hehe.si>

On Tuesday 03 October 2006 19:00, Jure Koren wrote:
> Well, it's really not that big, so here it is.

And, naturally, I attached the one that is broken.

Here it is, again.

-- 
Jure Koren, unix developer
Hehe d.o.o.

Attachments:

postgresql-jdbc-dollarquote.diff (text/x-diff, 1.3K) download diff -ru postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3/QueryExecutorImpl.java postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryExecutorImpl.java --- postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3/QueryExecutorImpl.java 2006-10-03 18:01:47.000000000 +0200 +++ postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryExecutorImpl.java 2006-10-03 18:42:03.000000000 +0200 @@ -99,6 +99,39 @@ } break; + case '$': + if (inDoubleQuotes || inSingleQuotes) + break; + int pos = query.indexOf('$', i+1); + if (pos < 0) + break; + String tag = query.substring(i+1, pos); + String nexttag = new StringBuilder(tag).insert(0, "$").append("$").toString(); + //System.out.println("next tag = (" + nexttag + ")"); + //System.out.println("begin =\n(" + query.substring(i-10, pos+10) + ")"); + int nextpos = query.indexOf(nexttag, pos+1); + if (nextpos < 0) + break; + i = nextpos + tag.length() + 2; + //System.out.println("end =\n(" + query.substring(i-10, i+tag.length()+10) + ")"); + break;

view thread (13+ messages)  latest in thread

Message-ID: <200610031903.32618.jure@hehe.si>
Permalink:  ../200610031903.32618.jure@hehe.si/
Also on:    postgresql.org/message-id/200610031903.32618.jure@hehe.si

 ·  · 

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-jdbc@postgresql.org
  Cc: jure@hehe.si
  Subject: Re: dollar quoting
  In-Reply-To: <200610031903.32618.jure@hehe.si>
  References: <200610031754.38595.jure@hehe.si> <200610031900.26121.jure@hehe.si> <200610031903.32618.jure@hehe.si>

* 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