Hi Hung,

Ack from me.

Thanks,
Zoran

-----Original Message-----
From: Hung Nguyen [mailto:[email protected]] 
Sent: den 6 september 2017 13:42
To: Zoran Milinkovic <[email protected]>
Cc: [email protected]; Hung Duc Nguyen 
<[email protected]>
Subject: [PATCH 1/1] imm: Regenerate PBE on SQLITE_CORRUPT and SQLITE_MISMATCH 
[#2573]

Regenerate PBE on SQLITE_CORRUPT and SQLITE_MISMATCH.
---
 src/imm/common/immpbe_dump.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc 
index 3d7c57e..11af674 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -415,7 +415,8 @@ static void valuesToPBE(const SaImmAttrValuesT_2 *p, 
SaImmAttrFlagsT attrFlags,
     if (rc != SQLITE_DONE) {
       LOG_ER("SQL statement ('%s') failed with error code: %d\n",
              preparedSql[sqlIndex], rc);
-      if (rc == SQLITE_CONSTRAINT) {
+      if (rc == SQLITE_CONSTRAINT || rc == SQLITE_CORRUPT
+          || rc == SQLITE_MISMATCH) {
         badfile = true;
       }
       goto bailout;
@@ -2405,7 +2406,8 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   if (rc != SQLITE_DONE) {
     LOG_ER("SQL statement('%s') failed with error code: %d",
            preparedSql[SQL_INS_OBJECTS], rc);
-    if (rc == SQLITE_CONSTRAINT) {
+    if (rc == SQLITE_CONSTRAINT || rc == SQLITE_CORRUPT
+        || rc == SQLITE_MISMATCH) {
       badfile = true;
     }
     goto bailout;
@@ -2475,7 +2477,8 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   if (rc != SQLITE_DONE) {
     LOG_ER("SQL object statement for table '%s' failed with error code: %d\n",
            classNameString.c_str(), rc);
-    if(rc == SQLITE_CONSTRAINT) {
+    if (rc == SQLITE_CONSTRAINT || rc == SQLITE_CORRUPT
+        || rc == SQLITE_MISMATCH) {
       badfile = true;
     }
     goto bailout;
--
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to