Possible fix for the core files seen when 2 Contexts are involved.
Introduced semaphore to initialize nadefaults from one context only.
diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp
index 8ac2ce4..3e16492 100644
--- a/core/sql/sqlcomp/nadefaults.cpp
+++ b/core/sql/sqlcomp/nadefaults.cpp
@@ -55,6 +55,7 @@
#include "CliDefs.h"
+#include "CliSemaphore.h"
#include "CmpContext.h"
#include "CmpErrors.h"
#include "ComObjectName.h"
@@ -3798,16 +3799,24 @@
systemParamterUpdated = TRUE;
}
- if (! readFromDefaultsTable_) {
- initCurrentDefaultsWithDefaultDefaults();
- readFromDefaultsTable();
- saveCurrentDefaults();
- readFromDefaultsTable_ = TRUE;
- }
- else {
+ if (readFromDefaultsTable_) {
initCurrentDefaultsFromSavedDefaults();
readFromDefaultsTable();
}
+ else {
+ globalSemaphore.get();
+ if (readFromDefaultsTable_) {
+ globalSemaphore.release();
+ initCurrentDefaultsFromSavedDefaults();
+ readFromDefaultsTable();
+ } else {
+ initCurrentDefaultsWithDefaultDefaults();
+ readFromDefaultsTable();
+ saveCurrentDefaults();
+ readFromDefaultsTable_ = TRUE;
+ globalSemaphore.release();
+ }
+ }
// Set additional defaultDefaults flags:
// If an attr allows ON/OFF/SYSTEM and the default-default is not SYSTEM,