[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15027847#comment-15027847 ] Tyler Hobbs commented on CASSANDRA-10631: - +1, with just a couple of minor typos to fix on commit: * 'cannot be found bu "IF EXISTS" is' - in {{DropIndexStatement}} * 'occured' - in {{SchemaAlteringStatement}} > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15024719#comment-15024719 ] Sylvain Lebresne commented on CASSANDRA-10631: -- The re-run of the unit test still had one failure but it's different from the previous run and is in {{testCompactionProgress}} which almost surely don't go into any code changed by this patch, so I'm confident we're good here. > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014117#comment-15014117 ] Sylvain Lebresne commented on CASSANDRA-10631: -- Yeah, saw the unit test were still failing, sorry for not updating. It's really weird cause the test seems to fail due to an error message not being the one they expect, and the patch doesn't touch that message, but I'll try to have a closer look tomorrow. > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014114#comment-15014114 ] Tyler Hobbs commented on CASSANDRA-10631: - Hmm, the unit test failures on 3.0 appear to be legit, as 3.0 doesn't show the same problems without your patch (I checked locally). I thought that perhaps the re-use of prepared statements was exposing an existing bug, but changing {{cassandra.test.reuse_prepared}} to false doesn't seem to affect the failures. However, setting {{cassandra.test.use_prepared}} to false does fix the test failures. Unfortunately, I don't have time to investigate further than that. > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013401#comment-15013401 ] Sylvain Lebresne commented on CASSANDRA-10631: -- I've rebased and updated the patch for 3.0 (I'm pretty certain there is no change in 3.1 that impact the same area so I'll just merge on commit): ||2.2||3.0|| |[branch|https://github.com/pcmanus/cassandra/commits/10631-2.2]|[branch|https://github.com/pcmanus/cassandra/commits/10631-3.0]| |[utests|http://cassci.datastax.com/job/pcmanus-10631-2.2-testall/1/]| [utests|http://cassci.datastax.com/job/pcmanus-10631-3.0-testall/2/]| |[dtests|http://cassci.datastax.com/job/pcmanus-10631-2.2-dtest/1/]| [dtests|http://cassci.datastax.com/job/pcmanus-10631-3.0-dtest/1/]| Results looks good except for the 3.0 unit tests which I've restarted because I apparently picked a bad apple in my initial rebase on that branch so that there was some clearly unrelated failures. > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009071#comment-15009071 ] Tyler Hobbs commented on CASSANDRA-10631: - Sorry for the slow response, I didn't realize I was reviewer on this one. Can you rebase if necessary and also run tests against 3.0 and 3.1? > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14989508#comment-14989508 ] Sylvain Lebresne commented on CASSANDRA-10631: -- Last [dtest|http://cassci.datastax.com/job/pcmanus-10631-dtest/2/] run confirms this is on par with the 2.2 branch. > 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)
[jira] [Commented] (CASSANDRA-10631) JSON Update not working with PreparedStatement
[ https://issues.apache.org/jira/browse/CASSANDRA-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14989365#comment-14989365 ] Sylvain Lebresne commented on CASSANDRA-10631: -- The changes to {{CQLTester}} actually exposed an unrelated bug: when a function is replaced, we were not invalidating statement using that function. And since we resolve functions at preparation time, this means the new function wasn't taken into account for statements prepared prior to the change. While this isn't really related to this issue, this does create unit test failure on this branch and the fix is pretty simple, so I included it in my branch above. Test results are here: [utest|http://cassci.datastax.com/job/pcmanus-10631-testall/4/#showFailuresLink] and [dtesthttp://cassci.datastax.com/view/Dev/view/pcmanus/job/pcmanus-10631-dtest/lastCompletedBuild/testReport/|] (the dtests have a few more failures than the last 2.2 run I've looked at. Nothing seems related to this so I suspect it's just flapping tests, but I've re-started the dtest to see). > 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)