Skip to content

Conversation

zhenlineo
Copy link
Contributor

No description provided.

@boggle
Copy link
Contributor

boggle commented Oct 29, 2015

I'm happy with the code in this PR though I'd like to understand why no summary was included. I though that we should always get one back? Could you please investigate the current behavior of Cypher, i.e. does db.execute(query) always give us update statistics? If so, remoting should behave the same. Or is this an optimization where we choose to not send an empty (all zero) statistics from the server side?

@zhenlineo
Copy link
Contributor Author

@boggle
We optimized it to only send stats when there are updates:

if ( delegate.getQueryStatistics().containsUpdates() )
{
...

https://github.com/neo4j/neo4j/blob/3.0/community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/internal/CypherAdapterStream.java#L73

In other word, if we got no updates, then nothing is sent and on the client we should give them 0s by default.

@jakewins
Copy link
Contributor

Looks good! Needs rebase, happy to merge this

Added a test to verify behaviours when empty result summary returned
zhenlineo pushed a commit that referenced this pull request Nov 18, 2015
Return an empty stats if no stat is included in summary
@zhenlineo zhenlineo merged commit 4a58e4d into master Nov 18, 2015
@zhenlineo zhenlineo deleted the fix-null-stats branch November 18, 2015 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants