ledgetech / lua-resty-redis-connector

Connection utilities for lua-resty-redis
234 stars 71 forks source link

ERR invalid DB index in 0.09 #38

Closed erchn closed 3 years ago

erchn commented 4 years ago

I believe this commit introduced a regression in the public connect interface that throws the following error when a url without a trailing /N exists where N is a valid DB index.

ERR invalid DB index

connect is passed a url matching redis://redis:6379 only.

Additionally, the connection object that is returned is a boolean.

Pinning the version to 0.08 resolves the issue.

pintsized commented 4 years ago

Thanks for the report. This is because we now error if select fails (except for when connected to a sentinel since that error is only noise), and we seem to lack a test for not providing a DB in the DSN.

On closer inspection there was probably a better fix for this case in the first place - it seems we test host.db against nil when it is most likely an empty string.

Fix coming shortly...

erchn commented 4 years ago

I’m installing via OPM and the mirrors take a few days to update sometimes, will verify early next week. Thank you.

Oh, actually, I’ll find a way of testing outside of an official version bump.

erchn commented 3 years ago

I did end up testing this and it looks good. Thanks!