close
The Wayback Machine - https://web.archive.org/web/20200623130856/https://github.com/gocql/gocql/issues/1059
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iter.NumRows() and iter.MapScan(m) have different counts #1059

Open
prats226 opened this issue Feb 12, 2018 · 1 comment
Open

iter.NumRows() and iter.MapScan(m) have different counts #1059

prats226 opened this issue Feb 12, 2018 · 1 comment
Labels

Comments

@prats226
Copy link

@prats226 prats226 commented Feb 12, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

[cqlsh 5.0.1 | Cassandra 3.10 | CQL spec 3.4.4 | Native protocol v4]

What version of Gocql are you using?

{
	"ImportPath": "github.com/gocql/gocql",
	"Comment": "pre-node-events-568-gaa93acc",
	"Rev": "aa93acc8f067e9233982b9a7de370e4d64b9c33e"
}

What did you do?

a = make([]A, iter.NumRows())
var i := 0
for iter.MapScan(m) {
    j, err := json.Marshal(m)
    err = json.Unmarshal(j, &a[i])
    i++
}

What did you expect to see?

Code should not panic since number of rows should be equal to number of elements in mapscan

What did you see instead?

Panic

If you are having connectivity related issues please share the following additional information

Describe your Cassandra cluster

please provide the following information

  • output of nodetool status
  • output of SELECT peer, rpc_address FROM system.peers
  • rebuild your application with the gocql_debug tag and post the output
@Zariel
Copy link
Member

@Zariel Zariel commented Feb 12, 2018

That row count is the number of rows in the current frame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.