summaryrefslogtreecommitdiff
path: root/src/t_hash.c
Commit message (Collapse)AuthorAgeFilesLines
* Module API for loading and saving long doubleOran Agra2019-11-031-1/+1
| | | | | | | | | | | looks like each platform implements long double differently (different bit count) so we can't save them as binary, and we also want to avoid creating a new RDB format version, so we save these are hex strings using "%La". This commit includes a change in the arguments of ld2string to support this. as well as tests for coverage and short reads. coded by @guybe7
* RESP3: fix cases of NULL reported instead of empty aggregate.antirez2019-09-021-2/+2
|
* Increase string2ld's buffer size (and fix HINCRBYFLOAT)Guy Benoish2019-01-281-0/+4
| | | | | | | | The string representation of `long double` may take up to ~5000 chars (see PR #3745). Before this fix HINCRBYFLOAT would never overflow (since the string could not exceed 256 chars). Now it can.
* RESP3: fix HMGET bug introduced with RESP3 changes.antirez2019-01-091-1/+1
|
* RESP3: fix genericHgetallCommand() assert.antirez2019-01-091-0/+3
|
* RESP3: most null replies converted.antirez2019-01-091-5/+5
|
* RESP3: Use new API and types in t_hash.c.antirez2019-01-091-7/+9
|
* Merge pull request #3745 from guybe7/unstableSalvatore Sanfilippo2018-02-131-1/+1
|\ | | | | enlarged buffer given to ld2string
| * enlarged buffer given to ld2stringGuy Benoish2017-01-111-1/+1
| |
* | t_hash.c: clarify calling two times the same function.antirez2017-11-281-2/+2
| |
* | HMSET and MSET implementations unified. HSET now variadic.antirez2017-06-291-18/+14
|/ | | | | | This is the first step towards getting rid of HMSET which is a command that does not make much sense once HSET is variadic, and has a saner return value.
* Use const in Redis Module API where possible.Yossi Gottlieb2016-06-201-2/+2
|
* Fix HINCRBYFLOAT to work with long doubles.antirez2015-11-041-4/+4
| | | | | | | | | | | | | | | | | During the refactoring needed for lazy free, specifically the conversion of t_hash from struct robj to plain SDS strings, HINCRBFLOAT was accidentally moved away from long doubles to doubles for internal processing of increments and formatting. The diminished precision created more obvious artifacts in the way small numbers are formatted once we convert from decimal number in radix 10 to double and back to its string in radix 10. By using more precision, we now have less surprising results at least with small numbers like "1.23", exactly like in the previous versions of Redis. See issue #2846.
* Hash new implementation memleaks fixed.antirez2015-10-011-11/+52
|
* Lazyfree: Hash converted to use plain SDS WIP 5.antirez2015-10-011-1/+1
|
* Lazyfree: Hash converted to use plain SDS WIP 4.antirez2015-10-011-33/+40
|
* Lazyfree: Hash converted to use plain SDS WIP 3.antirez2015-10-011-25/+16
|
* Lazyfree: Hash converted to use plain SDS WIP 2.antirez2015-10-011-5/+11
|
* Lazyfree: Hash converted to use plain SDS WIP 1.antirez2015-10-011-138/+120
|
* RDMF: More consistent define names.antirez2015-07-271-22/+22
|
* RDMF: REDIS_OK REDIS_ERR -> C_OK C_ERR.antirez2015-07-261-13/+13
|
* RDMF: redisAssert -> serverAssert.antirez2015-07-261-15/+15
|
* RDMF: OBJ_ macros for object related stuff.antirez2015-07-261-59/+59
|
* RDMF: use client instead of redisClient, like Disque.antirez2015-07-261-19/+19
|
* RDMF: redisLog -> serverLog.antirez2015-07-261-1/+1
|
* RDMF (Redis/Disque merge friendlyness) refactoring WIP 1.antirez2015-07-261-1/+1
|
* Hash: HSTRLEN crash fixed when getting len of int-encoded valueantirez2015-02-271-1/+1
|
* Hash: HSTRLEN (was HVSTRLEN) improved.antirez2015-02-271-10/+5
| | | | | | | | | | | 1. HVSTRLEN -> HSTRLEN. It's unlikely one needs the length of the key, not clear how the API would work (by value does not make sense) and there will be better names anyway. 2. Default is to return 0 when field is missing. 3. Default is to return 0 when key is missing. 4. The implementation was slower than needed, and produced unnecessary COW. Related issue #2415.
* Merge branch 'unstable' of github.com:/antirez/redis into unstableantirez2015-02-271-0/+14
|\
| * added a new hvstrlen commandJason Roth2015-02-211-0/+14
| | | | | | | | the hvstrlen command returns the length of a hash field value
* | Hash: API to get value string len by field name.antirez2015-02-271-1/+23
|/
* Use exp format and more precision output for ZSCAN.antirez2014-12-021-1/+1
| | | | Ref: issue #2175
* SCAN code refactored to parse cursor first.antirez2013-11-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | The previous implementation of SCAN parsed the cursor in the generic function implementing SCAN, SSCAN, HSCAN and ZSCAN. The actual higher-level command implementation only checked for empty keys and return ASAP in that case. The result was that inverting the arguments of, for instance, SSCAN for example and write: SSCAN 0 key Instead of SSCAN key 0 Resulted into no error, since 0 is a non-existing key name very likely. Just the iterator returned no elements at all. In order to fix this issue the code was refactored to extract the function to parse the cursor and return the error. Every higher level command implementation now parses the cursor and later checks if the key exist or not.
* Aesthetic fix (missing space) into HSCAN and ZSCAN implementations.antirez2013-10-281-1/+1
| | | | Thanks to @badboy for reporting.
* HSCAN implemented.antirez2013-10-281-0/+8
|
* Introduction of a new string encoding: EMBSTRantirez2013-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously two string encodings were used for string objects: 1) REDIS_ENCODING_RAW: a string object with obj->ptr pointing to an sds stirng. 2) REDIS_ENCODING_INT: a string object where the obj->ptr void pointer is casted to a long. This commit introduces a experimental new encoding called REDIS_ENCODING_EMBSTR that implements an object represented by an sds string that is not modifiable but allocated in the same memory chunk as the robj structure itself. The chunk looks like the following: +--------------+-----------+------------+--------+----+ | robj data... | robj->ptr | sds header | string | \0 | +--------------+-----+-----+------------+--------+----+ | ^ +-----------------------+ The robj->ptr points to the contiguous sds string data, so the object can be manipulated with the same functions used to manipulate plan string objects, however we need just on malloc and one free in order to allocate or release this kind of objects. Moreover it has better cache locality. This new allocation strategy should benefit both the memory usage and the performances. A performance gain between 60 and 70% was observed during micro-benchmarks, however there is more work to do to evaluate the performance impact and the memory usage behavior.
* Removed useless newlines from hashTypeCurrentObject().antirez2013-02-151-3/+0
|
* Keyspace events: it is now possible to select subclasses of events.antirez2013-01-281-7/+9
| | | | | | | | | When keyspace events are enabled, the overhead is not sever but noticeable, so this commit introduces the ability to select subclasses of events in order to avoid to generate events the user is not interested in. The events can be selected using redis.conf or CONFIG SET / GET.
* Keyspace events added for more commands.antirez2013-01-281-1/+9
|
* BSD license added to every C source and header file.antirez2012-11-081-0/+29
|
* Dump ziplist hex value on failed assertion.antirez2012-06-121-1/+5
| | | | | | | | | | | | | | | | | | The ziplist -> hashtable conversion code is triggered every time an hash value must be promoted to a full hash table because the number or size of elements reached the threshold. If a problem in the ziplist causes the same field to be present multiple times, the assertion of successful addition of the element inside the hash table will fail, crashing server with a failed assertion, but providing little information about the problem. This code adds a new logging function to perform the hex dump of binary data, and makes sure that the ziplist -> hashtable conversion code uses this new logging facility to dump the content of the ziplist when the assertion fails. This change was originally made in order to investigate issue #547.
* Replicate HINCRBYFLOAT as HSET.antirez2012-03-231-11/+14
|
* More vertical space saved.antirez2012-03-101-21/+4
|
* Minor code aesthetic change to use Redis code base style rule of saving ↵antirez2012-03-101-4/+1
| | | | vertical space when possible.
* Merge conflicts resolved.antirez2012-03-091-196/+417
|\
| * Implements ziplistFindPieter Noordhuis2012-01-031-40/+28
| | | | | | | | | | | | To improve the performance of the ziplist implementation, some functions have been converted to macros to avoid unnecessary stack movement and duplicate variable assignments.
| * Encode small hashes with a ziplistPieter Noordhuis2012-01-021-196/+429
| |
* | Fixed undefined behavior in *INCR style functions overflow detection. Sorry ↵antirez2012-02-211-2/+3
| | | | | | | | clang!
* | Now HINCRBY can detect overflows too. Fix for issue #330.antirez2012-02-161-1/+6
|/
* HINCRBYFLOAT implementedantirez2011-11-151-0/+27
|