This commit is contained in:
liuwentan
2023-04-13 18:53:36 +08:00
parent 571ce08d3b
commit ffc1740a00
6 changed files with 13 additions and 13 deletions

View File

@@ -97,7 +97,7 @@ struct maat_runtime {
struct table_manager *ref_tbl_mgr; //share with maat instance struct table_manager *ref_tbl_mgr; //share with maat instance
size_t max_table_num; size_t max_table_num;
uint32_t rule_num; long long rule_num;
struct maat_kv_store *sequence_map; struct maat_kv_store *sequence_map;
struct maat_garbage_bin *ref_garbage_bin; struct maat_garbage_bin *ref_garbage_bin;

View File

@@ -1507,7 +1507,7 @@ int maat_stream_scan(struct maat_stream *maat_stream, const char *data, int data
void *expr_rt = table_manager_get_runtime(maat_instance->tbl_mgr, maat_stream->physical_table_id); void *expr_rt = table_manager_get_runtime(maat_instance->tbl_mgr, maat_stream->physical_table_id);
assert(expr_rt != NULL); assert(expr_rt != NULL);
long long cur_expr_rt_version = expr_runtime_get_version(expr_rt); long long cur_expr_rt_version = expr_runtime_get_version(expr_rt);
if (maat_stream->expr_rt_version != cur_expr_rt_version) { if (maat_stream->expr_rt_version != cur_expr_rt_version) {
return MAAT_SCAN_OK; return MAAT_SCAN_OK;

View File

@@ -31,10 +31,10 @@ struct compile_schema {
int compile_id_column; int compile_id_column;
int rule_tag_column; int rule_tag_column;
int declared_clause_num_column; int declared_clause_num_column;
struct ex_data_schema ex_schema;
int set_flag;
int table_id; //ugly int table_id; //ugly
char table_name[NAME_MAX]; char table_name[NAME_MAX];
int set_flag;
struct ex_data_schema ex_schema;
struct table_manager *ref_tbl_mgr; struct table_manager *ref_tbl_mgr;
struct log_handle *logger; struct log_handle *logger;

View File

@@ -292,12 +292,7 @@ void maat_runtime_destroy(struct maat_runtime *maat_rt)
if (NULL == maat_rt) { if (NULL == maat_rt) {
return; return;
} }
if (maat_rt->ref_tbl_mgr != NULL) {
table_manager_runtime_destroy(maat_rt->ref_tbl_mgr);
maat_rt->ref_tbl_mgr = NULL;
}
if (maat_rt->sequence_map != NULL) { if (maat_rt->sequence_map != NULL) {
maat_kv_store_free(maat_rt->sequence_map); maat_kv_store_free(maat_rt->sequence_map);
maat_rt->sequence_map = NULL; maat_rt->sequence_map = NULL;

View File

@@ -441,6 +441,11 @@ void maat_table_free(struct maat_table *maat_tbl)
maat_tbl->runtime = NULL; maat_tbl->runtime = NULL;
} }
if (maat_tbl->updating_runtime != NULL) {
maat_table_runtime_free(maat_tbl->updating_runtime, maat_tbl->table_type);
maat_tbl->updating_runtime = NULL;
}
FREE(maat_tbl); FREE(maat_tbl);
} }
@@ -877,6 +882,7 @@ void table_commit_updating_runtime(struct table_manager *tbl_mgr, int table_id,
void *runtime = table_manager_get_runtime(tbl_mgr, table_id); void *runtime = table_manager_get_runtime(tbl_mgr, table_id);
tbl_mgr->tbl[table_id]->runtime = updating_rt; tbl_mgr->tbl[table_id]->runtime = updating_rt;
if (runtime != NULL) { if (runtime != NULL) {
enum table_type *arg = ALLOC(enum table_type, 1); enum table_type *arg = ALLOC(enum table_type, 1);
*arg = table_type; *arg = table_type;
@@ -902,7 +908,7 @@ void table_commit_runtime(struct table_manager *tbl_mgr, int table_id,
__FUNCTION__, __LINE__, table_id); __FUNCTION__, __LINE__, table_id);
return; return;
} }
struct maat_table *ptable = tbl_mgr->tbl[table_id]; struct maat_table *ptable = tbl_mgr->tbl[table_id];
if (table_ops[table_type].commit_runtime != NULL) { if (table_ops[table_type].commit_runtime != NULL) {
table_ops[table_type].commit_runtime(runtime, ptable->table_name, maat_rt_version); table_ops[table_type].commit_runtime(runtime, ptable->table_name, maat_rt_version);

View File

@@ -337,7 +337,6 @@ static void random_keyword_generate(char *keyword_buf, size_t sz)
return; return;
} }
#if 1
class MaatFlagScan : public testing::Test class MaatFlagScan : public testing::Test
{ {
protected: protected:
@@ -5555,7 +5554,7 @@ TEST_F(MaatRollbackTest, FullConfigRollback) {
maat_state_free(state); maat_state_free(state);
state = NULL; state = NULL;
} }
#endif
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
int ret=0; int ret=0;