mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-23 07:00:41 +00:00
!917 db path length is less than or equal to 128 bytes
Merge pull request !917 from LeiiYB/master
This commit is contained in:
commit
dda862c8be
@ -126,8 +126,8 @@ int ParseDatabasePath(const napi_env &env, const napi_value &object, std::shared
|
||||
}
|
||||
|
||||
auto [realPath, errCode] = RdbSqlUtils::GetDefaultDatabasePath(defaultDir, context->config.GetName(), customDir);
|
||||
// customDir length is limited to 1024 bytes
|
||||
CHECK_RETURN_SET(errCode == E_OK && realPath.length() <= 1024,
|
||||
// customDir length is limited to 128 bytes
|
||||
CHECK_RETURN_SET(errCode == E_OK && realPath.length() <= 128,
|
||||
std::make_shared<ParamError>("config", "a StoreConfig."));
|
||||
|
||||
context->config.SetPath(std::move(realPath));
|
||||
|
@ -44,7 +44,7 @@ const STORE_CONFIG3 = {
|
||||
const STORE_CONFIG4 = {
|
||||
name: "RdbCustomDir4.db",
|
||||
securityLevel: data_relationalStore.SecurityLevel.S1,
|
||||
customDir: "custom".repeat(1000),
|
||||
customDir: "custom".repeat(30), // customDir length exceeds 128 bytes
|
||||
};
|
||||
|
||||
const asset1 = {
|
||||
@ -415,7 +415,7 @@ describe('rdbStoreCustomTest', function () {
|
||||
|
||||
/**
|
||||
* @tc.number testRdbStoreCustomDirTest00010
|
||||
* @tc.name AbNormal test case of getRdbStore, if customDir length exceeds 1024 bytes
|
||||
* @tc.name AbNormal test case of getRdbStore, if customDir length exceeds 128 bytes
|
||||
* @tc.desc 1.Configure customDir
|
||||
* 2.Execute getRdbStore
|
||||
*/
|
||||
@ -431,6 +431,5 @@ describe('rdbStoreCustomTest', function () {
|
||||
}
|
||||
console.info(TAG, "************* testRdbStoreCustomDirTest00010 end *************")
|
||||
})
|
||||
|
||||
console.info(TAG, "*************Unit Test End*************");
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user