coolexp / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

randomkey on empty db causes bus error on server and destroys existing data that has not been saved #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. select an empty db (e.g. "select 9")
2. (not necessary to reproduce:  issue keys command to insure db is in fact 
empty $0 result)
3. issue randomkey

What is the expected output? What do you see instead?
server will crash.  

on server terminal:

..
. DB 0: 1 keys (0 volatile) in 16 slots HT.
. 1 clients connected (0 slaves), 2964 bytes in use
Bus error

What version of the product are you using? On what operating system?
redis:
Git download April 07 2009
"antirez-redis-05557f6de7fd7a4ae29614ae2cde78cd08ebd1b9"

os:
Mac OS X 10.5

Please provide any additional information below.

If the server has not saved any data you added in your session, regardless of 
the db, issuing 
randomkey in the empty db will also cause the loss of keys in other dbs.  
Issuing SAVE before 
doing this however will guard against that. 

Original issue reported on code.google.com by SunO...@gmail.com on 7 Apr 2009 at 10:45

GoogleCodeExporter commented 8 years ago
Fixed, regression test and standard randomkey test added. Thanks

Original comment by anti...@gmail.com on 7 Apr 2009 at 11:00

GoogleCodeExporter commented 8 years ago

Original comment by anti...@gmail.com on 7 Apr 2009 at 11:00