[ 
https://issues.apache.org/jira/browse/DERBY-3676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068528#comment-13068528
 ] 

Tiago R. Espinha commented on DERBY-3676:
-----------------------------------------

I've had a look at all the comments and I think reaching a consensus is really 
just a matter of setting it in stone. From what I've read, I think it's fairly 
safe to say that it's a bad idea to dramatically change the output of a method 
that has been this way ever since Derby has been around.

Seeing as this is a feature that we can provide without possibly breaking 
users' applications, I see no reason why to risk breaking it then.

We still have the lob/stream issue. One way of addressing this would be to 
mimic MySQL's behavior. I can give this a try and see what happens over there. 
But being reasonable about it, I think it would generally be a bad idea to also 
replace the question marks for LOB and stream fields. Let's not forget LOB 
stands for Large Object... it can contain incredibly large strings when 
converted to text. Is it a good idea to dump up to 2 GiB of information (times 
any number of LOBs you can put in a string) in one go? Sure, maybe it's also 
not our decision to make and it should be up to the developer, but I'm more 
inclined to not replace LOBs or streams.

In any case, I'll see if I can get MySQL's behavior on this.

Eventually we might have to be ready to go through with Mark's contribution 
even if he's not replying. Is his ICLA already on file?

> Make the toString() method of Derby PreparedStatements print out SQL text 
> with ? parameters replaced by the values that have been set so far
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3676
>                 URL: https://issues.apache.org/jira/browse/DERBY-3676
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>            Reporter: Rick Hillegas
>            Assignee: Siddharth Srivastava
>         Attachments: humanstringprepared.txt, humanstringprepared.txt, 
> humanstringprepared.txt, humanstringprepared.txt, humanstringprepared.txt, 
> humanstringprepared.txt, humanstringprepared.txt, ick.txt, ick.txt, 
> prepared.diff, statementCacheVTI.sql
>
>
> This topic came up in the following email thread on the user list: 
> http://www.nabble.com/PreparedStatement.toString%28%29---nice-formatting-td17250811.html#a17250811
>  Here's what the thread requests: 
> "In mysql, a toString() on a PreparedStatement will do this, eg "select x
> from foo where x.a = ?" will become "select x from foo where x.a = 1" with
> the appropriate setValue() call."
> At first blush, this seems like it might be a simple project for a newcomer.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to