Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis-things

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report