Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLXxZ-0003p2-2E for pgsql-jdbc@postgresql.org; Tue, 09 Oct 2012 11:26:49 +0000 Received: from news.hub.org ([200.46.204.72]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLXxU-0005J3-UG for pgsql-jdbc@postgresql.org; Tue, 09 Oct 2012 11:26:48 +0000 Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.5/8.14.5) with ESMTP id q99BQg9x063574 for ; Tue, 9 Oct 2012 08:26:43 -0300 (ADT) (envelope-from news@news.hub.org) Received: from news.hub.org (news@localhost) by news.hub.org (8.14.5/8.14.5/Submit) with NNTP id q99BF1GX056516 for pgsql-jdbc@postgresql.org; Tue, 9 Oct 2012 08:15:01 -0300 (ADT) (envelope-from news) Received: by 10.224.117.143 with SMTP id r15mr14543999qaq.1.1349781301132; Tue, 09 Oct 2012 04:15:01 -0700 (PDT) Received: by 10.52.71.82 with SMTP id s18mr856565vdu.9.1349781301080; Tue, 09 Oct 2012 04:15:01 -0700 (PDT) X-Newsgroups: pgsql.interfaces.jdbc Date: Tue, 9 Oct 2012 04:15:00 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=62.225.145.235; posting-account=_tU_vwoAAACwUUJQArOUoVkbTF2SYToU References: <31630_1348140231_505AFCC7_31630_19463_1_E4DFA2E3210FA443B032684B39D16BB4092FB05DA1@THSNCOA06MXS02P.ONE-06.GRP> <00f501cd9bf7$57195dc0$054c1940$@yahoo.com> <5077_1348672047_50631A2F_5077_14708_1_E4DFA2E3210FA443B032684B39D16BB4092FB673D5@THSNCOA06MXS02P.ONE-06.GRP> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9945522a-bc49-44e4-906b-cfdacc801b41@googlegroups.com> Subject: Re: Bug in AbstracJdbc2Statement.replaceProcessing when using dollar quoting? From: marc.mg75@googlemail.com Injection-Date: Tue, 09 Oct 2012 11:15:01 +0000 Content-Type: text/plain; charset=ISO-8859-1 To: pgsql-jdbc@postgresql.org X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201210/31 X-Sequence-Number: 23355 Am Donnerstag, 27. September 2012 15:02:28 UTC+2 schrieb Florent Guillaume: > Oracle is well known for its V$SESSION and other similar tables. Hi, even if Oracle uses V$SESSIONs, the $ here is not at the beginning, and it also does not fit the sql standard. I made a small patch doing what was said above. While parsing the sql code it checks if there is a $ while in the state IN_SQLCODE, if so it stops the parsing and returns the original sql. I ran the testsuite and it passed with no error. I also checked my example and the result returned is what would be expected. --- /org/postgresql/jdbc2/AbstractJdbc2Statement.java_orig Tue Oct 09 10:25:10 2012 +++ /org/postgresql/jdbc2/AbstractJdbc2Statement.java Tue Oct 09 10:31:50 2012 @@ -895,6 +895,7 @@ int len = p_sql.length(); StringBuffer newsql = new StringBuffer(len); int i=0; + try { while (i