From 99e8ffb5105b90b88e150c5f80be4b194aa18ac7 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Thu, 15 Jul 2021 17:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9scan=20status=E9=87=8D?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=EF=BC=8C=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E6=9B=B4=E5=A4=9A=E5=88=86=E6=94=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_hierarchy.cpp | 2 +- src/inc_internal/Maat_rule_internal.h | 1 - test/test_maatframe.cpp | 17 ++++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/entry/Maat_hierarchy.cpp b/src/entry/Maat_hierarchy.cpp index d4e4b84..2664de1 100644 --- a/src/entry/Maat_hierarchy.cpp +++ b/src/entry/Maat_hierarchy.cpp @@ -95,7 +95,7 @@ struct Maat_hierarchy_clause struct Maat_hierarchy { pthread_rwlock_t rwlock; - time_t version; + time_t version; //After full update, clause id may indicate a different clause. Comparing hier->version and mid->hier_ver can prevent false positive match. struct bool_matcher* bm; struct Maat_hierarchy_compile* hash_compile_by_id; //key: compile_id, value: struct Maat_hierarchy_compile*. diff --git a/src/inc_internal/Maat_rule_internal.h b/src/inc_internal/Maat_rule_internal.h index bdf5c3a..839165c 100644 --- a/src/inc_internal/Maat_rule_internal.h +++ b/src/inc_internal/Maat_rule_internal.h @@ -160,7 +160,6 @@ struct Maat_region_inner int expr_id_cnt; int expr_id_lb; //low boundary int expr_id_ub; //up boundary - enum MAAT_TABLE_TYPE table_type; }; diff --git a/test/test_maatframe.cpp b/test/test_maatframe.cpp index 5fba454..c8f14fd 100644 --- a/test/test_maatframe.cpp +++ b/test/test_maatframe.cpp @@ -4048,16 +4048,19 @@ TEST_F(MaatCmdTest, SameScanStatusWhenClauseUpdate_TSG6419) //region11->group11--clause1-->compile1 - // / - //region21->group21--clause2--/ - // / - //region22->group22---/ + // / + //region21->group21--clause2---/ + // / + //region22->group22--clause3-/ + + Maat_command_raw_set_compile(feather, MAAT_OP_DEL, &compile1, compile_table_name, NULL, 2, 0, 0); + Maat_command_raw_set_compile(feather, MAAT_OP_ADD, &compile1, compile_table_name, NULL, 3, 0, 0); memset(&group22, 0, sizeof(group22)); group22.group_id=Maat_command_get_new_group_id(feather); group22.table_name=g2c_tn; group22.compile_id=compile1.config_id; - group22.clause_index=2; + group22.clause_index=3; Maat_command_raw_set_group2compile(feather, MAAT_OP_ADD, &group22); region22.region_id=Maat_command_get_new_region_id(feather); @@ -4069,6 +4072,10 @@ TEST_F(MaatCmdTest, SameScanStatusWhenClauseUpdate_TSG6419) sleep(1); table_id=Maat_table_register(feather, app_id_table_name); + + ret=Maat_scan_intval(feather, table_id, 31, result, 4, &mid, 0); + EXPECT_EQ(ret, -2); + ret=Maat_scan_intval(feather, table_id, scan_app_id, result, 4, &mid, 0); EXPECT_EQ(ret, 1); EXPECT_EQ(result[0].config_id, compile1.config_id);