[ 
https://forge.continuent.org/jira/browse/SEQUOIA-239?page=comments#action_14647 
] 

Gilles Rayrat commented on SEQUOIA-239:
---------------------------------------

As of https://forge.continuent.org/jira/browse/SEQUOIA-1037, this issue is 
still relevant anymore for reads (where macro replacement is useless)

For writes, the macro replacement should not occur in most cases: one should be 
able to do setString("some string containaing now() not-a-macro") in a text 
column.

Anyway, there is at least one corner case where macro replacement should be 
done:

ps = conn.prepareStatement(INSERT INTO date_table VALUES((CAST (? AS DATE)));
ps.setString(1, "now()");
ps.executeUpdate();

I checked with a direct postgres connection, the now() is well replaced by the 
current date.

There might be some other examples but for now, I just found this "CAST" issue 
- if it's the only one, this could be considered as a limitation and documented 
as so.


> Macro replacement does not work in PreparedStatement parameters
> ---------------------------------------------------------------
>
>          Key: SEQUOIA-239
>          URL: https://forge.continuent.org/jira/browse/SEQUOIA-239
>      Project: Sequoia
>         Type: Bug

>   Components: Core
>     Versions: Sequoia 2.4
>     Reporter: Emmanuel Cecchet
>      Fix For: sequoia 2.10.11, Sequoia 4.0, Sequoia 2.5

>
>
> Macro replacement does not process the parameters of PreparedStatement.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to