X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4B11D3A1D95 for ; Fri, 29 Oct 2004 15:37:15 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52479-04 for ; Fri, 29 Oct 2004 14:37:07 +0000 (GMT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by svr1.postgresql.org (Postfix) with ESMTP id 4999A3A1D94 for ; Fri, 29 Oct 2004 15:37:08 +0100 (BST) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id i9TEb3ZA004983; Fri, 29 Oct 2004 10:37:03 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9TEawr28102; Fri, 29 Oct 2004 10:36:58 -0400 Received: from goodeats.boston.redhat.com (IDENT:U2FsdGVkX1+ylT5XgW0cTP1BqOPVRyCb+X+AdKtWKAw@goodeats.boston.redhat.com [172.16.80.95]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id i9TEauFE027522; Fri, 29 Oct 2004 10:36:56 -0400 Subject: Re: \0 and IllegalArgumentException From: Jon Orris Reply-To: jorris@redhat.com To: vadimn@redhat.com Cc: pgsql-jdbc@postgresql.org, sebster@sebster.com In-Reply-To: <200410291024.03718@vadim.nasardinov> References: <1099043710.595.50.camel@localhost> <200410291024.03718@vadim.nasardinov> Content-Type: text/plain Organization: Red Hat Date: Fri, 29 Oct 2004 10:36:57 -0400 Message-Id: <1099060617.1377.3.camel@goodeats.boston.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-1) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/308 X-Sequence-Number: 11413 On Fri, 2004-10-29 at 10:24 -0400, Vadim Nasardinov wrote: > | test=> select str, length(str) as length from dropme; > | str | length > | -------+-------- > | Hello | 5 > | (1 row) > | > | test=> select str, length(str) as length from dropme where str like '%world'; > | str | length > | -------+-------- > | Hello | 5 > | (1 row) > | > | test=> select str, length(str) as length from dropme where str like '%Welt'; > | str | length > | -----+-------- > | (0 rows) > Not sure how the latest version behaves. I get slightly different results from 7.4.5. The string is still truncated, but the length is correct: jorris=# select str, length(str) as length from dropme; str | length -------+-------- Hello | 11 (1 row) jorris=# select str, length(str) as length from dropme where str like '% world'; str | length -------+-------- Hello | 11 (1 row) jorris=# select substring(version(), 1, 20) as version; version ---------------------- PostgreSQL 7.4.5 on (1 row)