用telnet连接oncedb数据库,使用查询指令hsearch搜索并输出字段不正常,redis其它指令工作正常


发布人 Kris  发布时间 1574401213813
关键字 OnceDB  BUG 

重现步骤

1. 启动oncedb数据库
2. Win + R 在运行中输入 telnet 127.0.0.1 6400
3. 输入测试数据和搜索指令

//先输入任意字符
+OK
select 0
+OK
hmset user:001 name kris age 16
+OK
hmset user:002 name david age 17
+OK
hsearch user:* name ~ '' age > 16
-ERR wrong number of arguments for HSEARCH
hsearch user:* age > 16 name ~ ''
-ERR wrong number of arguments for HSEARCH
hsearch user:* age > 10 name ~ 'a'
*3
$8
user:002
$2
17
$5
david

实际结果

使用 name ~ '' 输出姓名字段,均显示错误

hsearch user:* name ~ '' age > 16
-ERR wrong number of arguments for HSEARCH
hsearch user:* age > 16 name ~ ''
-ERR wrong number of arguments for HSEARCH

当不使用字符串,输入任意一字符即正常:

hsearch user:* age > 10 name ~ a
*3
$8
user:002
$2
17
$5
david

截图

期望结果

telnet 支持所有 oncedb 指令

 





回复 (2)
  • #
  • #1 wx_15926 1574495281280

    解决方法


    添加 = * 指令,打印指定字段

    测试


    Ctrl + R 运行: telnet 127.0.0.1 6379

    -ERR unknown command 'sdfauthauth'
    hmset user:001 name kris age 10
    +OK
    hmset user:002 name ghost age 20
    +OK
    hsearch user:* age > 5 name ~ ''
    -ERR wrong number of arguments for HSEARCH
    hsearch user:* age > 5 name = *
    *6
    $8
    user:002
    $2
    20
    $5
    ghost
    $8
    user:001
    $2
    10
    $4
    kris


    Windows 测试版下载地址: http://onceoa.com/download/oncedb-server.zip

  • #2 wx_15926 1574495735467

     zhsearch 工作正常:  zhsearch zsetkey from to schema field operator value ...

    zadd user 100 001
    :1
    zadd user 200 002
    :1
    zrange user 0 10
    *2
    $3
    001
    $3
    002
    zhsearch user 0 10 user: age > 15 name = *
    *3
    $8
    user:002
    $2
    20
    $5
    ghost

    zhorsearch 工作正常

    zhorsearch user 0 10 user: age > 15 name ~ "i"
    *6
    $8
    user:001
    $2
    10
    $4
    kris
    $8
    user:002
    $2
    20
    $5
    ghost

     

 关键字
OnceDB BUG

 关注
关注
OnceOA

OnceOA