Changeset: f5cae21ec25d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5cae21ec25d
Modified Files:
        monetdb5/mal/mal_errors.h
        sql/storage/store.c
Branch: cmake-monetdblite
Log Message:

Restart storage global variables on server restart.

Also revert SQLSTATE macro change for MonetDBLite.


diffs (70 lines):

diff --git a/monetdb5/mal/mal_errors.h b/monetdb5/mal/mal_errors.h
--- a/monetdb5/mal/mal_errors.h
+++ b/monetdb5/mal/mal_errors.h
@@ -40,11 +40,7 @@
 #ifndef MAL_ERRORS
 #define MAL_ERRORS
 
-#ifdef HAVE_EMBEDDED
-#define SQLSTATE(sqlstate) " "
-#else
-#define SQLSTATE(sqlstate) #sqlstate "!"
-#endif
+#define SQLSTATE(sqlstate)     #sqlstate "!"
 
 #define MANUAL_HELP "See documentation for details"
 
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -35,6 +35,8 @@ store_type active_store_type = store_bat
 int store_readonly = 0;
 int store_singleuser = 0;
 int store_initialized = 0;
+static bool logging = false;
+static ATOMIC_TYPE need_flush = ATOMIC_VAR_INIT(0);
 
 static backend_stack backend_stk;
 
@@ -1986,7 +1988,6 @@ store_load(void) {
 int
 store_init(int debug, store_type store, int readonly, int singleuser, 
backend_stack stk)
 {
-
        int v = 1;
 
        backend_stk = stk;
@@ -1994,6 +1995,15 @@ store_init(int debug, store_type store, 
        bs_debug = debug&2;
        store_readonly = readonly;
        store_singleuser = singleuser;
+       store_initialized = 0;
+       nr_sessions = 0;
+       store_oid = 0;
+       prev_oid = 0;
+       transactions = 0;
+       store_oids = NULL;
+       nstore_oids = 0;
+       logging = false;
+       ATOMIC_SET(&need_flush, 0);
 
        MT_lock_set(&bs_lock);
 
@@ -2024,8 +2034,6 @@ store_init(int debug, store_type store, 
        return store_load();
 }
 
-static bool logging = false;
-
 void
 store_exit(void)
 {
@@ -2083,8 +2091,6 @@ store_apply_deltas(void)
        logging = false;
 }
 
-static ATOMIC_TYPE need_flush = ATOMIC_VAR_INIT(0);
-
 void
 store_flush_log(void)
 {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to