[v0.12.4]用户与角色UDF权限赋予问题,非root用户查询返回空值时,报错"Msg: 602: No permissions for this operation UDTF"
Describe the bug iotdb 0.12.4修复了0.12.2版本中用户与角色UDF权限赋予非root无法正确生效的问题,可参考Issue-4308。但是当我们使用非root用户进行UDF查询时,如果查询的值不存在,依然报错"Msg: 602: No permissions for this operation UDTF"。这会给用户误导。希望可以在新版本中修复。
To Reproduce Steps to reproduce the behavior:
-
使用root用户登录sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
-
创建非root用户并赋权: CREATE ROLE udtf_test 'udtf_passwd' CREATE ROLE udtf_test_role GRANT ROLE udtf_test_role PRIVILEGES 'SET_STORAGE_GROUP','CREATE_TIMESERIES','INSERT_TIMESERIES','READ_TIMESERIES','DELETE_TIMESERIES','DROP_FUNCTION','CREATE_FUNCTION' ON root.test GRANT udtf_test_role TO udtf_test
-
使用root用户查询: select WTUR_PwrAt_Ra_F32 from root.test.20.123456789 where time >= 2021-01-01 and time<= 2021-01-31 23:59:59 +----+ |Time| +----+ +----+
-
使用udtf_test用户查询:Msg: 602: No permissions for this operation UDTF。
-
执行命令,导入数据: insert into root.test.20.123456789(time, WTUR_PwrAt_Ra_F32) values(1,1)
-
root用户和用户分别使用相同命令查询,得到相同的结果如下: select WTUR_PwrAt_Ra_F32 from root.test.20.123456789 where time >= 2021-01-01 and time<= 2021-01-31 23:59:59 +----+-----------------------------------------+ |Time|root.test.20.123456789.WTUR_PwrAt_Ra_F32| +----+-----------------------------------------+ +----+-----------------------------------------+
Expected behavior 非root用户查询空表格时,应正确返回空值,而非报权限错误,这会使用户产生误解。
Desktop (please complete the following information):
OS: Amazon Linux
I met this problem as well, I will fix it.