[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15024572#comment-15024572 ]
Sylvain Lebresne commented on CASSANDRA-10631: ---------------------------------------------- So, there were more bugs that the change to CQLTester (so prepared statements are reused) was triggering. The first one, I've created CASSANDRA-10758 for: fixing it is not trivial enough that I feel confident shoving it in that (unrelated) ticket. To work-around that ticket, I've disabled the prepared statement reuse for the 2 class of tests that were failing otherwise (and I'll add a comment in CASSANDRA-10768 to remove that work-around). The 2nd problem was that the implementation of the {{DROP INDEX}} statement was stateful: we were looking up the metadata for table for which the index is dropped and saving it in an instance field, reusing it afterwards. Except that it's during this lookup that we're throwing an exception if the index doesn't exists, so this saving the result of the lookup was breaking if a {{DROP INDEX}} was prepared and reused. One could argue that preparing any schema related statement is borderline useless since you can't use bind marker anywhere (I guess you save parsing ...), but we actually don't disallow it and hence should probably fix that. Now, the main reason for saving the result of that metadata lookup was due to the fact that we need that metadata when creating the {{Event.SchemaChange}}, but by the time {{changeEvent()}} is called, the index has been dropped and the lookup method would fail. Anyway, what that mean is that {{changeEvent}} needed access to values that where only available in {{announceMigration}} (there is a few other function related statement that saves stuffs in fields for the very same reason) and so I make the change of removing the {{changeEvent()}} and making the event be the result of the {{announceMigration()}} call. I happen to think it's cleaner that way anyway and the change is trivial, so I've included a commit for this one. Only the 3.0 branch has new commits (there were no tests failure in 2.2 so I've let it alone): ||3.0|| |[branch|https://github.com/pcmanus/cassandra/commits/10631-3.0]| |[utests|http://cassci.datastax.com/job/pcmanus-10631-3.0-testall/4/]| |[dtests|http://cassci.datastax.com/job/pcmanus-10631-3.0-dtest/1/]| The unit test had 2 failures but those are junit timeouts so I suspect this is just a case of being unluky. I've restarted the job one more time to check however. > JSON Update not working with PreparedStatement > ---------------------------------------------- > > Key: CASSANDRA-10631 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10631 > Project: Cassandra > Issue Type: Bug > Components: CQL > Environment: Windows 7, Datastax Java Driver 2.2.0-rc2 > Reporter: Henrik Karlsson > Assignee: Sylvain Lebresne > Fix For: 2.2.x > > Attachments: test-json.zip > > > When using PreparedStatement to insert and update a row with JSON the first > "INSERT INTO {tablename} JSON ?" statement works OK. But when calling it a > second time with a changed value on a field the field is not updated. If I > use a SimpleStatement instead ("INSERT INTO {tablename} JSON '"+json+"'") the > modified field is updated as expected. > Attaching a test project that shows the problem. -- This message was sent by Atlassian JIRA (v6.3.4#6332)