dbTalk Databases Forums  

[BUGS] BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename - 05-23-2004 , 01:21 AM







The following bug has been logged online:

Bug reference: 1155
Logged by: David Brownlee

Email address: abs (AT) mono (DOT) org

PostgreSQL version: 7.4

Operating system: NetBSD

Description: AbstractJdbc2ResultSetarseQuery ; in tablename

Details:


In AbstractJdbc2ResultSetarseQuery 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


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org

Reply With Quote
  #2  
Old   
Kris Jurka
 
Posts: n/a

Default Re: [BUGS] BUG #1155: AbstractJdbc2ResultSet:parseQuery ; in tablename - 05-24-2004 , 02:12 PM








On Sat, 22 May 2004, PostgreSQL Bugs List wrote:

Quote:
The following bug has been logged online:

Logged by: David Brownlee
Email address: abs (AT) mono (DOT) org
PostgreSQL version: 7.4
Description: AbstractJdbc2ResultSetarseQuery ; in tablename
Details:


In AbstractJdbc2ResultSetarseQuery 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/...update.php?793

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.