-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Like as below:
mysql> select @a := json_object(topic as topic) from test limit 1; +-----------------------------------+ | @a := json_object(topic as topic) | +-----------------------------------+ | {"topic":"你 我 他 她"} | +-----------------------------------+ 1 row in set (0.00 sec) mysql> set @b := concat("hset \"htest\" \"1\" \"", @a, "\""); Query OK, 0 rows affected (0.00 sec) mysql> select @b; +------------------------------------------------+ | @b | +------------------------------------------------+ | hset "htest" "1" "{"topic":"你 我 他 她"}" | +------------------------------------------------+ 1 row in set (0.00 sec) mysql> select redis_command("127.0.0.1",6379, @b); +-------------------------------------+ | redis_command("127.0.0.1",6379, @b) | +-------------------------------------+ | 3 | +-------------------------------------+ 1 row in set (0.00 sec)
But it's succeed when wrap off white space.
mysql> select @a := json_object(replace(topic, " " , "") as topic) from test limit 1; +------------------------------------------------------+ | @a := json_object(replace(topic, " " , "") as topic) | +------------------------------------------------------+ | {"topic":"你我他她"} | +------------------------------------------------------+ 1 row in set (0.00 sec) mysql> set @b := concat("hset 'htest' '1' '", @a, "'"); Query OK, 0 rows affected (0.00 sec) mysql> select redis_command("127.0.0.1",6379, @b); +-------------------------------------+ | redis_command("127.0.0.1",6379, @b) | +-------------------------------------+ | 0 | +-------------------------------------+ 1 row in set (0.00 sec)
Metadata
Metadata
Assignees
Labels
No labels