Bugs item #1670732, was opened at 2007-02-28 12:05
Message generated for change (Settings changed) made by vzzzbx
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1670732&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/JDBC
Group: (zombie: Pathfinder 0.12.0)
>Status: Open
>Resolution: None
Priority: 5
Private: No
Submitted By: Wouter Alink (vzzzbx)
Assigned to: Fabian (mr-meltdown)
Summary: XQ/JDBC: escaping backslash

Initial Comment:
NOTE: this applies to 0.12. don't know whether it has been fixed in 0.16, but i 
could not find an earlier bugreport about it. (please close if it was fixed)

When retrieving strings using the JDBC getString(1) from a ResultSet returned 
after executing an XQuery, the backslashes have disappeared. 

When querying using MapiClient the problem does not appear, so I guess the bug 
should be somewhere in the JDBC code.

shred a document like:

<node>c:\tmp\</node>

when querying:

doc("test.xml")/node

and in java calling:

rs.next()
rs.getString(1)

will return (in 0.12):

<node>c:tmp</node>


----------------------------------------------------------------------

Comment By: Hans (hans_0_)
Date: 2007-04-10 11:08

Message:
Logged In: YES 
user_id=1761713
Originator: NO

Using JDBC on MonetDB 4.16 inadvertently suppresses the backslash
characters in the output.
Using MapiClient does not suppress the backslashes.

Please fix the JDBC, so that it does not suppress backslashes.


In MonetDB 4.16 executing the following xquery using JDBC:

let $d := doc("consumer02.xml") return element { "result" } {
$d//id(3122983) }

returns the result below:

<result>
<link xid="323417">
<size xid="323418">114688</size>
<volumelabel xid="323419"/>
<created xid="323420"><date xid="323421"
unixtime="1148993070"/></created>
<workingdir xid="323422">C:WINDOWSsystem32</workingdir>
<description
xid="323423">@%SystemRoot%system32shell32.dll,-22531</description>
<volumetype xid="323424">FIXED</volumetype>
<localpath xid="323425">C:WINDOWSsystem32calc.exe</localpath>
<modified xid="323426"><date xid="323427"
unixtime="1091620800"/></modified>
<accessed xid="323428"><date xid="323429"
unixtime="1148993070"/></accessed>
<volumeserial xid="323430">45609b6</volumeserial>
<relativepath
xid="323431">..........WINDOWSsystem32calc.exe</relativepath>
</link>
</result>

Executing the same xquery using MapiClient, on the same data:

$ echo 'doc("consumer02.xml")//id("3122983")' | MapiClient -lxq -h
localhost -p 40000

returns the result below:

<link xid="323417">
<size xid="323418">114688</size>
<volumelabel xid="323419"/>
<created xid="323420"><date unixtime="1148993070"
xid="323421"/></created>
<workingdir xid="323422">C:\WINDOWS\system32</workingdir>
<description
xid="323423">@%SystemRoot%\system32\shell32.dll,-22531</description>
<volumetype xid="323424">FIXED</volumetype>
<localpath xid="323425">C:\WINDOWS\system32\calc.exe</localpath>
<modified xid="323426"><date unixtime="1091620800"
xid="323427"/></modified>
<accessed xid="323428"><date unixtime="1148993070"
xid="323429"/></accessed>
<volumeserial xid="323430">45609b6</volumeserial>
<relativepath
xid="323431">..\..\..\..\..\WINDOWS\system32\calc.exe</relativepath>
</link>

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2007-03-02 10:40

Message:
Logged In: YES 
user_id=963970
Originator: NO

please test with 0.16

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2007-02-28 14:40

Message:
Logged In: YES 
user_id=963970
Originator: NO

Using the client I see some other stuff, so I guess your problem is deeper
under the hood.

(pegasus:portage/mail-client/mutt) fabian% JdbcClient -lxquery
Welcome to the MonetDB interactive JDBC terminal!
Type \q to quit, \h for a list of available commands
auto commit mode: on
monetdb-> 1 + 1
monetdb=>
<xquery>
<result>
  <row>
    <xml>2</xml>
  </row>
</result>
</xquery>

monetdb-> 'bla'
monetdb=>
<xquery>
<result>
  <row>
    <xml>"bla"</xml>
  </row>
</result>
</xquery>


Is it supposed to return " instead of ' here?  Or no quote at all?


monetdb-> 'bl\\a'
monetdb=>
<xquery>
<result>
  <row>
    <xml>"bl\\a"</xml>
  </row>
</result>
</xquery>

monetdb-> "bl\\a"
monetdb=>
<xquery>
<result>
  <row>
    <xml>"bl\\a"</xml>
  </row>
</result>
</xquery>

monetdb->

monetdb-> 'b\a'
monetdb=>
<xquery>
<result>
  <row>
    <xml>"b\a"</xml>
  </row>
</result>
</xquery>

monetdb->


backslashes seem to go well in this part.  But I'm not sure on the quotes.
 Could you generate a JDBC log please, and attach it for your application?

----------------------------------------------------------------------

Comment By: Fabian (mr-meltdown)
Date: 2007-02-28 13:49

Message:
Logged In: YES 
user_id=963970
Originator: NO

I think the bug is as simple as the backslash not being escaped, but I'll
check to be sure.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1670732&group_id=56967

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to