Re: BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename
Дата
Msg-id Pine.BSO.4.56.0405241359430.1159@leary.csoft.net
обсуждение исходный текст
Ответ на BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Список pgsql-bugs
On Sat, 22 May 2004, PostgreSQL Bugs List wrote:

>
> The following bug has been logged online:
>
> Logged by:          David Brownlee
> Email address:      abs@mono.org
> PostgreSQL version: 7.4
> Description:        AbstractJdbc2ResultSet:parseQuery ; in tablename
> Details:
>
>
> In AbstractJdbc2ResultSet:parseQuery can end up leaving a ; on the end of a
> tablename, which when later used in isUpdateable() will choke.
> The following 'fixes' it:
>
> --- org/postgresql/jdbc2/AbstractJdbc2ResultSet.java.orig       2004-05-21
> 12:54
> :29.000000000 +0100
> +++ org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
> @@ -1448,7 +1450,7 @@ public abstract class AbstractJdbc2Resul
>                         {
>                                 if (name.toLowerCase().equals("from"))
>                                 {
> -                                       tableName = st.nextToken();
> +                                       tableName =
> st.nextToken().replaceAll(";
> ", "");
>                                         tableFound = true;
>                                 }
>
> This was found while writing a small java tool to copy the contents of one
> database to another, which can be provided to demonstrate the problem on
> request. Would have attached it here if there had been an option :)
>

This isn't a valid solution as replaceAll is a 1.4 jdk feature while this
code is in the jdbc2 package which means it must be compilable with the
1.2 jdk.  Additionally it's possible for a tablename to contain a
semi-colon.  I've been discussing the failings of parseQuery with another
user here:

http://gborg.postgresql.org/project/pgjdbc/bugs/bugupdate.php?793

Kris Jurka

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "PostgreSQL Bugs List"
Дата:
Сообщение: BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename
Следующее
От: Martin Pitt
Дата:
Сообщение: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf