mirror of
https://github.com/fluencelabs/redis
synced 2025-06-22 13:31:32 +00:00
EVALSHA is now case insensitive.
EVALSHA used to crash if the SHA1 was not lowercase (Issue #783). Fixed using a case insensitive dictionary type for the sha -> script map used for replication of scripts.
This commit is contained in:
13
src/redis.c
13
src/redis.c
@ -393,7 +393,8 @@ int dictSdsKeyCompare(void *privdata, const void *key1,
|
||||
return memcmp(key1, key2, l1) == 0;
|
||||
}
|
||||
|
||||
/* A case insensitive version used for the command lookup table. */
|
||||
/* A case insensitive version used for the command lookup table and other
|
||||
* places where case insensitive non binary-safe comparison is needed. */
|
||||
int dictSdsKeyCaseCompare(void *privdata, const void *key1,
|
||||
const void *key2)
|
||||
{
|
||||
@ -508,6 +509,16 @@ dictType dbDictType = {
|
||||
dictRedisObjectDestructor /* val destructor */
|
||||
};
|
||||
|
||||
/* server.lua_scripts sha (as sds string) -> scripts (as robj) cache. */
|
||||
dictType shaScriptObjectDictType = {
|
||||
dictSdsCaseHash, /* hash function */
|
||||
NULL, /* key dup */
|
||||
NULL, /* val dup */
|
||||
dictSdsKeyCaseCompare, /* key compare */
|
||||
dictSdsDestructor, /* key destructor */
|
||||
dictRedisObjectDestructor /* val destructor */
|
||||
};
|
||||
|
||||
/* Db->expires */
|
||||
dictType keyptrDictType = {
|
||||
dictSdsHash, /* hash function */
|
||||
|
Reference in New Issue
Block a user