jbochi / lua-resty-cassandra

Pure Lua Cassandra client using CQL binary protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attempt to index local 'rows' (a nil value)

lordnynex opened this issue · comments

Sorry for the blank issue. Mashed the keyboard :)

When I pass { auto_paging: true }

I receive lua coroutine: runtime error: ./Vendor/resty/cassandra.lua:220: attempt to index local 'rows' (a nil value)

This is presumably because there are no rows, which is possibly expected behavior in my application. I would prefer to not implement manual paging.

https://github.com/jbochi/lua-resty-cassandra/blob/master/src/cassandra.lua#L221

Sorry about that! Indeed, if rows was a valid result set of length 0, the code handled it, but if it was nil (most likely because of a query error), accessing rows used to throw an error.

#52 fixes this, and returns an error if any!

Awesome. Thanks!