MonetDB: default - BATcreatedesc: make headless complaint a bit ...

2014-03-14 Thread Fabian Groffen
Changeset: b7a80b4ca68d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b7a80b4ca68d
Modified Files:
gdk/gdk_bat.c
Branch: default
Log Message:

BATcreatedesc: make headless complaint a bit more helpful


diffs (44 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -64,6 +64,28 @@
 char *BATstring_h = h;
 char *BATstring_t = t;
 
+static char *
+type2str(int type)
+{
+   switch (type) {
+   case 0:   return void;   break;
+   case 1:   return bit;break;
+   case 2:   return bte;break;
+   case 3:   return sht;break;
+   case 4:   return bat;break;
+   case 5:   return int;break;
+   case 6:   return oid;break;
+   case 7:   return wrd;break;
+   case 8:   return ptr;break;
+   case 9:   return flt;break;
+   case 10:  return dbl;break;
+   case 11:  return lng;break;
+   case 12:  return str;break;
+   case 255: return any;break;
+   default:  return ???;break;
+   }
+}
+
 static int
 default_ident(char *s)
 {
@@ -90,9 +112,8 @@ BATcreatedesc(int ht, int tt, int heapna
if (bs == NULL)
return NULL;
HEADLESSDEBUG {
-   if ( ht != TYPE_void  ht != TYPE_oid)
-   fprintf(stderr, #headless violation in BATcreatedesc 
%d\n, ht);
-
+   if (ht != TYPE_void  ht != TYPE_oid)
+   fprintf(stderr, #headless violation in BATcreatedesc 
for bat[:%s,:%s]\n, type2str(ht), type2str(tt));
}
/*
 * assert needed in the kernel to get symbol eprintf resolved.
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - mserver5: make debug mask visible in gdk opti...

2014-03-12 Thread Fabian Groffen
Changeset: f4cbcc7d9b53 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f4cbcc7d9b53
Modified Files:
tools/mserver/mserver5.c
Branch: default
Log Message:

mserver5: make debug mask visible in gdk options printout


diffs (19 lines):

diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -425,12 +425,13 @@ main(int argc, char **av)
 
if (debug || grpdebug) {
char buf[16];
+   char wasdebug = debug != 0;
 
-   if (debug)
-   mo_print_options(set, setlen);
debug |= grpdebug;  /* add the algorithm tracers */
snprintf(buf, sizeof(buf) - 1, %d, debug);
setlen = mo_add_option(set, setlen, opt_cmdline, gdk_debug, 
buf);
+   if (wasdebug)
+   mo_print_options(set, setlen);
}
 
monet_script = (str *) malloc(sizeof(str) * (argc + 1));
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - mal_http_daemon: provide dummy implementations

2014-03-12 Thread Fabian Groffen
Changeset: fdb535e7e4cc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fdb535e7e4cc
Modified Files:
monetdb5/mal/mal_http_daemon.c
monetdb5/mal/mal_private.h
Branch: default
Log Message:

mal_http_daemon: provide dummy implementations

Since the API for this file is statically defined no matter what, make
sure the symbols are available as well, no matter what.


diffs (46 lines):

diff --git a/monetdb5/mal/mal_http_daemon.c b/monetdb5/mal/mal_http_daemon.c
--- a/monetdb5/mal/mal_http_daemon.c
+++ b/monetdb5/mal/mal_http_daemon.c
@@ -277,4 +277,31 @@ void stopHttpdaemon(void){
MT_join_thread(hdthread);
 }
 
+#else
+
+#include mal.h
+#include mal_exception.h
+#include mal_private.h
+#include mal_http_daemon.h
+
+/* dummy noop functions to implement the exported API, if these had been
+ * defined to return a str, we could have informed the caller no
+ * implementation was available */
+
+void
+register_http_handler(http_request_handler handler)
+{
+   (void)handler;
+}
+
+void
+startHttpdaemon(void)
+{
+}
+
+void
+stopHttpdaemon(void)
+{
+}
+
 #endif
diff --git a/monetdb5/mal/mal_private.h b/monetdb5/mal/mal_private.h
--- a/monetdb5/mal/mal_private.h
+++ b/monetdb5/mal/mal_private.h
@@ -92,6 +92,7 @@ extern void malGarbageCollector(MalBlkPt
 extern void listFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int 
first, int step)
__attribute__((__visibility__(hidden)));
 
+/* mal_http_daemon.h */
 extern void startHttpdaemon(void)
__attribute__((__visibility__(hidden)));
 extern void stopHttpdaemon(void)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - mserver5: do a slight check on debug argument

2014-03-12 Thread Fabian Groffen
Changeset: bc8e33f27792 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc8e33f27792
Modified Files:
tools/mserver/mserver5.c
Branch: default
Log Message:

mserver5: do a slight check on debug argument

Make sure debug is a number such that wrong input doesn't go unnoticed
when we do something like mserver5 --debug=HEADLESS (obviously, this was
too naive, but anyway).


diffs (18 lines):

diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -380,7 +380,13 @@ main(int argc, char **av)
break;
case 'd':
if (optarg) {
-   debug |= strtol(optarg, NULL, 10);
+   char *endarg;
+   debug |= strtol(optarg, endarg, 10);
+   if (*endarg != '\0') {
+   fprintf(stderr, ERROR: wrong format 
for --debug=%s\n,
+   optarg);
+   usage(prog, -1);
+   }
} else {
debug |= 1;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jan2014 - configure: don't choke on deprecation messages

2014-03-05 Thread Fabian Groffen
Changeset: b4d844547d39 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b4d844547d39
Modified Files:
configure.ag
Branch: Jan2014
Log Message:

configure: don't choke on deprecation messages

Apple deprecated OpenSSL since Lion, don't complain about that.


diffs (15 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -598,8 +598,11 @@ yes-*-*)
dnl  not all) false positives, though, as well as in
dnl  YACC/BISON-generated code; thus, we do not use
dnl  -Wunreachable-code with clang and gcc  4.5 .
+   dnl  At the same time, Apple deprecated OpenSSL in favour of
+   dnl  their own CommonCrypto API.  We don't mind about that.
case $CC_ver in
clang-*|gcc-[[0-3]].*|gcc-4.[[0-4]].*)
+   MCHECK_ADD_FLAG([-Wno-deprecated-declarations])
;;
*)
MCHECK_ADD_FLAG([-Wunreachable-code])
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - configure: remove bashisms (dash is your frie...

2014-02-16 Thread Fabian Groffen
Changeset: 9b0325b524cc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9b0325b524cc
Modified Files:
configure.ag
Branch: default
Log Message:

configure: remove bashisms (dash is your friend...)


diffs (19 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2429,13 +2429,13 @@ AC_ARG_WITH(liburiparser,
[liburiparser library is installed in DIR]),
have_liburiparser=$withval)
 
-if test x$have_liburiparser == xauto; then
+if test x$have_liburiparser = xauto; then
   PKG_CHECK_MODULES([liburiparser], [liburiparser],
[have_liburiparser=yes],
[have_liburiparser=no; why_have_liburiparser=(liburiparser not 
found)])
 fi
 
-if test x$have_libmicrohttpd == xauto; then
+if test x$have_libmicrohttpd = xauto; then
   PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd],
[have_libmicrohttpd=yes],
[have_libmicrohttpd=no; why_have_libmicrohttpd=(libmicrohttpd 
not found)])
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jan2014 - AUTHinitTables: allow passing a password for ...

2014-02-16 Thread Fabian Groffen
Changeset: 8f6aa798f4c5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8f6aa798f4c5
Modified Files:
clients/Tests/exports.stable.out
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_authorize.h
Branch: Jan2014
Log Message:

AUTHinitTables: allow passing a password for monetdb user

This allows to securely setup a new database.


diffs (62 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -881,7 +881,7 @@ str AUTHcheckCredentials(oid *ret, Clien
 str AUTHgetPasswordHash(str *ret, Client *c, str *username);
 str AUTHgetUsername(str *ret, Client *c);
 str AUTHgetUsers(BAT **ret, Client *c);
-str AUTHinitTables(void);
+str AUTHinitTables(str *passwd);
 str AUTHremoveUser(Client *c, str *username);
 str AUTHrequireAdmin(Client *c);
 str AUTHresolveUser(str *ret, oid *uid);
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -112,12 +112,13 @@ AUTHcommit(void)
  * Localize the authorization tables in the database.  The authorization
  * tables are a set of aligned BATs that store username, password (hashed)
  * and scenario permissions.
- * If the BATs do not exist, they are created, and the monetdb/monetdb
- * administrator account is added.  Initialising the authorization tables
- * can only be done after the GDK kernel has been initialized.
+ * If the BATs do not exist, they are created, and the monetdb
+ * administrator account is added with the given password (or 'monetdb'
+ * if NULL).  Initialising the authorization tables can only be done
+ * after the GDK kernel has been initialized.
  */
 str
-AUTHinitTables(void) {
+AUTHinitTables(str *passwd) {
bat bid;
BAT *b;
int isNew = 1;
@@ -168,12 +169,13 @@ AUTHinitTables(void) {
/* insert the monetdb/monetdb administrator account on a
 * complete fresh and new auth tables system */
str user = monetdb;
-   str pw; /* will become the right hash for monetdb */
-   int len = (int) strlen(user);
+   str pw = monetdb;
oid uid;
Client c = mal_clients[0];
 
-   pw = mcrypt_BackendSum(user /* because user == pass */, len);
+   if (passwd != NULL  *passwd != NULL)
+   pw = *passwd;
+   pw = mcrypt_BackendSum(pw, strlen(pw));
msg = AUTHaddUser(uid, c, user, pw);
free(pw);
if (msg)
diff --git a/monetdb5/mal/mal_authorize.h b/monetdb5/mal/mal_authorize.h
--- a/monetdb5/mal/mal_authorize.h
+++ b/monetdb5/mal/mal_authorize.h
@@ -38,7 +38,7 @@ mal_export str AUTHgetUsers(BAT **ret, C
 mal_export str AUTHgetPasswordHash(str *ret, Client *c, str *username);
 
 mal_export str AUTHrequireAdmin(Client *c);
-mal_export str AUTHinitTables(void);
+mal_export str AUTHinitTables(str *passwd);
 
 
 /*
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jan2014 - Adjust calls to AUTHinitTables()

2014-02-16 Thread Fabian Groffen
Changeset: 82119e107e56 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=82119e107e56
Modified Files:
sql/backends/monet5/embeddedclient.c.in
tools/mserver/mserver5.c
Branch: Jan2014
Log Message:

Adjust calls to AUTHinitTables()


diffs (24 lines):

diff --git a/sql/backends/monet5/embeddedclient.c.in 
b/sql/backends/monet5/embeddedclient.c.in
--- a/sql/backends/monet5/embeddedclient.c.in
+++ b/sql/backends/monet5/embeddedclient.c.in
@@ -114,7 +114,7 @@ start_sql_server(void *arg)
return 0;
}
/* make sure the authorisation BATs are loaded */
-   if (AUTHinitTables() != MAL_SUCCEED)
+   if (AUTHinitTables(NULL) != MAL_SUCCEED)
return 0;
MSinitClientPrg(mal_clients, user,main);
initialized = 1;
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -576,7 +576,7 @@ main(int argc, char **av)
}
}
/* make sure the authorisation BATs are loaded */
-   if ((err = AUTHinitTables()) != MAL_SUCCEED) {
+   if ((err = AUTHinitTables(NULL)) != MAL_SUCCEED) {
/* don't show this as a crash */
msab_registerStop();
GDKfatal(%s, err);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jan2014 - monetdb: allow databases to be created with a...

2014-02-16 Thread Fabian Groffen
Changeset: 6177dd32ac5d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6177dd32ac5d
Modified Files:
tools/merovingian/ChangeLog.Jan2014
tools/merovingian/client/monetdb.1
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/Makefile.ag
tools/merovingian/daemon/controlrunner.c
Branch: Jan2014
Log Message:

monetdb: allow databases to be created with a password for monetdb user

Creating a database with a custom password for the monetdb user makes it
safer than when created with default/well-known credentials, hence it is
not necessary to lock the database after creation.


diffs (190 lines):

diff --git a/tools/merovingian/ChangeLog.Jan2014 
b/tools/merovingian/ChangeLog.Jan2014
--- a/tools/merovingian/ChangeLog.Jan2014
+++ b/tools/merovingian/ChangeLog.Jan2014
@@ -2,5 +2,7 @@
 # This file is updated with mchangelog
 
 * Sun Feb 16 2014 Fabian Groffen fab...@monetdb.org
+- monetdb create: add -p flag to set monetdb user password on creation,
+  and therefore allow creating the database in unlocked state
 - monetdb destroy -f now also works on running databases
 
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
@@ -52,12 +52,14 @@ stopping a database inside the MonetDB D
 For all commands, database arguments can be glob-like expressions.
 This allows to do wildcard matches.  For details on the syntax, see
 .IR EXPRESSIONS .
-.IP create [\-m pattern] database [database ...]
+.IP create [\-m pattern] [\-p password] database [database ...]
 Initialises a new database in the MonetDB Database Server.  A database
 created with this command makes it available under its database name,
 but not yet for use by clients, as the database is put into maintenance
 mode.  This allows the database administrator to perform initialisation
-steps before releasing it to users.  See also
+steps before releasing it to users, unless the
+.I \-p
+argument is supplied.  See also
 .BR monetdb lock .
 The name of the database must match the expression [A\-Za\-z0\-9\-_]+.
 .IP   \-m pattern
@@ -74,6 +76,14 @@ or discovery.  Each parallel target for 
 sequence, separated by commas.  Here the pattern is an ordinary pattern
 as would be used for connecting to a database, and can hence also be
 just the name of a database.
+.IP   \-p password
+The
+.I \-p
+flag allows to create a database with the given password for the monetdb
+user.  Since this protects the database from being accessed via
+well-known credentials, the created database is not locked after
+creation.  This way, a new database can be created and used right away
+using the password supplied.
 .IP destroy [\-f] database [database ...]
 Removes the given database, including all its data and logfiles.  Once
 destroy has completed, all data is lost.  Be careful when using this
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
@@ -1435,6 +1435,7 @@ command_create(int argc, char *argv[])
 {
int i;
char *mfunnel = NULL;
+   char *password = NULL;
sabdb *orig = NULL;
sabdb *stats = NULL;
 
@@ -1464,6 +1465,19 @@ command_create(int argc, char *argv[])
command_help(2, argv[-1]);
exit(1);
}
+   } else if (argv[i][1] == 'p') {
+   if (argv[i][2] != '\0') {
+   password = argv[i][2];
+   argv[i] = NULL;
+   } else if (i + 1  argc  argv[i + 1][0] != 
'-') {
+   argv[i] = NULL;
+   password = argv[++i];
+   argv[i] = NULL;
+   } else {
+   fprintf(stderr, create: -p needs an 
argument\n);
+   command_help(2, argv[-1]);
+   exit(1);
+   }
} else {
fprintf(stderr, create: unknown option: %s\n, 
argv[i]);
command_help(argc + 1, argv[-1]);
@@ -1492,6 +1506,13 @@ command_create(int argc, char *argv[])
simple_argv_cmd(argv[0], orig, cmd, 
created multiplex-funnel in maintenance mode, 
NULL);
free(cmd);
+   } else if (password != NULL) {
+   size_t len = strlen(create password=) + strlen(password) + 1;
+   char *cmd = malloc(len);
+   snprintf(cmd, len, create password=%s, password);
+   simple_argv_cmd(argv[0], orig, cmd

MonetDB: Feb2013 - mat_apply1: fix compilation on Darwin 11

2013-11-15 Thread Fabian Groffen
Changeset: 209f4125f117 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=209f4125f117
Modified Files:
monetdb5/optimizer/opt_mergetable.c
Branch: Feb2013
Log Message:

mat_apply1: fix compilation on Darwin 11

hgrepo/monetdb5/optimizer/opt_mergetable.c: In function ‘mat_apply1’:
hgrepo/monetdb5/optimizer/opt_mergetable.c:262: warning: ‘n’ may be used 
uninitialized in this function


diffs (12 lines):

diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -259,7 +259,7 @@ mat_apply1(MalBlkPtr mb, InstrPtr p, mat
 {
int tpe, k, is_select = isSubSelect(p), is_mirror = (getFunctionId(p) 
== mirrorRef);
int is_identity = (getFunctionId(p) == identityRef  getModuleId(p) == 
batcalcRef);
-   int ident_var = 0, is_assign = (getFunctionId(p) == NULL), n;
+   int ident_var = 0, is_assign = (getFunctionId(p) == NULL), n = 0;
InstrPtr r = NULL, q;
 
/* Find the mat we overwrite */
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - merovingian: refuse to startup when propertie...

2013-11-15 Thread Fabian Groffen
Changeset: b215b05c5c79 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b215b05c5c79
Modified Files:
tools/merovingian/daemon/merovingian.c
Branch: Feb2013
Log Message:

merovingian: refuse to startup when properties are missing

dbfarms that we can't read .merovingian_properties from are either
messed up in terms of permissions, or created by a simple mkdir, such as
in bug #3398.  Refuse starting up since this affects any other
operations on monetdbd (although it functions just fine), such as
shutdown via monetdbd stop 


diffs (16 lines):

diff --git a/tools/merovingian/daemon/merovingian.c 
b/tools/merovingian/daemon/merovingian.c
--- a/tools/merovingian/daemon/merovingian.c
+++ b/tools/merovingian/daemon/merovingian.c
@@ -660,7 +660,11 @@ main(int argc, char *argv[])
}
 
/* read the merovingian properties from the dbfarm */
-   readProps(ckv, .);
+   if (readProps(ckv, .) != 0) {
+   Mfprintf(stderr, cannot find or read properties file, was 
+   this dbfarm created by `monetdbd create`?\n);
+   MERO_EXIT_CLEAN(1);
+   }
_mero_props = ckv;
 
pidfilename = getConfVal(_mero_props, pidfile);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - add changelog entry

2013-11-15 Thread Fabian Groffen
Changeset: d6e1a6f11a08 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d6e1a6f11a08
Modified Files:
tools/merovingian/ChangeLog.Feb2013
Branch: Feb2013
Log Message:

add changelog entry


diffs (11 lines):

diff --git a/tools/merovingian/ChangeLog.Feb2013 
b/tools/merovingian/ChangeLog.Feb2013
--- a/tools/merovingian/ChangeLog.Feb2013
+++ b/tools/merovingian/ChangeLog.Feb2013
@@ -1,3 +1,7 @@
 # ChangeLog file for sql/src/backends/monet5/merovingian
 # This file is updated with mchangelog
 
+* Fri Nov 15 2013 Fabian Groffen fab...@monetdb.org
+- monetdbd(1) now refuses to startup if it cannot read the properties
+  from the dbfarm, bug #3398
+
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - configure: make missing geos-config message c...

2013-10-04 Thread Fabian Groffen
Changeset: d7253efd5e28 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d7253efd5e28
Modified Files:
configure.ag
Branch: Feb2013
Log Message:

configure: make missing geos-config message consistent with others


diffs (12 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2325,7 +2325,7 @@ yes|auto)
AC_MSG_ERROR([geos-config not found in $XPATH])
else
have_geos=no
-   why_have_geos=(geos-config not found in 
$XPATH)
+   why_have_geos=(geos-config not found)
fi
fi
fi
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - configure: handle case with ruby, but without...

2013-10-04 Thread Fabian Groffen
Changeset: 6b202e2d0273 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b202e2d0273
Modified Files:
configure.ag
Branch: Feb2013
Log Message:

configure: handle case with ruby, but without rubygems

Don't error if we have ruby, but no rubygems if we didn't request
rubygems explicitly.


diffs (63 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1317,34 +1317,45 @@ if test x$enable_testing != xno ; then
 fi
 
 RUBY=ruby
+AC_PATH_PROG(RUBY,$RUBY,no,$PATH)
 have_rubygem_dir=auto
 AC_ARG_WITH(rubygem-dir,
AS_HELP_STRING([--with-rubygem-dir=DIR], [Ruby gems are installed in 
DIR]),
have_rubygem_dir=$withval)
 
 case $have_rubygem_dir in
-   yes|auto)
-   AC_PATH_PROG(RUBY,$RUBY,no,$PATH)
+   no) ;;
+   *)
if test x$RUBY = xno; then
if test x$have_rubygem_dir != xauto; then
-   AC_MSG_ERROR([No Ruby executable found, specify 
--with-rubygem-dir explicitly])
+   AC_MSG_ERROR([No Ruby executable found])
fi
have_rubygem_dir=no
else
-   AC_MSG_CHECKING([where rubygems are stored])
-   RUBY_DIR=
-   d=`$RUBY -rrbconfig -e puts 
Config::CONFIG[['prefix']] 2/dev/null`
-   RUBY_DIR=`$RUBY -rrbconfig -e puts 
Config::CONFIG[['sitelibdir']] 2/dev/null | sed -e s|^$d/|| -e 
's/site_ruby/gems/'`
-   if test x$RUBY_DIR = x ; then
-   AC_MSG_ERROR([unable to determine rubygems 
location])
-   else
-   AC_MSG_RESULT([$RUBY_DIR])
-   fi
+   case $have_rubygem_dir in
+   yes|auto)
+   AC_MSG_CHECKING([where rubygems are 
stored])
+   RUBY_DIR=
+   d=`$RUBY -rrbconfig -e puts 
Config::CONFIG[['prefix']] 2/dev/null`
+   RUBY_DIR=`$RUBY -rrbconfig -e puts 
Config::CONFIG[['sitelibdir']] 2/dev/null | sed -e s|^$d/|| -e 
's/site_ruby/gems/'`
+   if test x$RUBY_DIR = x ; then
+   if test x$have_rubygem_dir != 
xauto; then
+   AC_MSG_ERROR([unable to 
determine rubygems location])
+   else
+   AC_MSG_RESULT([unable 
to determine rubygems location])
+   RUBY=no
+   fi
+   else
+   AC_MSG_RESULT([$RUBY_DIR])
+   fi
+   ;;
+   *)
+   RUBY_DIR=$have_rubygem_dir
+   ;;
+   esac
fi
;;
-   no) ;;
*)
-   RUBY_DIR=$have_rubygem_dir
;;
 esac
 case $RUBY_DIR in
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - configure: rubgems dir not found means no

2013-10-04 Thread Fabian Groffen
Changeset: a5c739ff661b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a5c739ff661b
Modified Files:
configure.ag
Branch: Feb2013
Log Message:

configure: rubgems dir not found means no

don't make the conditional be set when we didn't find what we're looking
for


diffs (11 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1344,6 +1344,7 @@ case $have_rubygem_dir in
else
AC_MSG_RESULT([unable 
to determine rubygems location])
RUBY=no
+   have_rubygem_dir=no
fi
else
AC_MSG_RESULT([$RUBY_DIR])
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - monetdb: don't compress output when not conne...

2013-07-30 Thread Fabian Groffen
Changeset: 8ca402652831 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ca402652831
Modified Files:
tools/merovingian/ChangeLog.Feb2013
tools/merovingian/client/monetdb.c
Branch: Feb2013
Log Message:

monetdb: don't compress output when not connected to a terminal

- check stdout for its size (since we're writing there, we don't care
  about reading end -- may as well be completely different in case of a
  pipe)
- don't compress output when we didn't find a terminal width (0),
  addresses bug #3292, now scripts should get full output


diffs (165 lines):

diff --git a/tools/merovingian/ChangeLog.Feb2013 
b/tools/merovingian/ChangeLog.Feb2013
--- a/tools/merovingian/ChangeLog.Feb2013
+++ b/tools/merovingian/ChangeLog.Feb2013
@@ -1,3 +1,7 @@
 # ChangeLog file for sql/src/backends/monet5/merovingian
 # This file is updated with mchangelog
 
+* Tue Jul 30 2013 Fabian Groffen fab...@monetdb.org
+- monetdb now no longer compresses output when not connected to a terminal,
+  bug #3292
+
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
@@ -67,7 +67,7 @@ static char *mero_host = NULL;
 static int mero_port = -1;
 static char *mero_pass = NULL;
 static char monetdb_quiet = 0;
-static int TERMWIDTH = 80;  /* default to classic terminal width */
+static int TERMWIDTH = 0;  /* default to no wrapping */
 
 static void
 command_help(int argc, char *argv[])
@@ -822,7 +822,7 @@ command_status(int argc, char *argv[])
*/
 
len = dbwidth  4 ? 4 : dbwidth + 2 + 5 + 2 + 8 + 2 + uriwidth;
-   if (len  twidth) {
+   if (twidth  0  len  twidth) {
if (len - twidth  10) {
uriwidth -= len - twidth;
if (dbwidth  4)
@@ -878,7 +878,7 @@ command_discover(int argc, char *argv[])
char *buf;
char *p, *q;
size_t twidth = TERMWIDTH;
-   char *location;
+   char *location = NULL;
char *match = NULL;
size_t numlocs = 50;
size_t posloc = 0;
@@ -912,7 +912,8 @@ command_discover(int argc, char *argv[])
fprintf(stderr, %s: %s\n, argv[0], p);
exit(1);
}
-   location = malloc(twidth + 1);
+   if (twidth  0)
+   location = malloc(twidth + 1);
while ((p = strtok(NULL, \n)) != NULL) {
if ((q = strchr(p, '\t')) == NULL) {
/* doesn't look correct */
@@ -925,8 +926,12 @@ command_discover(int argc, char *argv[])
snprintf(path, sizeof(path), %s%s, q, p);
 
if (match == NULL || glob(match, path)) {
-   /* cut too long location name */
-   abbreviateString(location, path, twidth);
+   if (twidth  0) {
+   /* cut too long location name */
+   abbreviateString(location, path, 
twidth);
+   } else {
+   location = path;
+   }
/* store what we found */
if (posloc == numlocs)
locations = realloc(locations,
@@ -936,7 +941,8 @@ command_discover(int argc, char *argv[])
loclen = strlen(location);
}
}
-   free(location);
+   if (twidth  0)
+   free(location);
}
 
free(buf);
@@ -1220,7 +1226,7 @@ command_get(int argc, char *argv[])
int i;
sabdb *orig, *stats;
int twidth = TERMWIDTH;
-   char *source, *value;
+   char *source, *value = NULL;
confkeyval *kv;
confkeyval *defprops = getDefaultProps();
confkeyval *props = getDefaultProps();
@@ -1305,13 +1311,15 @@ command_get(int argc, char *argv[])
readPropsBuf(defprops, buf + 3);
free(buf);
 
-   /* name = 15 */
-   /* prop = 8 */
-   /* source = 7 */
-   twidth -= 15 + 2 + 8 + 2 + 7 + 2;
-   if (twidth  6)
-   twidth = 6;
-   value = malloc(sizeof(char) * twidth + 1);
+   if (twidth  0) {
+   /* name = 15 */
+   /* prop = 8 */
+   /* source = 7 */
+   twidth -= 15 + 2 + 8 + 2 + 7 + 2;
+   if (twidth  6)
+   twidth = 6;
+   value = malloc(sizeof(char) * twidth + 1);
+   }
stats = orig;
while (stats != NULL) {
e = control_send(buf, mero_host, mero_port,
@@ -1379,19 +1387,32 @@ command_get(int argc, char *argv

MonetDB: Feb2013 - info: drop space element, since it can differ

2013-06-14 Thread Fabian Groffen
Changeset: 2f2a0cf0022a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2f2a0cf0022a
Modified Files:
monetdb5/extras/jaql/jaqltests/Tests/info.jaql
monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
Branch: Feb2013
Log Message:

info: drop space element, since it can differ


diffs (28 lines):

diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.jaql 
b/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
--- a/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
@@ -6,4 +6,8 @@ x = [
[ 4, 5, 6, 7 ]
 ];
 
-info(x);
+info(x)
+# fix 32/64-bit specific output, drop space
+# $.{* - space} support would be nice here
+- transform { $.elems, $.objs, $.strings, $.integers,
+   $.doubles, $.arrays, $.objects, $.keys };
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out 
b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
--- a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
@@ -27,10 +27,9 @@ Ready.
 % .json # table_name
 % json # name
 % clob # type
-% 19 # length
+% 18 # length
 [
   {
-space: 24064,
 elems: 5,
 objs: 11,
 strings: 1,
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - backout d7b99de2bd41, I fixed the test in Feb...

2013-06-14 Thread Fabian Groffen
Changeset: c650b8f90c77 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c650b8f90c77
Removed Files:
monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.32bit
monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.oid32
Branch: default
Log Message:

backout d7b99de2bd41, I fixed the test in Feb2013


diffs (106 lines):

diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.32bit 
b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.32bit
deleted file mode 100644
--- a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.32bit
+++ /dev/null
@@ -1,48 +0,0 @@
-stdout of test 'info` in directory 'monetdb5/extras/jaql/jaqltests` itself:
-
-
-# 15:22:07   
-# 15:22:07   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
mapi_open=true --set mapi_port=32732 --set 
mapi_usock=/var/tmp/mtest-86676/.s.monetdb.32732 --set monet_prompt= 
--forcemito --set mal_listing=2 
--dbpath=/Users/fgroffen/develop/MonetDB/Feb2013/mtest-gaia.cheops.bitzolder.nl/five/dbfarm/mTests_monetdb5_extras_jaql_jaqltests
 --set mal_listing=0
-# 15:22:07   
-
-# MonetDB 5 server v11.16.0 Feb2013-856309bec599
-# Serving database 'mTests_monetdb5_extras_jaql_jaqltests', using 4 threads
-# Compiled for x86_64-apple-darwin11/64bit with 64bit OIDs dynamically linked
-# Found 8.000 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://gaia.local:32732/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-86676/.s.monetdb.32732
-# MonetDB/JAQL module loaded
-# MonetDB/SQL module loaded
-
-Ready.
-
-# 15:22:07   
-# 15:22:07   mclient -ljaql -ftest -Eutf-8 -i -e 
--host=/var/tmp/mtest-86676 --port=32732
-# 15:22:07   
-
-#info(x);
-% .json # table_name
-% json # name
-% clob # type
-% 19 # length
-[
-  {
-space: 15872,
-elems: 5,
-objs: 11,
-strings: 1,
-integers: 6,
-doubles: 1,
-arrays: 2,
-objects: 1,
-keys: 1
-  }
-]
-
-# 15:22:07   
-# 15:22:07   Done.
-# 15:22:07   
-
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.oid32 
b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.oid32
deleted file mode 100644
--- a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out.oid32
+++ /dev/null
@@ -1,48 +0,0 @@
-stdout of test 'info` in directory 'monetdb5/extras/jaql/jaqltests` itself:
-
-
-# 15:22:07   
-# 15:22:07   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
mapi_open=true --set mapi_port=32732 --set 
mapi_usock=/var/tmp/mtest-86676/.s.monetdb.32732 --set monet_prompt= 
--forcemito --set mal_listing=2 
--dbpath=/Users/fgroffen/develop/MonetDB/Feb2013/mtest-gaia.cheops.bitzolder.nl/five/dbfarm/mTests_monetdb5_extras_jaql_jaqltests
 --set mal_listing=0
-# 15:22:07   
-
-# MonetDB 5 server v11.16.0 Feb2013-856309bec599
-# Serving database 'mTests_monetdb5_extras_jaql_jaqltests', using 4 threads
-# Compiled for x86_64-apple-darwin11/64bit with 64bit OIDs dynamically linked
-# Found 8.000 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://gaia.local:32732/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-86676/.s.monetdb.32732
-# MonetDB/JAQL module loaded
-# MonetDB/SQL module loaded
-
-Ready.
-
-# 15:22:07   
-# 15:22:07   mclient -ljaql -ftest -Eutf-8 -i -e 
--host=/var/tmp/mtest-86676 --port=32732
-# 15:22:07   
-
-#info(x);
-% .json # table_name
-% json # name
-% clob # type
-% 19 # length
-[
-  {
-space: 11776,
-elems: 5,
-objs: 11,
-strings: 1,
-integers: 6,
-doubles: 1,
-arrays: 2,
-objects: 1,
-keys: 1
-  }
-]
-
-# 15:22:07   
-# 15:22:07   Done.
-# 15:22:07   
-
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2013-06-14 Thread Fabian Groffen
Changeset: 9ca42eb266bf for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9ca42eb266bf
Modified Files:
monetdb5/extras/jaql/jaqltests/Tests/info.jaql
monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
Branch: default
Log Message:

Merged from Feb2013


diffs (28 lines):

diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.jaql 
b/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
--- a/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
@@ -6,4 +6,8 @@ x = [
[ 4, 5, 6, 7 ]
 ];
 
-info(x);
+info(x)
+# fix 32/64-bit specific output, drop space
+# $.{* - space} support would be nice here
+- transform { $.elems, $.objs, $.strings, $.integers,
+   $.doubles, $.arrays, $.objects, $.keys };
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out 
b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
--- a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
@@ -27,10 +27,9 @@ Ready.
 % .json # table_name
 % json # name
 % clob # type
-% 19 # length
+% 18 # length
 [
   {
-space: 24064,
 elems: 5,
 objs: 11,
 strings: 1,
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - setObject: fix BigDecimal handling after prev...

2013-06-14 Thread Fabian Groffen
Changeset: 088f48770956 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=088f48770956
Modified Files:
java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
Branch: Feb2013
Log Message:

setObject: fix BigDecimal handling after previous fix

This fixes Test_PStypes again.  Even if a double is rounded, this
doesn't mean it has all trailing zeros, since the representation simply
can't guarantee that.  So, just cut off excess digits like we did at the
previous implementation not to give the server any more than exactly the
specification of the decimal (it expects).


diffs (21 lines):

diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -973,12 +973,15 @@ public class MonetPreparedStatement
 
// Reduction is possible via rounding; do it and we're good to 
go.
x = x.round(new MathContext(targetScale, RoundingMode.HALF_UP));
-   x = x.stripTrailingZeros();
 
// MonetDB doesn't like leading 0's, since it counts them as 
part of
// the precision, so let's strip them off. (But be careful not 
to do
-   // this to the exact number 0.)
+   // this to the exact number 0.)  Also strip off trailing
+   // numbers that are inherent to the double representation.
String xStr = x.toPlainString();
+   int dot = xStr.indexOf(.);
+   if (dot != 0)
+   xStr = xStr.substring(0, Math.min(xStr.length(), dot + 
1 + scale[i]));
while (xStr.startsWith(0)  xStr.length()  1)
xStr = xStr.substring(1);
setValue(idx, xStr);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - group02: drop stray comment

2013-06-12 Thread Fabian Groffen
Changeset: 9891f42c756e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9891f42c756e
Modified Files:
monetdb5/extras/jaql/Tests/group02.mal
Branch: Feb2013
Log Message:

group02: drop stray comment


diffs (11 lines):

diff --git a/monetdb5/extras/jaql/Tests/group02.mal 
b/monetdb5/extras/jaql/Tests/group02.mal
--- a/monetdb5/extras/jaql/Tests/group02.mal
+++ b/monetdb5/extras/jaql/Tests/group02.mal
@@ -1,7 +1,5 @@
 # various bugs in the group(functions) code
 
-#disabled: works in progress
-
 # should return 0
 jaql.x([]-group into count($););
 # only works when the groupkey exists for all elements
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - funccall: allow json argument to be passed as...

2013-06-12 Thread Fabian Groffen
Changeset: 03550d3d4234 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=03550d3d4234
Modified Files:
monetdb5/extras/jaql/jaqlgencode.c
Branch: Feb2013
Log Message:

funccall: allow json argument to be passed as well

Make functions that take and return json structs be callable.


diffs (20 lines):

diff --git a/monetdb5/extras/jaql/jaqlgencode.c 
b/monetdb5/extras/jaql/jaqlgencode.c
--- a/monetdb5/extras/jaql/jaqlgencode.c
+++ b/monetdb5/extras/jaql/jaqlgencode.c
@@ -7388,6 +7388,7 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
switch (coltypes[i]) {
case j_json:
case j_json_arr:
+   case j_sort_arg:
case j_var:
q = 
pushArgument(mb, q, dynaarg[i][0]);
q = 
pushArgument(mb, q, dynaarg[i][1]);
@@ -7397,8 +7398,6 @@ dumptree(jc *j, Client cntxt, MalBlkPtr 
q = 
pushArgument(mb, q, dynaarg[i][5]);
q = 
pushArgument(mb, q, dynaarg[i][6]);
break;
-   case j_sort_arg:
-   assert(0);
default:
q = 
pushArgument(mb, q, dynaarg[i][0]);
break;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - jaql: implemented info() command

2013-06-12 Thread Fabian Groffen
Changeset: 3c799ab603f7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c799ab603f7
Modified Files:
monetdb5/extras/jaql/jaqlfunc.mal
Branch: Feb2013
Log Message:

jaql: implemented info() command


diffs (107 lines):

diff --git a/monetdb5/extras/jaql/jaqlfunc.mal 
b/monetdb5/extras/jaql/jaqlfunc.mal
--- a/monetdb5/extras/jaql/jaqlfunc.mal
+++ b/monetdb5/extras/jaql/jaqlfunc.mal
@@ -187,9 +187,6 @@ function list()(kind:bat[:oid,:bte],stri
offs := algebra.project(lens, 6);
docs := batstr.substring(docs, offs, lens);
 
-   # in the future we could try to list some info about the document
-   # here, like size
-
r1 := bat.new(:oid,:bte);
#r2 := bat.new(:oid,:str);
r3 := bat.new(:oid,:lng);
@@ -208,7 +205,92 @@ function list()(kind:bat[:oid,:bte],stri
r5 := bat.reverse(t2);
 
return (r1,r2,r3,r4,r5,r6,r7);
-end list();
+end list;
+
+# retrieve/calculate and return info about a stored document
+function 
info(docname:str)(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
+   # what we return:
+   # - number of bytes on disk
+   # - number of elements in top array
+   # - number of components (kind)
+   # - number of strings, ints, double, bool, arrays, objs?
+   # - ?
+   # [ {size: 444, elems: 444, ...} ]
+
+   (d1,d2,d3,d4,d5,d6,d7) := json.load(docname);
+
+   s1 := bat.getDiskSize(d1);
+   s2 := bat.getDiskSize(d2);
+   s3 := bat.getDiskSize(d3);
+   s4 := bat.getDiskSize(d4);
+   s5 := bat.getDiskSize(d5);
+   s6 := bat.getDiskSize(d6);
+   s7 := bat.getDiskSize(d7);
+   space := s1 + s2;
+   space := space + s3;
+   space := space + s4;
+   space := space + s5;
+   space := space + s6;
+   space := space + s7;
+
+   t1 := algebra.selectH(d1, 0@0);
+   t2 := bat.mirror(t1);
+   t3 := bat.reverse(d5);
+   t4 := algebra.leftjoin(t3,t2);
+   elems := aggr.count(t4);
+
+   # quick and dirty, but much easier than constructing a document
+   doc := [{;
+   doc := doc + \space\:;
+   spaces := calc.str(space);
+   doc := doc + spaces;
+
+   doc := doc + ,\elems\:;
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\objs\:;
+   elems := aggr.count(d1);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\strings\:;
+   elems := aggr.count(d2);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\integers\:;
+   elems := aggr.count(d3);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\doubles\:;
+   elems := aggr.count(d4);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\arrays\:;
+   u5 := algebra.kunique(d5);
+   elems := aggr.count(u5);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\objects\:;
+   u6 := algebra.kunique(d6);
+   elems := aggr.count(u6);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + ,\keys\:;
+   elems := aggr.count(d7);
+   elemss := calc.str(elems);
+   doc := doc + elemss;
+
+   doc := doc + }];
+
+   (r1,r2,r3,r4,r5,r6,r7) := json.shred(doc);
+   return (r1,r2,r3,r4,r5,r6,r7);
+end info;
 
 # produce a JSON document with trace information
 function 
gettrace()(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - info: allow usage on variables too

2013-06-12 Thread Fabian Groffen
Changeset: fd5c0307f3b6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fd5c0307f3b6
Modified Files:
monetdb5/extras/jaql/jaqlfunc.mal
Branch: Feb2013
Log Message:

info: allow usage on variables too


diffs (32 lines):

diff --git a/monetdb5/extras/jaql/jaqlfunc.mal 
b/monetdb5/extras/jaql/jaqlfunc.mal
--- a/monetdb5/extras/jaql/jaqlfunc.mal
+++ b/monetdb5/extras/jaql/jaqlfunc.mal
@@ -208,7 +208,7 @@ function list()(kind:bat[:oid,:bte],stri
 end list;
 
 # retrieve/calculate and return info about a stored document
-function 
info(docname:str)(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
+function 
info(d1:bat[:oid,:bte],d2:bat[:oid,:str],d3:bat[:oid,:lng],d4:bat[:oid,:dbl],d5:bat[:oid,:oid],d6:bat[:oid,:oid],d7:bat[:oid,:str])(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
# what we return:
# - number of bytes on disk
# - number of elements in top array
@@ -217,7 +217,6 @@ function info(docname:str)(kind:bat[:oid
# - ?
# [ {size: 444, elems: 444, ...} ]
 
-   (d1,d2,d3,d4,d5,d6,d7) := json.load(docname);
 
s1 := bat.getDiskSize(d1);
s2 := bat.getDiskSize(d2);
@@ -291,6 +290,11 @@ function info(docname:str)(kind:bat[:oid
(r1,r2,r3,r4,r5,r6,r7) := json.shred(doc);
return (r1,r2,r3,r4,r5,r6,r7);
 end info;
+function 
info(docname:str)(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
+   (d1,d2,d3,d4,d5,d6,d7) := json.load(docname);
+   (r1,r2,r3,r4,r5,r6,r7) := jaqlfunc.info(d1,d2,d3,d4,d5,d6,d7);
+   return (r1,r2,r3,r4,r5,r6,r7);
+end info;
 
 # produce a JSON document with trace information
 function 
gettrace()(kind:bat[:oid,:bte],string:bat[:oid,:str],integer:bat[:oid,:lng],double:bat[:oid,:dbl],array:bat[:oid,:oid],object:bat[:oid,:oid],name:bat[:oid,:str]);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - getdisksize: fix when bid 0

2013-06-12 Thread Fabian Groffen
Changeset: eb92c1b3f411 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eb92c1b3f411
Modified Files:
monetdb5/modules/kernel/bat5.c
Branch: Feb2013
Log Message:

getdisksize: fix when bid  0


diffs (14 lines):

diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -1633,9 +1633,8 @@ BKCinfo(int *ret1, int *ret2, int *bid)
 str
 BKCbatdisksize(lng *tot, int *bid){
BAT *b;
-   if ((b = BATdescriptor(*bid)) == NULL) {
+   if ((b = BATdescriptor(ABS(*bid))) == NULL)
throw(MAL, bat.getDiskSize, RUNTIME_OBJECT_MISSING);
-   }
CMDbatdisksize(tot,b);
BBPreleaseref(*bid);
return MAL_SUCCEED;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Add test for info()

2013-06-12 Thread Fabian Groffen
Changeset: c94f47b62764 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c94f47b62764
Added Files:
monetdb5/extras/jaql/jaqltests/Tests/info.jaql
monetdb5/extras/jaql/jaqltests/Tests/info.stable.err
monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
Modified Files:
monetdb5/extras/jaql/jaqltests/Tests/All
Branch: Feb2013
Log Message:

Add test for info()


diffs (115 lines):

diff --git a/monetdb5/extras/jaql/jaqltests/Tests/All 
b/monetdb5/extras/jaql/jaqltests/Tests/All
--- a/monetdb5/extras/jaql/jaqltests/Tests/All
+++ b/monetdb5/extras/jaql/jaqltests/Tests/All
@@ -11,3 +11,4 @@ HAVE_JAQL?in
 HAVE_JAQL?documents
 HAVE_JAQL?multiline
 HAVE_JAQL?calculations
+HAVE_JAQL?info
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.jaql 
b/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.jaql
@@ -0,0 +1,9 @@
+x = [
+   1,
+   5,
+   a,
+   { hello: 7.6 },
+   [ 4, 5, 6, 7 ]
+];
+
+info(x);
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.err 
b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'info` in directory 'monetdb5/extras/jaql/jaqltests` itself:
+
+
+# 15:22:07   
+# 15:22:07   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
mapi_open=true --set mapi_port=32732 --set 
mapi_usock=/var/tmp/mtest-86676/.s.monetdb.32732 --set monet_prompt= 
--forcemito --set mal_listing=2 
--dbpath=/Users/fgroffen/develop/MonetDB/Feb2013/mtest-gaia.cheops.bitzolder.nl/five/dbfarm/mTests_monetdb5_extras_jaql_jaqltests
 --set mal_listing=0
+# 15:22:07   
+
+# builtin opt  gdk_dbpath = 
/Users/fgroffen/develop/MonetDB/Feb2013/program-x86_64/var/lib/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = yes
+# 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 = 32732
+# cmdline opt  mapi_usock = /var/tmp/mtest-86676/.s.monetdb.32732
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/Users/fgroffen/develop/MonetDB/Feb2013/mtest-gaia.cheops.bitzolder.nl/five/dbfarm/mTests_monetdb5_extras_jaql_jaqltests
+# cmdline opt  mal_listing = 0
+
+# 15:22:07   
+# 15:22:07   mclient -ljaql -ftest -Eutf-8 -i -e 
--host=/var/tmp/mtest-86676 --port=32732
+# 15:22:07   
+
+
+# 15:22:07   
+# 15:22:07   Done.
+# 15:22:07   
+
diff --git a/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out 
b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/extras/jaql/jaqltests/Tests/info.stable.out
@@ -0,0 +1,48 @@
+stdout of test 'info` in directory 'monetdb5/extras/jaql/jaqltests` itself:
+
+
+# 15:22:07   
+# 15:22:07   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
mapi_open=true --set mapi_port=32732 --set 
mapi_usock=/var/tmp/mtest-86676/.s.monetdb.32732 --set monet_prompt= 
--forcemito --set mal_listing=2 
--dbpath=/Users/fgroffen/develop/MonetDB/Feb2013/mtest-gaia.cheops.bitzolder.nl/five/dbfarm/mTests_monetdb5_extras_jaql_jaqltests
 --set mal_listing=0
+# 15:22:07   
+
+# MonetDB 5 server v11.16.0 Feb2013-856309bec599
+# Serving database 'mTests_monetdb5_extras_jaql_jaqltests', using 4 threads
+# Compiled for x86_64-apple-darwin11/64bit with 64bit OIDs dynamically linked
+# Found 8.000 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://gaia.local:32732/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-86676/.s.monetdb.32732
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 15:22:07   
+# 15:22:07   mclient -ljaql -ftest -Eutf-8 -i -e 
--host=/var/tmp/mtest-86676 --port=32732
+# 15:22:07   
+
+#info(x);
+% .json # table_name
+% json # name
+% clob # type
+% 19 # length
+[
+  {
+space: 24064,
+elems: 5,
+objs: 11,
+strings: 1,
+integers: 6,
+doubles: 1,
+arrays: 2,
+objects: 1,
+keys: 1
+  }
+]
+
+# 15:22:07   
+# 15:22:07   Done.
+# 15:22:07   
+
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - revert cf01915f842e: restore intention of test

2013-06-09 Thread Fabian Groffen
Changeset: a117be6abf94 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a117be6abf94
Modified Files:
java/tests/Test_PStypes.java
Branch: Feb2013
Log Message:

revert cf01915f842e: restore intention of test


diffs (12 lines):

diff --git a/java/tests/Test_PStypes.java b/java/tests/Test_PStypes.java
--- a/java/tests/Test_PStypes.java
+++ b/java/tests/Test_PStypes.java
@@ -81,7 +81,7 @@ public class Test_PStypes {
System.out.print(2. updating record...);
 
pstmt.setString(1, some update);
-   pstmt.setObject(2, 3.2);
+   pstmt.setObject(2, (float)3.2);
pstmt.setLong(3, 1L);
pstmt.executeUpdate();
 
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - setBigDecimal: improve way we round BigDeci...

2013-06-09 Thread Fabian Groffen
Changeset: 3bde6392aa91 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3bde6392aa91
Modified Files:
java/ChangeLog.Feb2013
java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
Branch: Feb2013
Log Message:

setBigDecimal: improve way we round BigDecimals

Use BigDecimal rounding to shave off digits from the input BigDecimal
to try and make it fit for the DECIMAL(x,y) type the server expects.

Slightly modified patch by Ben Reilly from bug #3290.


diffs (69 lines):

diff --git a/java/ChangeLog.Feb2013 b/java/ChangeLog.Feb2013
--- a/java/ChangeLog.Feb2013
+++ b/java/ChangeLog.Feb2013
@@ -1,6 +1,10 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Sun Jun  9 2013 Fabian Groffen fab...@monetdb.org
+- Further improved setBigDecimal() method, based on patch by Ben Reilly
+  in bug #3290
+
 * Thu May 23 2013 Fabian Groffen fab...@monetdb.org
 - Fixed bug where PreparedStatement.setBigDecimal() wouldn't format its
   input well enough for the server causing odd errors.
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -951,25 +951,37 @@ public class MonetPreparedStatement
 * The driver converts this to an SQL NUMERIC value when it sends it to 
the
 * database.
 *
-* @param i the first parameter is 1, the second is 2, ...
+* @param idx the first parameter is 1, the second is 2, ...
 * @param x the parameter value
 * @throws SQLException if a database access error occurs
 */
-   public void setBigDecimal(int i, BigDecimal x)
+   public void setBigDecimal(int idx, BigDecimal x)
throws SQLException
{
-   // if we don't give the server the exact digits/scale thing, it
-   // barfs at us that we don't give it a correct value, so...
-   String ps = x.toPlainString();
-   // chop off excess precision
-   int di = ps.indexOf(.);
-   if (di = 0  ps.length() - di - 1  scale[i])
-   ps = ps.substring(0, di + scale[i] + (scale[i] == 0 ? 0 
: 1));
-   if (di  0)
-   di = ps.length();
-   if (di  (digits[i] - scale[i]))
-   throw new SQLDataException(DECIMAL value exceeds 
allowed digits/scale:  + ps +  ( + digits[i] + / + scale[i] + ), 
22003);
-   setValue(i, ps);
+   // get array position
+   int i = getParamIdx(idx);
+
+   // We need to shave off enough digits to bring ourselves to an
+   // acceptable precision if we currently have too many digits.
+   int digitsToShave = Math.max(0, x.precision() - digits[i]);
+   int targetScale = Math.min(scale[i], x.scale() - digitsToShave);
+
+   // However, if we need to shave off more digits than we have 
available
+   // to the right of the decimal point, then this is impossible.
+   if (targetScale  0)
+   throw new SQLDataException(DECIMAL value exceeds 
allowed digits/scale:  + x.toPlainString() +  ( + digits[i] + / + scale[i] 
+ ), 22003);
+
+   // Reduction is possible via rounding; do it and we're good to 
go.
+   x = x.round(new MathContext(targetScale, RoundingMode.HALF_UP));
+   x = x.stripTrailingZeros();
+
+   // MonetDB doesn't like leading 0's, since it counts them as 
part of
+   // the precision, so let's strip them off. (But be careful not 
to do
+   // this to the exact number 0.)
+   String xStr = x.toPlainString();
+   while (xStr.startsWith(0)  xStr.length()  1)
+   xStr = xStr.substring(1);
+   setValue(idx, xStr);
}
 
/**
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - PreparedStatement: properly handle null for s...

2013-05-23 Thread Fabian Groffen
Changeset: 0d3537514b4e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d3537514b4e
Modified Files:
java/ChangeLog.Feb2013
java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
Branch: Feb2013
Log Message:

PreparedStatement: properly handle null for setXXX() methods, bug #3288


diffs (98 lines):

diff --git a/java/ChangeLog.Feb2013 b/java/ChangeLog.Feb2013
--- a/java/ChangeLog.Feb2013
+++ b/java/ChangeLog.Feb2013
@@ -1,3 +1,7 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Thu May 23 2013 Fabian Groffen fab...@monetdb.org
+- Allow PreparedStatement.setXXX() methods to be called with null
+  arguments, bug #3288
+
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -1155,6 +1155,11 @@ public class MonetPreparedStatement
int length)
throws SQLException
{
+   if (reader == null) {
+   setNull(parameterIndex, -1);
+   return;
+   }
+
CharBuffer tmp = CharBuffer.allocate(length);
try {
reader.read(tmp);
@@ -1223,6 +1228,11 @@ public class MonetPreparedStatement
 * @throws SQLException if a database access error occurs
 */
public void setClob(int i, Clob x) throws SQLException {
+   if (x == null) {
+   setNull(i, -1);
+   return;
+   }
+
// simply serialise the CLOB into a variable for now... far from
// efficient, but might work for a few cases...
// be on your marks: we have to cast the length down!
@@ -1262,6 +1272,11 @@ public class MonetPreparedStatement
 * @throws SQLException if a database access error occurs
 */
public void setClob(int i, Reader reader, long length) throws 
SQLException {
+   if (reader == null) {
+   setNull(i, -1);
+   return;
+   }
+
// simply serialise the CLOB into a variable for now... far from
// efficient, but might work for a few cases...
CharBuffer buf = CharBuffer.allocate((int)length); // have to 
down cast :(
@@ -1306,6 +1321,11 @@ public class MonetPreparedStatement
public void setDate(int parameterIndex, java.sql.Date x, Calendar cal)
throws SQLException
{
+   if (x == null) {
+   setNull(parameterIndex, -1);
+   return;
+   }
+
if (cal == null) {
setValue(parameterIndex, date ' + x.toString() + ');
} else {
@@ -2098,6 +2118,11 @@ public class MonetPreparedStatement
 * @throws SQLException if a database access error occurs
 */
public void setString(int parameterIndex, String x) throws SQLException 
{
+   if (x == null) {
+   setNull(parameterIndex, -1);
+   return;
+   }
+
setValue(
parameterIndex,
' + x.replaceAll(, ).replaceAll(', 
') + '
@@ -2150,6 +2175,11 @@ public class MonetPreparedStatement
public void setTime(int index, Time x, Calendar cal)
throws SQLException
{
+   if (x == null) {
+   setNull(index, -1);
+   return;
+   }
+
boolean hasTimeZone = 
monetdbType[getParamIdx(index)].endsWith(tz);
if (hasTimeZone) {
// timezone shouldn't matter, since the server is 
timezone
@@ -2205,6 +2235,11 @@ public class MonetPreparedStatement
public void setTimestamp(int index, Timestamp x, Calendar cal)
throws SQLException
{
+   if (x == null) {
+   setNull(index, -1);
+   return;
+   }
+
boolean hasTimeZone = 
monetdbType[getParamIdx(index)].endsWith(tz);
if (hasTimeZone) {
// timezone shouldn't matter, since the server is 
timezone
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - setBigDecimal: properly format input for server

2013-05-23 Thread Fabian Groffen
Changeset: 78e62eb2c684 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=78e62eb2c684
Modified Files:
java/ChangeLog.Feb2013
java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
java/tests/Test_PStypes.java
Branch: Feb2013
Log Message:

setBigDecimal: properly format input for server

The server returns odd and less odd error messages when we send
mismatching data, e.g. for DECIMAL(2,1):
  11.0  - decimal doesn't match decimal
  0.11  - float doesn't match decimal
so make sure we properly chop off excess data, and generate a meaningful
error when we detect we'll be sending a too large number to the server.


diffs (63 lines):

diff --git a/java/ChangeLog.Feb2013 b/java/ChangeLog.Feb2013
--- a/java/ChangeLog.Feb2013
+++ b/java/ChangeLog.Feb2013
@@ -2,6 +2,8 @@
 # This file is updated with Maddlog
 
 * Thu May 23 2013 Fabian Groffen fab...@monetdb.org
+- Fixed bug where PreparedStatement.setBigDecimal() wouldn't format its
+  input well enough for the server causing odd errors.
 - Allow PreparedStatement.setXXX() methods to be called with null
   arguments, bug #3288
 
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetPreparedStatement.java
@@ -951,14 +951,25 @@ public class MonetPreparedStatement
 * The driver converts this to an SQL NUMERIC value when it sends it to 
the
 * database.
 *
-* @param parameterIndex the first parameter is 1, the second is 2, ...
+* @param i the first parameter is 1, the second is 2, ...
 * @param x the parameter value
 * @throws SQLException if a database access error occurs
 */
-   public void setBigDecimal(int parameterIndex, BigDecimal x)
+   public void setBigDecimal(int i, BigDecimal x)
throws SQLException
{
-   setValue(parameterIndex, x.toString());
+   // if we don't give the server the exact digits/scale thing, it
+   // barfs at us that we don't give it a correct value, so...
+   String ps = x.toPlainString();
+   // chop off excess precision
+   int di = ps.indexOf(.);
+   if (di = 0  ps.length() - di - 1  scale[i])
+   ps = ps.substring(0, di + scale[i] + (scale[i] == 0 ? 0 
: 1));
+   if (di  0)
+   di = ps.length();
+   if (di  (digits[i] - scale[i]))
+   throw new SQLDataException(DECIMAL value exceeds 
allowed digits/scale:  + ps +  ( + digits[i] + / + scale[i] + ), 
22003);
+   setValue(i, ps);
}
 
/**
diff --git a/java/tests/Test_PStypes.java b/java/tests/Test_PStypes.java
--- a/java/tests/Test_PStypes.java
+++ b/java/tests/Test_PStypes.java
@@ -76,12 +76,13 @@ public class Test_PStypes {
 
// try an update like bug #1757923
pstmt = con.prepareStatement(
-UPDATE HTMTEST set COMMENT=? WHERE HTMID=?
+UPDATE HTMTEST set COMMENT=?, TYPE=? WHERE HTMID=?
 );
System.out.print(2. updating record...);
 
pstmt.setString(1, some update);
-   pstmt.setLong(2, 1L);
+   pstmt.setObject(2, (float)3.2);
+   pstmt.setLong(3, 1L);
pstmt.executeUpdate();
 
System.out.println(success :));
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - jdbc: bump for recent fixes

2013-05-23 Thread Fabian Groffen
Changeset: 946b7a9c05dc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=946b7a9c05dc
Modified Files:
java/Makefile.ag
java/build.properties
java/pom.xml
java/release.txt
Branch: Feb2013
Log Message:

jdbc: bump for recent fixes


diffs (50 lines):

diff --git a/java/Makefile.ag b/java/Makefile.ag
--- a/java/Makefile.ag
+++ b/java/Makefile.ag
@@ -27,7 +27,7 @@ JAVA_HOME = @JAVA_HOME@
 ant_distjdbc = {
COND = HAVE_JAVAJDBC
DIR = datadir/monetdb/lib
-   FILES = monetdb-mcl-1.9.jar monetdb-jdbc-2.8.jar jdbcclient.jar
+   FILES = monetdb-mcl-1.9.jar monetdb-jdbc-2.9.jar jdbcclient.jar
 }
 
 ant_distmerocontrol = {
diff --git a/java/build.properties b/java/build.properties
--- a/java/build.properties
+++ b/java/build.properties
@@ -19,7 +19,7 @@ MCL_MINOR=9
 # major release number
 JDBC_MAJOR=2
 # minor release number
-JDBC_MINOR=8
+JDBC_MINOR=9
 # an additional identifying string
 JDBC_VER_SUFFIX=Liberica
 # the default port to connect on, if no port given when using SQL
diff --git a/java/pom.xml b/java/pom.xml
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -6,7 +6,7 @@
modelVersion4.0.0/modelVersion
groupIdmonetdb/groupId
artifactIdmonetdb-jdbc/artifactId
-   version2.8/version
+   version2.9/version
namemonetdb-jdbc/name
descriptionMonetDB JDBC driver/description
repositories
diff --git a/java/release.txt b/java/release.txt
--- a/java/release.txt
+++ b/java/release.txt
@@ -1,8 +1,8 @@
 RELEASE NOTES
-MonetDB JDBC driver version 2.8 (Liberica/MCL-1.9)
+MonetDB JDBC driver version 2.9 (Liberica/MCL-1.9)
 Fabian Groffen fab...@monetdb.org
 
-Release date: 2012-12-01
+Release date: 2013-05-23
 
 
 This JDBC driver is designed for use with MonetDB, a main-memory
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - jaqlscenario: properly reset time flag

2013-03-27 Thread Fabian Groffen
Changeset: 5f0c622f0486 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5f0c622f0486
Modified Files:
monetdb5/extras/jaql/jaqlscenario.c
Branch: Feb2013
Log Message:

jaqlscenario: properly reset time flag

Make sure we reset j-time, such that we don't keep timing from the
moment a TIME statement was used until client disconnect.


diffs (11 lines):

diff --git a/monetdb5/extras/jaql/jaqlscenario.c 
b/monetdb5/extras/jaql/jaqlscenario.c
--- a/monetdb5/extras/jaql/jaqlscenario.c
+++ b/monetdb5/extras/jaql/jaqlscenario.c
@@ -194,6 +194,7 @@ JAQLparser(Client c)
j-scanstreameof = 0;
j-pos = 0;
j-p = NULL;
+   j-time = 0;
j-timing.parse = j-timing.optimise = j-timing.gencode = 0L;
 
j-timing.parse = GDKusec();
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - JAQLparser: use shortcut variable for consist...

2013-03-27 Thread Fabian Groffen
Changeset: b996e1631c73 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b996e1631c73
Modified Files:
monetdb5/extras/jaql/jaqlscenario.c
Branch: Feb2013
Log Message:

JAQLparser: use shortcut variable for consistency


diffs (12 lines):

diff --git a/monetdb5/extras/jaql/jaqlscenario.c 
b/monetdb5/extras/jaql/jaqlscenario.c
--- a/monetdb5/extras/jaql/jaqlscenario.c
+++ b/monetdb5/extras/jaql/jaqlscenario.c
@@ -245,7 +245,7 @@ JAQLparser(Client c)
if (prg-def-errors) {
/* this is bad already, so let's try to make it 
debuggable */
mnstr_printf(out, !jaqlgencode: generated program 
contains errors\n);
-   printFunction(out, c-curprg-def, 0, LIST_MAPI);
+   printFunction(out, prg-def, 0, LIST_MAPI);

/* restore the state */
MSresetInstructions(prg-def, oldstop);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - handleClient: don't require (obsolete) proto ...

2013-01-11 Thread Fabian Groffen
Changeset: d5a2ff0b4275 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d5a2ff0b4275
Modified Files:
tools/merovingian/daemon/client.c
Branch: Oct2012
Log Message:

handleClient: don't require (obsolete) proto 8 for error reporting


diffs (13 lines):

diff --git a/tools/merovingian/daemon/client.c 
b/tools/merovingian/daemon/client.c
--- a/tools/merovingian/daemon/client.c
+++ b/tools/merovingian/daemon/client.c
@@ -362,7 +362,8 @@ handleClient(int sock, char isusock)
{
/* we need to let the client login in order not to 
violate
 * the protocol */
-   mnstr_printf(fout, void:merovingian:8:plain:BIG);
+   mnstr_printf(fout, void:merovingian:9:%s:BIG:%s:,
+   MONETDB5_PASSWDHASH, algos);
mnstr_flush(fout);
mnstr_read_block(fdin, buf, 8095, 1); /* eat away 
client response */
mnstr_printf(fout, !monetdbd: an internal error has 
occurred, refer to the logs for details, please try again later\n);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - Fixup order from previous commit

2013-01-11 Thread Fabian Groffen
Changeset: 55057606f524 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55057606f524
Modified Files:
tools/merovingian/daemon/client.c
Branch: Oct2012
Log Message:

Fixup order from previous commit


diffs (12 lines):

diff --git a/tools/merovingian/daemon/client.c 
b/tools/merovingian/daemon/client.c
--- a/tools/merovingian/daemon/client.c
+++ b/tools/merovingian/daemon/client.c
@@ -363,7 +363,7 @@ handleClient(int sock, char isusock)
/* we need to let the client login in order not to 
violate
 * the protocol */
mnstr_printf(fout, void:merovingian:9:%s:BIG:%s:,
-   MONETDB5_PASSWDHASH, algos);
+   algos, MONETDB5_PASSWDHASH);
mnstr_flush(fout);
mnstr_read_block(fdin, buf, 8095, 1); /* eat away 
client response */
mnstr_printf(fout, !monetdbd: an internal error has 
occurred, refer to the logs for details, please try again later\n);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-15 Thread Fabian Groffen
Changeset: a149a9f85fab for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a149a9f85fab
Added Files:
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.sql

sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.err

sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.out
Modified Files:
sql/server/sql_parser.y
sql/test/BugTracker-2012/Tests/All
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (truncated from 482 to 300 lines):

diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -3763,7 +3763,7 @@ opt_alias_name:
 atom:
 literal
{ 
- if (m-emode == m_normal  m-caching  m-argc  100) { 
+ if (m-emode == m_normal  m-caching) { 
/* replace by argument */
AtomNode *an = (AtomNode*)$1;

diff --git a/sql/test/BugTracker-2012/Tests/All 
b/sql/test/BugTracker-2012/Tests/All
--- a/sql/test/BugTracker-2012/Tests/All
+++ b/sql/test/BugTracker-2012/Tests/All
@@ -82,3 +82,5 @@ update_crash.Bug-2655
 tuples_INTERSECT_vs_count_intersect_differs.Bug-2659
 large-number-operation-strange-results.Bug-2929
 inet-casts.Bug-3205
+fixed_limit_for_prepare.Bug-3208
+exp_bin_assertion.Bug-3209
diff --git a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql 
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
@@ -0,0 +1,4 @@
+create table t (id int, x int, y int);
+select * from t as t1, t as t2 where power((t1.x - t2.x),2)  power((t1.y -
+   t2.y),2);
+drop table t;
diff --git 
a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err 
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
@@ -0,0 +1,39 @@
+stderr of test 'exp_bin_assertion.Bug-3209` in directory 
'test/BugTracker-2012` itself:
+
+
+# 11:42:44   
+# 11:42:44   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
gdk_dbfarm=/Users/jennie/scratch/monet-install/Oct2012/debug/var/MonetDB 
--set mapi_open=true --set mapi_port=33728 --set 
mapi_usock=/var/tmp/mtest-21808/.s.monetdb.33728 --set monet_prompt= 
--trace --forcemito --set mal_listing=2 
--dbname=mTests_test_BugTracker-2012 --set mal_listing=0
+# 11:42:44   
+
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = 
/Users/jennie/scratch/monet-install/Oct2012/debug/var/monetdb5/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = yes
+# 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  gdk_dbfarm = 
/Users/jennie/scratch/monet-install/Oct2012/debug/var/MonetDB
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 33728
+# cmdline opt  mapi_usock = /var/tmp/mtest-21808/.s.monetdb.33728
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_test_BugTracker-2012
+# cmdline opt  mal_listing = 0
+
+
+
+
+# 11:42:44   
+# 11:42:44   mclient -lsql -ftest -Eutf-8 -i -e 
--host=/var/tmp/mtest-21808 --port=33728
+# 11:42:44   
+
+# 11:42:45   
+# 11:42:45   Done.
+# 11:42:45   
+
diff --git 
a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out 
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
@@ -0,0 +1,60 @@
+stdout of test 'exp_bin_assertion.Bug-3209` in directory 
'test/BugTracker-2012` itself:
+
+
+# 11:42:44   
+# 11:42:44   mserver5 --debug=10 --set gdk_nr_threads=0 --set 
gdk_dbfarm=/Users/jennie/scratch/monet-install/Oct2012/debug/var/MonetDB 
--set mapi_open=true --set mapi_port=33728 --set 
mapi_usock=/var/tmp/mtest-21808/.s.monetdb.33728 --set monet_prompt= 
--trace --forcemito --set mal_listing=2 
--dbname=mTests_test_BugTracker-2012 --set mal_listing=0
+# 11:42:44   
+
+# MonetDB 5 server v11.13.8
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2012', using 2 threads
+# Compiled for x86_64-apple-darwin11.4.2/64bit with 64bit OIDs dynamically 
linked
+# Found 4.000 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection 

MonetDB: Feb2013 - Merged from Oct2012

2012-12-15 Thread Fabian Groffen
Changeset: 97c6f8e9c31a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=97c6f8e9c31a
Modified Files:
sql/server/rel_exp.c
sql/server/rel_exp.h
Branch: Feb2013
Log Message:

Merged from Oct2012

___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-15 Thread Fabian Groffen
Changeset: a961fc219e10 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a961fc219e10
Added Files:
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.sql

sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.err

sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.out
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/sql_parser.y
sql/test/BugTracker-2012/Tests/All
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 559 to 300 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1552,6 +1552,14 @@ rel2bin_join( mvc *sql, sql_rel *rel, li
prop *p;
 
/* only handle simple joins here */ 
+   if (exp_has_func(e)) {
+   if (!join  !list_length(lje)) {
+   stmt *l = bin_first_column(sql-sa, 
left);
+   stmt *r = bin_first_column(sql-sa, 
right);
+   join = stmt_join(sql-sa, l, r, 
cmp_all); 
+   }
+   break;
+   }
if (list_length(lje)  (idx || e-type != e_cmp || 
e-flag != cmp_equal))
break;
 
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -1034,6 +1034,44 @@ exp_is_atom( sql_exp *e )
 }
 
 static int
+exps_has_func( list *exps)
+{
+   node *n;
+   int has_func = 0;
+
+   for(n=exps-h; n  !has_func; n=n-next) 
+   has_func |= exp_has_func(n-data);
+   return has_func;
+}
+
+int
+exp_has_func( sql_exp *e )
+{
+   switch (e-type) {
+   case e_atom:
+   return 0;
+   case e_convert:
+   return exp_has_func(e-l);
+   case e_func:
+   case e_aggr:
+   return 1;
+   case e_cmp:
+   if (e-flag == cmp_or) {
+   return (exps_has_func(e-l) || exps_has_func(e-r));
+   } else if (e-flag == cmp_in || e-flag == cmp_notin || 
get_cmp(e) == cmp_filter) {
+   return (exp_has_func(e-l) || exps_has_func(e-r));
+   } else {
+   return (exp_has_func(e-l) || exp_has_func(e-r) || 
+   (e-f  exp_has_func(e-f)));
+   }
+   case e_column:
+   case e_psm:
+   return 0;
+   }
+   return 0;
+}
+
+static int
 exp_key( sql_exp *e )
 {
if (e-name)
diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h
--- a/sql/server/rel_exp.h
+++ b/sql/server/rel_exp.h
@@ -105,6 +105,7 @@ extern int exp_is_eqjoin(sql_exp *e);
 extern int exp_is_correlation(sql_exp *e, sql_rel *r );
 extern int exp_is_join_exp(sql_exp *e);
 extern int exp_is_atom(sql_exp *e);
+extern int exp_has_func(sql_exp *e);
 
 extern sql_exp *exps_bind_column( list *exps, char *cname, int *ambiguous);
 extern sql_exp *exps_bind_column2( list *exps, char *rname, char *cname);
diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -3763,7 +3763,7 @@ opt_alias_name:
 atom:
 literal
{ 
- if (m-emode == m_normal  m-caching  m-argc  100) { 
+ if (m-emode == m_normal  m-caching) { 
/* replace by argument */
AtomNode *an = (AtomNode*)$1;

diff --git a/sql/test/BugTracker-2012/Tests/All 
b/sql/test/BugTracker-2012/Tests/All
--- a/sql/test/BugTracker-2012/Tests/All
+++ b/sql/test/BugTracker-2012/Tests/All
@@ -82,3 +82,5 @@ update_crash.Bug-2655
 tuples_INTERSECT_vs_count_intersect_differs.Bug-2659
 large-number-operation-strange-results.Bug-2929
 inet-casts.Bug-3205
+fixed_limit_for_prepare.Bug-3208
+exp_bin_assertion.Bug-3209
diff --git a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql 
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
@@ -0,0 +1,4 @@
+create table t (id int, x int, y int);
+select * from t as t1, t as t2 where power((t1.x - t2.x),2)  power((t1.y -
+   t2.y),2);
+drop table t;
diff --git 
a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err 
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
new file mode 100644
--- /dev/null
+++ 

MonetDB: Oct2012 - configure: have_python - have_python2 typo

2012-12-11 Thread Fabian Groffen
Changeset: ab090df4bfc1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ab090df4bfc1
Modified Files:
configure.ag
Branch: Oct2012
Log Message:

configure: have_python - have_python2 typo


diffs (12 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1115,7 +1115,7 @@ AC_ARG_WITH(python2,
 case $have_python2 in
yes|no|auto) ;;
*)
-   PYTHON2=$have_python
+   PYTHON2=$have_python2
;;
 esac
 
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - configure: don't set PYTHONX to an absolute p...

2012-12-11 Thread Fabian Groffen
Changeset: 595711e495ee for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=595711e495ee
Modified Files:
configure.ag
Branch: Oct2012
Log Message:

configure: don't set PYTHONX to an absolute path for AC_PATH_PROG

AC_PATH_PROG will not perform its check if the variable is already set
to an absolute path.  Hence, don't set PYTHON2 and PYTHON3 to an
absolute path prior to checking for them.  I don't understand why it is
necessary to set PYTHONX in python, since we already do that in the
python2 and python3 cases.  So this should just work if there is no
pythonX binary, but python is version X.


diffs (34 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1137,28 +1137,15 @@ if test x$PYTHON != xno; then
case `$PYTHON -V 21` in
Python 2.[[67]]*)  # older Pythons don't get Python3 syntax
PYTHON_MAJ=2
-   case $have_python2 in
-   yes|auto)
-   have_python2=yes
-   PYTHON2=$PYTHON
-   ;;
-   esac
-   AC_MSG_RESULT([2])
;;
Python 3.*)
PYTHON_MAJ=3
-   case $have_python3 in
-   yes|auto)
-   have_python3=yes
-   PYTHON3=$PYTHON
-   ;;
-   esac
-   AC_MSG_RESULT([3])
;;
*)
-   AC_MSG_ERROR([unknown Python version])
+   AC_MSG_ERROR([unknown or unsupported Python version])
;;
esac
+   AC_MSG_RESULT($PYTHON_MAJ)
 fi
 
 
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - python: fix PYTHONX_LIBDIR values, bug #3207

2012-12-11 Thread Fabian Groffen
Changeset: a1826ecde882 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1826ecde882
Modified Files:
configure.ag
testing/Mtest.py.in
Branch: Oct2012
Log Message:

python: fix PYTHONX_LIBDIR values, bug #3207


diffs (71 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1179,10 +1179,15 @@ if test x$have_python2 != xno; then
fi
case $host_os-`$PYTHON2 -V 21` in
darwin9*-*2.5.1)
-   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,)' 
2/dev/null`/site-packages;;
+   # This is the Python installed on OSX 
Leopard, in
+   # later versions of OSX, Python is 
fixed to return
+   # standard output
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print 
distutils.sysconfig.get_python_lib(0,1,'$Qprefix')' 
2/dev/null`/site-packages;;
*)
-   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,)' 
2/dev/null`;;
+   # Use prefix field for Ubuntu Python, 
bug #3207
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print 
distutils.sysconfig.get_python_lib(0,0,'$Qprefix')' 2/dev/null`;;
esac
+   PYTHON2_LIBDIR=`echo $PYTHON2_LIBDIR | sed 
s|^$Qprefix/||`
;;
no) ;;
$Qprefix/*) dnl dubious
@@ -1233,7 +1238,9 @@ if test x$have_python3 != xno; then
if test x$cross_compiling = xyes; then
AC_MSG_ERROR([Must specify 
--with-python3-libdir when cross compiling])
fi
-   PYTHON3_LIBDIR=`$PYTHON3 -c 'import 
distutils.sysconfig; print(distutils.sysconfig.get_python_lib(0,0,))' 
2/dev/null`
+   # Use prefix field for Ubuntu Python, bug #3207
+   PYTHON3_LIBDIR=`$PYTHON3 -c 'import 
distutils.sysconfig; 
print(distutils.sysconfig.get_python_lib(0,0,'$Qprefix'))' 2/dev/null`
+   PYTHON3_LIBDIR=`echo $PYTHON3_LIBDIR | sed 
s|^$Qprefix/||`
;;
no) ;;
$Qprefix/*) dnl dubious
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -144,21 +144,7 @@ except ImportError:
 try:
 import MonetDBtesting.subprocess26 as subprocess
 except ImportError:
-import distutils.sysconfig
-if os.name != nt and os.uname()[0] + os.uname()[2][:1] == Darwin9 
and sys.version[:5] == 2.5.1:
-p = 
_configure(os.path.join('@QXprefix@',distutils.sysconfig.get_python_lib(0,1,),'site-packages'))
-else:
-p = distutils.sysconfig.get_python_lib(0, 0, '')
-if p.endswith('dist-packages'):
-# Ubuntu
-p = p.replace('dist-packages', 'site-packages')
-_configure(os.path.join('@QXprefix@', p))
-sys.path.insert(0, p)
-if os.environ.has_key('PYTHONPATH'):
-p += os.pathsep + os.environ['PYTHONPATH']
-os.environ['PYTHONPATH'] = p
-p = distutils.sysconfig.get_python_lib(0, 0, '')
-p = _configure(os.path.join('@QXprefix@', p))
+p = _configure(os.path.join('@QXprefix@', '@PYTHON2_LIBDIR@'))
 sys.path.insert(0, p)
 import MonetDBtesting.subprocess26 as subprocess
 if os.environ.has_key('PYTHONPATH'):
@@ -254,11 +240,7 @@ except ImportError:
 try:
 from MonetDBtesting import monet_options
 except ImportError:
-import distutils.sysconfig
-if os.name != nt and os.uname()[0] + os.uname()[2][:1] == Darwin9 
and sys.version[:5] == 2.5.1:
-p = 
_configure(os.path.join('@QXprefix@',distutils.sysconfig.get_python_lib(0,1,),'site-packages'))
-else:
-p = 
_configure(os.path.join('@QXprefix@',distutils.sysconfig.get_python_lib(0,0,)))
+p = _configure(os.path.join('@QXprefix@', '@PYTHON2_LIBDIR@'))
 sys.path.insert(0, p)
 from MonetDBtesting import monet_options
 if os.environ.has_key('PYTHONPATH'):
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-11 Thread Fabian Groffen
Changeset: 0c3b7faa33cc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0c3b7faa33cc
Added Files:
monetdb5/tests/gdkTests/Tests/selecttst.mal
monetdb5/tests/gdkTests/Tests/selecttst.stable.err
monetdb5/tests/gdkTests/Tests/selecttst.stable.out
Modified Files:
configure.ag
monetdb5/tests/gdkTests/Tests/All
testing/Mtest.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (truncated from 1019 to 300 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1115,7 +1115,7 @@ AC_ARG_WITH(python2,
 case $have_python2 in
yes|no|auto) ;;
*)
-   PYTHON2=$have_python
+   PYTHON2=$have_python2
;;
 esac
 
@@ -1137,28 +1137,15 @@ if test x$PYTHON != xno; then
case `$PYTHON -V 21` in
Python 2.[[67]]*)  # older Pythons don't get Python3 syntax
PYTHON_MAJ=2
-   case $have_python2 in
-   yes|auto)
-   have_python2=yes
-   PYTHON2=$PYTHON
-   ;;
-   esac
-   AC_MSG_RESULT([2])
;;
Python 3.*)
PYTHON_MAJ=3
-   case $have_python3 in
-   yes|auto)
-   have_python3=yes
-   PYTHON3=$PYTHON
-   ;;
-   esac
-   AC_MSG_RESULT([3])
;;
*)
-   AC_MSG_ERROR([unknown Python version])
+   AC_MSG_ERROR([unknown or unsupported Python version])
;;
esac
+   AC_MSG_RESULT($PYTHON_MAJ)
 fi
 
 
@@ -1192,10 +1179,15 @@ if test x$have_python2 != xno; then
fi
case $host_os-`$PYTHON2 -V 21` in
darwin9*-*2.5.1)
-   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,)' 
2/dev/null`/site-packages;;
+   # This is the Python installed on OSX 
Leopard, in
+   # later versions of OSX, Python is 
fixed to return
+   # standard output
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print 
distutils.sysconfig.get_python_lib(0,1,'$Qprefix')' 
2/dev/null`/site-packages;;
*)
-   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,)' 
2/dev/null`;;
+   # Use prefix field for Ubuntu Python, 
bug #3207
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print 
distutils.sysconfig.get_python_lib(0,0,'$Qprefix')' 2/dev/null`;;
esac
+   PYTHON2_LIBDIR=`echo $PYTHON2_LIBDIR | sed 
s|^$Qprefix/||`
;;
no) ;;
$Qprefix/*) dnl dubious
@@ -1246,7 +1238,9 @@ if test x$have_python3 != xno; then
if test x$cross_compiling = xyes; then
AC_MSG_ERROR([Must specify 
--with-python3-libdir when cross compiling])
fi
-   PYTHON3_LIBDIR=`$PYTHON3 -c 'import 
distutils.sysconfig; print(distutils.sysconfig.get_python_lib(0,0,))' 
2/dev/null`
+   # Use prefix field for Ubuntu Python, bug #3207
+   PYTHON3_LIBDIR=`$PYTHON3 -c 'import 
distutils.sysconfig; 
print(distutils.sysconfig.get_python_lib(0,0,'$Qprefix'))' 2/dev/null`
+   PYTHON3_LIBDIR=`echo $PYTHON3_LIBDIR | sed 
s|^$Qprefix/||`
;;
no) ;;
$Qprefix/*) dnl dubious
diff --git a/monetdb5/tests/gdkTests/Tests/All 
b/monetdb5/tests/gdkTests/Tests/All
--- a/monetdb5/tests/gdkTests/Tests/All
+++ b/monetdb5/tests/gdkTests/Tests/All
@@ -13,3 +13,4 @@ str_heap
 TMsubcommit
 void
 scanselect
+selecttst
diff --git a/monetdb5/tests/gdkTests/Tests/selecttst.mal 
b/monetdb5/tests/gdkTests/Tests/selecttst.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/tests/gdkTests/Tests/selecttst.mal
@@ -0,0 +1,209 @@
+b := bat.new(:oid,:int);
+bat.append(b,0);
+bat.append(b,1);
+bat.append(b,2);
+bat.append(b,3);
+bat.append(b,4);
+bat.append(b,5);
+bat.append(b,6);
+bat.append(b,7);
+bat.append(b,nil:int);
+io.print(b);
+
+x := algebra.subselect(b,4,nil:int,false,false,false);
+io.print(low=4 high=nil li=false hi=false anti=false);
+y := algebra.leftfetchjoin(x,b);
+io.print(y);
+x := 

MonetDB: default - Merged from Feb2013

2012-12-11 Thread Fabian Groffen
Changeset: b530b37c599b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b530b37c599b
Added Files:
monetdb5/tests/gdkTests/Tests/selecttst.mal
monetdb5/tests/gdkTests/Tests/selecttst.stable.err
monetdb5/tests/gdkTests/Tests/selecttst.stable.out
Modified Files:
MonetDB.spec
configure.ag
debian/rules
gdk/gdk_select.c
monetdb5/tests/gdkTests/Tests/All
testing/Mtest.py.in
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 1138 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -632,7 +632,6 @@ developer, but if you do want to test, t
--enable-jdbc=no \
--enable-merocontrol=no \
--enable-monetdb5=yes \
-   --enable-noexpand=no \
--enable-odbc=yes \
--enable-oid32=%{?oid32:yes}%{!?oid32:no} \
--enable-optimize=yes \
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1103,28 +1103,10 @@ AC_SUBST(PERL_LIBDIR)
 # check if python2 and python3 exist
 # if python2 or python3 doesn't exist, use python if major matches
 
-AC_PATH_PROG(PYTHON,python,no,$PATH)
-PYTHON_MAJ=
-if test x$PYTHON != xno; then
-   AC_MSG_CHECKING([major version of $PYTHON])
-   case `$PYTHON -V 21` in
-   Python 2.[[67]]*)  # older Pythons don't get Python3 syntax
-   PYTHON_MAJ=2
-   AC_MSG_RESULT([2])
-   ;;
-   Python 3.*)
-   PYTHON_MAJ=3
-   AC_MSG_RESULT([3])
-   ;;
-   *)
-   AC_MSG_ERROR([unknown Python version])
-   ;;
-   esac
-fi
-
-
 have_python2=auto
 PYTHON2=python2
+have_python3=auto
+PYTHON3=python3
 
 AC_ARG_WITH(python2,
AS_HELP_STRING([--with-python2=FILE], [python2 is installed as FILE]),
@@ -1133,15 +1115,45 @@ AC_ARG_WITH(python2,
 case $have_python2 in
yes|no|auto) ;;
*)
-   PYTHON2=$have_python
+   PYTHON2=$have_python2
;;
 esac
 
+AC_ARG_WITH(python3,
+   AS_HELP_STRING([--with-python3=FILE], [python3 is installed as FILE]),
+   have_python3=$withval)
+
+case $have_python3 in
+   yes|no|auto) ;;
+   *)
+   PYTHON3=$have_python3
+   ;;
+esac
+
+AC_PATH_PROG(PYTHON,python,no,$PATH)
+PYTHON_MAJ=
+if test x$PYTHON != xno; then
+   AC_MSG_CHECKING([major version of $PYTHON])
+   case `$PYTHON -V 21` in
+   Python 2.[[67]]*)  # older Pythons don't get Python3 syntax
+   PYTHON_MAJ=2
+   ;;
+   Python 3.*)
+   PYTHON_MAJ=3
+   ;;
+   *)
+   AC_MSG_ERROR([unknown or unsupported Python version])
+   ;;
+   esac
+   AC_MSG_RESULT($PYTHON_MAJ)
+fi
+
+
 if test x$have_python2 != xno; then
if test x$cross_compiling != xyes; then
AC_PATH_PROG(PYTHON2,$PYTHON2,no,$PATH)
if test x$PYTHON2 = xno; then
-   if ( test x$have_python2 = xyes || test 
x$have_python2 = xauto )  test x$PYTHON_MAJ = 2; then
+   if ( test x$have_python2 = xyes || test 
x$have_python2 = xauto )  test x$PYTHON_MAJ = x2; then
PYTHON2=$PYTHON
have_python2=yes
elif test x$have_python2 != xauto; then
@@ -1167,10 +1179,15 @@ if test x$have_python2 != xno; then
fi
case $host_os-`$PYTHON2 -V 21` in
darwin9*-*2.5.1)
-   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,)' 
2/dev/null`/site-packages;;
+   # This is the Python installed on OSX 
Leopard, in
+   # later versions of OSX, Python is 
fixed to return
+   # standard output
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print 
distutils.sysconfig.get_python_lib(0,1,'$Qprefix')' 
2/dev/null`/site-packages;;
*)
-   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,)' 
2/dev/null`;;
+   # Use prefix field for Ubuntu Python, 
bug #3207
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print 
distutils.sysconfig.get_python_lib(0,0,'$Qprefix')' 2/dev/null`;;
esac
+   PYTHON2_LIBDIR=`echo $PYTHON2_LIBDIR | sed 
s|^$Qprefix/||`
;;
no)

MonetDB: Oct2012 - sqlsample: fix syntax for Python 3

2012-12-10 Thread Fabian Groffen
Changeset: 75648ce26d7d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=75648ce26d7d
Modified Files:
clients/examples/python/sqlsample.py.in
Branch: Oct2012
Log Message:

sqlsample: fix syntax for Python 3


diffs (31 lines):

diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py.in
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py.in
@@ -24,23 +24,23 @@ dbh = monetdb.sql.Connection(port=int(sy
 
 cursor = dbh.cursor();
 cursor.execute('select 1;')
-print cursor.fetchall()
+print(cursor.fetchall())
 
 cursor = dbh.cursor();
 cursor.execute('select 2;')
-print cursor.fetchone()
+print(cursor.fetchone())
 
 # deliberately executing a wrong SQL statement:
 try:
 cursor.execute('( xyz 1);')
 except monetdb.sql.OperationalError, e:
-print e
+print(e)
 
 cursor.execute('create table python_table (i smallint,s string);');
 cursor.execute('insert into python_table values ( 3, \'three\');');
 cursor.execute('insert into python_table values ( 7, \'seven\');');
 cursor.execute('select * from python_table;');
-print cursor.fetchall()
+print(cursor.fetchall())
 
 s = ((0, 'row1'), (1, 'row2'))
 x = cursor.executemany(insert into python_table VALUES (%s, %s);, s)
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-10 Thread Fabian Groffen
Changeset: f2d2c612b2c5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f2d2c612b2c5
Modified Files:
clients/examples/python/sqlsample.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (31 lines):

diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py.in
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py.in
@@ -24,23 +24,23 @@ dbh = monetdb.sql.Connection(port=int(sy
 
 cursor = dbh.cursor();
 cursor.execute('select 1;')
-print cursor.fetchall()
+print(cursor.fetchall())
 
 cursor = dbh.cursor();
 cursor.execute('select 2;')
-print cursor.fetchone()
+print(cursor.fetchone())
 
 # deliberately executing a wrong SQL statement:
 try:
 cursor.execute('( xyz 1);')
 except monetdb.sql.OperationalError, e:
-print e
+print(e)
 
 cursor.execute('create table python_table (i smallint,s string);');
 cursor.execute('insert into python_table values ( 3, \'three\');');
 cursor.execute('insert into python_table values ( 7, \'seven\');');
 cursor.execute('select * from python_table;');
-print cursor.fetchall()
+print(cursor.fetchall())
 
 s = ((0, 'row1'), (1, 'row2'))
 x = cursor.executemany(insert into python_table VALUES (%s, %s);, s)
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Add licence

2012-12-10 Thread Fabian Groffen
Changeset: e2fff7e80d23 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2fff7e80d23
Modified Files:
clients/python3/test/test_control.py
Branch: Feb2013
Log Message:

Add licence


diffs (31 lines):

diff --git a/clients/python3/test/test_control.py 
b/clients/python3/test/test_control.py
--- a/clients/python3/test/test_control.py
+++ b/clients/python3/test/test_control.py
@@ -1,3 +1,20 @@
+# The contents of this file are subject to the MonetDB Public License
+# Version 1.1 (the License); you may not use this file except in
+# compliance with the License. You may obtain a copy of the License at
+# http://www.monetdb.org/Legal/MonetDBLicense
+#
+# Software distributed under the License is distributed on an AS IS
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+# License for the specific language governing rights and limitations
+# under the License.
+#
+# The Original Code is the MonetDB Database System.
+#
+# The Initial Developer of the Original Code is CWI.
+# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+# Copyright August 2008-2012 MonetDB B.V.
+# All Rights Reserved.
+
 import unittest
 from monetdb.control import Control
 from monetdb.exceptions import OperationalError
@@ -116,4 +133,4 @@ class TestManage(unittest.TestCase):
 neighbours
 
 if __name__ == '__main__':
-unittest.main()
\ No newline at end of file
+unittest.main()
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - mclient.py: update shebang to reflect target ...

2012-12-10 Thread Fabian Groffen
Changeset: 9813105aadfc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9813105aadfc
Modified Files:
clients/python2/examples/mclient.py
clients/python3/examples/mclient.py
Branch: Oct2012
Log Message:

mclient.py: update shebang to reflect target python version

since these examples aren't installed as binaries at the moment, we
don't need to have the shebang right.


diffs (18 lines):

diff --git a/clients/python2/examples/mclient.py 
b/clients/python2/examples/mclient.py
--- a/clients/python2/examples/mclient.py
+++ b/clients/python2/examples/mclient.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
diff --git a/clients/python3/examples/mclient.py 
b/clients/python3/examples/mclient.py
--- a/clients/python3/examples/mclient.py
+++ b/clients/python3/examples/mclient.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - basics: move example to generic example dir

2012-12-10 Thread Fabian Groffen
Changeset: cb4fa2be3901 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cb4fa2be3901
Added Files:
clients/examples/python/basics.py
Removed Files:
clients/python2/examples/basics.py
clients/python3/examples/basics.py
Branch: Oct2012
Log Message:

basics: move example to generic example dir

python2 and python3 versions of this example are identical


diffs (51 lines):

diff --git a/clients/python2/examples/basics.py 
b/clients/examples/python/basics.py
rename from clients/python2/examples/basics.py
rename to clients/examples/python/basics.py
diff --git a/clients/python3/examples/basics.py 
b/clients/python3/examples/basics.py
deleted file mode 100644
--- a/clients/python3/examples/basics.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the License); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an AS IS
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-import logging
-
-#configure the logger, so we can see what is happening
-logging.basicConfig(level=logging.DEBUG)
-logger = logging.getLogger('monetdb')
-
-try:
-import monetdb.sql
-except ImportError:
-# running examples from development tree
-import sys
-import os
-parent = os.path.join(sys.path[0], os.pardir)
-sys.path.append(parent)
-import monetdb.sql
-
-
-x = monetdb.sql.connect(username=monetdb, password=monetdb, 
hostname=localhost, database=demo)
-c = x.cursor()
-
-# some basic query
-c.arraysize=100
-c.execute('select * from tables')
-results = c.fetchall()
-x.commit()
-print(results)
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - perf: move python2 example to generic examples

2012-12-10 Thread Fabian Groffen
Changeset: a5f1dc4a4eec for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a5f1dc4a4eec
Added Files:
clients/examples/python/perf.py
Removed Files:
clients/python2/examples/perf.py
clients/python3/examples/perf.py
Branch: Oct2012
Log Message:

perf: move python2 example to generic examples

python3 perf.py example uses non-Python 3 syntax, so it cannot be
correct.  It only adds a loop and some printing, so non essential.


diffs (52 lines):

diff --git a/clients/python2/examples/perf.py b/clients/examples/python/perf.py
rename from clients/python2/examples/perf.py
rename to clients/examples/python/perf.py
diff --git a/clients/python3/examples/perf.py b/clients/python3/examples/perf.py
deleted file mode 100644
--- a/clients/python3/examples/perf.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the License); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an AS IS
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-
-import time
-
-#configure the logger, so we can see what is happening
-#import logging
-#logging.basicConfig(level=logging.DEBUG)
-#logger = logging.getLogger('monetdb')
-
-
-try:
-import monetdb.sql
-except ImportError:
-# running examples from development tree
-import sys
-import os
-parent = os.path.join(sys.path[0], os.pardir)
-sys.path.append(parent)
-import monetdb.sql
-
-for i in (10, 100, 1000, 1):
-t = time.time()
-x = monetdb.sql.connect(database=demo)
-c = x.cursor()
-c.arraysize=i
-c.execute('select * from tables, tables, tables')
-results = c.fetchall()
-print i, time.time() - t
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - mclient.py: move to generic examples using sh...

2012-12-10 Thread Fabian Groffen
Changeset: d314d59abf11 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d314d59abf11
Added Files:
clients/examples/python/mclient-python2.py.in
clients/examples/python/mclient-python3.py.in
Removed Files:
clients/python2/examples/mclient.py
clients/python3/examples/mclient.py
Branch: Oct2012
Log Message:

mclient.py: move to generic examples using shebang reflecting python version


diffs (31 lines):

diff --git a/clients/python2/examples/mclient.py 
b/clients/examples/python/mclient-python2.py.in
rename from clients/python2/examples/mclient.py
rename to clients/examples/python/mclient-python2.py.in
--- a/clients/python2/examples/mclient.py
+++ b/clients/examples/python/mclient-python2.py.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!@PYTHON2@
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
@@ -17,8 +17,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-#
-
 import sys
 import getopt
 
diff --git a/clients/python3/examples/mclient.py 
b/clients/examples/python/mclient-python3.py.in
rename from clients/python3/examples/mclient.py
rename to clients/examples/python/mclient-python3.py.in
--- a/clients/python3/examples/mclient.py
+++ b/clients/examples/python/mclient-python3.py.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!@PYTHON3@
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - mclient.py: was never installed, don't instal...

2012-12-10 Thread Fabian Groffen
Changeset: c36dbc144941 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c36dbc144941
Added Files:
clients/examples/python/mclient-python2.py
clients/examples/python/mclient-python3.py
Removed Files:
clients/examples/python/mclient-python2.py.in
clients/examples/python/mclient-python3.py.in
Modified Files:
clients/python2/Makefile.ag
clients/python3/Makefile.ag
Branch: Oct2012
Log Message:

mclient.py: was never installed, don't install now either


diffs (40 lines):

diff --git a/clients/examples/python/mclient-python2.py.in 
b/clients/examples/python/mclient-python2.py
rename from clients/examples/python/mclient-python2.py.in
rename to clients/examples/python/mclient-python2.py
--- a/clients/examples/python/mclient-python2.py.in
+++ b/clients/examples/python/mclient-python2.py
@@ -1,4 +1,4 @@
-#!@PYTHON2@
+#!/usr/bin/env python2
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
diff --git a/clients/examples/python/mclient-python3.py.in 
b/clients/examples/python/mclient-python3.py
rename from clients/examples/python/mclient-python3.py.in
rename to clients/examples/python/mclient-python3.py
--- a/clients/examples/python/mclient-python3.py.in
+++ b/clients/examples/python/mclient-python3.py
@@ -1,4 +1,4 @@
-#!@PYTHON3@
+#!/usr/bin/env python3
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
diff --git a/clients/python2/Makefile.ag b/clients/python2/Makefile.ag
--- a/clients/python2/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -20,4 +20,4 @@ python2_setup = {
 }
 
 EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
diff --git a/clients/python3/Makefile.ag b/clients/python3/Makefile.ag
--- a/clients/python3/Makefile.ag
+++ b/clients/python3/Makefile.ag
@@ -20,4 +20,4 @@ python3_setup = {
 }
 
 EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - python: misc changes to run tests with both p...

2012-12-10 Thread Fabian Groffen
Changeset: d7c15c16bc8e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d7c15c16bc8e
Added Files:
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
Removed Files:
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
Modified Files:
sql/test/mapi/Tests/All
testing/Mtest.py.in
Branch: Oct2012
Log Message:

python: misc changes to run tests with both python2 and python3

Mtest: export PYTHON2 and PYTHON3 to the test env (so we can run the
right interpreter)
python_test_monetdb_sql: duplicate and fix for python2 and python3


diffs (122 lines):

diff --git a/sql/test/mapi/Tests/All b/sql/test/mapi/Tests/All
--- a/sql/test/mapi/Tests/All
+++ b/sql/test/mapi/Tests/All
@@ -10,4 +10,5 @@ HAVE_PYTHON?python_dbapi
 HAVE_GEOMHAVE_PHP?php_monetdb
 !HAVE_GEOMHAVE_PHP?php_monetdb_nogeom
 utf8test
-python_test_monetdb_sql
+HAVE_PYTHON2?python2_test_monetdb_sql
+HAVE_PYTHON3?python3_test_monetdb_sql
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
rename from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
@@ -8,4 +8,4 @@ set PYTHONPATH=%testpath%;%PYTHONPATH%
 prompt # $t $g  
 echo on
 
-python %testpath%/runtests.py
+%PYTHON2% %testpath%/runtests.py
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
rename from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
@@ -6,4 +6,4 @@ testpath=$TSTSRCBASE/../clients/python2
 PYTHONPATH=$testpath:$PYTHONPATH
 export PYTHONPATH
 
-Mlog -x python $testpath/runtests.py
+Mlog -x ${PYTHON2} $testpath/runtests.py
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.err 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
rename from sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'python_test_monetdb_sql` in directory 'test/mapi` itself:
+stderr of test 'python2_test_monetdb_sql` in directory 'test/mapi` itself:
 
 
 # 11:54:47   
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.out 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
rename from sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'python_test_monetdb_sql` in directory 'test/mapi` itself:
+stdout of test 'python2_test_monetdb_sql` in directory 'test/mapi` itself:
 
 
 # 11:54:47   
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
copy from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
copy to sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
@@ -2,10 +2,10 @@
 
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
-set testpath=%TSTSRCBASE%\..\clients\python2\test
+set testpath=%TSTSRCBASE%\..\clients\python3\test
 set PYTHONPATH=%testpath%;%PYTHONPATH%
 
 prompt # $t $g  
 echo on
 
-python %testpath%/runtests.py
+%PYTHON3% %testpath%/runtests.py
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
copy from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
copy to sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
@@ -2,8 +2,8 @@
 
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag

MonetDB: Feb2013 - Merged from Oct2012

2012-12-10 Thread Fabian Groffen
Changeset: a72d771c0256 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a72d771c0256
Added Files:
clients/examples/python/basics.py
clients/examples/python/mclient-python2.py
clients/examples/python/mclient-python3.py
clients/examples/python/perf.py
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
Removed Files:
clients/python2/examples/basics.py
clients/python2/examples/mclient.py
clients/python2/examples/perf.py
clients/python3/examples/basics.py
clients/python3/examples/mclient.py
clients/python3/examples/perf.py
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
Modified Files:
clients/python2/Makefile.ag
clients/python3/Makefile.ag
sql/test/mapi/Tests/All
testing/Mtest.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (272 lines):

diff --git a/clients/python2/examples/basics.py 
b/clients/examples/python/basics.py
rename from clients/python2/examples/basics.py
rename to clients/examples/python/basics.py
diff --git a/clients/python2/examples/mclient.py 
b/clients/examples/python/mclient-python2.py
rename from clients/python2/examples/mclient.py
rename to clients/examples/python/mclient-python2.py
--- a/clients/python2/examples/mclient.py
+++ b/clients/examples/python/mclient-python2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
@@ -17,8 +17,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-#
-
 import sys
 import getopt
 
diff --git a/clients/python3/examples/mclient.py 
b/clients/examples/python/mclient-python3.py
rename from clients/python3/examples/mclient.py
rename to clients/examples/python/mclient-python3.py
--- a/clients/python3/examples/mclient.py
+++ b/clients/examples/python/mclient-python3.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
diff --git a/clients/python2/examples/perf.py b/clients/examples/python/perf.py
rename from clients/python2/examples/perf.py
rename to clients/examples/python/perf.py
diff --git a/clients/python2/Makefile.ag b/clients/python2/Makefile.ag
--- a/clients/python2/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -20,4 +20,4 @@ python2_setup = {
 }
 
 EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
diff --git a/clients/python3/Makefile.ag b/clients/python3/Makefile.ag
--- a/clients/python3/Makefile.ag
+++ b/clients/python3/Makefile.ag
@@ -20,4 +20,4 @@ python3_setup = {
 }
 
 EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
diff --git a/clients/python3/examples/basics.py 
b/clients/python3/examples/basics.py
deleted file mode 100644
--- a/clients/python3/examples/basics.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the License); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an AS IS
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-import logging
-
-#configure the logger, so we can see what is happening
-logging.basicConfig(level=logging.DEBUG)
-logger = logging.getLogger('monetdb')
-
-try:
-import monetdb.sql
-except ImportError:
-# running examples from development tree
-import sys
-import os
-parent = os.path.join(sys.path[0], os.pardir)
-sys.path.append(parent)
-import monetdb.sql
-
-
-x = monetdb.sql.connect(username=monetdb, password=monetdb, 
hostname=localhost, database=demo)
-c = x.cursor()
-
-# some basic 

MonetDB: default - Merged from Feb2013

2012-12-10 Thread Fabian Groffen
Changeset: 5a0f3d236cc2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a0f3d236cc2
Added Files:
clients/examples/python/basics.py
clients/examples/python/mclient-python2.py
clients/examples/python/mclient-python3.py
clients/examples/python/perf.py
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
Removed Files:
clients/python2/examples/basics.py
clients/python2/examples/mclient.py
clients/python2/examples/perf.py
clients/python3/examples/basics.py
clients/python3/examples/mclient.py
clients/python3/examples/perf.py
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
Modified Files:
clients/examples/python/sqlsample.py.in
clients/python2/Makefile.ag
clients/python2/test/test_control.py
clients/python3/Makefile.ag
clients/python3/test/test_control.py
monetdb5/modules/mal/language.c
monetdb5/modules/mal/language.h
monetdb5/modules/mal/language.mal
monetdb5/optimizer/opt_dataflow.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_prelude.h
sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.err

sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
sql/test/mapi/Tests/All
testing/Mtest.py.in
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 1483 to 300 lines):

diff --git a/clients/python2/examples/basics.py 
b/clients/examples/python/basics.py
rename from clients/python2/examples/basics.py
rename to clients/examples/python/basics.py
diff --git a/clients/python2/examples/mclient.py 
b/clients/examples/python/mclient-python2.py
rename from clients/python2/examples/mclient.py
rename to clients/examples/python/mclient-python2.py
--- a/clients/python2/examples/mclient.py
+++ b/clients/examples/python/mclient-python2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
@@ -17,8 +17,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-#
-
 import sys
 import getopt
 
diff --git a/clients/python3/examples/mclient.py 
b/clients/examples/python/mclient-python3.py
rename from clients/python3/examples/mclient.py
rename to clients/examples/python/mclient-python3.py
--- a/clients/python3/examples/mclient.py
+++ b/clients/examples/python/mclient-python3.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
diff --git a/clients/python2/examples/perf.py b/clients/examples/python/perf.py
rename from clients/python2/examples/perf.py
rename to clients/examples/python/perf.py
diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py.in
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py.in
@@ -24,23 +24,23 @@ dbh = monetdb.sql.Connection(port=int(sy
 
 cursor = dbh.cursor();
 cursor.execute('select 1;')
-print cursor.fetchall()
+print(cursor.fetchall())
 
 cursor = dbh.cursor();
 cursor.execute('select 2;')
-print cursor.fetchone()
+print(cursor.fetchone())
 
 # deliberately executing a wrong SQL statement:
 try:
 cursor.execute('( xyz 1);')
 except monetdb.sql.OperationalError, e:
-print e
+print(e)
 
 cursor.execute('create table python_table (i smallint,s string);');
 cursor.execute('insert into python_table values ( 3, \'three\');');
 cursor.execute('insert into python_table values ( 7, \'seven\');');
 cursor.execute('select * from python_table;');
-print cursor.fetchall()
+print(cursor.fetchall())
 
 s = ((0, 'row1'), (1, 'row2'))
 x = cursor.executemany(insert into python_table VALUES (%s, %s);, s)
diff --git a/clients/python2/Makefile.ag b/clients/python2/Makefile.ag
--- a/clients/python2/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -20,4 +20,4 @@ python2_setup = {
 }
 
 EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
diff --git a/clients/python2/test/test_control.py 

MonetDB: Oct2012 - Mtest/python: export PYTHON{2,3}PATH for test...

2012-12-10 Thread Fabian Groffen
Changeset: 66c81a601b38 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=66c81a601b38
Modified Files:
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest/python: export PYTHON{2,3}PATH for tests to use

Since Mtest can only run with one Python interpreter, the PYTHONPATH it
builds and exports cannot always be right if we're running a specific
python version.  Hence, export PYTHON2PATH and PYTHON3PATH such that we
can override the PYTHONPATH manually, discarding incompatible python
code for the python interpreter being used.


diffs (69 lines):

diff --git a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
@@ -3,7 +3,9 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCBASE%\..\clients\python2\test
-set PYTHONPATH=%testpath%;%PYTHONPATH%
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%testpath%;%PYTHON2PATH%
 
 prompt # $t $g  
 echo on
diff --git a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
@@ -3,7 +3,9 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath=$TSTSRCBASE/../clients/python2/test
-PYTHONPATH=$testpath:$PYTHONPATH
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=$testpath:${PYTHON2PATH}
 export PYTHONPATH
 
 Mlog -x ${PYTHON2} $testpath/runtests.py
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
@@ -3,7 +3,9 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCBASE%\..\clients\python3\test
-set PYTHONPATH=%testpath%;%PYTHONPATH%
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%testpath%;%PYTHON3PATH%
 
 prompt # $t $g  
 echo on
diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
@@ -3,7 +3,9 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath=$TSTSRCBASE/../clients/python3/test
-PYTHONPATH=$testpath:$PYTHONPATH
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=$testpath:${PYTHON3PATH}
 export PYTHONPATH
 
 Mlog -x ${PYTHON3} $testpath/runtests.py
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1164,7 +1164,9 @@ def PerformDir(env, testdir, testlist, B
 os.environ['TSTTRGDIR'] = TSTTRGDIR
 os.environ['RELSRCDIR'] = env['RELSRCDIR']
 os.environ['PYTHON2']   = '@PYTHON2@'
+os.environ['PYTHON2PATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON2_LIBDIR@'))
 os.environ['PYTHON3']   = '@PYTHON3@'
+os.environ['PYTHON3PATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON3_LIBDIR@'))
 
 #STDERR.flush()
 #for v in 'RELSRCDIR':
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - python3_test_monetdb_sql: approve now python3...

2012-12-10 Thread Fabian Groffen
Changeset: 0842cf5cce2d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0842cf5cce2d
Modified Files:
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
Branch: Oct2012
Log Message:

python3_test_monetdb_sql: approve now python3 successfully runs


diffs (20 lines):

diff --git a/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err 
b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
--- a/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
@@ -80,7 +80,6 @@ stderr of test 'python3_test_monetdb_sql
 # 11:54:47   
 
 test_BLOB (__main__.Test_Capabilities) ... ok
-test_BOOL (__main__.Test_Capabilities) ... ok
 test_CHAR (__main__.Test_Capabilities) ... ok
 test_DATE (__main__.Test_Capabilities) ... ok
 test_DATETIME (__main__.Test_Capabilities) ... ok
@@ -103,7 +102,7 @@ test_transactions (__main__.Test_Capabil
 test_truncation (__main__.Test_Capabilities) ... ok
 
 --
-Ran 22 tests
+Ran 21 tests
 
 OK
 test_BINARY (__main__.Test_DBAPI20) ... ok
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - sqlsample.py: fix syntax for Python 3

2012-12-10 Thread Fabian Groffen
Changeset: 61515ba0d64e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=61515ba0d64e
Modified Files:
clients/examples/python/sqlsample.py.in
Branch: Oct2012
Log Message:

sqlsample.py: fix syntax for Python 3


diffs (12 lines):

diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py.in
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py.in
@@ -33,7 +33,7 @@ print(cursor.fetchone())
 # deliberately executing a wrong SQL statement:
 try:
 cursor.execute('( xyz 1);')
-except monetdb.sql.OperationalError, e:
+except monetdb.sql.OperationalError as e:
 print(e)
 
 cursor.execute('create table python_table (i smallint,s string);');
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - sqlsample.py: don't need a specific python in...

2012-12-10 Thread Fabian Groffen
Changeset: afe7a0add2c6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afe7a0add2c6
Added Files:
clients/examples/python/sqlsample.py
Branch: Oct2012
Log Message:

sqlsample.py: don't need a specific python interpreter


diffs (11 lines):

diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py
copy from clients/examples/python/sqlsample.py.in
copy to clients/examples/python/sqlsample.py
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!/usr/bin/env python
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - python_dbapi: make Python2 and Python3 tests

2012-12-10 Thread Fabian Groffen
Changeset: 2750dd19f10f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2750dd19f10f
Added Files:
sql/test/mapi/Tests/python2_dbapi.SQL.bat
sql/test/mapi/Tests/python2_dbapi.SQL.sh
sql/test/mapi/Tests/python2_dbapi.stable.err
sql/test/mapi/Tests/python2_dbapi.stable.out
sql/test/mapi/Tests/python3_dbapi.SQL.bat
sql/test/mapi/Tests/python3_dbapi.SQL.sh
sql/test/mapi/Tests/python3_dbapi.stable.err
sql/test/mapi/Tests/python3_dbapi.stable.out
Removed Files:
sql/test/mapi/Tests/python_dbapi.SQL.bat
sql/test/mapi/Tests/python_dbapi.SQL.sh
sql/test/mapi/Tests/python_dbapi.stable.err
sql/test/mapi/Tests/python_dbapi.stable.out
Modified Files:
sql/test/mapi/Tests/All
Branch: Oct2012
Log Message:

python_dbapi: make Python2 and Python3 tests


diffs (138 lines):

diff --git a/sql/test/mapi/Tests/All b/sql/test/mapi/Tests/All
--- a/sql/test/mapi/Tests/All
+++ b/sql/test/mapi/Tests/All
@@ -6,7 +6,8 @@ sample4
 smack00
 smack01
 HAVE_PERL?perl_dbi
-HAVE_PYTHON?python_dbapi
+HAVE_PYTHON2?python2_dbapi
+HAVE_PYTHON3?python3_dbapi
 HAVE_GEOMHAVE_PHP?php_monetdb
 !HAVE_GEOMHAVE_PHP?php_monetdb_nogeom
 utf8test
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python2_dbapi.SQL.bat
rename from sql/test/mapi/Tests/python_dbapi.SQL.bat
rename to sql/test/mapi/Tests/python2_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python2_dbapi.SQL.bat
@@ -3,4 +3,11 @@
 prompt # $t $g  
 echo on
 
-sqlsample.py %MAPIPORT% %TSTDB%
+rem must be aligned with the installation directory chosen in
+rem clients/examples/python
+set testpath=%TSTSRCBASE%\..\clients\examples\python
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%PYTHON2PATH%
+
+%PYTHON2% %testpath%/sqlsample.py %MAPIPORT% %TSTDB%
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.sh 
b/sql/test/mapi/Tests/python2_dbapi.SQL.sh
rename from sql/test/mapi/Tests/python_dbapi.SQL.sh
rename to sql/test/mapi/Tests/python2_dbapi.SQL.sh
--- a/sql/test/mapi/Tests/python_dbapi.SQL.sh
+++ b/sql/test/mapi/Tests/python2_dbapi.SQL.sh
@@ -1,3 +1,11 @@
 #!/bin/sh
 
-Mlog -x sqlsample.py $MAPIPORT $TSTDB
+# must be aligned with the installation directory chosen in
+# clients/examples/python
+testpath=$TSTSRCBASE/../clients/examples/python
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest (currently always Python 2)
+PYTHONPATH=${PYTHON2PATH}
+export PYTHONPATH
+
+Mlog -x ${PYTHON2} ${testpath}/sqlsample.py $MAPIPORT $TSTDB
diff --git a/sql/test/mapi/Tests/python_dbapi.stable.err 
b/sql/test/mapi/Tests/python2_dbapi.stable.err
rename from sql/test/mapi/Tests/python_dbapi.stable.err
rename to sql/test/mapi/Tests/python2_dbapi.stable.err
--- a/sql/test/mapi/Tests/python_dbapi.stable.err
+++ b/sql/test/mapi/Tests/python2_dbapi.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'python_dbapi` in directory 'test/mapi` itself:
+stderr of test 'python2_dbapi` in directory 'test/mapi` itself:
 
 
 # 22:24:36   
diff --git a/sql/test/mapi/Tests/python_dbapi.stable.out 
b/sql/test/mapi/Tests/python2_dbapi.stable.out
rename from sql/test/mapi/Tests/python_dbapi.stable.out
rename to sql/test/mapi/Tests/python2_dbapi.stable.out
--- a/sql/test/mapi/Tests/python_dbapi.stable.out
+++ b/sql/test/mapi/Tests/python2_dbapi.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'python_dbapi` in directory 'test/mapi` itself:
+stdout of test 'python2_dbapi` in directory 'test/mapi` itself:
 
 
 # 20:08:06   
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
copy from sql/test/mapi/Tests/python_dbapi.SQL.bat
copy to sql/test/mapi/Tests/python3_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
@@ -3,4 +3,11 @@
 prompt # $t $g  
 echo on
 
-sqlsample.py %MAPIPORT% %TSTDB%
+rem must be aligned with the installation directory chosen in
+rem clients/examples/python
+set testpath=%TSTSRCBASE%\..\clients\examples\python
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%PYTHON3PATH%
+
+%PYTHON3% %testpath%/sqlsample.py %MAPIPORT% %TSTDB%
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.sh 
b/sql/test/mapi/Tests/python3_dbapi.SQL.sh
copy from sql/test/mapi/Tests/python_dbapi.SQL.sh
copy to sql/test/mapi/Tests/python3_dbapi.SQL.sh
--- a/sql/test/mapi/Tests/python_dbapi.SQL.sh
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.sh
@@ -1,3 +1,11 @@
 #!/bin/sh
 
-Mlog -x sqlsample.py $MAPIPORT $TSTDB
+# must be aligned with the installation directory chosen in
+# clients/examples/python
+testpath=$TSTSRCBASE/../clients/examples/python
+# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+# Python that runs Mtest 

MonetDB: Oct2012 - build-sys: don't need to descend into python ...

2012-12-10 Thread Fabian Groffen
Changeset: d40b1be57b1e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d40b1be57b1e
Modified Files:
clients/examples/Makefile.ag
Branch: Oct2012
Log Message:

build-sys: don't need to descend into python any more


diffs (11 lines):

diff --git a/clients/examples/Makefile.ag b/clients/examples/Makefile.ag
--- a/clients/examples/Makefile.ag
+++ b/clients/examples/Makefile.ag
@@ -15,4 +15,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = C python php
+SUBDIRS = C php
+
+EXTRA_DIST_DIR = python
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-10 Thread Fabian Groffen
Changeset: 00628eb117e0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=00628eb117e0
Added Files:
clients/examples/python/sqlsample.py
sql/test/mapi/Tests/python2_dbapi.SQL.bat
sql/test/mapi/Tests/python2_dbapi.SQL.sh
sql/test/mapi/Tests/python2_dbapi.stable.err
sql/test/mapi/Tests/python2_dbapi.stable.out
sql/test/mapi/Tests/python3_dbapi.SQL.bat
sql/test/mapi/Tests/python3_dbapi.SQL.sh
sql/test/mapi/Tests/python3_dbapi.stable.err
sql/test/mapi/Tests/python3_dbapi.stable.out
Removed Files:
clients/examples/python/Makefile.ag
clients/examples/python/sqlsample.py.in
sql/test/mapi/Tests/python_dbapi.SQL.bat
sql/test/mapi/Tests/python_dbapi.SQL.sh
sql/test/mapi/Tests/python_dbapi.stable.err
sql/test/mapi/Tests/python_dbapi.stable.out
Modified Files:
clients/examples/Makefile.ag
sql/test/mapi/Tests/All
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
testing/Mtest.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (287 lines):

diff --git a/clients/examples/Makefile.ag b/clients/examples/Makefile.ag
--- a/clients/examples/Makefile.ag
+++ b/clients/examples/Makefile.ag
@@ -15,4 +15,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = C python php
+SUBDIRS = C php
+
+EXTRA_DIST_DIR = python
diff --git a/clients/examples/python/Makefile.ag 
b/clients/examples/python/Makefile.ag
deleted file mode 100644
--- a/clients/examples/python/Makefile.ag
+++ /dev/null
@@ -1,24 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the License); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an AS IS
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-MTSAFE
-
-scripts_py = {
-   COND = HAVE_TESTING
-   DIR = bindir
-   SOURCES = sqlsample.py.in
-}
diff --git a/clients/examples/python/sqlsample.py.in 
b/clients/examples/python/sqlsample.py
rename from clients/examples/python/sqlsample.py.in
rename to clients/examples/python/sqlsample.py
--- a/clients/examples/python/sqlsample.py.in
+++ b/clients/examples/python/sqlsample.py
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!/usr/bin/env python
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
@@ -33,7 +33,7 @@ print(cursor.fetchone())
 # deliberately executing a wrong SQL statement:
 try:
 cursor.execute('( xyz 1);')
-except monetdb.sql.OperationalError, e:
+except monetdb.sql.OperationalError as e:
 print(e)
 
 cursor.execute('create table python_table (i smallint,s string);');
diff --git a/sql/test/mapi/Tests/All b/sql/test/mapi/Tests/All
--- a/sql/test/mapi/Tests/All
+++ b/sql/test/mapi/Tests/All
@@ -6,7 +6,8 @@ sample4
 smack00
 smack01
 HAVE_PERL?perl_dbi
-HAVE_PYTHON?python_dbapi
+HAVE_PYTHON2?python2_dbapi
+HAVE_PYTHON3?python3_dbapi
 HAVE_GEOMHAVE_PHP?php_monetdb
 !HAVE_GEOMHAVE_PHP?php_monetdb_nogeom
 utf8test
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python2_dbapi.SQL.bat
rename from sql/test/mapi/Tests/python_dbapi.SQL.bat
rename to sql/test/mapi/Tests/python2_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python2_dbapi.SQL.bat
@@ -3,4 +3,11 @@
 prompt # $t $g  
 echo on
 
-sqlsample.py %MAPIPORT% %TSTDB%
+rem must be aligned with the installation directory chosen in
+rem clients/examples/python
+set testpath=%TSTSRCBASE%\..\clients\examples\python
+rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
+rem Python that runs Mtest (currently always Python 2)
+set PYTHONPATH=%PYTHON2PATH%
+
+%PYTHON2% %testpath%/sqlsample.py %MAPIPORT% %TSTDB%
diff --git a/sql/test/mapi/Tests/python_dbapi.SQL.sh 
b/sql/test/mapi/Tests/python2_dbapi.SQL.sh
rename from sql/test/mapi/Tests/python_dbapi.SQL.sh
rename to sql/test/mapi/Tests/python2_dbapi.SQL.sh
--- a/sql/test/mapi/Tests/python_dbapi.SQL.sh
+++ b/sql/test/mapi/Tests/python2_dbapi.SQL.sh
@@ -1,3 +1,11 @@
 #!/bin/sh
 
-Mlog -x sqlsample.py $MAPIPORT $TSTDB
+# must be aligned with the installation directory chosen in
+# 

MonetDB: Feb2013 - datacell: add missing includes

2012-12-09 Thread Fabian Groffen
Changeset: 018ad7e53125 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=018ad7e53125
Modified Files:
sql/backends/monet5/datacell/basket.c
sql/backends/monet5/datacell/petrinet.c
Branch: Feb2013
Log Message:

datacell: add missing includes


diffs (23 lines):

diff --git a/sql/backends/monet5/datacell/basket.c 
b/sql/backends/monet5/datacell/basket.c
--- a/sql/backends/monet5/datacell/basket.c
+++ b/sql/backends/monet5/datacell/basket.c
@@ -31,6 +31,8 @@
 #ifdef WIN32
 #include winsock2.h
 #endif
+#include mal_builder.h
+#include opt_prelude.h
 
 str schema_default = datacell;
 str statusname[6] = { unknown, init, paused, running, stop, 
error };
diff --git a/sql/backends/monet5/datacell/petrinet.c 
b/sql/backends/monet5/datacell/petrinet.c
--- a/sql/backends/monet5/datacell/petrinet.c
+++ b/sql/backends/monet5/datacell/petrinet.c
@@ -73,6 +73,7 @@
 #include monetdb_config.h
 #include petrinet.h
 #include mal_builder.h
+#include opt_prelude.h
 
 #define MAXPN 200   /* it is the minimum, if we need more space 
GDKrealloc */
 #define PNcontrolInfinit 1  /* infinit loop of PNController  */
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - approve changed help output

2012-12-09 Thread Fabian Groffen
Changeset: 05ebff1c3f40 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=05ebff1c3f40
Modified Files:
clients/mapiclient/Tests/stethoscope--help.stable.err
Branch: Feb2013
Log Message:

approve changed help output


diffs (15 lines):

diff --git a/clients/mapiclient/Tests/stethoscope--help.stable.err 
b/clients/mapiclient/Tests/stethoscope--help.stable.err
--- a/clients/mapiclient/Tests/stethoscope--help.stable.err
+++ b/clients/mapiclient/Tests/stethoscope--help.stable.err
@@ -10,10 +10,9 @@ stderr of test 'stethoscope--help` in di
 # 10:36:09   Mtimeout -timeout 60 stethoscope --help
 # 10:36:09   
 
-stethoscope [options] +[trace options] {mod.fcn}
+stethoscope [options] [dbname] +[trace options] {mod.fcn}
   -d | --dbname=database_name
   -u | --user=user
-  -P | --password=password
   -p | --port=portnr
   -h | --host=hostname
   -? | --help
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - exports: GDKgetenv_int was exported in 2033a1...

2012-12-09 Thread Fabian Groffen
Changeset: 100032d6036a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=100032d6036a
Modified Files:
clients/Tests/exports.stable.out
Branch: Feb2013
Log Message:

exports: GDKgetenv_int was exported in 2033a11b0643


diffs (11 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -255,6 +255,7 @@ int GDKfatal(_In_z_ _Printf_format_strin
 void GDKfilepath(str path, const char *nme, const char *mode, const char *ext);
 void GDKfree(void *blk);
 char *GDKgetenv(const char *name);
+int GDKgetenv_int(const char *name, int def);
 int GDKgetenv_istrue(const char *name);
 int GDKgetenv_isyes(const char *name);
 int GDKinit(opt *set, int setlen);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-09 Thread Fabian Groffen
Changeset: bc927f5eef71 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc927f5eef71
Removed Files:
sql/backends/monet5/sql_emptyset.c
sql/backends/monet5/sql_emptyset.h
Modified Files:
clients/Tests/exports.stable.out
clients/mapiclient/Tests/stethoscope--help.stable.err
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_function.c
monetdb5/mal/mal_resource.c
monetdb5/optimizer/opt_aliases.c
monetdb5/optimizer/opt_costModel.c
monetdb5/optimizer/opt_inline.c
monetdb5/optimizer/opt_wrapper.c
sql/backends/monet5/Makefile.ag
sql/backends/monet5/datacell/basket.c
sql/backends/monet5/datacell/petrinet.c
sql/backends/monet5/sql.mx
sql/backends/monet5/sql_optimizer.c
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 983 to 300 lines):

diff --git a/clients/mapiclient/Tests/stethoscope--help.stable.err 
b/clients/mapiclient/Tests/stethoscope--help.stable.err
--- a/clients/mapiclient/Tests/stethoscope--help.stable.err
+++ b/clients/mapiclient/Tests/stethoscope--help.stable.err
@@ -10,10 +10,9 @@ stderr of test 'stethoscope--help` in di
 # 10:36:09   Mtimeout -timeout 60 stethoscope --help
 # 10:36:09   
 
-stethoscope [options] +[trace options] {mod.fcn}
+stethoscope [options] [dbname] +[trace options] {mod.fcn}
   -d | --dbname=database_name
   -u | --user=user
-  -P | --password=password
   -p | --port=portnr
   -h | --host=hostname
   -? | --help
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -331,8 +331,9 @@ DFLOWworker(void *t)
}
MT_lock_unset(flow-flowlock, MALworker);
 
-   MALresourceFairness(flow-cntxt, flow-mb, usec);
q_enqueue(flow-done, fe);
+   if ( fnxt == 0)
+   MALresourceFairness(flow-cntxt, flow-mb, usec);
}
GDKfree(GDKerrbuf);
GDKsetbuf(0);
diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c
--- a/monetdb5/mal/mal_function.c
+++ b/monetdb5/mal/mal_function.c
@@ -694,7 +694,6 @@ setLifespan(MalBlkPtr mb)
int *blk;
Lifespan span= newLifespan(mb);
 
-   memset((char*) span,0, sizeof(LifespanRecord)* mb-vtop);
prop = PropertyIndex(transparent);
 
blk= (int *) GDKzalloc(sizeof(int)*mb-vtop);
diff --git a/monetdb5/mal/mal_resource.c b/monetdb5/mal/mal_resource.c
--- a/monetdb5/mal/mal_resource.c
+++ b/monetdb5/mal/mal_resource.c
@@ -189,20 +189,20 @@ MALresourceFairness(Client cntxt, MalBlk
if ( rss  MEMORY_THRESHOLD * monet_memory)
return;
 
-   clk = GDKusec();
if ( usec )
/* worker reporting time spent ! */
-   clk = (clk - usec) / 1000;
+   clk =  usec / 1000;
else  {
/* interpreter calling without timing */
/* punish based on total duration of call */
-   clk = (clk-mb-starttime)/1000;
+   clk = (GDKusec() - mb-starttime)/1000;
if ( clk = TIMESLICE) 
/* use fake time for penalty */
clk = DELAYUNIT;
}
 
if ( clk = DELAYUNIT ) {
+   PARDEBUG mnstr_printf(GDKstdout, #delay %d initial LLFMTn, 
cntxt-idx, clk);
while (clk  0) {
/* always keep one running to avoid all waiting  */
if (running  2)
diff --git a/monetdb5/optimizer/opt_aliases.c b/monetdb5/optimizer/opt_aliases.c
--- a/monetdb5/optimizer/opt_aliases.c
+++ b/monetdb5/optimizer/opt_aliases.c
@@ -74,7 +74,6 @@ OPTaliasesImplementation(Client cntxt, M
mb-stmt[i]= NULL;
mb-stop= k;
/*
-* @-
 * The second phase is constant alias replacement should be implemented.
 */
GDKfree(span);
diff --git a/monetdb5/optimizer/opt_costModel.c 
b/monetdb5/optimizer/opt_costModel.c
--- a/monetdb5/optimizer/opt_costModel.c
+++ b/monetdb5/optimizer/opt_costModel.c
@@ -32,28 +32,6 @@
varSetProp(mb, getArg(p,Z), rowsProp, op_eq, 
VALset(v,TYPE_wrd,k));\
 }
 /*
- * SQL specific back propagation of table size may be needed to avoid
- * the empty-set optimizer to through away a BAT we need.
- */
-static void
-OPTbackpropagate(MalBlkPtr mb, int i, int idx){
-   wrd rows;
-   InstrPtr p;
-
-rows = getVarRows(mb, idx);
-   if (rows == -1)
-   return;
-   for( ; i  0; i--){
-   p = getInstrPtr(mb,i);
-   if (getFunctionId(p) == setWriteModeRef){
-   if (getVarRows(mb, getArg(p,1)) == 0) {
-   ValRecord v, *vp = VALset(v, TYPE_wrd, rows);
-   varSetProp(mb, getArg(p,1), rowsProp, op_eq, 
vp);
-   }
-

MonetDB: Feb2013 - stethoscope: remove multi-server monitoring b...

2012-12-08 Thread Fabian Groffen
Changeset: 26622b43db44 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=26622b43db44
Modified Files:
clients/mapiclient/Makefile.ag
clients/mapiclient/stethoscope.c
Branch: Feb2013
Log Message:

stethoscope: remove multi-server monitoring behaviour


diffs (truncated from 324 to 300 lines):

diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -42,7 +42,7 @@ bin_stethoscope = {
SOURCES = stethoscope.c
LIBS = libmcutil ../mapilib/libmapi \
../../common/stream/libstream \
-   $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS)
+   $(curl_LIBS) $(MALLOC_LIBS) $(SOCKET_LIBS)
 }
 
 bin_tomograph = {
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -28,9 +28,6 @@
 #include errno.h
 #include signal.h
 #include unistd.h
-#ifdef HAVE_PTHREAD_H
-#include pthread.h
-#endif
 #include dotmonetdb.h
 
 #ifndef HAVE_GETOPT_LONG
@@ -88,13 +85,7 @@ static struct {
/*  3  */ { 0, 0, 0, 0 }
 };
 
-typedef struct _wthread {
-#if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-   HANDLE id;
-#else
-   pthread_t id;
-#endif
-   int tid;
+static struct _wthread {
char *uri;
char *host;
char *dbname;
@@ -104,10 +95,8 @@ typedef struct _wthread {
stream *s;
size_t argc;
char **argv;
-   struct _wthread *next;
-} wthread;
+} wthr;
 
-static wthread *thds = NULL;
 static char hostname[128];
 
 static void
@@ -148,13 +137,8 @@ usage(void)
 static void
 stopListening(int i)
 {
-   wthread *walk;
(void)i;
-   /* kill all connections */
-   for (walk = thds; walk != NULL; walk = walk-next) {
-   if (walk-s != NULL)
-   mnstr_close(walk-s);
-   }
+   mnstr_close(wthr.s);
 }
 
 static int
@@ -180,14 +164,9 @@ setCounter(char *nme)
if ((hdl = mapi_query(dbh, X)) == NULL || mapi_error(dbh) != MOK) \
 die(dbh, hdl);
 
-#if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-static DWORD WINAPI
-#else
-static void *
-#endif
-doProfile(void *d)
+static void
+doProfile(void)
 {
-   wthread *wthr = (wthread*)d;
int i;
size_t a;
ssize_t n;
@@ -203,10 +182,10 @@ doProfile(void *d)
 
/* set up the profiler */
id[0] = '\0';
-   if (wthr-uri)
-   dbh = mapi_mapiuri(wthr-uri, wthr-user, wthr-pass, mal);
+   if (wthr.uri)
+   dbh = mapi_mapiuri(wthr.uri, wthr.user, wthr.pass, mal);
else
-   dbh = mapi_mapi(wthr-host, wthr-port, wthr-user, wthr-pass, 
mal, wthr-dbname);
+   dbh = mapi_mapi(wthr.host, wthr.port, wthr.user, wthr.pass, 
mal, wthr.dbname);
if (dbh == NULL || mapi_error(dbh))
die(dbh, hdl);
mapi_reconnect(dbh);
@@ -217,16 +196,9 @@ doProfile(void *d)
fprintf(stderr, !! UNIX domain socket not supported\n);
goto stop_disconnect;
}
-   if (wthr-tid  0) {
-   snprintf(id, 10, [%d] , wthr-tid);
 #ifdef _DEBUG_STETHOSCOPE_
-   printf(-- connection with server %s is %s\n, wthr-uri ? 
wthr-uri : host, id);
+   printf(-- connection with server %s\n, wthr.uri ? wthr.uri : host);
 #endif
-   } else {
-#ifdef _DEBUG_STETHOSCOPE_
-   printf(-- connection with server %s\n, wthr-uri ? wthr-uri 
: host);
-#endif
-   }
 
/* set counters */
x = NULL;
@@ -243,24 +215,24 @@ doProfile(void *d)
profileCounter[i].ptag);
doQ(buf);
 #ifdef _DEBUG_STETHOSCOPE_
-   printf(-- %s%s\n, id, buf);
+   printf(-- %s\n, buf);
 #endif
}
x = profileCounter[i].ptag;
}
 
for (portnr = 50010; portnr  62010; portnr++) {
-   if ((wthr-s = udp_rastream(host, portnr, profileStream)) != 
NULL)
+   if ((wthr.s = udp_rastream(host, portnr, profileStream)) != 
NULL)
break;
}
-   if (wthr-s == NULL) {
+   if (wthr.s == NULL) {
fprintf(stderr, !! %sopening stream failed: no free ports 
available\n,
id);
goto stop_cleanup;
}
 
-   printf(-- %sopened UDP profile stream %s:%d for %s\n,
-   id, hostname, portnr, host);
+   printf(-- opened UDP profile stream %s:%d for %s\n,
+   hostname, portnr, host);
 
snprintf(buf, BUFSIZ, port := profiler.openStream(\%s\, %d);,
hostname, portnr);
@@ -269,15 +241,15 @@ doProfile(void *d)
/* Set Filters */
doQ(profiler.setNone(););
 
-   if (wthr-argc == 0) {
+   if 

MonetDB: Feb2013 - stethoscope: handle user/password like mclient

2012-12-08 Thread Fabian Groffen
Changeset: 76f7d299e3e5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76f7d299e3e5
Modified Files:
clients/mapiclient/stethoscope.c
Branch: Feb2013
Log Message:

stethoscope: handle user/password like mclient

Drop --password/-P argument, don't die for missing user or password, but
prompt like mclient does.


diffs (100 lines):

diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -28,6 +28,7 @@
 #include errno.h
 #include signal.h
 #include unistd.h
+#include mprompt.h
 #include dotmonetdb.h
 
 #ifndef HAVE_GETOPT_LONG
@@ -105,7 +106,6 @@ usage(void)
fprintf(stderr, stethoscope [options] +[trace options] 
{mod.fcn}\n);
fprintf(stderr,   -d | --dbname=database_name\n);
fprintf(stderr,   -u | --user=user\n);
-   fprintf(stderr,   -P | --password=password\n);
fprintf(stderr,   -p | --port=portnr\n);
fprintf(stderr,   -h | --host=hostname\n);
fprintf(stderr,   -? | --help\n);
@@ -306,9 +306,11 @@ stop_disconnect:
mapi_destroy(dbh);
}
 
-   printf(-- connection with server %s closed\n, wthr.uri ? wthr.uri : 
host);
+   if (host != NULL) {
+   printf(-- connection with server %s closed\n, wthr.uri ? 
wthr.uri : host);
 
-   free(host);
+   free(host);
+   }
 }
 
 int
@@ -322,12 +324,9 @@ main(int argc, char **argv)
char *user = NULL;
char *password = NULL;
 
-   /* some .monetdb properties are used by mclient, perhaps we need them 
as well later */
-
-   static struct option long_options[8] = {
+   static struct option long_options[6] = {
{ dbname, 1, 0, 'd' },
{ user, 1, 0, 'u' },
-   { password, 1, 0, 'P' },
{ port, 1, 0, 'p' },
{ host, 1, 0, 'h' },
{ help, 0, 0, '?' },
@@ -339,7 +338,7 @@ main(int argc, char **argv)
 
while (1) {
int option_index = 0;
-   int c = getopt_long(argc, argv, d:u:P:p:h:?,
+   int c = getopt_long(argc, argv, d:u:p:h:?,
long_options, option_index);
if (c == -1)
break;
@@ -351,11 +350,10 @@ main(int argc, char **argv)
if (user)
free(user);
user = strdup(optarg);
-   break;
-   case 'P':
+   /* force password prompt */
if (password)
free(password);
-   password = strdup(optarg);
+   password = NULL;
break;
case 'p':
portnr = atol(optarg);
@@ -377,22 +375,21 @@ main(int argc, char **argv)
 
a = optind;
if (argc  1  a  argc  argv[a][0] == '+') {
-   k= setCounter(argv[a] + 1);
+   k = setCounter(argv[a] + 1);
a++;
} else
-   k= setCounter(COUNTERSDEFAULT);
+   k = setCounter(COUNTERSDEFAULT);
 
/* DOT needs function id and PC to correlate */
-   if( profileCounter[32].status ) {
+   if (profileCounter[32].status) {
profileCounter[3].status= k++;
profileCounter[4].status= k;
}
 
-   if (user == NULL || password == NULL) {
-   fprintf(stderr, %s: need -u and -P arguments\n, argv[0]);
-   usage();
-   exit(-1);
-   }
+   if (user == NULL)
+   user = simple_prompt(user, BUFSIZ, 1, prompt_getlogin());
+   if (password == NULL)
+   password = simple_prompt(password, BUFSIZ, 0, NULL);
 
 #ifdef SIGPIPE
signal(SIGPIPE, stopListening);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - stethoscope: like mclient, accept first non-o...

2012-12-08 Thread Fabian Groffen
Changeset: e158276d1a82 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e158276d1a82
Modified Files:
clients/mapiclient/stethoscope.c
Branch: Feb2013
Log Message:

stethoscope: like mclient, accept first non-option argument as dbname or uri


diffs (39 lines):

diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -92,7 +92,7 @@ static char hostname[128];
 static void
 usage(void)
 {
-   fprintf(stderr, stethoscope [options] +[trace options] 
{mod.fcn}\n);
+   fprintf(stderr, stethoscope [options] [dbname] +[trace options] 
{mod.fcn}\n);
fprintf(stderr,   -d | --dbname=database_name\n);
fprintf(stderr,   -u | --user=user\n);
fprintf(stderr,   -p | --port=portnr\n);
@@ -166,6 +166,7 @@ main(int argc, char **argv)
char *uri = NULL;
char *user = NULL;
char *password = NULL;
+   struct stat statb;
char *response, *x;
char buf[BUFSIZ + 1];
char *mod, *fcn;
@@ -221,6 +222,18 @@ main(int argc, char **argv)
}
}
 
+   if (dbname == NULL  optind != argc  argv[optind][0] != '+' 
+   (stat(argv[optind], statb) != 0 || 
!S_ISREG(statb.st_mode)))
+   {
+   dbname = argv[optind];
+   optind++;
+   }
+
+   if (dbname != NULL  strncmp(dbname, mapi:monetdb://, 15) == 0) {
+   uri = dbname;
+   dbname = NULL;
+   }
+
i = optind;
if (argc  1  i  argc  argv[i][0] == '+') {
k = setCounter(argv[i] + 1);
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - stethoscope: remove UNIX sockets restriction

2012-12-08 Thread Fabian Groffen
Changeset: 0ddfe20c620d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ddfe20c620d
Modified Files:
clients/mapiclient/stethoscope.c
Branch: Feb2013
Log Message:

stethoscope: remove UNIX sockets restriction

By opening a UDP connection on the correct host(name) (where we as
stethoscope run, iso on the target connection's hostname) we don't need
a TCP connection to the server.  Actually fixes a problem with
stethoscope interaction between hosts.


diffs (23 lines):

diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -284,10 +284,6 @@ main(int argc, char **argv)
if (mapi_error(dbh))
die(dbh, hdl);
host = strdup(mapi_get_host(dbh));
-   if (*host == '/') {
-   fprintf(stderr, !! UNIX domain socket not supported\n);
-   goto stop_disconnect;
-   }
 #ifdef _DEBUG_STETHOSCOPE_
printf(-- connection with server %s\n, uri ? uri : host);
 #endif
@@ -314,7 +310,7 @@ main(int argc, char **argv)
}
 
for (portnr = 50010; portnr  62010; portnr++) {
-   if ((conn = udp_rastream(host, portnr, profileStream)) != 
NULL)
+   if ((conn = udp_rastream(hostname, portnr, profileStream)) != 
NULL)
break;
}
if (conn == NULL) {
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-08 Thread Fabian Groffen
Changeset: bf5b7356d1ed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bf5b7356d1ed
Modified Files:
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/transaction.mal

sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err

sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out
sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err
testing/Mfilter.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (80 lines):

diff --git a/monetdb5/modules/kernel/bat5.mal b/monetdb5/modules/kernel/bat5.mal
--- a/monetdb5/modules/kernel/bat5.mal
+++ b/monetdb5/modules/kernel/bat5.mal
@@ -228,7 +228,7 @@ comment Delete one specific BUN.;
 
 command delete(b:bat[:any_1, :any_2], h:any_1) :bat[:any_1,:any_2]
 address BKCdelete
-comment Delete all BUNs with a certain tail value.;
+comment Delete all BUNs with a certain head value.;
 
 command delete(b:bat[:any_1, :any_2]) :bat[:any_1,:any_2]
 address BKCdelete_all
diff --git a/monetdb5/modules/mal/transaction.mal 
b/monetdb5/modules/mal/transaction.mal
--- a/monetdb5/modules/mal/transaction.mal
+++ b/monetdb5/modules/mal/transaction.mal
@@ -43,7 +43,7 @@ comment Declare a BAT clean without flu
 
 command prev(b:bat[:oid,:any_1]):bat[:oid,:any_1]
 address TRNtrans_prev
-comment The previous stae of this BAT;
+comment The previous state of this BAT;
 command alpha(b:bat[:oid,:any_1]) :bat[:oid,:any_1]
 address TRNtrans_alpha
 commentList insertions since last commit.;
diff --git 
a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err
 
b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err
--- 
a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err
+++ 
b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err
@@ -68,9 +68,10 @@ stderr of test 'select_from_env.SF-12407
 # 22:29:10   mclient -lsql -i -umonetdb -Pmonetdb --host=pegasus --port=30332 
 # 22:29:10   
 
-MAPI  = monetdb@madrid:39416
+MAPI  = (monetdb) /var/tmp/mtest-29744/.s.monetdb.36963
 QUERY = select * from env() as env where name = ( select 'prefix' from env() 
as env );
-ERROR = !cardinality violation (201)
+ERROR = !cardinality violation (211)
+
 
 
 # 13:22:15   
diff --git 
a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out
 
b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out
--- 
a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out
+++ 
b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out
@@ -39,6 +39,7 @@ Ready.
 [ mapi_autosense ]
 [ mapi_open  ]
 [ mapi_port  ]
+[ mapi_usock ]
 [ max_clients]
 [ monet_daemon   ]
 [ monet_mod_path ]
diff --git 
a/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err 
b/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err
--- a/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err
+++ b/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err
@@ -80,10 +80,10 @@ stderr of test 'cardinality_violation.SF
 # 21:00:43   mclient -lsql -umonetdb -Pmonetdb --host=alf --port=38808 
 # 21:00:43   
 
-MAPI  = monetdb@madrid:36834
+MAPI  = (monetdb) /var/tmp/mtest-29744/.s.monetdb.36963
 QUERY = select * from env() as env where name = ( select 'prefix' from env() 
as env );
-ERROR = !cardinality violation (201)
-MAPI  = monetdb@madrid:36834
+ERROR = !cardinality violation (211)
+MAPI  = (monetdb) /var/tmp/mtest-29744/.s.monetdb.36963
 QUERY = select * from columns where name = (select columns.name from _tables, 
columns where _tables.id = columns.table_id);
 ERROR = !cardinality violation (3261)
 
diff --git a/testing/Mfilter.py.in b/testing/Mfilter.py.in
--- a/testing/Mfilter.py.in
+++ b/testing/Mfilter.py.in
@@ -48,7 +48,7 @@ test = (
 # potential differences, which we want to ignore
 re.compile('(?:'+')|(?:'.join([
 # MAPI port numbers
-r^MAPI  = (.*@.*:\d*|\(monetdb\) /.*\.s\.monetdb\.\d+)$,
+r^MAPI  = 
(.*@.*:\d*|\((monetdb|testuser|(monet|user)_test|my_user2)\) 
/.*\.s\.monetdb\.\d+)$,
 # SPHINX is optional in monetdb5/modules/mal/inspec05
 
r'\[\s+[^]*,\s+(?:command|function|pattern),\s+sphinx,\s+[^]*,\s+[^]*\s+\]',
  ])+')',  re.MULTILINE),
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-08 Thread Fabian Groffen
Changeset: 76a7f6c878e7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76a7f6c878e7
Modified Files:
clients/mapiclient/Makefile.ag
clients/mapiclient/stethoscope.c
gdk/gdk_aggr.c
gdk/gdk_calc.c
monetdb5/modules/kernel/bat5.mal
monetdb5/modules/mal/transaction.mal
monetdb5/optimizer/opt_accumulators.c
monetdb5/optimizer/opt_aliases.c
monetdb5/optimizer/opt_coercion.c
monetdb5/optimizer/opt_commonTerms.c
monetdb5/optimizer/opt_constants.c
monetdb5/optimizer/opt_costModel.c
monetdb5/optimizer/opt_dataflow.c
monetdb5/optimizer/opt_deadcode.c
monetdb5/optimizer/opt_emptySet.c
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_garbageCollector.c
monetdb5/optimizer/opt_groups.c
monetdb5/optimizer/opt_history.c
monetdb5/optimizer/opt_inline.c
monetdb5/optimizer/opt_joinpath.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_origin.c
monetdb5/optimizer/opt_prejoin.c
monetdb5/optimizer/opt_prelude.h
monetdb5/optimizer/opt_reduce.c
monetdb5/optimizer/opt_remap.c
monetdb5/optimizer/opt_wrapper.c

sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err

sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out
sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err
testing/Mfilter.py.in
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 1819 to 300 lines):

diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -42,7 +42,7 @@ bin_stethoscope = {
SOURCES = stethoscope.c
LIBS = libmcutil ../mapilib/libmapi \
../../common/stream/libstream \
-   $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS)
+   $(curl_LIBS) $(MALLOC_LIBS) $(SOCKET_LIBS)
 }
 
 bin_tomograph = {
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -28,9 +28,7 @@
 #include errno.h
 #include signal.h
 #include unistd.h
-#ifdef HAVE_PTHREAD_H
-#include pthread.h
-#endif
+#include mprompt.h
 #include dotmonetdb.h
 
 #ifndef HAVE_GETOPT_LONG
@@ -88,35 +86,15 @@ static struct {
/*  3  */ { 0, 0, 0, 0 }
 };
 
-typedef struct _wthread {
-#if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-   HANDLE id;
-#else
-   pthread_t id;
-#endif
-   int tid;
-   char *uri;
-   char *host;
-   char *dbname;
-   int port;
-   char *user;
-   char *pass;
-   stream *s;
-   size_t argc;
-   char **argv;
-   struct _wthread *next;
-} wthread;
-
-static wthread *thds = NULL;
+static stream *conn = NULL;
 static char hostname[128];
 
 static void
 usage(void)
 {
-   fprintf(stderr, stethoscope [options] +[trace options] 
{mod.fcn}\n);
+   fprintf(stderr, stethoscope [options] [dbname] +[trace options] 
{mod.fcn}\n);
fprintf(stderr,   -d | --dbname=database_name\n);
fprintf(stderr,   -u | --user=user\n);
-   fprintf(stderr,   -P | --password=password\n);
fprintf(stderr,   -p | --port=portnr\n);
fprintf(stderr,   -h | --host=hostname\n);
fprintf(stderr,   -? | --help\n);
@@ -148,13 +126,9 @@ usage(void)
 static void
 stopListening(int i)
 {
-   wthread *walk;
(void)i;
-   /* kill all connections */
-   for (walk = thds; walk != NULL; walk = walk-next) {
-   if (walk-s != NULL)
-   mnstr_close(walk-s);
-   }
+   if (conn != NULL)
+   mnstr_close(conn);
 }
 
 static int
@@ -174,193 +148,34 @@ setCounter(char *nme)
 
 #define die(dbh, hdl) while (1) {(hdl ? mapi_explain_query(hdl, stderr) :  \
   dbh ? mapi_explain(dbh, stderr) :
\
-  fprintf(stderr, !! %scommand 
failed\n, id)); \
+  fprintf(stderr, !! command 
failed\n)); \
   goto stop_disconnect;}
 #define doQ(X) \
if ((hdl = mapi_query(dbh, X)) == NULL || mapi_error(dbh) != MOK) \
 die(dbh, hdl);
 
-#if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-static DWORD WINAPI
-#else
-static void *
-#endif
-doProfile(void *d)
+int
+main(int argc, char **argv)
 {
-   wthread *wthr = (wthread*)d;
-   int i;
-   size_t a;
+   int i, k;
ssize_t n;
+   char *e;
+   char *host = NULL;
+   int portnr = 0;
+   char *dbname = NULL;
+   char *uri = NULL;
+   char *user = NULL;
+   char 

MonetDB: Feb2013 - dotmonetdb: don't support passwd

2012-12-08 Thread Fabian Groffen
Changeset: c1f634d9db8c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c1f634d9db8c
Modified Files:
clients/mapiclient/dotmonetdb.c
Branch: Feb2013
Log Message:

dotmonetdb: don't support passwd

The purposely only option for it ever documented is password, so no
need to check for more than that.


diffs (12 lines):

diff --git a/clients/mapiclient/dotmonetdb.c b/clients/mapiclient/dotmonetdb.c
--- a/clients/mapiclient/dotmonetdb.c
+++ b/clients/mapiclient/dotmonetdb.c
@@ -95,7 +95,7 @@ parse_dotmonetdb(char **user, char **pas
if (user)
*user = strdup(q);
q = NULL;
-   } else if (strcmp(buf, password) == 0 || strcmp(buf, 
passwd) == 0) {
+   } else if (strcmp(buf, password) == 0) == 0) {
if (passwd)
*passwd = strdup(q);
q = NULL;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - dotmonetdb: fix c1f634d9db8c

2012-12-08 Thread Fabian Groffen
Changeset: 6b03b77b7d44 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b03b77b7d44
Modified Files:
clients/mapiclient/dotmonetdb.c
Branch: Feb2013
Log Message:

dotmonetdb: fix c1f634d9db8c


diffs (12 lines):

diff --git a/clients/mapiclient/dotmonetdb.c b/clients/mapiclient/dotmonetdb.c
--- a/clients/mapiclient/dotmonetdb.c
+++ b/clients/mapiclient/dotmonetdb.c
@@ -95,7 +95,7 @@ parse_dotmonetdb(char **user, char **pas
if (user)
*user = strdup(q);
q = NULL;
-   } else if (strcmp(buf, password) == 0) == 0) {
+   } else if (strcmp(buf, password) == 0) {
if (passwd)
*passwd = strdup(q);
q = NULL;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - tomograph: indent (for a start)

2012-12-08 Thread Fabian Groffen
Changeset: 2a0a7d88af73 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2a0a7d88af73
Modified Files:
clients/mapiclient/tomograph.c
Branch: Feb2013
Log Message:

tomograph: indent (for a start)


diffs (truncated from 1973 to 300 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -64,7 +64,8 @@ static struct {
char *ptag; /* which profiler group counter is needed */
char *name; /* which logical counter is needed */
int status; /* trace it or not */
-} profileCounter[] = {
+}
+profileCounter[] = {
/*  0  */ { 'a', aggregate, total count, 0 },
/*  1  */ { 'a', aggregate, total ticks, 0 },
/*  2  */ { 'e', event, event id, 0 },
@@ -76,7 +77,7 @@ static struct {
/*  8  */ { 'c', cpu, cutime, 0 },
/*  9  */ { 'c', cpu, stime, 0 },
/*  0  */ { 'c', cpu, cstime, 0 },
-   /*  1  */ { 'm', memory, arena, 0 },/* memory details are ignored*/
+   /*  1  */ { 'm', memory, arena, 0 }, /* memory details are ignored*/
/*  2  */ { 'm', memory, ordblks, 0 },
/*  3  */ { 'm', memory, smblks, 0 },
/*  4  */ { 'm', memory, hblkhd, 0 },
@@ -126,16 +127,16 @@ typedef struct _wthread {
 
 static wthread *thds = NULL;
 static char hostname[128];
-static char *filename=tomograph;
-static char *tracefile=0;
-static long startrange=0, endrange= 0;
-static char *title =0;
+static char *filename = tomograph;
+static char *tracefile = 0;
+static long startrange = 0, endrange = 0;
+static char *title = 0;
 static int debug = 0;
 static int colormap = 0;
-static int beat= 50;
+static int beat = 50;
 static char *sqlstatement = NULL;
 static int batch = 1; /* number of queries to combine in one run */
-static long maxio=0;
+static long maxio = 0;
 static int cpus = 0;
 
 static FILE *gnudata;
@@ -162,16 +163,16 @@ usage(void)
 }
 
 
-#define die(dbh, hdl) while (1) {(hdl ? mapi_explain_query(hdl, stderr) :  \
-  dbh ? mapi_explain(dbh, stderr) :
\
-  fprintf(stderr, !! %scommand 
failed\n, id)); \
-  goto stop_disconnect;}
+#define die(dbh, hdl) while (1) { (hdl ? mapi_explain_query(hdl, stderr) : 
\
+  dbh ? 
mapi_explain(dbh, stderr) :\
+  
fprintf(stderr, !! %scommand failed\n, id)); \
+ goto 
stop_disconnect; }
 #define doQ(X) \
-   if ((wthr-hdl = mapi_query(wthr-dbh, X)) == NULL || 
mapi_error(wthr-dbh) != MOK) \
-die(wthr-dbh, wthr-hdl);
+   if ((wthr-hdl = mapi_query(wthr-dbh, X)) == NULL || 
mapi_error(wthr-dbh) != MOK) \
+   die(wthr-dbh, wthr-hdl);
 #define doQsql(X) \
if ((hdlsql = mapi_query(dbhsql, X)) == NULL || mapi_error(dbhsql) != 
MOK) \
-die(dbhsql, hdlsql);
+   die(dbhsql, hdlsql);
 
 
 /* Any signal should be captured and turned into a graceful
@@ -179,20 +180,22 @@ usage(void)
 static void createTomogram(void);
 
 static int activated = 0;
-static void deactivateBeat(void){
+static void deactivateBeat(void)
+{
wthread *wthr;
-   char *id =deactivateBeat;
-   if ( activated == 0)
+   char *id = deactivateBeat;
+   if (activated == 0)
return;
activated = 0;
-   if ( debug)
-   fprintf(stderr,Deactivate beat\n);
+   if (debug)
+   fprintf(stderr, Deactivate beat\n);
/* deactivate all connections  */
-   for (wthr = thds; wthr != NULL; wthr = wthr-next) 
-   if (wthr-dbh ){
-   doQ(profiler.deactivate(\ping\);\n);
-   doQ(profiler.stop(););
-   }
+   for (wthr = thds; wthr != NULL; wthr = wthr-next)
+   if (wthr-dbh) {
+   doQ(profiler.deactivate(\ping\);\n);
+   doQ(profiler.stop(););
+   }
+
return;
 stop_disconnect:
;
@@ -202,14 +205,14 @@ static void
 stopListening(int i)
 {
wthread *walk;
-   (void)i;
-   if ( debug) 
-   fprintf(stderr,Interrupt received\n);
+   (void) i;
+   if (debug)
+   fprintf(stderr, Interrupt received\n);
batch = 0;
deactivateBeat();
/* kill all connections  */
for (walk = thds; walk != NULL; walk = walk-next) {
-   if (walk-s != NULL){
+   if (walk-s != NULL) {
mnstr_close(walk-s);
}
}
@@ -231,25 +234,27 @@ setCounter(char *nme)
return k;
 }
 
-static void activateBeat(void){
+static void activateBeat(void)
+{
char buf[BUFSIZ];
-   char *id 

MonetDB: Feb2013 - tomograph: use same username/password handlin...

2012-12-08 Thread Fabian Groffen
Changeset: d4639facb9cb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d4639facb9cb
Modified Files:
clients/mapiclient/tomograph.c
Branch: Feb2013
Log Message:

tomograph: use same username/password handling as mclient


diffs (73 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -34,6 +34,7 @@
 #ifdef HAVE_LIMITS_H
 #include limits.h
 #endif
+#include mprompt.h
 #include dotmonetdb.h
 
 #ifndef HAVE_GETOPT_LONG
@@ -1518,15 +1519,12 @@ main(int argc, char **argv)
char *user = NULL;
char *password = NULL;
 
-   /* some .monetdb properties are used by mclient, perhaps we need them 
as well later */
-
char **alts, **oalts;
wthread *walk;
 
-   static struct option long_options[18] = {
+   static struct option long_options[15] = {
{ dbname, 1, 0, 'd' },
{ user, 1, 0, 'u' },
-   { password, 1, 0, 'P' },
{ port, 1, 0, 'p' },
{ host, 1, 0, 'h' },
{ help, 0, 0, '?' },
@@ -1549,7 +1547,7 @@ main(int argc, char **argv)
 
while (1) {
int option_index = 0;
-   int c = getopt_long(argc, argv, d:u:P:p:h:?T:t:r:o:Db:B:s:m,
+   int c = getopt_long(argc, argv, d:u:p:h:?T:t:r:o:Db:B:s:m,
long_options, option_index);
if (c == -1)
break;
@@ -1570,6 +1568,10 @@ main(int argc, char **argv)
if (user)
free(user);
user = optarg;
+   /* force password prompt */
+   if (password)
+   free(password);
+   password = NULL;
break;
case 'm':
colormap = 1;
@@ -1634,6 +1636,11 @@ main(int argc, char **argv)
}
}
 
+   if (user == NULL)
+   user = simple_prompt(user, BUFSIZ, 1, prompt_getlogin());
+   if (password == NULL)
+   password = simple_prompt(password, BUFSIZ, 0, NULL);
+
if (tracefile) {
/* reload existing tomogram */
scandata(tracefile);
@@ -1658,12 +1665,6 @@ main(int argc, char **argv)
profileCounter[4].status = k;
}
 
-   if (user == NULL || password == NULL) {
-   fprintf(stderr, %s: need -u and -P arguments\n, argv[0]);
-   usage();
-   exit(-1);
-   }
-
 #ifdef SIGPIPE
signal(SIGPIPE, stopListening);
 #endif
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - tomograph: remove multi-server monitoring beh...

2012-12-08 Thread Fabian Groffen
Changeset: 024191fb8a62 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=024191fb8a62
Modified Files:
clients/mapiclient/tomograph.c
Branch: Feb2013
Log Message:

tomograph: remove multi-server monitoring behaviour


diffs (106 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1683,79 +1683,32 @@ main(int argc, char **argv)
/* our hostname, how remote servers have to contact us */
gethostname(hostname, sizeof(hostname));
 
-   /* try and find multiple options, we assume that we always need a
-* local merovingian for that, in the future we probably need to fix
-* this in a decent manner */
-   if (dbname != NULL  host == NULL) {
-   oalts = alts = mapi_resolve(host, portnr, dbname);
-   } else
-   alts = NULL;
-
-   if (alts == NULL || *alts == NULL) {
-   /* nothing to redirect, so a single db to try */
-   walk = thds = malloc(sizeof(wthread));
-   walk-uri = NULL;
-   walk-host = host;
-   walk-port = portnr;
-   walk-dbname = dbname;
-   walk-user = user;
-   walk-pass = password;
-   walk-argc = argc - a;
-   walk-argv = argv[a];
-   walk-tid = 0;
-   walk-s = NULL;
-   walk-next = NULL;
-   /* In principle we could do this without a thread, but it seems
-* that if we do it that way, ctrl-c (or any other signal)
-* doesn't interrupt the read inside this function, and hence
-* the function never terminates... at least on Linux */
+   /* nothing to redirect, so a single db to try */
+   walk = thds = malloc(sizeof(wthread));
+   walk-uri = NULL;
+   walk-host = host;
+   walk-port = portnr;
+   walk-dbname = dbname;
+   walk-user = user;
+   walk-pass = password;
+   walk-argc = argc - a;
+   walk-argv = argv[a];
+   walk-tid = 0;
+   walk-s = NULL;
+   walk-next = NULL;
+   /* In principle we could do this without a thread, but it seems
+* that if we do it that way, ctrl-c (or any other signal)
+* doesn't interrupt the read inside this function, and hence
+* the function never terminates... at least on Linux */
 #if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-   walk-id = CreateThread(NULL, 0, doProfile, walk, 0, NULL);
-   WaitForSingleObject(walk-id, INFINITE);
-   CloseHandle(walk-id);
+   walk-id = CreateThread(NULL, 0, doProfile, walk, 0, NULL);
+   WaitForSingleObject(walk-id, INFINITE);
+   CloseHandle(walk-id);
 #else
-   pthread_create(walk-id, NULL, doProfile, walk);
-   pthread_join(walk-id, NULL);
+   pthread_create(walk-id, NULL, doProfile, walk);
+   pthread_join(walk-id, NULL);
 #endif
-   free(walk);
-   } else {
-   /* fork runner threads for all alternatives */
-   i = 1;
-   walk = thds = malloc(sizeof(wthread));
-   while (1) {
-   walk-tid = i++;
-   walk-uri = *alts;
-   walk-host = NULL;
-   walk-port = 0;
-   walk-dbname = NULL;
-   walk-user = user;
-   walk-pass = password;
-   walk-argc = argc - a;
-   walk-argv = argv[a];
-   walk-s = NULL;
-#if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-   walk-id = CreateThread(NULL, 0, doProfile, walk, 0, 
NULL);
-#else
-   pthread_create(walk-id, NULL, doProfile, walk);
-#endif
-   alts++;
-   if (*alts == NULL)
-   break;
-   walk = walk-next = malloc(sizeof(wthread));
-   }
-   walk-next = NULL;
-   free(oalts);
-   for (walk = thds; walk != NULL; walk = walk-next) {
-#if !defined(HAVE_PTHREAD_H)  defined(_MSC_VER)
-   WaitForSingleObject(walk-id, INFINITE);
-   CloseHandle(walk-id);
-#else
-   pthread_join(walk-id, NULL);
-#endif
-   free(walk-uri);
-   free(walk);
-   }
-   }
+   free(walk);
free(user);
free(password);
return 0;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - tomograph: accept first non-option argument a...

2012-12-08 Thread Fabian Groffen
Changeset: 5a1b55f4e88a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a1b55f4e88a
Modified Files:
clients/mapiclient/tomograph.c
Branch: Feb2013
Log Message:

tomograph: accept first non-option argument as dbname or uri


diffs (84 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1512,14 +1512,15 @@ int
 main(int argc, char **argv)
 {
int a = 1;
-   int i, k = 0;
+   int k = 0;
char *host = NULL;
int portnr = 0;
char *dbname = NULL;
+   char *uri = NULL;
char *user = NULL;
char *password = NULL;
+   struct stat statb;
 
-   char **alts, **oalts;
wthread *walk;
 
static struct option long_options[15] = {
@@ -1636,10 +1637,24 @@ main(int argc, char **argv)
}
}
 
-   if (user == NULL)
-   user = simple_prompt(user, BUFSIZ, 1, prompt_getlogin());
-   if (password == NULL)
-   password = simple_prompt(password, BUFSIZ, 0, NULL);
+   if (dbname == NULL  optind != argc  argv[optind][0] != '+' 
+   (stat(argv[optind], statb) != 0 || 
!S_ISREG(statb.st_mode)))
+   {
+   dbname = argv[optind];
+   optind++;
+   }
+
+   if (dbname != NULL  strncmp(dbname, mapi:monetdb://, 15) == 0) {
+   uri = dbname;
+   dbname = NULL;
+   }
+
+   a = optind;
+   if (argc  1  a  argc  argv[a][0] == '+') {
+   k = setCounter(argv[a] + 1);
+   a++;
+   } else
+   k = setCounter(COUNTERSDEFAULT);
 
if (tracefile) {
/* reload existing tomogram */
@@ -1652,12 +1667,6 @@ main(int argc, char **argv)
printf(Color map file '%s.gpl' generated\n, filename);
exit(0);
}
-   a = optind;
-   if (argc  1  a  argc  argv[a][0] == '+') {
-   k = setCounter(argv[a] + 1);
-   a++;
-   } else
-   k = setCounter(COUNTERSDEFAULT);
 
/* DOT needs function id and PC to correlate */
if (profileCounter[32].status) {
@@ -1665,6 +1674,11 @@ main(int argc, char **argv)
profileCounter[4].status = k;
}
 
+   if (user == NULL)
+   user = simple_prompt(user, BUFSIZ, 1, prompt_getlogin());
+   if (password == NULL)
+   password = simple_prompt(password, BUFSIZ, 0, NULL);
+
 #ifdef SIGPIPE
signal(SIGPIPE, stopListening);
 #endif
@@ -1685,7 +1699,7 @@ main(int argc, char **argv)
 
/* nothing to redirect, so a single db to try */
walk = thds = malloc(sizeof(wthread));
-   walk-uri = NULL;
+   walk-uri = uri;
walk-host = host;
walk-port = portnr;
walk-dbname = dbname;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - tomograph: initialise full wthread, avoids cr...

2012-12-08 Thread Fabian Groffen
Changeset: eb672f05014f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eb672f05014f
Modified Files:
clients/mapiclient/tomograph.c
Branch: Feb2013
Log Message:

tomograph: initialise full wthread, avoids crash lateron


diffs (12 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1710,6 +1710,8 @@ main(int argc, char **argv)
walk-tid = 0;
walk-s = NULL;
walk-next = NULL;
+   walk-dbh = NULL;
+   walk-hdl = NULL;
/* In principle we could do this without a thread, but it seems
 * that if we do it that way, ctrl-c (or any other signal)
 * doesn't interrupt the read inside this function, and hence
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-08 Thread Fabian Groffen
Changeset: 1d2192d211bc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d2192d211bc
Modified Files:
clients/mapiclient/dotmonetdb.c
clients/mapiclient/tomograph.c
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 2123 to 300 lines):

diff --git a/clients/mapiclient/dotmonetdb.c b/clients/mapiclient/dotmonetdb.c
--- a/clients/mapiclient/dotmonetdb.c
+++ b/clients/mapiclient/dotmonetdb.c
@@ -95,7 +95,7 @@ parse_dotmonetdb(char **user, char **pas
if (user)
*user = strdup(q);
q = NULL;
-   } else if (strcmp(buf, password) == 0 || strcmp(buf, 
passwd) == 0) {
+   } else if (strcmp(buf, password) == 0) {
if (passwd)
*passwd = strdup(q);
q = NULL;
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -34,6 +34,7 @@
 #ifdef HAVE_LIMITS_H
 #include limits.h
 #endif
+#include mprompt.h
 #include dotmonetdb.h
 
 #ifndef HAVE_GETOPT_LONG
@@ -64,7 +65,8 @@ static struct {
char *ptag; /* which profiler group counter is needed */
char *name; /* which logical counter is needed */
int status; /* trace it or not */
-} profileCounter[] = {
+}
+profileCounter[] = {
/*  0  */ { 'a', aggregate, total count, 0 },
/*  1  */ { 'a', aggregate, total ticks, 0 },
/*  2  */ { 'e', event, event id, 0 },
@@ -76,7 +78,7 @@ static struct {
/*  8  */ { 'c', cpu, cutime, 0 },
/*  9  */ { 'c', cpu, stime, 0 },
/*  0  */ { 'c', cpu, cstime, 0 },
-   /*  1  */ { 'm', memory, arena, 0 },/* memory details are ignored*/
+   /*  1  */ { 'm', memory, arena, 0 }, /* memory details are ignored*/
/*  2  */ { 'm', memory, ordblks, 0 },
/*  3  */ { 'm', memory, smblks, 0 },
/*  4  */ { 'm', memory, hblkhd, 0 },
@@ -126,16 +128,16 @@ typedef struct _wthread {
 
 static wthread *thds = NULL;
 static char hostname[128];
-static char *filename=tomograph;
-static char *tracefile=0;
-static long startrange=0, endrange= 0;
-static char *title =0;
+static char *filename = tomograph;
+static char *tracefile = 0;
+static long startrange = 0, endrange = 0;
+static char *title = 0;
 static int debug = 0;
 static int colormap = 0;
-static int beat= 50;
+static int beat = 50;
 static char *sqlstatement = NULL;
 static int batch = 1; /* number of queries to combine in one run */
-static long maxio=0;
+static long maxio = 0;
 static int cpus = 0;
 
 static FILE *gnudata;
@@ -162,16 +164,16 @@ usage(void)
 }
 
 
-#define die(dbh, hdl) while (1) {(hdl ? mapi_explain_query(hdl, stderr) :  \
-  dbh ? mapi_explain(dbh, stderr) :
\
-  fprintf(stderr, !! %scommand 
failed\n, id)); \
-  goto stop_disconnect;}
+#define die(dbh, hdl) while (1) { (hdl ? mapi_explain_query(hdl, stderr) : 
\
+  dbh ? 
mapi_explain(dbh, stderr) :\
+  
fprintf(stderr, !! %scommand failed\n, id)); \
+ goto 
stop_disconnect; }
 #define doQ(X) \
-   if ((wthr-hdl = mapi_query(wthr-dbh, X)) == NULL || 
mapi_error(wthr-dbh) != MOK) \
-die(wthr-dbh, wthr-hdl);
+   if ((wthr-hdl = mapi_query(wthr-dbh, X)) == NULL || 
mapi_error(wthr-dbh) != MOK) \
+   die(wthr-dbh, wthr-hdl);
 #define doQsql(X) \
if ((hdlsql = mapi_query(dbhsql, X)) == NULL || mapi_error(dbhsql) != 
MOK) \
-die(dbhsql, hdlsql);
+   die(dbhsql, hdlsql);
 
 
 /* Any signal should be captured and turned into a graceful
@@ -179,20 +181,22 @@ usage(void)
 static void createTomogram(void);
 
 static int activated = 0;
-static void deactivateBeat(void){
+static void deactivateBeat(void)
+{
wthread *wthr;
-   char *id =deactivateBeat;
-   if ( activated == 0)
+   char *id = deactivateBeat;
+   if (activated == 0)
return;
activated = 0;
-   if ( debug)
-   fprintf(stderr,Deactivate beat\n);
+   if (debug)
+   fprintf(stderr, Deactivate beat\n);
/* deactivate all connections  */
-   for (wthr = thds; wthr != NULL; wthr = wthr-next) 
-   if (wthr-dbh ){
-   doQ(profiler.deactivate(\ping\);\n);
-   doQ(profiler.stop(););
-   }
+   for (wthr = thds; wthr != NULL; wthr = wthr-next)
+   if (wthr-dbh) {
+   doQ(profiler.deactivate(\ping\);\n);
+  

MonetDB: default - tomograph: indent to aboid future merge confl...

2012-12-08 Thread Fabian Groffen
Changeset: e85f39f968bd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e85f39f968bd
Modified Files:
clients/mapiclient/tomograph.c
Branch: default
Log Message:

tomograph: indent to aboid future merge conflicts with Feb2013


diffs (112 lines):

diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -197,6 +197,7 @@ static void deactivateBeat(void)
doQ(profiler.stop(););
}
 
+
return;
 stop_disconnect:
;
@@ -253,6 +254,7 @@ static void activateBeat(void)
doQ(buf);
}
 
+
return;
 stop_disconnect:
if (wthr) {
@@ -618,6 +620,7 @@ static void dumpboxes(void)
}
}
 
+
if (f)
(void) fclose(f);
if (fcpu)
@@ -644,6 +647,7 @@ static void showmemory(void)
}
 
 
+
fprintf(gnudata, \nset tmarg 1\n);
fprintf(gnudata, set bmarg 1\n);
fprintf(gnudata, set lmarg 10\n);
@@ -703,6 +707,7 @@ static void showio(void)
}
 
 
+
fprintf(gnudata, \nset tmarg 1\n);
fprintf(gnudata, set bmarg 1\n);
fprintf(gnudata, set lmarg 10\n);
@@ -792,6 +797,7 @@ static void showcolormap(char *filename,
k++;
}
 
+
h -= 45;
fprintf(f, set label %d \ %ld MAL instructions executed\ at %d,%d\n,
object++, totfreq, (int) (0.2 * w), h - 35);
@@ -808,16 +814,18 @@ static void updmap(int idx)
if (fcn) {
*fcn = 0;
fcn++;
-   } else fcn = *;
-   for ( i =0; colors[i].col; i++)
-   if ( mod  strcmp(mod,colors[i].mod)== 0) {
-   if (strcmp(fcn,colors[i].fcn) == 0 ){
-   fnd = i;
-   break;
+   } else
+   fcn = *;
+   for (i = 0; colors[i].col; i++)
+   if (mod  strcmp(mod, colors[i].mod) == 0) {
+   if (strcmp(fcn, colors[i].fcn) == 0) {
+   fnd = i;
+   break;
+   }
}
-   } 
-   if ( colors[i].col == 0 )
-   fnd = i-1;
+
+   if (colors[i].col == 0)
+   fnd = i - 1;
colors[fnd].freq++;
colors[fnd].timeused += box[idx].clkend - box[idx].clkstart;
box[idx].color = fnd;
@@ -848,6 +856,7 @@ static void keepdata(char *filename)
fprintf(f, %s\n, box[i].fcn);
}
 
+
(void) fclose(f);
 }
 
@@ -973,6 +982,7 @@ static void createTomogram(void)
}
 
 
+
height = top * 20;
fprintf(gnudata, set yrange [0:%d]\n, height);
fprintf(gnudata, set ylabel \threads\\n);
@@ -1027,6 +1037,7 @@ static void createTomogram(void)
object++, box[i].clkstart, box[i].row * 
2 * h, box[i].clkend, box[i].row * 2 * h + h, colors[box[i].color].col);
}
 
+
fprintf(gnudata, plot 0 notitle with lines\n);
fprintf(gnudata, unset for[i=%d:%d] object i\n, prevobject, object - 
1);
prevobject = object - 1;
@@ -1635,7 +1646,7 @@ main(int argc, char **argv)
}
 
if (dbname == NULL  optind != argc  argv[optind][0] != '+' 
-   (stat(argv[optind], statb) != 0 || 
!S_ISREG(statb.st_mode)))
+   (stat(argv[optind], statb) != 0 || !S_ISREG(statb.st_mode)))
{
dbname = argv[optind];
optind++;
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - Mtest: add TODO

2012-12-06 Thread Fabian Groffen
Changeset: ec778d249b78 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec778d249b78
Modified Files:
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest: add TODO


diffs (11 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -30,6 +30,7 @@
 #   contains(file,string)
 # - do multi-level prompting?
 # - normalize all path's used
+# - Python 3? (or do a full rewrite?)
 
 try:
 True
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - Mtest: update monetdb-jdbc match for current ...

2012-12-06 Thread Fabian Groffen
Changeset: 3dfcd6783061 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3dfcd6783061
Modified Files:
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest: update monetdb-jdbc match for current testweb modifications


diffs (12 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2986,7 +2986,7 @@ def CheckClassPath() :
 cp = ''
 cpx = ''
 JARS = {
-'HAVE_MONETDBJDBC_JAR' : 
re.compile('^monetdb-jdbc-[0-9]\.[0-9]+\.jar$'),
+'HAVE_MONETDBJDBC_JAR' : 
re.compile('^monetdb-jdbc-[0-9]\.[0-9]+(-[a-f0-9]{12})?\.jar$'),
 'HAVE_JDBCCLIENT_JAR'  : re.compile('^jdbcclient\.jar$'),
 'HAVE_JDBCTESTS_JAR'   : re.compile('^jdbctests\.jar$'),
 }
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - Mtest: use UNIX socket when the platform is c...

2012-12-06 Thread Fabian Groffen
Changeset: 5189b769500c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5189b769500c
Modified Files:
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest: use UNIX socket when the platform is capable

Try to avoid our socket-spam a bit for the faster platforms we have in
use.  On those we see socket bind problems, and a very large amount of
TIME_WAIT connections.  By using a UNIX socket connection we half this,
since only the server sets up the connection, but the client no longer
uses it.  Reason to still setup the socket is for python/java/etc
applications.

Refinement would be to actually not setup the TCP socket when we know
we're running an mclient test (we do know that), however that requires
some more efforts.  Let's first see if this does the trick already.


diffs (42 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3144,6 +3144,15 @@ if sys.platform == 'linux2' and CONDITIO
 HOST = WINE
 RELEASE = 5.2
 
+# see if we can use UNIX sockets
+SOCK = False
+try:
+server = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
+SOCK = True
+except socket.error, (Serrno,Serrstr):
+# apparently not
+pass
+
 if SYST == Linux:
 #  Please keep this aligned / in sync with configure.ag !
 LINUX_DIST=''
@@ -3723,12 +3732,20 @@ def main(argv) :
 # if no revision known, can't refer to repository
 URLPREFIX = None
 
+global SOCK
+if SOCK:
+SOCK = --set mapi_usock=%s/.s.monetdb.%s % \
+(env['GDK_DBFARM'], env['MAPIPORT'])
+HOST = env['GDK_DBFARM']
+else:
+SOCK = 
+
 # check for executables, set their standard options and export them
 if THISFILE == Mtest.py:
 exe = {}
 exe['Mtimeout']  = CheckExec('Mtimeout') , 'Mtimeout -timeout 
%d ' % par['TIMEOUT']
-exe['Mserver']   = CheckExec('mserver5') , '%s mserver5 %s 
--debug=%s --set gdk_nr_threads=%s %s %s --set mapi_open=true --set 
mapi_port=%s --set monet_prompt= --trace --forcemito --set mal_listing=2 %s' % \
-   (env['setDBG'], 
config, env['GDK_DEBUG'], env['GDK_NR_THREADS'], env['setMONETDB_MOD_PATH'], 
env['setGDK_DBFARM'], env['MAPIPORT'], env['MSERVER_SET'])
+exe['Mserver']   = CheckExec('mserver5') , '%s mserver5 %s 
--debug=%s --set gdk_nr_threads=%s %s %s --set mapi_open=true --set 
mapi_port=%s %s --set monet_prompt= --trace --forcemito --set mal_listing=2 %s' 
% \
+   (env['setDBG'], 
config, env['GDK_DEBUG'], env['GDK_NR_THREADS'], env['setMONETDB_MOD_PATH'], 
env['setGDK_DBFARM'], env['MAPIPORT'], SOCK, env['MSERVER_SET'])
 exe['Mdiff'] = CheckExec('Mdiff'), 'Mdiff'
 exe['python']= CheckExec(sys.executable) , sys.executable
 exe['MAL_Client']= CheckExec(env['MALCLIENT'].split(None, 1)[0])  
, '%s -i -e --host=%s --port=%s' % (env['MALCLIENT'], HOST, env['MAPIPORT'])
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-06 Thread Fabian Groffen
Changeset: 1f05f3d940b6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1f05f3d940b6
Modified Files:
monetdb5/mal/mal_dataflow.c
testing/Mtest.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (112 lines):

diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -594,6 +594,7 @@ runMALdataflow(Client cntxt, MalBlkPtr m
 
flow-status = (FlowEvent)GDKzalloc((stoppc - startpc + 1) * 
sizeof(FlowEventRec));
size = DFLOWgraphSize(mb, startpc, stoppc);
+   size += stoppc - startpc;
flow-nodes = (int*)GDKzalloc(sizeof(int) * size);
flow-edges = (int*)GDKzalloc(sizeof(int) * size);
DFLOWinitBlk(flow, mb, size);
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -30,6 +30,7 @@
 #   contains(file,string)
 # - do multi-level prompting?
 # - normalize all path's used
+# - Python 3? (or do a full rewrite?)
 
 try:
 True
@@ -165,24 +166,27 @@ except ImportError:
 os.environ['PYTHONPATH'] = p
 
 ttywidth = 0
-if os.name != 'nt' and isatty and os.isatty(sys.stdin.fileno()):
-try:
-proc = subprocess.Popen(['stty', '-a'], stdout = subprocess.PIPE,
-stderr = subprocess.PIPE)
-except OSError:
-pass
+if isatty and os.isatty(sys.stdin.fileno()):
+if os.name != 'nt':
+ttywidth = 80
 else:
-out, err = proc.communicate()
-res = re.search('columns ([0-9]+)', out)
-if res is not None:
-ttywidth = int(res.group(1))
+try:
+proc = subprocess.Popen(['stty', '-a'], stdout = subprocess.PIPE,
+stderr = subprocess.PIPE)
+except OSError:
+pass
 else:
-res = re.search(' ([0-9]+) columns', out)
+out, err = proc.communicate()
+res = re.search('columns ([0-9]+)', out)
 if res is not None:
 ttywidth = int(res.group(1))
-if ttywidth  60:
-# rediculously narrow tty, ignore value
-ttywidth = 0
+else:
+res = re.search(' ([0-9]+) columns', out)
+if res is not None:
+ttywidth = int(res.group(1))
+if ttywidth  60:
+# rediculously narrow tty, ignore value
+ttywidth = 0
 
 import string   # for whitespace
 def splitcommand(cmd):
@@ -2982,7 +2986,7 @@ def CheckClassPath() :
 cp = ''
 cpx = ''
 JARS = {
-'HAVE_MONETDBJDBC_JAR' : 
re.compile('^monetdb-jdbc-[0-9]\.[0-9]+\.jar$'),
+'HAVE_MONETDBJDBC_JAR' : 
re.compile('^monetdb-jdbc-[0-9]\.[0-9]+(-[a-f0-9]{12})?\.jar$'),
 'HAVE_JDBCCLIENT_JAR'  : re.compile('^jdbcclient\.jar$'),
 'HAVE_JDBCTESTS_JAR'   : re.compile('^jdbctests\.jar$'),
 }
@@ -3140,6 +3144,15 @@ if sys.platform == 'linux2' and CONDITIO
 HOST = WINE
 RELEASE = 5.2
 
+# see if we can use UNIX sockets
+SOCK = False
+try:
+server = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
+SOCK = True
+except socket.error, (Serrno,Serrstr):
+# apparently not
+pass
+
 if SYST == Linux:
 #  Please keep this aligned / in sync with configure.ag !
 LINUX_DIST=''
@@ -3714,12 +3727,20 @@ def main(argv) :
 # if no revision known, can't refer to repository
 URLPREFIX = None
 
+global SOCK
+if SOCK:
+SOCK = --set mapi_usock=%s/.s.monetdb.%s % \
+(env['GDK_DBFARM'], env['MAPIPORT'])
+HOST = env['GDK_DBFARM']
+else:
+SOCK = 
+
 # check for executables, set their standard options and export them
 if THISFILE == Mtest.py:
 exe = {}
 exe['Mtimeout']  = CheckExec('Mtimeout') , 'Mtimeout -timeout 
%d ' % par['TIMEOUT']
-exe['Mserver']   = CheckExec('mserver5') , '%s mserver5 %s 
--debug=%s --set gdk_nr_threads=%s %s --set mapi_open=true --set mapi_port=%s 
--set monet_prompt= --forcemito --set mal_listing=2 %s' % \
-   (env['setDBG'], 
config, env['GDK_DEBUG'], env['GDK_NR_THREADS'], env['setMONETDB_MOD_PATH'], 
env['MAPIPORT'], env['MSERVER_SET'])
+exe['Mserver']   = CheckExec('mserver5') , '%s mserver5 %s 
--debug=%s --set gdk_nr_threads=%s %s --set mapi_open=true --set mapi_port=%s 
%s --set monet_prompt= --forcemito --set mal_listing=2 %s' % \
+   (env['setDBG'], 
config, env['GDK_DEBUG'], env['GDK_NR_THREADS'], env['setMONETDB_MOD_PATH'], 
env['MAPIPORT'], SOCK, env['MSERVER_SET'])
 exe['Mdiff'] = CheckExec('Mdiff'), 'Mdiff'
 exe['python']= CheckExec(sys.executable) , sys.executable
 exe['MAL_Client']= 

MonetDB: Oct2012 - Mfilter: extend ignore for mapi error origin

2012-12-06 Thread Fabian Groffen
Changeset: 29524eebda19 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=29524eebda19
Modified Files:
testing/Mfilter.py.in
Branch: Oct2012
Log Message:

Mfilter: extend ignore for mapi error origin

now we do UNIX sockets, also ignore those if we see them


diffs (12 lines):

diff --git a/testing/Mfilter.py.in b/testing/Mfilter.py.in
--- a/testing/Mfilter.py.in
+++ b/testing/Mfilter.py.in
@@ -48,7 +48,7 @@ test = (
 # potential differences, which we want to ignore
 re.compile('(?:'+')|(?:'.join([
 # MAPI port numbers
-r^MAPI  = .*@.*:\d*$,
+r^MAPI  = (.*@.*:\d*|\(monetdb\) /.*\.s\.monetdb\.\d+)$,
 # SPHINX is optional in monetdb5/modules/mal/inspec05
 
r'\[\s+[^]*,\s+(?:command|function|pattern),\s+sphinx,\s+[^]*,\s+[^]*\s+\]',
  ])+')',  re.MULTILINE),
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - Mtest: don't use (too) long UNIX paths

2012-12-06 Thread Fabian Groffen
Changeset: 1856dea46ec5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1856dea46ec5
Modified Files:
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest: don't use (too) long UNIX paths

Apparently UNIX sockets are limited in size, more than normal paths, so
we're forced to use a hard-coded short path, /var/tmp/mtest-pid.  We
need to clean it up too.  This solves the very long timeouts of tests
all failing to run.


diffs (38 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3734,9 +3734,17 @@ def main(argv) :
 
 global SOCK, HOST
 if SOCK:
-SOCK = --set mapi_usock=%s/.s.monetdb.%s % \
-(env['GDK_DBFARM'], env['MAPIPORT'])
-HOST = env['GDK_DBFARM']
+# we cannot put the UNIX socket in the mtest root, because that
+# makes the UNIX socket too long on most platforms, so use
+# /var/tmp/mtest and try not to forget to clean that up
+sockdir = /var/tmp/mtest-%d % os.getpid()
+try:
+os.mkdir(sockdir);
+SOCK = --set mapi_usock=%s/.s.monetdb.%s % \
+(sockdir, env['MAPIPORT'])
+HOST = sockdir
+except:
+SOCK = 
 else:
 SOCK = 
 
@@ -4076,6 +4084,13 @@ VALUES (%s, '%s', '%s', '%s',
 if not testweb:
 CreateHtmlIndex(env, *body)
 
+# cleanup the place where we put our UNIX sockets
+if SOCK:
+try:
+shutil.rmtree(sockdir);
+except:
+pass
+
 Failed = 0
 for f in Failure[1:-1]:
 Failed += len(f)
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-06 Thread Fabian Groffen
Changeset: 6df1de2f1ecd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6df1de2f1ecd
Modified Files:
testing/Mfilter.py.in
testing/Mtest.py.in
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (50 lines):

diff --git a/testing/Mfilter.py.in b/testing/Mfilter.py.in
--- a/testing/Mfilter.py.in
+++ b/testing/Mfilter.py.in
@@ -48,7 +48,7 @@ test = (
 # potential differences, which we want to ignore
 re.compile('(?:'+')|(?:'.join([
 # MAPI port numbers
-r^MAPI  = .*@.*:\d*$,
+r^MAPI  = (.*@.*:\d*|\(monetdb\) /.*\.s\.monetdb\.\d+)$,
 # SPHINX is optional in monetdb5/modules/mal/inspec05
 
r'\[\s+[^]*,\s+(?:command|function|pattern),\s+sphinx,\s+[^]*,\s+[^]*\s+\]',
  ])+')',  re.MULTILINE),
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3729,9 +3729,17 @@ def main(argv) :
 
 global SOCK, HOST
 if SOCK:
-SOCK = --set mapi_usock=%s/.s.monetdb.%s % \
-(env['GDK_DBFARM'], env['MAPIPORT'])
-HOST = env['GDK_DBFARM']
+# we cannot put the UNIX socket in the mtest root, because that
+# makes the UNIX socket too long on most platforms, so use
+# /var/tmp/mtest and try not to forget to clean that up
+sockdir = /var/tmp/mtest-%d % os.getpid()
+try:
+os.mkdir(sockdir);
+SOCK = --set mapi_usock=%s/.s.monetdb.%s % \
+(sockdir, env['MAPIPORT'])
+HOST = sockdir
+except:
+SOCK = 
 else:
 SOCK = 
 
@@ -4071,6 +4079,13 @@ VALUES (%s, '%s', '%s', '%s',
 if not testweb:
 CreateHtmlIndex(env, *body)
 
+# cleanup the place where we put our UNIX sockets
+if SOCK:
+try:
+shutil.rmtree(sockdir);
+except:
+pass
+
 Failed = 0
 for f in Failure[1:-1]:
 Failed += len(f)
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - configure: make Python 2 vs Python 3 explicit

2012-12-05 Thread Fabian Groffen
Changeset: c5bf13a351f4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c5bf13a351f4
Modified Files:
configure.ag
Branch: Oct2012
Log Message:

configure: make Python 2 vs Python 3 explicit

Since Python 3 may be the active interpreter (python), instead of Python
2, move away from the assumption that python is Python 2.

Figure out what python is, and then use that when python2 or python3
are absent.  This way we prefer the versioned binaries over the generic
one, which may change over time (e.g. on Gentoo: eselect python ...).


diffs (179 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1099,73 +1099,99 @@ AC_SUBST(PERL)
 AM_CONDITIONAL(HAVE_PERL, test x$have_perl != xno)
 AC_SUBST(PERL_LIBDIR)
 
-have_python=auto
-PYTHON=python
+# check major version of python
+# check if python2 and python3 exist
+# if python2 or python3 doesn't exist, use python if major matches
 
-AC_ARG_WITH(python,
-   AS_HELP_STRING([--with-python=FILE], [python is installed as FILE]),
-   have_python=$withval)
+AC_PATH_PROG(PYTHON,python,no,$PATH)
+PYTHON_MAJ=
+if test x$PYTHON != xno; then
+   AC_MSG_CHECKING([major version of $PYTHON])
+   case `$PYTHON -V 21` in
+   Python 2.[67]*)  # older Pythons don't get Python3 syntax
+   PYTHON_MAJ=2
+   AC_MSG_RESULT([2])
+   ;;
+   Python 3.*)
+   PYTHON_MAJ=3
+   AC_MSG_RESULT([3])
+   ;;
+   *)
+   AC_MSG_ERROR([unknown Python version])
+   ;;
+   esac
+fi
 
-case $have_python in
+
+have_python2=auto
+PYTHON2=python2
+
+AC_ARG_WITH(python2,
+   AS_HELP_STRING([--with-python2=FILE], [python2 is installed as FILE]),
+   have_python2=$withval)
+
+case $have_python2 in
yes|no|auto) ;;
*)
-   PYTHON=$have_python
-   have_python=yes
+   PYTHON2=$have_python
;;
 esac
 
-if test x$have_python != xno; then
+if test x$have_python2 != xno; then
if test x$cross_compiling != xyes; then
-   AC_PATH_PROG(PYTHON,$PYTHON,no,$PATH)
-   if test x$PYTHON = xno; then
-   if test x$have_python != xauto; then
-   AC_MSG_ERROR([No Python executable found])
+   AC_PATH_PROG(PYTHON2,$PYTHON2,no,$PATH)
+   if test x$PYTHON2 = xno; then
+   if ( test x$have_python2 = xyes || test 
x$have_python2 = xauto )  test x$PYTHON_MAJ = 2; then
+   PYTHON2=$PYTHON
+   have_python2=yes
+   elif test x$have_python2 != xauto; then
+   AC_MSG_ERROR([Python 2 executable not found])
fi
-   have_python=no
+   have_python2=no
fi
fi
 fi
 
-if test x$have_python != xno; then
-   have_python_libdir=auto
+if test x$have_python2 != xno; then
+   have_python2_libdir=auto
 
-   AC_ARG_WITH(python-libdir,
-   AS_HELP_STRING([--with-python-libdir=DIR],
-   [relative path for Python library directory (where 
Python modules should be installed)]),
-   have_python_libdir=$withval)
+   AC_ARG_WITH(python2-libdir,
+   AS_HELP_STRING([--with-python2-libdir=DIR],
+   [relative path for Python 2 library directory (where 
Python 2 modules should be installed)]),
+   have_python2_libdir=$withval)
 
-   case $have_python_libdir in
+   case $have_python2_libdir in
yes|auto)
if test x$cross_compiling = xyes; then
-   AC_MSG_ERROR([Must specify --with-python-libdir 
when cross compiling])
+   AC_MSG_ERROR([Must specify 
--with-python2-libdir when cross compiling])
fi
-   case $host_os-`$PYTHON -V 21` in
+   case $host_os-`$PYTHON2 -V 21` in
darwin9*-*2.5.1)
-   PYTHON_LIBDIR=`$PYTHON -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,)' 
2/dev/null`/site-packages;;
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,)' 
2/dev/null`/site-packages;;
*)
-   PYTHON_LIBDIR=`$PYTHON -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,)' 
2/dev/null`;;
+   PYTHON2_LIBDIR=`$PYTHON2 -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,)' 
2/dev/null`;;
esac
   

MonetDB: Oct2012 - Mtest: require Python 2

2012-12-05 Thread Fabian Groffen
Changeset: 28aba19be2a4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=28aba19be2a4
Modified Files:
configure.ag
testing/Mfilter.py.in
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Mtest: require Python 2

Mtest and Mfilter are too large to just fix for Python 3.  For the time
being just use Python 2 for them.  This means, if we don't have Python 2
(technically possible now autogen runs fine with Python 3) we can't
install testing.


diffs (35 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1258,6 +1258,13 @@ AC_SUBST(PYTHON3)
 AM_CONDITIONAL(HAVE_PYTHON3, test x$have_python3 != xno)
 AC_SUBST(PYTHON3_LIBDIR)
 
+# Mtest/Mfilter currently require Python 2
+if test x$enable_testing != xno ; then
+   if test x$PYTHON2 = xfalse ; then
+   enable_testing = no
+   fi
+fi
+
 RUBY=ruby
 have_rubygem_dir=auto
 AC_ARG_WITH(rubygem-dir,
diff --git a/testing/Mfilter.py.in b/testing/Mfilter.py.in
--- a/testing/Mfilter.py.in
+++ b/testing/Mfilter.py.in
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!@PYTHON2@
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!@PYTHON2@
 
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the License); you may not use this file except in
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - python: use explicit python2 and python3 targets

2012-12-05 Thread Fabian Groffen
Changeset: ce8ee749e18a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce8ee749e18a
Added Files:
clients/python2/MANIFEST.in
clients/python2/Makefile.ag
clients/python2/README.rst
clients/python2/examples/basics.py
clients/python2/examples/mclient.py
clients/python2/examples/perf.py
clients/python2/monetdb/__init__.py
clients/python2/monetdb/exceptions.py
clients/python2/monetdb/mapi.py
clients/python2/monetdb/sql/__init__.py
clients/python2/monetdb/sql/connections.py
clients/python2/monetdb/sql/converters.py
clients/python2/monetdb/sql/cursors.py
clients/python2/monetdb/sql/monetize.py
clients/python2/monetdb/sql/pythonize.py
clients/python2/monetdb/sql/types.py
clients/python2/setup.py
clients/python2/test/capabilities.py
clients/python2/test/dbapi20.py
clients/python2/test/run.sh
clients/python2/test/runtests.py
Removed Files:
clients/python/MANIFEST.in
clients/python/Makefile.ag
clients/python/README.rst
clients/python/examples/basics.py
clients/python/examples/mclient.py
clients/python/examples/perf.py
clients/python/monetdb/__init__.py
clients/python/monetdb/exceptions.py
clients/python/monetdb/mapi.py
clients/python/monetdb/sql/__init__.py
clients/python/monetdb/sql/connections.py
clients/python/monetdb/sql/converters.py
clients/python/monetdb/sql/cursors.py
clients/python/monetdb/sql/monetize.py
clients/python/monetdb/sql/pythonize.py
clients/python/monetdb/sql/types.py
clients/python/setup.py
clients/python/test/capabilities.py
clients/python/test/dbapi20.py
clients/python/test/run.sh
clients/python/test/runtests.py
Modified Files:
buildtools/autogen/autogen/am.py
clients/Makefile.ag
Branch: Oct2012
Log Message:

python: use explicit python2 and python3 targets

Don't assume python is Python 2, but rather make it explicit, such that
we are more flexible.


diffs (108 lines):

diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -1022,8 +1022,8 @@ def am_python_generic(fd, var, python, a
 for pkgdir in sorted(pkgdirs, reverse = True):
 fd.write(\t[ '$(srcdir)' -ef . ] || rm -r '%s'\n % pkgdir)
 
-def am_python(fd, var, python, am):
-am_python_generic(fd, var, python, am, 'PYTHON')
+def am_python2(fd, var, python, am):
+am_python_generic(fd, var, python, am, 'PYTHON2')
 
 def am_python3(fd, var, python3, am):
 am_python_generic(fd, var, python3, am, 'PYTHON3')
@@ -1156,7 +1156,7 @@ output_funcs = {'SUBDIRS': am_subdirs,
 'HEADERS': am_headers,
 'ANT': am_ant,
 'GEM': am_gem,
-'PYTHON': am_python,
+'PYTHON2': am_python2,
 'PYTHON3': am_python3,
 }
 
diff --git a/clients/Makefile.ag b/clients/Makefile.ag
--- a/clients/Makefile.ag
+++ b/clients/Makefile.ag
@@ -15,6 +15,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php 
HAVE_RUBYGEM?ruby examples HAVE_PYTHON?python HAVE_PYTHON3?python3 
NATIVE_WIN32?NT
+SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php 
HAVE_RUBYGEM?ruby examples HAVE_PYTHON2?python2 HAVE_PYTHON3?python3 
NATIVE_WIN32?NT
 
 EXTRA_DIST_DIR = Tests
diff --git a/clients/python/MANIFEST.in b/clients/python2/MANIFEST.in
rename from clients/python/MANIFEST.in
rename to clients/python2/MANIFEST.in
diff --git a/clients/python/Makefile.ag b/clients/python2/Makefile.ag
rename from clients/python/Makefile.ag
rename to clients/python2/Makefile.ag
--- a/clients/python/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -15,7 +15,7 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-python_setup = {
+python2_setup = {
FILES = setup.py
 }
 
diff --git a/clients/python/README.rst b/clients/python2/README.rst
rename from clients/python/README.rst
rename to clients/python2/README.rst
diff --git a/clients/python/examples/basics.py 
b/clients/python2/examples/basics.py
rename from clients/python/examples/basics.py
rename to clients/python2/examples/basics.py
diff --git a/clients/python/examples/mclient.py 
b/clients/python2/examples/mclient.py
rename from clients/python/examples/mclient.py
rename to clients/python2/examples/mclient.py
diff --git a/clients/python/examples/perf.py b/clients/python2/examples/perf.py
rename from clients/python/examples/perf.py
rename to clients/python2/examples/perf.py
diff --git a/clients/python/monetdb/__init__.py 
b/clients/python2/monetdb/__init__.py
rename from clients/python/monetdb/__init__.py
rename to 

MonetDB: Oct2012 - rpm/deb: experimental fix for configure changes

2012-12-05 Thread Fabian Groffen
Changeset: 2d0a7370c4d1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2d0a7370c4d1
Modified Files:
MonetDB.spec
debian/rules
Branch: Oct2012
Log Message:

rpm/deb: experimental fix for configure changes


diffs (38 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -651,7 +651,7 @@ developer, but if you do want to test, t
--with-mseed=no \
--with-perl=yes \
--with-pthread=yes \
-   --with-python=yes \
+   --with-python2=yes \
--with-python3=yes \
--with-readline=yes \
--with-rubygem=yes \
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -37,7 +37,7 @@ override_dh_auto_configure:
--with-mseed=no \
--with-perl=yes \
--with-pthread=yes \
-   --with-python=yes \
+   --with-python2=yes \
--with-readline=yes \
--with-rubygem=yes \
--with-rubygem-dir=lib/ruby/gems/1.8 \
@@ -50,11 +50,11 @@ override_dh_auto_test:
 
 override_dh_auto_install:
dh_auto_install
-   cd clients/python  python setup.py install 
--root=$(CURDIR)/debian/tmp --install-layout=deb
+   cd clients/python2  python setup.py install 
--root=$(CURDIR)/debian/tmp --install-layout=deb
cd clients/python3  python3 setup.py install 
--root=$(CURDIR)/debian/tmp --install-layout=deb
 
 override_dh_clean:
dh_clean
-   cd clients/python  python setup.py clean
+   cd clients/python2  python setup.py clean
cd clients/python3  python3 setup.py clean
 
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-05 Thread Fabian Groffen
Changeset: 4d694615ef7a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d694615ef7a
Added Files:
clients/python2/MANIFEST.in
clients/python2/Makefile.ag
clients/python2/README.rst
clients/python2/examples/basics.py
clients/python2/examples/mclient.py
clients/python2/examples/perf.py
clients/python2/monetdb/__init__.py
clients/python2/monetdb/control.py
clients/python2/monetdb/exceptions.py
clients/python2/monetdb/mapi.py
clients/python2/monetdb/sql/__init__.py
clients/python2/monetdb/sql/connections.py
clients/python2/monetdb/sql/converters.py
clients/python2/monetdb/sql/cursors.py
clients/python2/monetdb/sql/monetize.py
clients/python2/monetdb/sql/pythonize.py
clients/python2/monetdb/sql/types.py
clients/python2/setup.py
clients/python2/test/capabilities.py
clients/python2/test/control.py
clients/python2/test/dbapi20.py
clients/python2/test/run.sh
clients/python2/test/runtests.py
clients/python2/test/test_control.py
sql/test/BugTracker-2012/Tests/inet-casts.Bug-3205.sql
sql/test/BugTracker-2012/Tests/inet-casts.Bug-3205.stable.err
sql/test/BugTracker-2012/Tests/inet-casts.Bug-3205.stable.out
Removed Files:
clients/python/MANIFEST.in
clients/python/Makefile.ag
clients/python/README.rst
clients/python/examples/basics.py
clients/python/examples/mclient.py
clients/python/examples/perf.py
clients/python/monetdb/__init__.py
clients/python/monetdb/control.py
clients/python/monetdb/exceptions.py
clients/python/monetdb/mapi.py
clients/python/monetdb/sql/__init__.py
clients/python/monetdb/sql/connections.py
clients/python/monetdb/sql/converters.py
clients/python/monetdb/sql/cursors.py
clients/python/monetdb/sql/monetize.py
clients/python/monetdb/sql/pythonize.py
clients/python/monetdb/sql/types.py
clients/python/setup.py
clients/python/test/capabilities.py
clients/python/test/control.py
clients/python/test/dbapi20.py
clients/python/test/run.sh
clients/python/test/runtests.py
clients/python/test/test_control.py
Modified Files:
MonetDB.spec
buildtools/autogen/autogen/am.py
clients/Makefile.ag
configure.ag
debian/rules
monetdb5/modules/atoms/inet.c
sql/test/BugTracker-2012/Tests/All
testing/Mfilter.py.in
testing/Mtest.py.in
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 568 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -650,7 +650,7 @@ developer, but if you do want to test, t
--with-mseed=no \
--with-perl=yes \
--with-pthread=yes \
-   --with-python=yes \
+   --with-python2=yes \
--with-python3=yes \
--with-readline=yes \
--with-rubygem=yes \
diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -1022,8 +1022,8 @@ def am_python_generic(fd, var, python, a
 for pkgdir in sorted(pkgdirs, reverse = True):
 fd.write(\t[ '$(srcdir)' -ef . ] || rm -r '%s'\n % pkgdir)
 
-def am_python(fd, var, python, am):
-am_python_generic(fd, var, python, am, 'PYTHON')
+def am_python2(fd, var, python, am):
+am_python_generic(fd, var, python, am, 'PYTHON2')
 
 def am_python3(fd, var, python3, am):
 am_python_generic(fd, var, python3, am, 'PYTHON3')
@@ -1156,7 +1156,7 @@ output_funcs = {'SUBDIRS': am_subdirs,
 'HEADERS': am_headers,
 'ANT': am_ant,
 'GEM': am_gem,
-'PYTHON': am_python,
+'PYTHON2': am_python2,
 'PYTHON3': am_python3,
 }
 
diff --git a/clients/Makefile.ag b/clients/Makefile.ag
--- a/clients/Makefile.ag
+++ b/clients/Makefile.ag
@@ -15,6 +15,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php 
HAVE_RUBYGEM?ruby examples HAVE_PYTHON?python HAVE_PYTHON3?python3 
NATIVE_WIN32?NT
+SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php 
HAVE_RUBYGEM?ruby examples HAVE_PYTHON2?python2 HAVE_PYTHON3?python3 
NATIVE_WIN32?NT
 
 EXTRA_DIST_DIR = Tests
diff --git a/clients/python/MANIFEST.in b/clients/python2/MANIFEST.in
rename from clients/python/MANIFEST.in
rename to clients/python2/MANIFEST.in
diff --git a/clients/python/Makefile.ag b/clients/python2/Makefile.ag
rename from clients/python/Makefile.ag
rename to clients/python2/Makefile.ag
--- a/clients/python/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -15,7 +15,7 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights 

MonetDB: Oct2012 - python: produce unique source tar for 2 and 3

2012-12-05 Thread Fabian Groffen
Changeset: 53165321f562 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=53165321f562
Modified Files:
clients/python2/setup.py
clients/python3/setup.py
Branch: Oct2012
Log Message:

python: produce unique source tar for 2 and 3


diffs (24 lines):

diff --git a/clients/python2/setup.py b/clients/python2/setup.py
--- a/clients/python2/setup.py
+++ b/clients/python2/setup.py
@@ -31,7 +31,7 @@ setup(name='python-monetdb',
 author_email='i...@monetdb.org',
 url='http://www.monetdb.org/',
 packages=['monetdb', 'monetdb.sql'],
-download_url='will be filled in before a 
release/python-monetdb-11.13.6.tar.gz',
+download_url='will be filled in before a 
release/python2-monetdb-11.13.6.tar.gz',
 classifiers=[
 Topic :: Database,
 Topic :: Database :: Database Engines/Servers,
diff --git a/clients/python3/setup.py b/clients/python3/setup.py
--- a/clients/python3/setup.py
+++ b/clients/python3/setup.py
@@ -31,7 +31,7 @@ setup(name='python-monetdb',
 author_email='i...@monetdb.org',
 url='http://www.monetdb.org/',
 packages=['monetdb', 'monetdb.sql'],
-download_url='will be filled in before a 
release/python-monetdb-11.13.6.tar.gz',
+download_url='will be filled in before a 
release/python3-monetdb-11.13.6.tar.gz',
 classifiers=[
 Topic :: Database :: Database Engines/Servers,
 Development Status :: 5 - Production/Stable,
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-05 Thread Fabian Groffen
Changeset: f5ef12d7a1bb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5ef12d7a1bb
Modified Files:
clients/python2/setup.py
clients/python3/setup.py
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (24 lines):

diff --git a/clients/python2/setup.py b/clients/python2/setup.py
--- a/clients/python2/setup.py
+++ b/clients/python2/setup.py
@@ -31,7 +31,7 @@ setup(name='python-monetdb',
 author_email='i...@monetdb.org',
 url='http://www.monetdb.org/',
 packages=['monetdb', 'monetdb.sql'],
-download_url='will be filled in before a 
release/python-monetdb-11.15.0.tar.gz',
+download_url='will be filled in before a 
release/python2-monetdb-11.15.0.tar.gz',
 classifiers=[
 Topic :: Database,
 Topic :: Database :: Database Engines/Servers,
diff --git a/clients/python3/setup.py b/clients/python3/setup.py
--- a/clients/python3/setup.py
+++ b/clients/python3/setup.py
@@ -31,7 +31,7 @@ setup(name='python-monetdb',
 author_email='i...@monetdb.org',
 url='http://www.monetdb.org/',
 packages=['monetdb', 'monetdb.sql'],
-download_url='will be filled in before a 
release/python-monetdb-11.15.0.tar.gz',
+download_url='will be filled in before a 
release/python3-monetdb-11.15.0.tar.gz',
 classifiers=[
 Topic :: Database,
 Topic :: Database :: Database Engines/Servers,
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-05 Thread Fabian Groffen
Changeset: c047b12fcfd1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c047b12fcfd1
Modified Files:
clients/python2/setup.py
clients/python3/setup.py
Branch: default
Log Message:

Merged from Feb2013


diffs (24 lines):

diff --git a/clients/python2/setup.py b/clients/python2/setup.py
--- a/clients/python2/setup.py
+++ b/clients/python2/setup.py
@@ -31,7 +31,7 @@ setup(name='python-monetdb',
 author_email='i...@monetdb.org',
 url='http://www.monetdb.org/',
 packages=['monetdb', 'monetdb.sql'],
-download_url='will be filled in before a 
release/python-monetdb-11.16.0.tar.gz',
+download_url='will be filled in before a 
release/python2-monetdb-11.16.0.tar.gz',
 classifiers=[
 Topic :: Database,
 Topic :: Database :: Database Engines/Servers,
diff --git a/clients/python3/setup.py b/clients/python3/setup.py
--- a/clients/python3/setup.py
+++ b/clients/python3/setup.py
@@ -31,7 +31,7 @@ setup(name='python-monetdb',
 author_email='i...@monetdb.org',
 url='http://www.monetdb.org/',
 packages=['monetdb', 'monetdb.sql'],
-download_url='will be filled in before a 
release/python-monetdb-11.16.0.tar.gz',
+download_url='will be filled in before a 
release/python3-monetdb-11.16.0.tar.gz',
 classifiers=[
 Topic :: Database,
 Topic :: Database :: Database Engines/Servers,
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - vertoo: update for changed python client

2012-12-05 Thread Fabian Groffen
Changeset: 53abef7de896 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=53abef7de896
Modified Files:
vertoo.config
Branch: Oct2012
Log Message:

vertoo: update for changed python client


diffs (19 lines):

diff --git a/vertoo.config b/vertoo.config
--- a/vertoo.config
+++ b/vertoo.config
@@ -35,12 +35,12 @@ main.addAnchors(clients/mapilib/mapi.rc
 'VALUE ProductVersion, %v\\0',
 arguments(pattern = 'FILEVERSION %v', format = '@winrc'),
 arguments(pattern = 'PRODUCTVERSION %v', format = '@winrc'))
-main.addAnchors(clients/python/setup.py,
+main.addAnchors(clients/python2/setup.py,
 version=%q,,
-python-monetdb-%v.tar)
+python2-monetdb-%v.tar)
 main.addAnchors(clients/python3/setup.py,
 version=%q,,
-python-monetdb-%v.tar)
+python3-monetdb-%v.tar)
 main.addAnchors(monetdb5/tools/libmonetdb5.rc,
 'VALUE FileVersion, %v\\0',
 'VALUE ProductVersion, %v\\0',
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Feb2013 - Merged from Oct2012

2012-12-05 Thread Fabian Groffen
Changeset: 681b2840da64 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=681b2840da64
Modified Files:
vertoo.config
Branch: Feb2013
Log Message:

Merged from Oct2012


diffs (19 lines):

diff --git a/vertoo.config b/vertoo.config
--- a/vertoo.config
+++ b/vertoo.config
@@ -35,12 +35,12 @@ main.addAnchors(clients/mapilib/mapi.rc
 'VALUE ProductVersion, %v\\0',
 arguments(pattern = 'FILEVERSION %v', format = '@winrc'),
 arguments(pattern = 'PRODUCTVERSION %v', format = '@winrc'))
-main.addAnchors(clients/python/setup.py,
+main.addAnchors(clients/python2/setup.py,
 version=%q,,
-python-monetdb-%v.tar)
+python2-monetdb-%v.tar)
 main.addAnchors(clients/python3/setup.py,
 version=%q,,
-python-monetdb-%v.tar)
+python3-monetdb-%v.tar)
 main.addAnchors(monetdb5/tools/libmonetdb5.rc,
 'VALUE FileVersion, %v\\0',
 'VALUE ProductVersion, %v\\0',
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - Merged from Feb2013

2012-12-05 Thread Fabian Groffen
Changeset: 659787c679be for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=659787c679be
Modified Files:
vertoo.config
Branch: default
Log Message:

Merged from Feb2013


diffs (19 lines):

diff --git a/vertoo.config b/vertoo.config
--- a/vertoo.config
+++ b/vertoo.config
@@ -35,12 +35,12 @@ main.addAnchors(clients/mapilib/mapi.rc
 'VALUE ProductVersion, %v\\0',
 arguments(pattern = 'FILEVERSION %v', format = '@winrc'),
 arguments(pattern = 'PRODUCTVERSION %v', format = '@winrc'))
-main.addAnchors(clients/python/setup.py,
+main.addAnchors(clients/python2/setup.py,
 version=%q,,
-python-monetdb-%v.tar)
+python2-monetdb-%v.tar)
 main.addAnchors(clients/python3/setup.py,
 version=%q,,
-python-monetdb-%v.tar)
+python3-monetdb-%v.tar)
 main.addAnchors(monetdb5/tools/libmonetdb5.rc,
 'VALUE FileVersion, %v\\0',
 'VALUE ProductVersion, %v\\0',
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Oct2012 - Merged from parallel Oct2012 head

2012-12-05 Thread Fabian Groffen
Changeset: 318f875fdcd4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=318f875fdcd4
Modified Files:
NT/rules.msc
buildtools/autogen/autogen/msc.py
configure.ag
testing/Makefile.ag
testing/Mtest.py.in
Branch: Oct2012
Log Message:

Merged from parallel Oct2012 head


diffs (130 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -74,13 +74,13 @@ PTHREAD_LIBS =
 ODBCINST_LIBS = odbccp32.lib user32.lib
 ODBC_LIBS = odbc32.lib
 
-!IFNDEF PYTHONBASE
-PYTHONBASE=C:\Python27
+!IFNDEF PYTHON2BASE
+PYTHON2BASE=C:\Python27
 !ENDIF
-!IFNDEF PYTHONLIB
-PYTHONLIB=python27.lib
+!IFNDEF PYTHON2LIB
+PYTHON2LIB=python27.lib
 !ENDIF
-PYTHON_LIBDIR=share\MonetDB\python
+PYTHON2_LIBDIR=share\MonetDB\python
 
 !IFNDEF PYTHON3BASE
 PYTHON3BASE=C:\Python32
@@ -177,7 +177,8 @@ RUBY_DIR = lib\ruby\gems\1.9.1
 
 # some programs we use, probably no need to edit
 
-# install python, flex and bison on your systems 
+# install python, flex and bison on your systems
+# PYTHON may be either a version 2 or a version 3
 PYTHON = python
 YACC = bison
 LEX = flex
@@ -370,6 +371,11 @@ create_winconfig_conds_new_py:
 !ELSE
$(ECHO) HAVE_PYTHON_FALSE=''  $(TOPDIR)\winconfig_conds_new.py
 !ENDIF
+!IFDEF HAVE_PYTHON2
+   $(ECHO) HAVE_PYTHON2_FALSE='#'  $(TOPDIR)\winconfig_conds_new.py
+!ELSE
+   $(ECHO) HAVE_PYTHON2_FALSE=''  $(TOPDIR)\winconfig_conds_new.py
+!ENDIF
 !IFDEF HAVE_PYTHON3
$(ECHO) HAVE_PYTHON3_FALSE='#'  $(TOPDIR)\winconfig_conds_new.py
 !ELSE
@@ -436,7 +442,8 @@ CONFIGURE=$(PYTHON) $(CONFIGURE_PY) \
PACKAGE=$(pkg) \
PERL_LIBDIR=$(PERL_LIBDIR) \
PYTHON=$(PYTHON) \
-   PYTHON_LIBDIR=$(PYTHON_LIBDIR) \
+   PYTHON2=$(PYTHON2) \
+   PYTHON2_LIBDIR=$(PYTHON2_LIBDIR) \
PYTHON3=$(PYTHON3) \
PYTHON3_LIBDIR=$(PYTHON3_LIBDIR) \
RUBY_DIR=$(RUBY_DIR) \
diff --git a/buildtools/autogen/autogen/msc.py 
b/buildtools/autogen/autogen/msc.py
--- a/buildtools/autogen/autogen/msc.py
+++ b/buildtools/autogen/autogen/msc.py
@@ -1029,8 +1029,8 @@ def msc_python_generic(fd, var, python, 
 fd.write('install_%s:\n' % f)
 fd.write('\t$(%s) %s install --prefix $(prefix)\n' % (PYTHON, f))
 
-def msc_python(fd, var, python, msc):
-msc_python_generic(fd, var, python, msc, 'PYTHON')
+def msc_python2(fd, var, python, msc):
+msc_python_generic(fd, var, python, msc, 'PYTHON2')
 
 def msc_python3(fd, var, python3, msc):
 msc_python_generic(fd, var, python3, msc, 'PYTHON3')
@@ -1105,7 +1105,7 @@ output_funcs = {'SUBDIRS': msc_subdirs,
 'HEADERS': msc_headers,
 'ANT': msc_ant,
 'GEM': msc_gem,
-'PYTHON': msc_python,
+'PYTHON2': msc_python2,
 'PYTHON3': msc_python3,
 }
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1258,6 +1258,17 @@ AC_SUBST(PYTHON3)
 AM_CONDITIONAL(HAVE_PYTHON3, test x$have_python3 != xno)
 AC_SUBST(PYTHON3_LIBDIR)
 
+AM_CONDITIONAL(HAVE_PYTHON, test x$have_python2 != xno -o x$have_python3 
!= xno)
+
+if test x$PYTHON = xno; then
+   if test x$PYTHON2 != xno; then
+   PYTHON=$PYTHON2
+   elif test x$PYTHON3 != xno; then
+   PYTHON=$PYTHON3
+   fi
+fi
+AC_SUBST(PYTHON)
+
 # Mtest/Mfilter currently require Python 2
 if test x$enable_testing != xno ; then
if test x$PYTHON2 = xfalse ; then
diff --git a/testing/Makefile.ag b/testing/Makefile.ag
--- a/testing/Makefile.ag
+++ b/testing/Makefile.ag
@@ -44,7 +44,7 @@ scripts_py = {
 
 headers_python = {
HEADERS = py
-   DIR = $(prefix)/$(PYTHON_LIBDIR)/MonetDBtesting
+   DIR = $(prefix)/$(PYTHON2_LIBDIR)/MonetDBtesting
SOURCES = trace.py process.py monet_options.py.in __init__.py 
subprocess26.py listexports.py.in
 }
 
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -292,6 +292,7 @@ CONDITIONALS = {
 'HAVE_PCRE': @HAVE_PCRE_FALSE@,
 'HAVE_PERL': @HAVE_PERL_FALSE@,
 'HAVE_PYTHON'  : @HAVE_PYTHON_FALSE@,
+'HAVE_PYTHON2' : @HAVE_PYTHON2_FALSE@,
 'HAVE_PYTHON3' : @HAVE_PYTHON3_FALSE@,
 'HAVE_RAPTOR'  : @HAVE_RAPTOR_FALSE@,
 'HAVE_RUBYGEM' : @HAVE_RUBYGEM_FALSE@,
@@ -3577,7 +3578,7 @@ def main(argv) :
 # inject vars that tell various languages where to find their libs
 env['PERL5LIB'] = _configure(os.path.join('@QXprefix@', '@PERL_LIBDIR@'))
 # set dynamically for python test lib
-#env['PYTHONPATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON_LIBDIR@'))
+#env['PYTHONPATH'] = _configure(os.path.join('@QXprefix@', 
'@PYTHON2_LIBDIR@'))
 env['PHP_INCPATH'] = _configure(os.path.join('@datadir@', 'php'))
 env['BINDIR'] = _configure('@bindir@')
 vars_ = vars_ + ['PERL5LIB', 'PHP_INCPATH', 'BINDIR']

MonetDB: Oct2012 - MonetDB.spec: get README from existing dir

2012-12-05 Thread Fabian Groffen
Changeset: a25ba5398e35 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a25ba5398e35
Modified Files:
MonetDB.spec
Branch: Oct2012
Log Message:

MonetDB.spec: get README from existing dir


diffs (12 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -539,7 +539,7 @@ program.
 %dir %{python_sitelib}/monetdb
 %{python_sitelib}/monetdb/*
 %{python_sitelib}/python_monetdb-*.egg-info
-%doc clients/python/README.rst
+%doc clients/python2/README.rst
 
 %package -n python3-monetdb
 Summary: Native MonetDB client Python3 API
___
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list


  1   2   3   4   5   6   7   8   9   10   >