Changeset: 8092f92c84db for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8092f92c84db
Removed Files:
sql/test/BugTracker-2009/drop_history.sql
sql/test/BugTracker-2009/set_history_and_drop_table.SF-2607045.sql
sql/test/BugTracker-2011/Tests/history.Bug-2909.sql
sql/test/BugTracker-2011/Tests/history.Bug-2909.stable.err
sql/test/BugTracker-2011/Tests/history.Bug-2909.stable.out
Modified Files:
common/utils/mutils.h
gdk/gdk_bbp.c
gdk/gdk_storage.c
monetdb5/mal/mal_profiler.c
sql/ChangeLog.Apr2019
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/51_sys_schema_extension.sql
sql/server/sql_env.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/test/BugTracker-2011/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.powerpc64.int128
Branch: default
Log Message:
Merge with Apr2019 branch.
diffs (truncated from 129524 to 300 lines):
diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -48,13 +48,17 @@ mutils_export char *dirname(char *path);
/* if one doesn't exist, presumably they all don't exist - Not so on MinGW */
#define S_IRUSR 0000400 /* read permission, owner */
#define S_IWUSR 0000200 /* write permission, owner */
+#define S_IXUSR 0000100 /* execute permission, owner */
#define S_IRGRP 0000040 /* read permission, group */
-#define S_IWGRP 0000020 /* write permission, grougroup */
+#define S_IWGRP 0000020 /* write permission, group */
+#define S_IXGRP 0000010 /* execute permission, group */
#define S_IROTH 0000004 /* read permission, other */
#define S_IWOTH 0000002 /* write permission, other */
+#define S_IXOTH 0000001 /* execute permission, other */
#endif
#define MONETDB_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
S_IWOTH)
+#define MONETDB_DIRMODE (MONETDB_MODE | S_IXUSR | S_IXGRP |
S_IXOTH)
#define F_TEST 3 /* test a region for other processes locks. */
#define F_TLOCK 2 /* test and lock a region for exclusive
use */
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1241,7 +1241,7 @@ BBPaddfarm(const char *dirname, int role
if (rolemask == 0 || (rolemask & 1 && BBPfarms[0].dirname != NULL)) {
GDKfatal("BBPaddfarm: bad rolemask\n");
}
- if (mkdir(dirname, 0755) < 0) {
+ if (mkdir(dirname, MONETDB_DIRMODE) < 0) {
if (errno == EEXIST) {
if (stat(dirname, &st) == -1 || !S_ISDIR(st.st_mode)) {
GDKfatal("BBPaddfarm: %s: not a directory\n",
dirname);
@@ -3029,7 +3029,7 @@ BBPprepare(bool subcommit)
backup_dir = 0;
ret = BBPrecover(0);
if (ret == GDK_SUCCEED) {
- if (mkdir(bakdirpath, 0755) < 0 && errno != EEXIST) {
+ if (mkdir(bakdirpath, MONETDB_DIRMODE) < 0 && errno !=
EEXIST) {
GDKsyserror("BBPprepare: cannot create
directory %s\n", bakdirpath);
ret = GDK_FAIL;
}
@@ -3039,7 +3039,7 @@ BBPprepare(bool subcommit)
}
if (ret == GDK_SUCCEED && start_subcommit) {
/* make a new SUBDIR (subdir of BAKDIR) */
- if (mkdir(subdirpath, 0755) < 0) {
+ if (mkdir(subdirpath, MONETDB_DIRMODE) < 0) {
GDKsyserror("BBPprepare: cannot create directory %s\n",
subdirpath);
ret = GDK_FAIL;
}
@@ -3425,7 +3425,7 @@ BBPrecover(int farmid)
dstdir = dstpath + j;
IODEBUG fprintf(stderr, "#BBPrecover(start)\n");
- if (mkdir(leftdirpath, 0755) < 0 && errno != EEXIST) {
+ if (mkdir(leftdirpath, MONETDB_DIRMODE) < 0 && errno != EEXIST) {
GDKsyserror("BBPrecover: cannot create directory %s\n",
leftdirpath);
closedir(dirp);
GDKfree(bakdirpath);
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -118,7 +118,7 @@ GDKcreatedir(const char *dir)
#ifdef WIN32
strlen(path) > 3 &&
#endif
- mkdir(path, 0755) < 0) {
+ mkdir(path, MONETDB_DIRMODE) < 0) {
if (errno != EEXIST) {
GDKsyserror("GDKcreatedir: cannot create
directory %s\n", path);
IODEBUG fprintf(stderr, "#GDKcreatedir:
mkdir(%s) failed\n", path);
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -599,7 +599,7 @@ startTrace(str path)
MT_lock_set(&mal_profileLock );
if(eventstream == NULL && offlinestore ==0){
snprintf(buf,FILENAME_MAX,"%s%c%s",GDKgetenv("gdk_dbpath"), DIR_SEP, path);
- if (mkdir(buf, 0755) < 0 && errno != EEXIST) {
+ if (mkdir(buf, MONETDB_DIRMODE) < 0 && errno != EEXIST)
{
MT_lock_unset(&mal_profileLock);
throw(MAL, "profiler.startTrace",
SQLSTATE(42000) "Failed to create directory %s", buf);
}
diff --git a/sql/ChangeLog.Apr2019 b/sql/ChangeLog.Apr2019
--- a/sql/ChangeLog.Apr2019
+++ b/sql/ChangeLog.Apr2019
@@ -1,6 +1,9 @@
# ChangeLog file for sql
# This file is updated with Maddlog
+* Fri Jan 18 2019 Sjoerd Mullender <[email protected]>
+- Removed unused global SQL variable "history".
+
* Thu Dec 20 2018 Pedro Ferreira <[email protected]>
- Allow usage of custom expressions in GROUP BY and PARTITION BY
clauses. The same expressions can be used in the projection phase as
diff --git a/sql/backends/monet5/UDF/capi/capi.c
b/sql/backends/monet5/UDF/capi/capi.c
--- a/sql/backends/monet5/UDF/capi/capi.c
+++ b/sql/backends/monet5/UDF/capi/capi.c
@@ -693,7 +693,7 @@ static str CUDFeval(Client cntxt, MalBlk
msg = createException(MAL, "cudf.eval",
MAL_MALLOC_FAIL);
goto wrapup;
}
- if (mkdir(deldirpath, 0755) < 0 && errno != EEXIST) {
+ if (mkdir(deldirpath, 0777) < 0 && errno != EEXIST) {
msg = createException(MAL, "cudf.eval",
"cannot
create directory %s\n", deldirpath);
goto wrapup;
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -231,7 +231,7 @@ SQLepilogue(void *ret)
if(!stack_push_var(sql, name, &ctype) || !stack_set_var(sql, name,
VALset(&src, ctype.type->localtype, val))) \
failure--;
-#define NR_GLOBAL_VARS 10
+#define NR_GLOBAL_VARS 9
/* NR_GLOBAL_VAR should match exactly the number of variables created
in global_variables */
/* initialize the global variable, ie make mvc point to these */
@@ -241,7 +241,6 @@ global_variables(mvc *sql, char *user, c
sql_subtype ctype;
char *typename;
lng sec = 0;
- bit F = FALSE;
ValRecord src;
str opt;
int failure = 0;
@@ -267,10 +266,6 @@ global_variables(mvc *sql, char *user, c
sql_find_subtype(&ctype, typename, inttype2digits(ihour, isec), 0);
SQLglobal("current_timezone", &sec, failure);
- typename = "boolean";
- sql_find_subtype(&ctype, typename, 0, 0);
- SQLglobal("history", &F, failure);
-
typename = "bigint";
sql_find_subtype(&ctype, typename, 0, 0);
SQLglobal("last_id", &sql->last_id, failure);
diff --git a/sql/backends/monet5/sql_upgrades.c
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -1754,6 +1754,24 @@ sql_update_apr2019(Client c, mvc *sql)
"ALTER TABLE sys.keywords SET READ WRITE;\n"
"INSERT INTO sys.keywords VALUES ('WINDOW');\n"
);
+ t = mvc_bind_table(sql, s, "var_values");
+ t->system = 0; /* make it non-system else the drop view will fail */
+ pos += snprintf(buf + pos, bufsize - pos,
+ "DROP VIEW sys.var_values;\n"
+ "CREATE VIEW sys.var_values (var_name, value) AS\n"
+ "SELECT 'cache' AS var_name, convert(cache,
varchar(10)) AS value UNION ALL\n"
+ "SELECT 'current_role', current_role UNION ALL\n"
+ "SELECT 'current_schema', current_schema UNION ALL\n"
+ "SELECT 'current_timezone', current_timezone UNION
ALL\n"
+ "SELECT 'current_user', current_user UNION ALL\n"
+ "SELECT 'debug', debug UNION ALL\n"
+ "SELECT 'last_id', last_id UNION ALL\n"
+ "SELECT 'optimizer', optimizer UNION ALL\n"
+ "SELECT 'pi', pi() UNION ALL\n"
+ "SELECT 'rowcnt', rowcnt;\n"
+ "UPDATE sys._tables SET system = true WHERE name =
'var_values' AND schema_id = (SELECT id FROM sys.schemas WHERE name = 'sys');\n"
+ "GRANT SELECT ON sys.var_values TO PUBLIC;\n");
+
/* 99_system.sql */
t = mvc_bind_table(sql, s, "systemfunctions");
t->system = 0;
diff --git a/sql/scripts/51_sys_schema_extension.sql
b/sql/scripts/51_sys_schema_extension.sql
--- a/sql/scripts/51_sys_schema_extension.sql
+++ b/sql/scripts/51_sys_schema_extension.sql
@@ -413,7 +413,6 @@ SELECT 'current_schema', current_schema
SELECT 'current_timezone', current_timezone UNION ALL
SELECT 'current_user', current_user UNION ALL
SELECT 'debug', debug UNION ALL
-SELECT 'history', history UNION ALL
SELECT 'last_id', last_id UNION ALL
SELECT 'optimizer', optimizer UNION ALL
SELECT 'pi', pi() UNION ALL
diff --git a/sql/server/sql_env.c b/sql/server/sql_env.c
--- a/sql/server/sql_env.c
+++ b/sql/server/sql_env.c
@@ -79,13 +79,6 @@ sql_update_var(mvc *m, const char *name,
assert((lng) GDK_int_min <= sgn && sgn <= (lng) GDK_int_max);
#endif
m->cache = (int) sgn;
- } else if (strcmp(name, "history") == 0) {
-#ifdef HAVE_HGE
- assert((hge) GDK_int_min <= sgn && sgn <= (hge) GDK_int_max);
-#else
- assert((lng) GDK_int_min <= sgn && sgn <= (lng) GDK_int_max);
-#endif
- m->history = (sgn != 0);
}
return NULL;
}
diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -94,8 +94,6 @@ mvc_init(int debug, store_type store, in
/* disable caching */
m->caching = 0;
- /* disable history */
- m->history = 0;
/* disable size header */
m->sizeheader = 0;
@@ -674,7 +672,6 @@ mvc_create(int clientid, backend_stack s
m->debug = debug;
m->cache = DEFAULT_CACHESIZE;
m->caching = m->cache;
- m->history = 0;
m->label = 0;
m->remote = 0;
@@ -756,9 +753,6 @@ mvc_reset(mvc *m, bstream *rs, stream *w
stack_set_number(m, "cache", DEFAULT_CACHESIZE);
m->cache = DEFAULT_CACHESIZE;
m->caching = m->cache;
- if (m->history != 0)
- stack_set_number(m, "history", 0);
- m->history = 0;
m->label = 0;
m->remote = 0;
diff --git a/sql/server/sql_mvc.h b/sql/server/sql_mvc.h
--- a/sql/server/sql_mvc.h
+++ b/sql/server/sql_mvc.h
@@ -126,7 +126,6 @@ typedef struct mvc {
int timezone; /* milliseconds west of UTC */
int cache; /* some queries should not be cached ! */
int caching; /* cache current query ? */
- int history; /* queries statistics are kept */
int reply_size; /* reply size */
int sizeheader; /* print size header in result set */
int debug;
diff --git a/sql/test/BugTracker-2009/drop_history.sql
b/sql/test/BugTracker-2009/drop_history.sql
deleted file mode 100644
--- a/sql/test/BugTracker-2009/drop_history.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-set history = false;
-call resetHistory();
diff --git a/sql/test/BugTracker-2009/set_history_and_drop_table.SF-2607045.sql
b/sql/test/BugTracker-2009/set_history_and_drop_table.SF-2607045.sql
deleted file mode 100644
--- a/sql/test/BugTracker-2009/set_history_and_drop_table.SF-2607045.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-set history = true;
-create table t1 (id int);
-drop table t1;
diff --git a/sql/test/BugTracker-2011/Tests/All
b/sql/test/BugTracker-2011/Tests/All
--- a/sql/test/BugTracker-2011/Tests/All
+++ b/sql/test/BugTracker-2011/Tests/All
@@ -52,7 +52,6 @@ HAVE_PYMONETDB?python-connections-Bug.29
many-connects-cache.Bug-2904
alter-table-set-read-only.bug-2906
predicate.Bug-2908
-history.Bug-2909
interrupted-initialization.Bug-2875
case-overflow.Bug-2239
sqltables.Bug-2921
diff --git a/sql/test/BugTracker-2011/Tests/history.Bug-2909.sql
b/sql/test/BugTracker-2011/Tests/history.Bug-2909.sql
deleted file mode 100644
--- a/sql/test/BugTracker-2011/Tests/history.Bug-2909.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-set history = true;
-select 1;
diff --git a/sql/test/BugTracker-2011/Tests/history.Bug-2909.stable.err
b/sql/test/BugTracker-2011/Tests/history.Bug-2909.stable.err
deleted file mode 100644
--- a/sql/test/BugTracker-2011/Tests/history.Bug-2909.stable.err
+++ /dev/null
@@ -1,37 +0,0 @@
-stderr of test 'history.Bug-2909` in directory 'sql/test/BugTracker-2011`
itself:
-
-
-# 17:31:53 >
-# 17:31:53 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/ufs/sjoerd/Monet-stable/var/MonetDB" "--set" "mapi_open=true"
"--set" "mapi_port=39058" "--set" "monet_prompt=" "--trace" "--forcemito"
"--set" "mal_listing=2" "--dbname=mTests_test_BugTracker-2011" "--set"
"mal_listing=0"
-# 17:31:53 >
-
-# builtin opt gdk_dbname = demo
-# builtin opt gdk_dbfarm = /ufs/sjoerd/Monet-stable/var/monetdb5/dbfarm
-# builtin opt gdk_debug = 0
-# builtin opt gdk_alloc_map = no
-# builtin opt gdk_vmtrim = yes
-# builtin opt monet_prompt = >
-# builtin opt monet_daemon = no
-# builtin opt mapi_port = 50000
-# builtin opt mapi_open = false
-# builtin opt mapi_autosense = false
-# builtin opt sql_optimizer = default_pipe
-# builtin opt sql_debug = 0
-# cmdline opt gdk_nr_threads = 0
-# cmdline opt gdk_dbfarm = /ufs/sjoerd/Monet-stable/var/MonetDB
-# cmdline opt mapi_open = true
-# cmdline opt mapi_port = 39058
-# cmdline opt monet_prompt =
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list