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

David Capwell commented on CASSANDRA-18302:
-------------------------------------------

This still causes memory to expand for a rare case, which gets even worse for 
prepared as they do not share the same memory...  The argument that this is 
matching the user's string is also not correct, as the parser strips things out 
and this logic also mutates the string, so you get the following

{code}
-- This is a query
SELECT peer,
       peer_port
FROM system.peers_v2
{code}

{code}
Expecting:
 <"SELECT peer, peer_port FROM system.peers_v2">
to be equal to:
 <"-- This is a query
SELECT peer,
       peer_port
FROM system.peers_v2">
but was not.
{code}

So honestly I find this is still complex, adds extra cost, and still violates 
the intent of the original string...  I am ok with StatementSource(int line, 
int position) as that can help transactions, but anything more than that I feel 
isn't worth the cost.

> Fix AIOOBE and improve validation messages for transaction statements
> ---------------------------------------------------------------------
>
>                 Key: CASSANDRA-18302
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18302
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Accord
>            Reporter: Jacek Lewandowski
>            Assignee: Jacek Lewandowski
>            Priority: Normal
>             Fix For: 5.x
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Currently it happens sometimes that ArrayIndexOutOfBoundsException is thrown 
> from asCql method when validation transaction statement. In addition, asCql 
> does not return precisely the query user entered so the whole error message 
> can be misleading.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to