• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Distributed Data Management Changelog
2
3## cl.distributeddatamgr.1 Change of Error Codes Returned When RelationalStore execute() and executeSync() Execute an Invalid SQL Statement
4
5**Access Level**
6
7Public API
8
9**Reason for Change**
10
11The change is made to improve accuracy of the error codes returned by APIs, which helps increase the fault locating efficiency.
12
13**Change Impact**
14
15This change is a non-compatible change.
16
17Before the change:
18
19If an invalid SQL statement is executed, error code 14800000 is reported.
20
21After the change:
22
23If an invalid SQL statement is executed, error code 14800021 is reported.
24
25**Start API Level**
26
2712
28
29**Change Since**
30
31OpenHarmony SDK 5.0.0.38
32
33**Key API/Component Changes**
34
35|               Use Case              |      Error Code Before the Change     |      Error Code After the Change     |
36| :------------------------------ | :--------------: | :--------------: |
37|   An invalid SQL statement is executed by **execute()**.  | 14800000| 14800021|
38| An invalid SQL statement is executed by **executeSync()**.| 14800000| 14800021|
39
40**Adaptation Guide**
41
42If error code 14800000 was used in **execute()** and **executeSync()**, change the error code to 14800021.
43
44Before the change:
45
46If an invalid SQL statement is executed by **execute()**, the error message is as follows:
47
48```ts
49try {
50    await rdbStore.execute("COMMIT");
51} catch (err) {
52    if (err.code === 14800000) {
53        console.log(`execute failed, code: ${err.code}`);
54    }
55}
56```
57
58After the change:
59
60If an invalid SQL statement is executed by **execute()**, the error message is as follows:
61
62```ts
63try {
64    await rdbStore.execute("COMMIT");
65} catch (err) {
66    if (err.code === 14800021) {
67        console.log(`execute failed, code: ${err.code}`);
68    }
69}
70```
71
72Before the change:
73
74If an invalid SQL statement is executed by **executeSync()**, the error message is as follows:
75
76```ts
77try {
78    await rdbStore.executeSync("COMMIT");
79} catch (err) {
80    if (err.code === 14800000) {
81        console.log(`execute failed, code: ${err.code}`);
82    }
83}
84```
85
86After the change:
87
88If an invalid SQL statement is executed by **executeSync()**, the error message is as follows:
89
90```ts
91try {
92    await rdbStore.executeSync("COMMIT");
93} catch (err) {
94    if (err.code === 14800021) {
95        console.log(`execute failed, code: ${err.code}`);
96    }
97}
98```
99