From 45f18a0c5ae525b4d92a79223885780356c2eab1 Mon Sep 17 00:00:00 2001 From: lbbniu Date: Wed, 31 Jan 2024 11:09:02 +0800 Subject: [PATCH 1/2] optimize doReserveDb drop table --- StatServer/StatServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StatServer/StatServer.cpp b/StatServer/StatServer.cpp index 661c083..5ef5d62 100644 --- a/StatServer/StatServer.cpp +++ b/StatServer/StatServer.cpp @@ -139,7 +139,7 @@ void StatServer::doReserveDb(const string path, TC_Config *pconf) { TLOGDEBUG(__FUNCTION__ << ", drop name:" << name << ", tableName: " << tableName << ", " << (name < tableName) << endl); - mysql.execute("drop table " + name); + mysql.execute("DROP TABLE IF EXISTS " + name); } else { From 03cdbe7768d507fa7eebc5460696fd7ab60cb85a Mon Sep 17 00:00:00 2001 From: lbbniu Date: Wed, 31 Jan 2024 11:11:04 +0800 Subject: [PATCH 2/2] optimize property drop table --- PropertyServer/PropertyServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PropertyServer/PropertyServer.cpp b/PropertyServer/PropertyServer.cpp index 8f65f00..ffea009 100644 --- a/PropertyServer/PropertyServer.cpp +++ b/PropertyServer/PropertyServer.cpp @@ -139,7 +139,7 @@ void PropertyServer::doReserveDb(const string path, TC_Config *pconf) { TLOGDEBUG(__FUNCTION__ << ", drop name:" << name << ", tableName: " << tableName << ", " << (name < tableName) << endl); - mysql.execute("drop table " + name); + mysql.execute("DROP TABLE IF EXISTS " + name); } else {