Changeset: 8b7f3d3b61f8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b7f3d3b61f8
Modified Files:
        sql/backends/monet5/sql_gencode.c
Branch: default
Log Message:

Hold store lock while creating and destroying sql session


diffs (29 lines):

diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -1177,7 +1177,10 @@ mal_function_find_implementation_address
        m->type = Q_PARSE;
        m->user_id = m->role_id = USER_MONETDB;
 
-       if (!(m->session = sql_session_create(0, 0))) {
+       store_lock();
+       m->session = sql_session_create(0, 0);
+       store_unlock();
+       if (!m->session) {
                (void) sql_error(o, 02, SQLSTATE(HY013) MAL_MALLOC_FAIL);
                goto bailout;
        }
@@ -1220,8 +1223,11 @@ mal_function_find_implementation_address
 bailout:
        if (m) {
                bstream_destroy(m->scanner.rs);
-               if (m->session)
-                       sql_session_destroy(m->session); 
+               if (m->session) {
+                       store_lock();
+                       sql_session_destroy(m->session);
+                       store_unlock();
+               }
                if (m->sa)
                        sa_destroy(m->sa);
                _DELETE(m);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to