MonetDB: Jul2017 - Stick requirements on their own line.

2017-08-04 Thread Sjoerd Mullender
Changeset: fae670c9d2a1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fae670c9d2a1
Modified Files:
MonetDB.spec
Branch: Jul2017
Log Message:

Stick requirements on their own line.


diffs (14 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -139,7 +139,9 @@ Source: https://www.monetdb.org/download
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
 # RHEL >= 7, and all current Fedora
 BuildRequires: systemd
-BuildRequires: checkpolicy, selinux-policy-devel, hardlink
+BuildRequires: checkpolicy
+BuildRequires: selinux-policy-devel
+BuildRequires: hardlink
 %endif
 BuildRequires: bison
 BuildRequires: bzip2-devel
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


monetdb-php: default - Add extensions to files so that "make ins...

2017-08-04 Thread Sjoerd Mullender
Changeset: fff2bebbc7e3 for monetdb-php
URL: https://dev.monetdb.org/hg/monetdb-php?cmd=changeset;node=fff2bebbc7e3
Added Files:
COPYING.txt
INSTALL.txt
README.txt
TODO.txt
Removed Files:
COPYING
INSTALL
README
TODO
Modified Files:
php-monetdb.spec
Branch: default
Log Message:

Add extensions to files so that "make install" can be used on a case-squashing 
file system.


diffs (46 lines):

diff --git a/COPYING b/COPYING.txt
rename from COPYING
rename to COPYING.txt
diff --git a/INSTALL b/INSTALL.txt
rename from INSTALL
rename to INSTALL.txt
diff --git a/README b/README.txt
rename from README
rename to README.txt
--- a/README
+++ b/README.txt
@@ -9,9 +9,9 @@ The php API aims at being compatible wit
 
  - examples/simple_query.php - an example of php+monetdb in action
 
- - INSTALL - note about installing and using the native interface
+ - INSTALL.txt - note about installing and using the native interface
 
- - TODO: list of pending tasks.
+ - TODO.txt: list of pending tasks.
 
 == Benchmark ==
 
diff --git a/TODO b/TODO.txt
rename from TODO
rename to TODO.txt
diff --git a/php-monetdb.spec b/php-monetdb.spec
--- a/php-monetdb.spec
+++ b/php-monetdb.spec
@@ -1,6 +1,6 @@
 Name:  php-monetdb
 Version:   1.0
-Release:   2%{?dist}
+Release:   3%{?dist}
 Summary:   MonetDB php interface
 Group: Applications/Databases
 
@@ -41,7 +41,7 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %files
-%license COPYING
+%license COPYING.txt
 %defattr(-,root,root)
 %dir %{_datadir}/php/monetdb
 %{_datadir}/php/monetdb/*
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Add error handling.

2017-08-04 Thread Sjoerd Mullender
Changeset: fedb63ea4b33 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fedb63ea4b33
Modified Files:
tools/merovingian/daemon/connections.c
Branch: Jul2017
Log Message:

Add error handling.
Fixes bug 6384.


diffs (14 lines):

diff --git a/tools/merovingian/daemon/connections.c 
b/tools/merovingian/daemon/connections.c
--- a/tools/merovingian/daemon/connections.c
+++ b/tools/merovingian/daemon/connections.c
@@ -53,6 +53,10 @@ openConnectionTCP(int *ret, const char *
server.sin_family = AF_INET;
if (bindaddr) {
hoste = gethostbyname(bindaddr);
+   if (hoste == NULL) {
+   closesocket(sock);
+   return newErr("cannot find host %s", bindaddr);
+   }
memcpy(&server.sin_addr.s_addr, *(hoste->h_addr_list),
sizeof(server.sin_addr.s_addr));
} else {
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Approve upgrade.

2017-08-04 Thread Sjoerd Mullender
Changeset: 8a121df3e2b3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8a121df3e2b3
Modified Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: Jul2017
Log Message:

Approve upgrade.


diffs (truncated from 36304 to 300 lines):

diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -350,4903 +350,4943 @@ insert into sys.functions values (146, '
 insert into sys.args values (11626, 146, 'res_0', 'smallint', 16, 0, 0, 0);
 insert into sys.args values (11627, 146, 'arg_1', 'smallint', 16, 0, 1, 1);
 insert into sys.args values (11628, 146, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (147, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.functions values (147, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11629, 147, 'res_0', 'smallint', 16, 0, 0, 0);
-insert into sys.args values (11630, 147, 'arg_1', 'smallint', 16, 0, 1, 1);
-insert into sys.args values (11631, 147, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (148, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11632, 148, 'res_0', 'int', 32, 0, 0, 0);
-insert into sys.args values (11633, 148, 'arg_1', 'int', 32, 0, 1, 1);
+insert into sys.args values (11630, 147, 'arg_1', 'tinyint', 8, 0, 1, 1);
+insert into sys.args values (11631, 147, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.functions values (148, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.args values (11632, 148, 'res_0', 'smallint', 16, 0, 0, 0);
+insert into sys.args values (11633, 148, 'arg_1', 'smallint', 16, 0, 1, 1);
 insert into sys.args values (11634, 148, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (149, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.functions values (149, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11635, 149, 'res_0', 'int', 32, 0, 0, 0);
 insert into sys.args values (11636, 149, 'arg_1', 'int', 32, 0, 1, 1);
 insert into sys.args values (11637, 149, 'arg_2', 'tinyint', 8, 0, 1, 2);
 insert into sys.functions values (150, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11638, 150, 'res_0', 'int', 32, 0, 0, 0);
-insert into sys.args values (11639, 150, 'arg_1', 'int', 32, 0, 1, 1);
-insert into sys.args values (11640, 150, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.args values (11639, 150, 'arg_1', 'tinyint', 8, 0, 1, 1);
+insert into sys.args values (11640, 150, 'arg_2', 'int', 32, 0, 1, 2);
 insert into sys.functions values (151, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11641, 151, 'res_0', 'int', 32, 0, 0, 0);
 insert into sys.args values (11642, 151, 'arg_1', 'int', 32, 0, 1, 1);
-insert into sys.args values (11643, 151, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.args values (11643, 151, 'arg_2', 'tinyint', 8, 0, 1, 2);
 insert into sys.functions values (152, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11644, 152, 'res_0', 'bigint', 64, 0, 0, 0);
-insert into sys.args values (11645, 152, 'arg_1', 'bigint', 64, 0, 1, 1);
-insert into sys.args values (11646, 152, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (153, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11647, 153, 'res_0', 'bigint', 64, 0, 0, 0);
-insert into sys.args values (11648, 153, 'arg_1', 'bigint', 64, 0, 1, 1);
-insert into sys.args values (11649, 153, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (154, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11650, 154, 'res_0', 'bigint', 64, 0, 0, 0);
-insert into sys.args values (11651, 154, 'arg_1', 'bigint', 64, 0, 1, 1);
+insert into sys.args values (11644, 152, 'res_0', 'int', 32, 0, 0, 0);
+insert into sys.args values (11645, 152, 'arg_1', 'int', 32, 0, 1, 1);
+insert into sys.args values (11646, 152, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.functions values (153, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.args values (11647, 153, 'res_0', 'int', 32, 0, 0, 0);
+insert into sys.args values (11648, 153, 'arg_1', 'smallint', 16, 0, 1, 1);
+insert into sys.args values (11649, 153, 'arg_2', 'int', 32, 0, 1, 2);
+insert into sys.functions values (154, 'sql_div', '/', 'calc', 0, 1,

MonetDB: default - Approve error codes.

2017-08-04 Thread Sjoerd Mullender
Changeset: 3b22799d345f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3b22799d345f
Modified Files:
sql/test/Users/Tests/role2.stable.err
sql/test/Users/Tests/test_privs2_p2.stable.err
sql/test/Users/Tests/test_privs_p2.stable.err
Branch: default
Log Message:

Approve error codes.


diffs (83 lines):

diff --git a/sql/test/Users/Tests/role2.stable.err 
b/sql/test/Users/Tests/role2.stable.err
--- a/sql/test/Users/Tests/role2.stable.err
+++ b/sql/test/Users/Tests/role2.stable.err
@@ -82,6 +82,7 @@ stderr of test 'role2` in directory 'sql
 MAPI  = my_user2@sofia:38256
 QUERY = SET ROLE my_role;
 ERROR = !SQLException:sql.update_var:42000!Role (my_role) missing
+CODE  = 42100
 
 # 20:38:25 >  
 # 20:38:25 >  Done.
diff --git a/sql/test/Users/Tests/test_privs2_p2.stable.err 
b/sql/test/Users/Tests/test_privs2_p2.stable.err
--- a/sql/test/Users/Tests/test_privs2_p2.stable.err
+++ b/sql/test/Users/Tests/test_privs2_p2.stable.err
@@ -31,27 +31,35 @@ stderr of test 'test_privs2_p2` in direc
 MAPI  = (my_user2) /var/tmp/mtest-15225/.s.monetdb.34050
 QUERY = SELECT * FROM version;
 ERROR = !SELECT: access denied for my_user2 to table 'my_schema.version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = insert into version (name ,i) values ('test2' ,2) ;
 ERROR = !INSERT INTO: insufficient privileges for user 'my_user2' to insert 
into table 'version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = SELECT insertversion('test3', 3);
 ERROR = !INSERT INTO: insufficient privileges for user 'my_user2' to insert 
into table 'version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = SELECT * FROM version;
 ERROR = !SELECT: access denied for my_user2 to table 'my_schema.version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = SELECT updateversion('test1', 4);
 ERROR = !UPDATE: insufficient privileges for user 'my_user2' to update table 
'version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = SELECT * FROM version;
 ERROR = !SELECT: access denied for my_user2 to table 'my_schema.version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = SELECT deleteversion(4);
 ERROR = !DELETE FROM: insufficient privileges for user 'my_user2' to delete 
from table 'version'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = SELECT * FROM version;
 ERROR = !SELECT: access denied for my_user2 to table 'my_schema.version'
+CODE  = 42000
 
 # 15:54:47 >  
 # 15:54:47 >  "Done."
diff --git a/sql/test/Users/Tests/test_privs_p2.stable.err 
b/sql/test/Users/Tests/test_privs_p2.stable.err
--- a/sql/test/Users/Tests/test_privs_p2.stable.err
+++ b/sql/test/Users/Tests/test_privs_p2.stable.err
@@ -31,15 +31,19 @@ stderr of test 'test_privs_p2` in direct
 MAPI  = (my_user2) /var/tmp/mtest-14654/.s.monetdb.35552
 QUERY = select * from test;
 ERROR = !SELECT: access denied for my_user2 to table 'my_schema.test'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = insert into test values(1,1);
 ERROR = !INSERT INTO: insufficient privileges for user 'my_user2' to insert 
into table 'test'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = update test set b = 2;
 ERROR = !UPDATE: insufficient privileges for user 'my_user2' to update table 
'test' on column 'b'
-MAPI  = (my_user2) /var/tmp/mtest-13234/.s.monetdb.39382
+CODE  = 42000
+MAPI  = (my_user2) /var/tmp/mtest-28783/.s.monetdb.30417
 QUERY = delete from test;
 ERROR = !DELETE FROM: insufficient privileges for user 'my_user2' to delete 
from table 'test'
+CODE  = 42000
 
 # 13:35:21 >  
 # 13:35:21 >  "Done."
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merge with Jul2017 branch.

2017-08-04 Thread Sjoerd Mullender
Changeset: a96d2e3bcd2a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a96d2e3bcd2a
Modified Files:
MonetDB.spec
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
tools/merovingian/daemon/connections.c
Branch: default
Log Message:

Merge with Jul2017 branch.


diffs (truncated from 36376 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -139,7 +139,9 @@ Source: https://www.monetdb.org/download
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
 # RHEL >= 7, and all current Fedora
 BuildRequires: systemd
-BuildRequires: checkpolicy, selinux-policy-devel, hardlink
+BuildRequires: checkpolicy
+BuildRequires: selinux-policy-devel
+BuildRequires: hardlink
 %endif
 BuildRequires: bison
 BuildRequires: bzip2-devel
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -349,4912 +349,4952 @@ insert into sys.functions values (145, '
 insert into sys.args values (11626, 145, 'res_0', 'smallint', 16, 0, 0, 0);
 insert into sys.args values (11627, 145, 'arg_1', 'smallint', 16, 0, 1, 1);
 insert into sys.args values (11628, 145, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (146, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.functions values (146, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11629, 146, 'res_0', 'smallint', 16, 0, 0, 0);
-insert into sys.args values (11630, 146, 'arg_1', 'smallint', 16, 0, 1, 1);
-insert into sys.args values (11631, 146, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (147, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11632, 147, 'res_0', 'int', 32, 0, 0, 0);
-insert into sys.args values (11633, 147, 'arg_1', 'int', 32, 0, 1, 1);
+insert into sys.args values (11630, 146, 'arg_1', 'tinyint', 8, 0, 1, 1);
+insert into sys.args values (11631, 146, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.functions values (147, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.args values (11632, 147, 'res_0', 'smallint', 16, 0, 0, 0);
+insert into sys.args values (11633, 147, 'arg_1', 'smallint', 16, 0, 1, 1);
 insert into sys.args values (11634, 147, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (148, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
+insert into sys.functions values (148, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11635, 148, 'res_0', 'int', 32, 0, 0, 0);
 insert into sys.args values (11636, 148, 'arg_1', 'int', 32, 0, 1, 1);
 insert into sys.args values (11637, 148, 'arg_2', 'tinyint', 8, 0, 1, 2);
 insert into sys.functions values (149, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11638, 149, 'res_0', 'int', 32, 0, 0, 0);
-insert into sys.args values (11639, 149, 'arg_1', 'int', 32, 0, 1, 1);
-insert into sys.args values (11640, 149, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.args values (11639, 149, 'arg_1', 'tinyint', 8, 0, 1, 1);
+insert into sys.args values (11640, 149, 'arg_2', 'int', 32, 0, 1, 2);
 insert into sys.functions values (150, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
 insert into sys.args values (11641, 150, 'res_0', 'int', 32, 0, 0, 0);
 insert into sys.args values (11642, 150, 'arg_1', 'int', 32, 0, 1, 1);
-insert into sys.args values (11643, 150, 'arg_2', 'smallint', 16, 0, 1, 2);
+insert into sys.args values (11643, 150, 'arg_2', 'tinyint', 8, 0, 1, 2);
 insert into sys.functions values (151, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11644, 151, 'res_0', 'bigint', 64, 0, 0, 0);
-insert into sys.args values (11645, 151, 'arg_1', 'bigint', 64, 0, 1, 1);
-insert into sys.args values (11646, 151, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (152, 'sql_div', '/', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11647, 152, 'res_0', 'bigint', 64, 0, 0, 0);
-insert into sys.args values (11648, 152, 'arg_1', 'bigint', 64, 0, 1, 1);
-insert into sys.args values (11649, 152, 'arg_2', 'tinyint', 8, 0, 1, 2);
-insert into sys.functions values (153, 'sql_mul', '*', 'calc', 0, 1, false, 
false, false, 2000);
-insert into sys.args values (11650, 153, 'res_0', 'bigint', 64, 0, 0, 0);
-insert into sys.args values (11651, 153, 'arg_1', 'bigint', 64, 0, 1, 1);
+insert into sys.args values (11644, 151, 'res_0', 'int', 32, 0, 0, 0);
+inser

MonetDB: trails - Continuous function target

2017-08-04 Thread Martin Kersten
Changeset: 4809c0bde193 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4809c0bde193
Added Files:
sql/backends/monet5/Tests/cfunction00.sql
Branch: trails
Log Message:

Continuous function target


diffs (44 lines):

diff --git a/sql/backends/monet5/Tests/cfunction00.sql 
b/sql/backends/monet5/Tests/cfunction00.sql
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/cfunction00.sql
@@ -0,0 +1,39 @@
+create function myaggr() 
+returns integer
+begin
+declare s int;
+   set s = 0;
+   while (true)
+   do
+   set s = s + 1;
+   return s ; --yield s;
+   end while;
+   return s;
+END;
+select * from functions where name ='myaggr';
+
+-- a continuous procedure can be called like any other procedure
+start continuous  myaggr();
+
+select myaggr(); #should return 1
+select myaggr(); #should return 2
+
+drop function myproc;
+
+--factory factories.myaggr():int;  #[0] (0)  0 
+--#function user.myaggr():int; #[0] (0)  0 
+--As := nil:int;   #[1] (0)  2 <- 3 
+--As := 0:int; #[2] (0)  2 <- 5 
+--barrier X_8 := true; #[3] (0)  8 <- 7 
+--leave X_8 := false:bit;  #[4] (0)  8 <- 54 
+--X_12 := As;  #[5] (0)  12 <- 2 
+--X_13 := calc.lng(X_12);  #[6] (0) CMDvarCONVERT 13 <- 12 
+--X_16:lng := calc.+(X_13, 1:lng); #[7] (0) CMDvarADDsignal 16 <- 
13 15 
+--X_17 := calc.int(X_16);  #[8] (0) CMDvarCONVERT 17 <- 16 
+--As := X_17;  #[9] (0)  2 <- 17 
+-- yield myaggr:int := As;
+--# return myaggr:int := As;   #[10] (0)  0 <- 2 
+--redo X_8 := true;#[11] (0)  8 <- 7 
+--exit X_8;#[12] (0)  8 
+--return myaggr:int := As; #[13] (0)  0 <- 2 
+--end factories.myaggr;#[14] (0)  
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Continue working on the profilerstart command

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 25d180d4a8ec for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=25d180d4a8ec
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Continue working on the profilerstart command


diffs (98 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "merovingian.h"
 #include "discoveryrunner.h" /* remotedb */
@@ -763,7 +764,12 @@ fork_profiler(char *dbname, sabdb **stat
 {
pid_t pid;
char *error = NO_ERR;
+   char *pidfilename = NULL;
confkeyval *ckv, *kv;
+   size_t pidfnlen;
+   FILE *pidfile;
+   char *profiler_executable;
+   char *tmp_exe;
 
(void) pid;
(void) log_path;
@@ -780,6 +786,31 @@ fork_profiler(char *dbname, sabdb **stat
return error;
}
 
+   /* monetdb
+* stethoscope
+*/
+   tmp_exe = get_bin_path();
+   if (tmp_exe == NULL) {
+   error = newErr("Cannot find the profiler executable");
+   return error;
+   } else {
+   char *s = strstr(tmp_exe, "monetdbd");
+   size_t executable_len = 0;
+
+   if (s == NULL || strncmp(s, "monetdbd", strlen("monetdbd")) != 
0) {
+   error = newErr("Unexpected executable (missing the 
string \"monetdbd\")");
+   free(tmp_exe);
+   return error;
+   }
+
+   executable_len = strlen(tmp_exe) + strlen("stethoscope") - 
strlen("monetdbd") + 1;
+   *s = '\0';
+   profiler_executable = malloc(executable_len);
+   snprintf(profiler_executable, executable_len, "%s%s%s",
+tmp_exe, "stethoscope", s + 8);
+   /* free(tmp_exe); */
+   }
+
pthread_mutex_lock(&fork_lock);
 
if ((*stats)->state != SABdbRunning) {
@@ -798,9 +829,40 @@ fork_profiler(char *dbname, sabdb **stat
goto cleanup;
}
 
-   *log_path = GDKstrdup(kv->val);
+   *log_path = strdup(kv->val);
+   /* Check that the log_path exists and create it if it does not */
+
+
+   pidfnlen = strlen(*log_path) + strlen("/profiler.pid") + 1;
+   pidfilename = malloc(pidfnlen);
+   snprintf(pidfilename, pidfnlen, "%s/profiler.pid", *log_path);
+   if ((pidfile = fopen(pidfilename, "w")) == NULL) {
+   error = newErr("unable to open %s for writing\n", pidfilename);
+   free(*log_path);
+   *log_path = NULL;
+   goto cleanup;
+   }
+
+
+   pid = fork();
+   if (pid == 0) {
+   fclose(pidfile);
+   /* find the executable */
+   /* build the arguments */
+   /* execute */
+   exit(1);
+   } else {
+   /* write pid of stethoscope */
+   Mfprintf(pidfile, "%d", (int)pid);
+   fclose(pidfile);
+
+   }
 
   cleanup:
+   freeConfFile(ckv);
+   free(ckv);
+   free(profiler_executable);
+   msab_freeStatus(stats);
pthread_mutex_unlock(&fork_lock);
return error;
 }
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Started work for stethoscope handling through...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 56447bc0d7ee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=56447bc0d7ee
Modified Files:
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/forkmserver.h
Branch: default
Log Message:

Started work for stethoscope handling through merovingian

Usage:
$ monetdb set profilerlogpath=/path/to/log/directory 
$ monetdb profilerstart  [db...]
$ monetdb profilerstop  [db...]

At most one stethoscope should be running for each database.

This should produce files in the directory specified by profilerlogpath, each
time profilerstart is called. The file name should be:

proflog__-MM-DD-HH-MM-SS.json


diffs (150 lines):

diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -101,6 +101,14 @@ command_help(int argc, char *argv[])
printf("  Brings back a database from maintenance mode.  A 
released\n");
printf("  database is available again for normal use.  Use 
the\n");
printf("  \"lock\" command to take a database under 
maintenance.\n");
+   } else if (strcmp(argv[1], "profilerstart") == 0) {
+   printf("Usage: monetdb profilerstart database [database 
...]\n");
+   printf("  Starts the collection of profiling events. The 
property\n");
+   printf("  \"profiler_path\" should be set. Use the 
\"profilerstop\"\n");
+   printf("  command to stop the profiler.\n");
+   } else if (strcmp(argv[1], "profilerstop") == 0) {
+   printf("Usage: monetdb profilerstop database [database ...]\n");
+   printf("  Stops the collection of profiling events.\n");
} else if (strcmp(argv[1], "status") == 0) {
printf("Usage: monetdb status [-lc] [expression ...]\n");
printf("  Shows the state of a given glob-style database match, 
or\n");
@@ -1629,6 +1637,18 @@ command_release(int argc, char *argv[])
simple_command(argc, argv, "release", "taken database out of 
maintenance mode", 1);
 }
 
+static void
+command_profilerstart(int argc, char *argv[])
+{
+   simple_command(argc, argv, "profilerstart", "started profiler", 1);
+}
+
+static void
+command_profilerstop(int argc, char *argv[])
+{
+   simple_command(argc, argv, "profilerstop", "stopped profiler", 1);
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -1807,6 +1827,10 @@ main(int argc, char *argv[])
command_lock(argc - i, &argv[i]);
} else if (strcmp(argv[i], "release") == 0) {
command_release(argc - i, &argv[i]);
+   } else if (strcmp(argv[i], "profilerstart") == 0) {
+   command_profilerstart(argc - i, &argv[i]);
+   } else if (strcmp(argv[i], "profilerstop") == 0) {
+   command_profilerstop(argc - i, &argv[i]);
} else if (strcmp(argv[i], "status") == 0) {
command_status(argc - i, &argv[i]);
} else if (strcmp(argv[i], "start") == 0) {
diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -619,6 +619,27 @@ static void ctl_handle_client(
len = snprintf(buf2, sizeof(buf2), 
"OK\n");
send_client("=");
}
+   } else if (strncmp(p, "profilerstart", 
strlen("profilerstart")) == 0) {
+   char *log_path = NULL;
+   char *e = fork_profiler(q, &stats, &log_path);
+   if (e != NULL) {
+   Mfprintf(_mero_ctlerr, "%s: failed to 
start the profiler "
+"database '%s': %s\n", 
origin, q, getErrMsg(e));
+   len = snprintf(buf2, sizeof(buf2),
+  "%s\n", 
getErrMsg(e));
+   send_client("!");
+   freeErr(e);
+   } else {
+   len = snprintf(buf2, sizeof(buf2), 
"OK\n");
+   send_client("=");
+   Mfprintf(_mero_ctlout, "%s: started 
profiler for '%s'\n",
+origin, q);
+   Mfprintf(_mero_ctlout, "%s: logs at: 
%s\n",
+origin, log_path);
+   }
+   msab_freeStatus(&stats);
+   }  else if (strncmp(p, 

MonetDB: default - First version of profilerstart command working

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: d9e7e8566bae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d9e7e8566bae
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

First version of profilerstart command working


diffs (180 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -770,6 +770,8 @@ fork_profiler(char *dbname, sabdb **stat
FILE *pidfile;
char *profiler_executable;
char *tmp_exe;
+   struct stat path_info;
+   int error_code;
 
(void) pid;
(void) log_path;
@@ -786,39 +788,49 @@ fork_profiler(char *dbname, sabdb **stat
return error;
}
 
-   /* monetdb
-* stethoscope
+   /* Find the profiler executable. We are currently running as:
+* /path/to/installation/monetdbd
+* and the profiler executable should be:
+* /path/to/installation/stethoscope
 */
tmp_exe = get_bin_path();
if (tmp_exe == NULL) {
error = newErr("Cannot find the profiler executable");
return error;
} else {
-   char *s = strstr(tmp_exe, "monetdbd");
+   char *daemon_filename = "monetdbd";
+   char *profiler_filename = "stethoscope";
+   char *s = strstr(tmp_exe, daemon_filename);
size_t executable_len = 0;
 
-   if (s == NULL || strncmp(s, "monetdbd", strlen("monetdbd")) != 
0) {
+   if (s == NULL || strncmp(s, daemon_filename, 
strlen(daemon_filename)) != 0) {
error = newErr("Unexpected executable (missing the 
string \"monetdbd\")");
free(tmp_exe);
return error;
}
 
-   executable_len = strlen(tmp_exe) + strlen("stethoscope") - 
strlen("monetdbd") + 1;
+   executable_len = strlen(tmp_exe) + strlen(profiler_filename) - 
strlen(daemon_filename) + 1;
*s = '\0';
profiler_executable = malloc(executable_len);
snprintf(profiler_executable, executable_len, "%s%s%s",
-tmp_exe, "stethoscope", s + 8);
+tmp_exe, profiler_filename, s + 8);
+   if (stat(profiler_executable, &path_info) == -1) {
+   error = newErr("Cannot find profiler executable");
+   goto cleanup;
+   }
/* free(tmp_exe); */
}
 
pthread_mutex_lock(&fork_lock);
 
+   /* Verify that the requested db is running */
if ((*stats)->state != SABdbRunning) {
/* server is not running, shoo */
error = newErr("Database is not running.");
goto cleanup;
}
 
+   /* find the path that the profiler will be storing files */
ckv = getDefaultProps();
readAllProps(ckv, (*stats)->path);
kv = findConfKey(ckv, "profilerlogpath");
@@ -830,39 +842,105 @@ fork_profiler(char *dbname, sabdb **stat
}
 
*log_path = strdup(kv->val);
+
/* Check that the log_path exists and create it if it does not */
+   error_code = stat(*log_path, &path_info);
+   if (error_code == -1) {  /* stat failed */
+   if (errno == ENOENT) {  /* dir does not exist, create it */
+   mode_t mode = 0755;
+   if (mkdir(*log_path, mode) == -1) {  /* mkdir failed, 
bail out */
+   char error_message[BUFSIZ];
+   strerror_r(errno, error_message, BUFSIZ);
+   error = newErr("%s", error_message);
+   free(*log_path);
+   *log_path = NULL;
+   goto cleanup;
+   }
+   } else {  /* Something else went wrong, can't handle the heat */
+   char error_message[BUFSIZ];
+   strerror_r(errno, error_message, BUFSIZ);
+   error = newErr("%s", error_message);
+   free(*log_path);
+   *log_path = NULL;
+   goto cleanup;
+   }
+   } else {  /* stat succeeded */
+   if(!S_ISDIR(path_info.st_mode)) {  /* file exists but is not a 
directory, bail out */
+   error = newErr("File %s exists but is not a 
directory.", *log_path);
+   free(*log_path);
+   *log_path = NULL;
+   goto cleanup;
+   }
+   }
 
-
+   /* construct the filename of the pid file */
pidfnlen = strlen(*log_path) + strlen("/profiler.pid") + 1;
pidfilename = malloc(pidfnlen);
snprintf(pidfilename, pidfnlen, "%

MonetDB: default - Don't crash while freeing a confkeyval list i...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 55a4d9377c25 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55a4d9377c25
Modified Files:
tools/merovingian/utils/utils.c
Branch: default
Log Message:

Don't crash while freeing a confkeyval list if it is NULL


diffs (12 lines):

diff --git a/tools/merovingian/utils/utils.c b/tools/merovingian/utils/utils.c
--- a/tools/merovingian/utils/utils.c
+++ b/tools/merovingian/utils/utils.c
@@ -136,6 +136,8 @@ readConfFileFull(confkeyval *list, FILE 
  */
 inline void
 freeConfFile(confkeyval *list) {
+   if (list == NULL)
+   return;
while (list->key != NULL) {
if (list->val != NULL) {
free(list->val);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Add profilerstart and profilerstop at the mon...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 83aabe627d44 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=83aabe627d44
Modified Files:
tools/merovingian/client/monetdb.c
Branch: default
Log Message:

Add profilerstart and profilerstop at the monetdb usage message


diffs (11 lines):

diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -66,6 +66,7 @@ command_help(int argc, char *argv[])
printf("  where command is one of:\n");
printf("create, destroy, lock, release\n");
printf("status, start, stop, kill\n");
+   printf("profilerstart, profilerstop\n");
printf("set, get, inherit\n");
printf("discover, help, version\n");
printf("  options can be:\n");
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Make the property name easy to change

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: f232d8502034 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f232d8502034
Modified Files:
tools/merovingian/client/monetdb.c
tools/merovingian/utils/properties.h
Branch: default
Log Message:

Make the property name easy to change


diffs (23 lines):

diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -105,7 +105,7 @@ command_help(int argc, char *argv[])
} else if (strcmp(argv[1], "profilerstart") == 0) {
printf("Usage: monetdb profilerstart database [database 
...]\n");
printf("  Starts the collection of profiling events. The 
property\n");
-   printf("  \"profiler_path\" should be set. Use the 
\"profilerstop\"\n");
+   printf("  \""PROFILERLOGPROPERTY"\" should be set. Use the 
\"profilerstop\"\n");
printf("  command to stop the profiler.\n");
} else if (strcmp(argv[1], "profilerstop") == 0) {
printf("Usage: monetdb profilerstop database [database ...]\n");
diff --git a/tools/merovingian/utils/properties.h 
b/tools/merovingian/utils/properties.h
--- a/tools/merovingian/utils/properties.h
+++ b/tools/merovingian/utils/properties.h
@@ -12,6 +12,7 @@
 #include "utils.h"
 
 #define MEROPROPFILE ".merovingian_properties"
+#define PROFILERLOGPROPERTY "profilerlogpath"
 
 confkeyval *getDefaultProps(void);
 int writeProps(confkeyval *ckv, const char *path);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Tidy up the errors in profiler startup

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: ce3f1c38b536 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce3f1c38b536
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Tidy up the errors in profiler startup


diffs (69 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -28,7 +28,6 @@
 #include "multiplex-funnel.h" /* multiplexInit */
 #include "forkmserver.h"
 
-
 static pthread_mutex_t fork_lock = PTHREAD_MUTEX_INITIALIZER;
 
 /**
@@ -773,18 +772,14 @@ fork_profiler(char *dbname, sabdb **stat
struct stat path_info;
int error_code;
 
-   (void) pid;
-   (void) log_path;
error = msab_getStatus(stats, dbname);
if (error != NULL) {
-   err er = NULL;
-   er = newErr("%s", er);
-   free(error);
-   return er;
+   return error;
}
 
if (*stats == NULL) {
/* TODO: What now? */
+   error = newErr("Null stats for db %s", dbname);
return error;
}
 
@@ -826,14 +821,14 @@ fork_profiler(char *dbname, sabdb **stat
/* Verify that the requested db is running */
if ((*stats)->state != SABdbRunning) {
/* server is not running, shoo */
-   error = newErr("Database is not running.");
+   error = newErr("Database %s is not running.", dbname);
goto cleanup;
}
 
/* find the path that the profiler will be storing files */
ckv = getDefaultProps();
readAllProps(ckv, (*stats)->path);
-   kv = findConfKey(ckv, "profilerlogpath");
+   kv = findConfKey(ckv, PROFILERLOGPROPERTY);
 
if (kv == NULL) {
error = newErr("Property 'profilerlogpath' not set for db %s\n",
@@ -876,6 +871,10 @@ fork_profiler(char *dbname, sabdb **stat
/* construct the filename of the pid file */
pidfnlen = strlen(*log_path) + strlen("/profiler.pid") + 1;
pidfilename = malloc(pidfnlen);
+   if (pidfilename == NULL) {
+   error = newErr("Cannot allocate buffer while starting 
profiler");
+   goto cleanup;
+   }
snprintf(pidfilename, pidfnlen, "%s/profiler.pid", *log_path);
 
/* Make sure that the pid file is does not exist */
@@ -888,6 +887,8 @@ fork_profiler(char *dbname, sabdb **stat
goto cleanup;
}
 
+   /* TODO: if the pid file exists read it and check if stethoscope with 
the
+* given pid is running */
/* Open the pid file */
if ((pidfile = fopen(pidfilename, "w")) == NULL) {
error = newErr("unable to open %s for writing", pidfilename);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Implement profiler shutdown procedure

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 9540ecbf9d0e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9540ecbf9d0e
Modified Files:
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/forkmserver.h
Branch: default
Log Message:

Implement profiler shutdown procedure


diffs (151 lines):

diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -639,7 +639,21 @@ static void ctl_handle_client(
}
msab_freeStatus(&stats);
}  else if (strncmp(p, "profilerstop", 
strlen("profilerstop")) == 0) {
-
+   char *e = shutdown_profiler(q, &stats);
+   if (e != NULL) {
+   Mfprintf(_mero_ctlerr, "%s: failed to 
shutdown the profiler "
+"database '%s': %s\n", 
origin, q, getErrMsg(e));
+   len = snprintf(buf2, sizeof(buf2),
+  "%s\n", 
getErrMsg(e));
+   send_client("!");
+   freeErr(e);
+   } else {
+   len = snprintf(buf2, sizeof(buf2), 
"OK\n");
+   send_client("=");
+   Mfprintf(_mero_ctlout, "%s: profiler 
shut down for '%s'\n",
+origin, q);
+   }
+   msab_freeStatus(&stats);
} else if (strncmp(p, "name=", strlen("name=")) == 0) {
char *e;
 
diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include  /* char ** */
 #include  /* localtime */
@@ -942,8 +943,102 @@ fork_profiler(char *dbname, sabdb **stat
freeConfFile(ckv);
free(ckv);
free(profiler_executable);
+   free(pidfilename);
pthread_mutex_unlock(&fork_lock);
return error;
 }
 
+err
+shutdown_profiler(char *dbname, sabdb **stats)
+{
+   err error=NO_ERR;
+   confkeyval *ckv, *kv;
+   size_t pidfnlen = 0;
+   char *pidfilename = NULL;
+   FILE *pidfile;
+   char buf[BUFSIZ];
+   size_t nbytes;
+   pid_t pid;
+
+   error = msab_getStatus(stats, dbname);
+   if (error != NULL) {
+   return error;
+   }
+
+   if (*stats == NULL) {
+   /* TODO: What now? */
+   error = newErr("Null stats for db %s", dbname);
+   return error;
+   }
+
+   /* Verify that the requested db is running */
+   if ((*stats)->state != SABdbRunning) {
+   /* server is not running, shoo */
+   error = newErr("Database %s is not running.", dbname);
+   goto cleanup;
+   }
+
+   /* Find the pid file and make sure the profiler is running */
+   ckv = getDefaultProps();
+   readAllProps(ckv, (*stats)->path);
+   kv = findConfKey(ckv, PROFILERLOGPROPERTY);
+
+   if (kv == NULL) {
+   error = newErr("Property 'profilerlogpath' not set for db %s\n",
+  dbname);
+   goto cleanup;
+   }
+
+   /* construct the filename of the pid file */
+   pidfnlen = strlen(kv->val) + strlen("/profiler.pid") + 1;
+   pidfilename = malloc(pidfnlen);
+   if (pidfilename == NULL) {
+   error = newErr("Cannot allocate buffer while shutting down of 
profiler");
+   goto cleanup;
+   }
+   snprintf(pidfilename, pidfnlen, "%s/profiler.pid", kv->val);
+
+   if ((pidfile = fopen(pidfilename, "r")) == NULL) {
+   error = newErr("Unable to open %s for reading", pidfilename);
+   goto cleanup;
+   }
+
+   clearerr(pidfile);
+   nbytes = fread(buf, 1, BUFSIZ, pidfile);
+
+   if (ferror(pidfile)) {
+   error = newErr("Cannot read pid (%s) from file %s", buf, 
pidfilename);
+   fclose(pidfile);
+   goto cleanup;
+   }
+   fclose(pidfile);
+
+   if (buf[nbytes - 1] == '\n') {
+   buf[nbytes - 1] = '\0';
+   }
+
+   pid = (pid_t)strtol(buf, NULL, 10);
+   if (pid == 0 && errno == EINVAL) {
+   error = newErr("File contents %s not a valid pid", buf);
+   goto cleanup;
+   }
+
+   if (kill(pid, SIGTERM) == -1) {
+   char error_message[BUFSIZ];
+  

MonetDB: default - Add ChangeLog message for new daemon commands

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 6ab4532e6980 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ab4532e6980
Modified Files:
tools/merovingian/ChangeLog
Branch: default
Log Message:

Add ChangeLog message for new daemon commands


diffs (11 lines):

diff --git a/tools/merovingian/ChangeLog b/tools/merovingian/ChangeLog
--- a/tools/merovingian/ChangeLog
+++ b/tools/merovingian/ChangeLog
@@ -1,3 +1,7 @@
 # ChangeLog file for sql/src/backends/monet5/merovingian
 # This file is updated with mchangelog
 
+* Fri Aug  4 2017 Panagiotis Koutsourakis 
+- Add daemon commands for starting/stopping collection of profiler
+  (stethoscope) logs.
+
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Add documentation for the new commands in the...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 282ba6825a07 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=282ba6825a07
Modified Files:
tools/merovingian/client/monetdb.1
Branch: default
Log Message:

Add documentation for the new commands in the monetdb man page


diffs (34 lines):

diff --git a/tools/merovingian/client/monetdb.1 
b/tools/merovingian/client/monetdb.1
--- a/tools/merovingian/client/monetdb.1
+++ b/tools/merovingian/client/monetdb.1
@@ -70,6 +70,8 @@ utility are
 .BR start ,
 .BR stop ,
 .BR kill ,
+.BR profilerstart ,
+.BR profilerstop ,
 .BR set ,
 .BR get ,
 .BR inherit ,
@@ -263,6 +265,21 @@ the return code of
 indicates failure if one of the databases had a failure, even though
 the operation on other databases was successful.
 .TP
+\fBprofilerstart\fP \fIdatabase\fP
+.PD 0
+.TP
+\fBprofilerstop\fP \fIdatabase\fP
+Starts or stops the collection of profiling logs for the given database. The 
property
+.B profilerlogpath
+must be set for the given database, and it should point to a directory where 
the logs
+will be gathered. The filenames of the logs have the format:
+.I proflog__-MM-DD_HH-MM-SS.json
+where the last part is the date and time when the collection started. Please
+note that a file recording the pid of the profiler is written in the log
+directory, therefore each database needs to have a different
+.B profilerlogpath
+value.
+.TP
 \fBget\fP <\fBall\fP | \fIproperty\fP[,\fIproperty\fP[,..]]> [\fIdatabase\fP 
...]
 Prints the requested properties, or all known properties, for the given
 database.  For each property its source and value are printed.  Source
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Change the profiler log file prefix to agree ...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: cd0fbacbb7af for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cd0fbacbb7af
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Change the profiler log file prefix to agree with the documentation


diffs (21 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -910,7 +910,7 @@ fork_profiler(char *dbname, sabdb **stat
 
fclose(pidfile);
/* construct the log output file */
-   log_filename_len = strlen(*log_path) + strlen("/proflen_") + 
strlen(dbname) + 26;
+   log_filename_len = strlen(*log_path) + strlen("/proflog_") + 
strlen(dbname) + 26;
log_filename = malloc(log_filename_len);
if (log_filename == NULL) {
/* TODO What now? */
@@ -920,7 +920,7 @@ fork_profiler(char *dbname, sabdb **stat
current_time = time(NULL);
tm_ctime = localtime(¤t_time);
strftime(timestamp, sizeof(timestamp), "%Y-%m-%d_%H:%M:%S", 
tm_ctime);
-   snprintf(log_filename, log_filename_len, 
"%s/proflen_%s_%s.json",
+   snprintf(log_filename, log_filename_len, 
"%s/proflog_%s_%s.json",
 *log_path, dbname, timestamp);
 
/* build the arguments */
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Fix a bug that would prevent monetdbd from st...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: c8d65040ee41 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c8d65040ee41
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Fix a bug that would prevent monetdbd from starting mservers

The function get_bin_path() returns a pointer to a global variable. It is
changed in place in the main function of monetdbd to contain the path to
mserver5 executable. If it is called again it will change the executable and
monetdbd will not be able to spawn new mserver5 processes.

Instead of calling get_bin_path again in order to construct the path to the
stethoscope executable, copy the global variable that contains the path to
mserver5 executable and work on that.


diffs (45 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -784,32 +784,33 @@ fork_profiler(char *dbname, sabdb **stat
return error;
}
 
-   /* Find the profiler executable. We are currently running as:
-* /path/to/installation/monetdbd
+   /* Find the profiler executable. The mserver is running as
+* /path/to/installation/mserver5
 * and the profiler executable should be:
 * /path/to/installation/stethoscope
 */
-   tmp_exe = get_bin_path();
+   tmp_exe = strdup(_mero_mserver);
if (tmp_exe == NULL) {
error = newErr("Cannot find the profiler executable");
return error;
} else {
-   char *daemon_filename = "monetdbd";
+   char *server_filename = "mserver5";
char *profiler_filename = "stethoscope";
-   char *s = strstr(tmp_exe, daemon_filename);
+   char *s = strstr(tmp_exe, server_filename);
size_t executable_len = 0;
 
-   if (s == NULL || strncmp(s, daemon_filename, 
strlen(daemon_filename)) != 0) {
-   error = newErr("Unexpected executable (missing the 
string \"monetdbd\")");
+   if (s == NULL || strncmp(s, server_filename, 
strlen(server_filename)) != 0) {
+   error = newErr("Unexpected executable (missing the 
string \"%s\")", server_filename);
free(tmp_exe);
return error;
}
 
-   executable_len = strlen(tmp_exe) + strlen(profiler_filename) - 
strlen(daemon_filename) + 1;
+   executable_len = strlen(tmp_exe) + strlen(profiler_filename) - 
strlen(server_filename) + 1;
*s = '\0';
profiler_executable = malloc(executable_len);
snprintf(profiler_executable, executable_len, "%s%s%s",
 tmp_exe, profiler_filename, s + 8);
+   free(tmp_exe);
if (stat(profiler_executable, &path_info) == -1) {
error = newErr("Cannot find profiler executable");
goto cleanup;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - The new commands also work for multiple dbs a...

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 0dfdbc6cb4cc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0dfdbc6cb4cc
Modified Files:
tools/merovingian/client/monetdb.1
Branch: default
Log Message:

The new commands also work for multiple dbs as well, update docs


diffs (16 lines):

diff --git a/tools/merovingian/client/monetdb.1 
b/tools/merovingian/client/monetdb.1
--- a/tools/merovingian/client/monetdb.1
+++ b/tools/merovingian/client/monetdb.1
@@ -265,10 +265,10 @@ the return code of
 indicates failure if one of the databases had a failure, even though
 the operation on other databases was successful.
 .TP
-\fBprofilerstart\fP \fIdatabase\fP
+\fBprofilerstart\fP \fIdatabase\fP [\fIdatabase\fP ...]
 .PD 0
 .TP
-\fBprofilerstop\fP \fIdatabase\fP
+\fBprofilerstop\fP \fIdatabase\fP [\fIdatabase\fP ...]
 Starts or stops the collection of profiling logs for the given database. The 
property
 .B profilerlogpath
 must be set for the given database, and it should point to a directory where 
the logs
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jul2017 - Added tests for Bug 6385

2017-08-04 Thread Jennie Zhang
Changeset: 078c96c28337 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=078c96c28337
Added Files:

sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.sql

sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err

sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.out
Modified Files:
sql/test/BugTracker-2017/Tests/All
Branch: Jul2017
Log Message:

Added tests for Bug 6385


diffs (223 lines):

diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -62,3 +62,4 @@ crash-select_after_MAL_error.Bug-6332
 handle-values-subqueries.Bug-6336
 spurious_errors.Bug-6344
 caching_stats_bug.6374
+aggr_udf_with_more_than_2params.Bug-6385
diff --git 
a/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.sql 
b/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.sql
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.sql
@@ -0,0 +1,43 @@
+CREATE AGGREGATE aggr2(val INTEGER, val2 INTEGER)
+RETURNS INTEGER
+LANGUAGE PYTHON {
+unique = numpy.unique(aggr_group)
+x = numpy.zeros(shape=(unique.size))
+for i in range(0, unique.size):
+x[i] = numpy.sum(val[aggr_group==unique[i]])
+return(x)
+};
+
+CREATE AGGREGATE aggr3(val INTEGER, val2 INTEGER, val3 INTEGER)
+RETURNS DOUBLE
+LANGUAGE PYTHON {
+unique = numpy.unique(aggr_group)
+x = numpy.zeros(shape=(unique.size))
+for i in range(0, unique.size):
+x[i] = numpy.sum(val[aggr_group==unique[i]])
+return(x)
+};
+
+CREATE AGGREGATE aggr4(val INTEGER, val2 INTEGER, val3 INTEGER, val4 INTEGER)
+RETURNS DOUBLE
+LANGUAGE PYTHON {
+unique = numpy.unique(aggr_group)
+x = numpy.zeros(shape=(unique.size))
+for i in range(0, unique.size):
+x[i] = numpy.sum(val[aggr_group==unique[i]])
+return(x)
+};
+
+CREATE TABLE grouped_ints (value INTEGER, groupnr INTEGER, dbvalue double);
+INSERT INTO  grouped_ints VALUES (1, 0, 0.11), (2, 1, 0.22), (3, 0, 0.33), 
(4,1, 0.44), (5,0, 0.55);
+
+SELECT groupnr, aggr3(value, value, value) FROM grouped_ints GROUP BY groupnr;
+SELECT groupnr, aggr4(value, value, value, value) FROM grouped_ints GROUP BY 
groupnr;
+
+SELECT groupnr, aggr2(value) FROM grouped_ints GROUP BY groupnr;
+SELECT groupnr, aggr2(value, value, value) FROM grouped_ints GROUP BY groupnr;
+
+DROP TABLE grouped_ints;
+DROP AGGREGATE aggr2;
+DROP AGGREGATE aggr3;
+
diff --git 
a/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err
 
b/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/aggr_udf_with_more_than_2params.Bug-6385.stable.err
@@ -0,0 +1,42 @@
+stderr of test 'aggr_udf_with_more_than_2params.Bug-6385` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 16:36:12 >  
+# 16:36:12 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=35710" "--set" 
"mapi_usock=/var/tmp/mtest-31488/.s.monetdb.35710" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/Users/jennie/scratch/monet-install/Jul2017/debug/var/MonetDB/mTests_sql_test_BugTracker-2017"
 "--set" "embedded_r=yes" "--set" "embedded_py=true"
+# 16:36:12 >  
+
+# builtin opt  gdk_dbpath = 
/Users/jennie/scratch/monet-install/Jul2017/debug/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 5
+# 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  mapi_open = true
+# cmdline opt  mapi_port = 35710
+# cmdline opt  mapi_usock = /var/tmp/mtest-31488/.s.monetdb.35710
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/Users/jennie/scratch/monet-install/Jul2017/debug/var/MonetDB/mTests_sql_test_BugTracker-2017
+# cmdline opt  embedded_r = yes
+# cmdline opt  embedded_py = true
+# cmdline opt  gdk_debug = 536870922
+
+# 16:36:12 >  
+# 16:36:12 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-31488" "--port=35710"
+# 16:36:12 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-31488/.s.monetdb.35710
+QUERY = SELECT groupnr, aggr2(value) FROM grouped_ints GROUP BY groupnr;
+ERROR = !SELECT: no such aggregate 'aggr2' (int(32))
+MAPI  = (monetdb) /var/tmp/mtest-31488/.s.monetdb.35710
+QUERY = SELECT groupnr, aggr2(value, value, value) FROM grouped_ints GROUP BY 
groupnr;
+ERROR = !SELECT: no such aggregate 'aggr2' (int(32), int(32), int(32))
+
+# 16:36:13 >  
+# 16:36:13 >  "Done."
+# 16:36:13 >  
+
diff --git 
a/sql/test/BugTracker-2017/Tests/aggr_udf_with_more

MonetDB: default - Make compilable with stricter compiler.

2017-08-04 Thread Sjoerd Mullender
Changeset: 76c485d64cae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76c485d64cae
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Make compilable with stricter compiler.


diffs (51 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -765,7 +765,7 @@ fork_profiler(char *dbname, sabdb **stat
pid_t pid;
char *error = NO_ERR;
char *pidfilename = NULL;
-   confkeyval *ckv, *kv;
+   confkeyval *ckv = NULL, *kv;
size_t pidfnlen;
FILE *pidfile;
char *profiler_executable;
@@ -847,7 +847,8 @@ fork_profiler(char *dbname, sabdb **stat
mode_t mode = 0755;
if (mkdir(*log_path, mode) == -1) {  /* mkdir failed, 
bail out */
char error_message[BUFSIZ];
-   strerror_r(errno, error_message, BUFSIZ);
+   if (strerror_r(errno, error_message, BUFSIZ) != 
0)
+   strcpy(error_message, "unknown error");
error = newErr("%s", error_message);
free(*log_path);
*log_path = NULL;
@@ -855,7 +856,8 @@ fork_profiler(char *dbname, sabdb **stat
}
} else {  /* Something else went wrong, can't handle the heat */
char error_message[BUFSIZ];
-   strerror_r(errno, error_message, BUFSIZ);
+   if (strerror_r(errno, error_message, BUFSIZ) != 0)
+   strcpy(error_message, "unknown error");
error = newErr("%s", error_message);
free(*log_path);
*log_path = NULL;
@@ -953,7 +955,7 @@ err
 shutdown_profiler(char *dbname, sabdb **stats)
 {
err error=NO_ERR;
-   confkeyval *ckv, *kv;
+   confkeyval *ckv = NULL, *kv;
size_t pidfnlen = 0;
char *pidfilename = NULL;
FILE *pidfile;
@@ -1026,7 +1028,8 @@ shutdown_profiler(char *dbname, sabdb **
 
if (kill(pid, SIGTERM) == -1) {
char error_message[BUFSIZ];
-   strerror_r(errno, error_message, BUFSIZ);
+   if (strerror_r(errno, error_message, BUFSIZ) != 0)
+   strcpy(error_message, "unknown error");
error = newErr("%s", error_message);
goto cleanup;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Parametrize messages

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 585b82113676 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=585b82113676
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: default
Log Message:

Parametrize messages


diffs (21 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -833,7 +833,7 @@ fork_profiler(char *dbname, sabdb **stat
kv = findConfKey(ckv, PROFILERLOGPROPERTY);
 
if (kv == NULL) {
-   error = newErr("Property 'profilerlogpath' not set for db %s\n",
+   error = newErr("Property '"PROFILERLOGPROPERTY"' not set for db 
%s\n",
   dbname);
goto cleanup;
}
@@ -987,7 +987,7 @@ shutdown_profiler(char *dbname, sabdb **
kv = findConfKey(ckv, PROFILERLOGPROPERTY);
 
if (kv == NULL) {
-   error = newErr("Property 'profilerlogpath' not set for db %s\n",
+   error = newErr("Property '"PROFILERLOGPROPERTY"' not set for db 
%s\n",
   dbname);
goto cleanup;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: data-vaults - Merge with default

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 68283ddeffa5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68283ddeffa5
Modified Files:
geom/monetdb5/geom.c
geom/monetdb5/geomBulk.c
monetdb5/mal/Tests/tst019.stable.err
monetdb5/mal/Tests/tst036.stable.err
monetdb5/mal/Tests/tst054.stable.err
monetdb5/mal/Tests/tst058.stable.err
monetdb5/mal/Tests/tst070.stable.err
monetdb5/mal/Tests/tst804.stable.err
monetdb5/mal/mal_errors.h
monetdb5/modules/atoms/mtime.c
monetdb5/optimizer/opt_pipes.c
sql/backends/monet5/LSST/lsst.c
sql/backends/monet5/UDF/cudf/udf.c
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/conversion.c
sql/backends/monet5/UDF/pyapi/convert_loops.h
sql/backends/monet5/UDF/pyapi/emit.c
sql/backends/monet5/UDF/pyapi/formatinput.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/pyheader.h
sql/backends/monet5/UDF/pyapi/pyloader.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/generator/generator.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_assert.c
sql/backends/monet5/sql_bat2time.c
sql/backends/monet5/sql_cast.c
sql/backends/monet5/sql_cast_impl_down_from_flt.h
sql/backends/monet5/sql_cast_impl_int.h
sql/backends/monet5/sql_cast_impl_up_to_flt.h
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_fround_impl.h
sql/backends/monet5/sql_orderidx.c
sql/backends/monet5/sql_rank.c
sql/backends/monet5/sql_round_impl.h
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_statistics.c
sql/backends/monet5/sql_transaction.c
sql/backends/monet5/sql_upgrades.c
sql/backends/monet5/sql_user.c
sql/backends/monet5/vaults/bam/bam_export.c
sql/backends/monet5/vaults/bam/bam_lib.c
sql/backends/monet5/vaults/bam/bam_loader.c
sql/backends/monet5/vaults/bam/bam_wrapper.c
sql/backends/monet5/vaults/fits/fits.c
sql/backends/monet5/vaults/lidar/lidar.c
sql/backends/monet5/vaults/netcdf/netcdf.c
sql/backends/monet5/vaults/shp/shp.c
sql/backends/monet5/vaults/vault.c
sql/backends/monet5/wlr.c
sql/server/rel_dump.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/rel_semantic.c
sql/server/rel_sequence.c
sql/server/rel_trans.c
sql/server/rel_updates.c
sql/server/rel_xml.c
sql/server/sql_env.c
sql/server/sql_mvc.c
sql/server/sql_parser.h
sql/server/sql_parser.y
sql/server/sql_privileges.c
sql/server/sql_scan.c
Branch: data-vaults
Log Message:

Merge with default

Change to the SQLSTATE macro


diffs (truncated from 15023 to 300 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -71,7 +71,7 @@ transformCoordSeq(int idx, int coordinat
if (!GEOSCoordSeq_getX(gcs_old, idx, &x) ||
!GEOSCoordSeq_getY(gcs_old, idx, &y) ||
(coordinatesNum > 2 && !GEOSCoordSeq_getZ(gcs_old, idx, &z)))
-   throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos cannot get 
coordinates");
+   throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos cannot get 
coordinates");
 
/* check if the passed reference system is geographic (proj=latlong)
 * and change the degrees to radians because pj_transform works with 
radians*/
@@ -83,9 +83,9 @@ transformCoordSeq(int idx, int coordinat
errorNum = pj_get_errno_ref();
if (*errorNum != 0) {
if (coordinatesNum > 2)
-   throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos 
cannot transform point (%f %f %f): %s\n", x, y, z, pj_strerrno(*errorNum));
+   throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos 
cannot transform point (%f %f %f): %s\n", x, y, z, pj_strerrno(*errorNum));
else
-   throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos 
cannot transform point (%f %f): %s\n", x, y, pj_strerrno(*errorNum));
+   throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos 
cannot transform point (%f %f): %s\n", x, y, pj_strerrno(*errorNum));
}
 
/* check if the destination reference system is geographic and change
@@ -96,7 +96,7 @@ transformCoordSeq(int idx, int coordinat
if (!GEOSCoordSeq_setX(gcs_new, idx, x) ||
!GEOSCoordSeq_setY(gcs_new, idx, y) ||
(coordinatesNum > 2 && !GEOSCoordSeq_setZ(gcs_new, idx, z)))
-   throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos cannot set 
coordinates");
+ 

MonetDB: data-vaults - Merge with default

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: ecc1eefb4054 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ecc1eefb4054
Modified Files:
geom/monetdb5/geom.c
monetdb5/extras/rapi/rapi.c
monetdb5/mal/mal_atom.c
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_exception.c
monetdb5/mal/mal_factory.c
monetdb5/mal/mal_import.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_namespace.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_session.c
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/inet.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/mcurl.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/str.c
monetdb5/modules/atoms/streams.c
monetdb5/modules/atoms/url.c
monetdb5/modules/atoms/uuid.c
monetdb5/modules/atoms/xml.c
monetdb5/modules/kernel/aggr.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/batcolor.c
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/kernel/status.c
monetdb5/modules/mal/batExtensions.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/calc.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/groupby.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/iterator.c
monetdb5/modules/mal/json_util.c
monetdb5/modules/mal/language.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/manifold.c
monetdb5/modules/mal/manual.c
monetdb5/modules/mal/mat.c
monetdb5/modules/mal/mdb.c
monetdb5/modules/mal/mkey.c
monetdb5/modules/mal/oltp.c
monetdb5/modules/mal/orderidx.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/projectionpath.c
monetdb5/modules/mal/querylog.c
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/sysmon.c
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tokenizer.c
monetdb5/modules/mal/txtsim.c
monetdb5/optimizer/opt_aliases.c
monetdb5/optimizer/opt_coercion.c
monetdb5/optimizer/opt_commonTerms.c
monetdb5/optimizer/opt_constants.c
monetdb5/optimizer/opt_dataflow.c
monetdb5/optimizer/opt_deadcode.c
monetdb5/optimizer/opt_emptybind.c
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_garbageCollector.c
monetdb5/optimizer/opt_generator.c
monetdb5/optimizer/opt_jit.c
monetdb5/optimizer/opt_json.c
monetdb5/optimizer/opt_macro.c
monetdb5/optimizer/opt_matpack.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_oltp.c
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_projectionpath.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_querylog.c
monetdb5/optimizer/opt_remap.c
monetdb5/optimizer/opt_remoteQueries.c
monetdb5/optimizer/opt_reorder.c
monetdb5/optimizer/opt_volcano.c
monetdb5/optimizer/opt_wlc.c
monetdb5/optimizer/opt_wrapper.c
monetdb5/scheduler/run_adder.c
monetdb5/scheduler/run_memo.c
sql/backends/monet5/LSST/lsst.c
sql/backends/monet5/UDF/cudf/udf.c
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/type_conversion.c
sql/backends/monet5/generator/generator.c
sql/backends/monet5/sql_cast_impl_down_from_flt.h
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_fround_impl.h
sql/backends/monet5/sql_rank.c
sql/backends/monet5/sql_round_impl.h
sql/backends/monet5/sql_statistics.c
sql/backends/monet5/vaults/fits/fits.c
sql/backends/monet5/vaults/netcdf/netcdf.c
Branch: data-vaults
Log Message:

Merge with default


diffs (truncated from 5150 to 300 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -4624,7 +4624,7 @@ wkbBox2D(mbr **box, wkb **point1, wkb **
//Assign the coordinates. Ensure that they are in correct order
*box = GDKmalloc(sizeof(mbr));
if (*box == NULL) {
-   err = createException(MAL, SQLSTATE(38000) 
"geom.MakeBox2D", MAL_MALLOC_FAIL);
+   err = createException(MAL, "geom.MakeBox2D", 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
} else {
(*box)->xmin = (float) (xmin < xmax ? xmin : xmax);
(*box)->ymin = (float) (ymin < ymax ? ymin : ymax);
diff --git a/mo

MonetDB: data-vaults - Merge with default

2017-08-04 Thread Panagiotis Koutsourakis
Changeset: 433f76fef9d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=433f76fef9d5
Modified Files:
clients/Tests/exports.stable.out
clients/mapilib/ChangeLog
clients/mapilib/mapi.c
clients/mapilib/mapi.h
clients/odbc/driver/ODBCStmt.h
clients/odbc/driver/SQLExecDirect.c
clients/odbc/driver/SQLExecute.c
clients/odbc/driver/SQLPrepare.c
geom/BugTracker/Tests/X_crash.SF-1971632.stable.err
geom/BugTracker/Tests/copy_into_crash.SF-1975402.stable.err
geom/monetdb5/geomBulk.c
geom/sql/functions/Tests/ST_GeomFromText.stable.err
geom/sql/functions/Tests/ST_LineFromText.stable.err
geom/sql/functions/Tests/ST_MLineFromText.stable.err
geom/sql/functions/Tests/ST_MPointFromText.stable.err
geom/sql/functions/Tests/ST_MPolygonFromText.stable.err
geom/sql/functions/Tests/ST_MakeBox2D.stable.err
geom/sql/functions/Tests/ST_MakePoint.stable.err
geom/sql/functions/Tests/ST_NumPoints.stable.err
geom/sql/functions/Tests/ST_PointFromText.stable.err
geom/sql/functions/Tests/ST_PolygonFromText.stable.err
geom/sql/functions/Tests/XYZ.stable.err
monetdb5/ChangeLog
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.err
monetdb5/mal/mal_client.c
monetdb5/mal/mal_exception.c
monetdb5/mal/mal_exception.h
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_session.c
monetdb5/modules/mal/mal_mapi.c
sql/ChangeLog
sql/backends/monet5/Tests/createorreplace.stable.err
sql/backends/monet5/Tests/optimizers.stable.err
sql/backends/monet5/Tests/optimizers.stable.out
sql/backends/monet5/generator/Tests/crash.Bug-3609.stable.err
sql/backends/monet5/generator/Tests/generator00.stable.out
sql/backends/monet5/generator/Tests/generator01.stable.err
sql/backends/monet5/generator/Tests/generator02.stable.out
sql/backends/monet5/generator/Tests/generator03.stable.out
sql/backends/monet5/generator/Tests/generator04.stable.err
sql/backends/monet5/generator/Tests/thetaselect00.stable.out
sql/backends/monet5/generator/generator.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_assert.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/vaults/bam/Tests/bam_lib.stable.err
sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.out
sql/backends/monet5/vaults/bam/Tests/mergetable.stable.err
sql/backends/monet5/vaults/bam/Tests/query1.1.stable.out
sql/backends/monet5/vaults/bam/Tests/query1.2.stable.out
sql/backends/monet5/vaults/bam/Tests/query2.5.stable.out
sql/backends/monet5/vaults/bam/Tests/query2.5.stable.out.int128
sql/backends/monet5/vaults/bam/Tests/query2.6.stable.out
sql/backends/monet5/vaults/bam/Tests/query2.7.stable.out
sql/backends/monet5/vaults/bam/Tests/query2.8.stable.out
sql/backends/monet5/vaults/bam/Tests/verify_load.stable.err
sql/benchmarks/nobench/Tests/nobench.stable.err
sql/common/sql_types.c
sql/server/rel_dump.c
sql/server/sql_parser.y
sql/test/ADT2006/Tests/benesamo.stable.out
sql/test/ADT2006/Tests/bram.stable.out
sql/test/ADT2006/Tests/sander.stable.err
sql/test/ADT2006/Tests/slam.stable.out
sql/test/ADT2006/Tests/woud.stable.out
sql/test/BugConstraints/Tests/add_constraint_1643522.stable.err
sql/test/BugConstraints/Tests/delete_primarykey_1643845.stable.err
sql/test/BugConstraints/Tests/drop_column_1643542.stable.err
sql/test/BugConstraints/Tests/update_primarykey_1643375.stable.err
sql/test/BugDay_2005-10-06_2.8/Tests/double_commit.SF-916584.stable.err
sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err
sql/test/BugDay_2005-10-06_2.8/Tests/select_null.stable.out
sql/test/BugDay_2005-10-06_2.8/Tests/string_quotes.SF-919539.stable.out

sql/test/BugDay_2005-10-06_2.8/Tests/string_truncate.SF-919542.stable.err
sql/test/BugDay_2005-10-06_2.8/Tests/union-SF.918078.stable.out

sql/test/BugDay_2005-10-06_2.9.3/Tests/BATpropcheck_error.SF-1012739.stable.out

sql/test/BugDay_2005-10-06_2.9.3/Tests/CrashMe_SQL_server_crash-1.SF-921673.stable.out

sql/test/BugDay_2005-10-06_2.9.3/Tests/CrashMe_SQL_server_crash-2.SF-921673.stable.out
sql/test/BugDay_2005-10-06_2.9.3/Tests/case.SF-929151.stable.err
sql/test/BugDay_2005-10-06_2.9.3/Tests/div_by_zero.SF-987304.stable.err
sql/test/BugDay_2005-10-06_2.9.3/Tests/having.SF-922614.stable.err

sql/test/BugDay_2005-10-06_2.9.3/Tests/index_management.SF-927326.stable.err