Changeset: 31d5214f5085 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/31d5214f5085
Modified Files:
sql/backends/monet5/sql.c
sql/server/sql_var.c
Branch: default
Log Message:
Implemented Boolean variable `pipeline` to switch pipeline mode on/off.
diffs (36 lines):
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -838,6 +838,12 @@ setVariable(Client cntxt, MalBlkPtr mb,
throw(SQL, "sql.setVariable",
SQLSTATE(HY013) MAL_MALLOC_FAIL);
} else if (!sqlvar_set_string(m->session->sa,
find_global_var(m, s, varname), newopt))
throw(SQL, "sql.setVariable", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
+ } else if (strcmp(s->base.name, "sys") == 0 &&
+ strcmp(varname, "pipeline") == 0) {
+ bit val = *getArgReference_bit(stk, pci, 4);
+ if (is_bit_nil(val))
+ throw(SQL, "sql.setVariable", SQLSTATE(42000)
"Variable '%s.%s' cannot be NULL", sname, varname);
+ cntxt->qryctx.pipeline_mode = (bool) val;
} else {
ValPtr ptr = &stk->stk[getArg(pci, 4)];
diff --git a/sql/server/sql_var.c b/sql/server/sql_var.c
--- a/sql/server/sql_var.c
+++ b/sql/server/sql_var.c
@@ -18,6 +18,7 @@
#include "sql_datetime.h"
#include "sql_atom.h"
#include "rel_rel.h"
+#include "mal_client.h" /* for default_pipeline_mode */
static void
destroy_sql_var(void *gdata, void *data)
@@ -82,6 +83,8 @@ init_global_variables(mvc *sql)
SQL_GLOBAL(sa, sname, "last_id", &sec);
SQL_GLOBAL(sa, sname, "rowcnt", &sec);
+ sql_find_subtype(&ctype, "boolean", 0, 0);
+ SQL_GLOBAL(sa, sname, "pipeline", &(bit){default_pipeline_mode});
return 0;
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]