Get the App
SLTechnology News&Howtos  ›  Database  › 

Redis-things

Shulou Source: shulou.com Published: 2022-06-01 17:36:57 11月10日 Update

If the multi is executed, it will be put in a queue.

Note:

In the statements that follow multi, this happens after a statement error

A, grammatical problems

Upon receipt of the exec, an error is reported and the statement is not executed.

B, the grammar is correct, but there is something wrong with the applicable object.

After exec, the correct statement is executed and the wrong one is skipped.

127.0.0.1 purl 6379 > flushdb

OK

127.0.0.1 set yang 6379 >

OK

127.0.0.1 set yu 6379 >

OK

127.0.0.1 purl 6379 > multi

OK

127.0.0.1 6379 > decrby yang 10

QUEUED

127.0.0.1 incrby yu 6379 >

QUEUED

127.0.0.1 purl 6379 > exec

1) (integer) 190

2) (integer) 200

127.0.0.1 purl 6379 > multi

OK

127.0.0.1 decrby yang 6379 >

QUEUED

127.0.0.1 purl 6379 > sadd yu jkjkjkjkj

QUEUED

127.0.0.1 purl 6379 > exec

1) (integer) 90

2) (error) WRONGTYPE Operation against a key holding the wrong kind of value

127.0.0.1 purl 6379 > mget yang yu

1) "90"

2) "200"

2, cancel the operation

127.0.0.1 purl 6379 > multi

OK

127.0.0.1 6379 > decrby yang 10

QUEUED

127.0.0.1 6379 > incrby yu 20000

QUEUED

127.0.0.1 purl 6379 > discard

OK

127.0.0.1 purl 6379 > mget yang yu

1) "90"

2) "200"

3The optimistic lock in key Reis, responsible for whether it has been changed.

Watch command

Tags: Statements syntax problems things optimism commands objects situations times faults queues Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB Linux Shulou Technology Redmi