commit
f008643c6f
|
@ -179,9 +179,14 @@ void mnodeDecDbRef(SDbObj *pDb) {
|
||||||
|
|
||||||
SDbObj *mnodeGetDbByTableId(char *tableId) {
|
SDbObj *mnodeGetDbByTableId(char *tableId) {
|
||||||
char db[TSDB_TABLE_ID_LEN], *pos;
|
char db[TSDB_TABLE_ID_LEN], *pos;
|
||||||
|
|
||||||
|
// tableId format should be : acct.db.table
|
||||||
pos = strstr(tableId, TS_PATH_DELIMITER);
|
pos = strstr(tableId, TS_PATH_DELIMITER);
|
||||||
|
assert(NULL != pos);
|
||||||
|
|
||||||
pos = strstr(pos + 1, TS_PATH_DELIMITER);
|
pos = strstr(pos + 1, TS_PATH_DELIMITER);
|
||||||
|
assert(NULL != pos);
|
||||||
|
|
||||||
memset(db, 0, sizeof(db));
|
memset(db, 0, sizeof(db));
|
||||||
strncpy(db, tableId, pos - tableId);
|
strncpy(db, tableId, pos - tableId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue