Hbase 26275 update error message when executing deleteall with ROWPREFIXFILTER in meta table (#4205)

Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
This commit is contained in:
xicm 2022-03-16 20:02:38 +08:00 committed by haxiaolin
parent e008cb836d
commit 4ff63f6570
2 changed files with 12 additions and 1 deletions

View File

@ -244,8 +244,12 @@ EOF
# delete operation doesn't need read permission. Retaining the read check for
# meta table as a part of HBASE-5837.
if is_meta_table?
if row.is_a?(Hash) and row.key?('ROWPREFIXFILTER')
raise ArgumentError, 'deleteall with ROWPREFIXFILTER in hbase:meta is not allowed.'
else
raise ArgumentError, 'Row Not Found' if _get_internal(row).nil?
end
end
if row.is_a?(Hash)
_deleterows_internal(row, column, timestamp, args, all_version)
else

View File

@ -194,6 +194,13 @@ module Hbase
assert_nil(res2)
end
define_test "deleteall with row prefix in hbase:meta should not be allowed." do
assert_raise(ArgumentError) do
@meta_table = table('hbase:meta')
@meta_table.deleteall({ROWPREFIXFILTER => "test_meta"})
end
end
define_test "append should work with value" do
@test_table.append("123", 'x:cnt2', '123')
assert_equal("123123", @test_table._append_internal("123", 'x:cnt2', '123'))