fix: failed to identify dbName when only ? exists
This commit is contained in:
parent
1a32279f7f
commit
42361fcd45
|
@ -75,11 +75,11 @@ bool qParseDbName(const char* pStr, size_t length, char** pDbName) {
|
||||||
*pDbName = NULL;
|
*pDbName = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
char *dotPos = strchr(t.z, '.');
|
char *dotPos = strnchr(t.z, '.', t.n, true);
|
||||||
if (dotPos != NULL) {
|
if (dotPos != NULL) {
|
||||||
int dbNameLen = dotPos - t.z;
|
int dbNameLen = dotPos - t.z;
|
||||||
*pDbName = taosMemoryMalloc(dbNameLen + 1);
|
*pDbName = taosMemoryMalloc(dbNameLen + 1);
|
||||||
if (NULL == *pDbName) {
|
if (*pDbName == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
strncpy(*pDbName, t.z, dbNameLen);
|
strncpy(*pDbName, t.z, dbNameLen);
|
||||||
|
|
Loading…
Reference in New Issue