fix:add excluded msg for meta in tmq

This commit is contained in:
wangmm0220 2024-02-22 11:32:45 +08:00
parent 6e13e4aa63
commit c22360a529
2 changed files with 11 additions and 3 deletions

View File

@ -323,7 +323,7 @@ class TDTestCase:
tdSql.query("select * from st")
tdSql.checkRows(8)
tdSql.execute(f'create topic topic_excluded with meta as database d1')
tdSql.execute(f'create topic topic_all with meta as database d1')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
@ -333,7 +333,7 @@ class TDTestCase:
consumer = Consumer(consumer_dict)
try:
consumer.subscribe(["topic_excluded"])
consumer.subscribe(["topic_all"])
except TmqError:
tdLog.exit(f"subscribe error")

View File

@ -20,6 +20,7 @@
#include <time.h>
#include "taos.h"
#include "types.h"
#include "tmsg.h"
static int running = 1;
TdFilePtr g_fp = NULL;
@ -966,7 +967,14 @@ void testConsumeExcluded(int topic_type){
tmq_raw_data raw = {0};
tmq_get_raw(msg, &raw);
if(topic_type == 1){
assert(raw.raw_type != 2 && raw.raw_type != 4);
assert(raw.raw_type != 2 && raw.raw_type != 4 &&
raw.raw_type != TDMT_VND_CREATE_STB &&
raw.raw_type != TDMT_VND_ALTER_STB &&
raw.raw_type != TDMT_VND_CREATE_TABLE &&
raw.raw_type != TDMT_VND_ALTER_TABLE &&
raw.raw_type != TDMT_VND_DELETE);
assert(raw.raw_type == TDMT_VND_DROP_STB ||
raw.raw_type == TDMT_VND_DROP_TABLE);
}else if(topic_type == 2){
assert(0);
}