From ca31d250af032cf7187ce3de74f9f35c9a9bcc1b Mon Sep 17 00:00:00 2001 From: liao-yonghuang Date: Tue, 9 Dec 2025 10:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=94=AF=E6=8C=81=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=88=86=E5=B8=83=E5=BC=8F=E8=A1=A8=E3=80=91?= =?UTF-8?q?=E3=80=90bugfix=E3=80=91=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E8=A1=A8=E5=90=8E=E5=BC=82=E6=AD=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=88=86=E5=B8=83=E5=BC=8F=E8=A1=A8=E6=9C=AA=E5=9B=9E?= =?UTF-8?q?=E6=BB=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liao-yonghuang --- .../relational/sqlite_single_relational_storage_engine.cpp | 1 + .../interfaces/distributeddb_interfaces_stop_task_test.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_relational_storage_engine.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_relational_storage_engine.cpp index a847dc50346..64a7cc8464d 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_relational_storage_engine.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/relational/sqlite_single_relational_storage_engine.cpp @@ -316,6 +316,7 @@ int SQLiteSingleRelationalStorageEngine::CreateDistributedTable(const CreateDist } if (param.isAsync && !table.GetTrackerTable().GetTableName().empty()) { LOGE("[CreateDistributedTable] not support async create distributed table on tracker table"); + (void)handle->Rollback(); return -E_NOT_SUPPORT; } if (!table.GetTrackerTable().IsEmpty() && param.syncType == TableSyncType::DEVICE_COOPERATION && diff --git a/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_stop_task_test.cpp b/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_stop_task_test.cpp index 6868a9bca40..b932c98de66 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_stop_task_test.cpp +++ b/frameworks/libs/distributeddb/test/unittest/common/interfaces/distributeddb_interfaces_stop_task_test.cpp @@ -1014,6 +1014,11 @@ HWTEST_F(DistributedDBInterfacesStopTaskTest, AsyncCreateDistributedDBTableTest0 bool isExistFlag = true; CheckAsyncGenLogFlag(NORMAL_TABLE, isExistFlag); EXPECT_FALSE(isExistFlag); + /** + * @tc.steps:step3. Async create distributed table again. + * @tc.expected: step3. Return NOT_SUPPORT. + */ + EXPECT_EQ(g_delegate->CreateDistributedTable(NORMAL_TABLE, CLOUD_COOPERATION, {true}), NOT_SUPPORT); } /** -- Gitee