Changeset: ca69401134a8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ca69401134a8
Modified Files:
        bootstrap
        clients/python2/test/capabilities.py
        clients/python3/test/capabilities.py
        common/stream/stream.c
        monetdb5/modules/mal/tablet.c
        sql/server/rel_select.c
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Jan2014 branch.


diffs (truncated from 957 to 300 lines):

diff --git a/bootstrap b/bootstrap
--- a/bootstrap
+++ b/bootstrap
@@ -29,6 +29,17 @@ type -P glibtoolize > /dev/null \
        && libtoolize=glibtoolize \
        || libtoolize=libtoolize
 
+# cope with systems where aclocal is known as aclocal-1.10 (and
+# automake as automake-1.10), e.g. OpenIndiana
+amv=
+if ! type -P aclocal > /dev/null; then
+    if type -P aclocal-1.11 > /dev/null; then
+       amv=-1.11
+    elif type -P aclocal-1.10 > /dev/null; then
+       amv=-1.10
+    fi
+fi
+
 _m4_extra_dirs=
 if [[ -n ${M4DIRS} ]] ; then
        for d in ${M4DIRS} ; do
@@ -52,9 +63,9 @@ while read f; do [ -x $f.in ] && echo "A
 sed '1,/^AC_CONFIG_FILES/d' configure.ag
 ) > configure.ac &&
 $libtoolize -c -f  &&
-aclocal ${_m4_extra_dirs} &&
+aclocal$amv ${_m4_extra_dirs} &&
 autoheader  &&
-automake --add-missing --copy --foreign  &&
+automake$amv --add-missing --copy --foreign  &&
 autoconf
 if [ -f buildtools/conf/install-sh -a ! -x buildtools/conf/install-sh ]; then
     chmod +x buildtools/conf/install-sh
diff --git a/clients/python2/test/capabilities.py 
b/clients/python2/test/capabilities.py
--- a/clients/python2/test/capabilities.py
+++ b/clients/python2/test/capabilities.py
@@ -361,7 +361,7 @@ class DatabaseTest(unittest.TestCase):
         r = self.cursor.fetchone()
         n = r[0]
         self.cursor.arraysize=100000
-        self.cursor.execute('select * from tables, tables')
+        self.cursor.execute('select * from tables, tables t')
         r = self.cursor.fetchall()
         self.assertEqual(len(r), n**2)
 
diff --git a/clients/python3/test/capabilities.py 
b/clients/python3/test/capabilities.py
--- a/clients/python3/test/capabilities.py
+++ b/clients/python3/test/capabilities.py
@@ -361,7 +361,7 @@ class DatabaseTest(unittest.TestCase):
         r = self.cursor.fetchone()
         n = r[0]
         self.cursor.arraysize=100000
-        self.cursor.execute('select * from tables, tables')
+        self.cursor.execute('select * from tables, tables t')
         r = self.cursor.fetchall()
         self.assertEqual(len(r), n**2)
 
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -918,6 +918,7 @@ stream *open_gzrstream(const char *filen
        (void) filename;
        return NULL;
 }
+#define open_gzwstream_(filename, mode)                NULL
 stream *open_gzwstream(const char *filename) {
        (void) filename;
        return NULL;
@@ -926,6 +927,7 @@ stream *open_gzrastream(const char *file
        (void) filename;
        return NULL;
 }
+#define open_gzwastream_(filename, mode)       NULL
 stream *open_gzwastream(const char *filename) {
        (void) filename;
        return NULL;
@@ -1131,6 +1133,7 @@ stream *open_bzrstream(const char *filen
        (void) filename;
        return NULL;
 }
+#define open_bzwstream_(filename, mode)                NULL
 stream *open_bzwstream(const char *filename) {
        (void) filename;
        return NULL;
@@ -1139,6 +1142,7 @@ stream *open_bzrastream(const char *file
        (void) filename;
        return NULL;
 }
+#define open_bzwastream_(filename, mode)       NULL
 stream *open_bzwastream(const char *filename) {
        (void) filename;
        return NULL;
diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -1230,6 +1230,18 @@ SQLload_file(Client cntxt, Tablet *as, b
 #ifdef MLOCK_TST
        mlock(task->b->buf, task->b->size);
 #endif
+       if (b->pos == b->len && b->eof && maxrow > 0) {
+               /* special case:
+                * mclient -s 'COPY INTO table FROM STDIN' - < file
+                * Initially we've seen the complete input, but we need to read 
more.
+                */
+#ifdef SQLLOADTHREAD
+               MT_sema_up(&task->producer, "SQLload_file");
+               MT_sema_down(&task->consumer, "SQLload_file");
+#else
+               task->ateof = tablet_read_more(task->b, task->out, 
task->b->size - (task->b->len - task->b->pos)) == EOF;
+#endif
+       }
        while ((task->b->pos < task->b->len || !task->b->eof) && cnt < (BUN) 
maxrow && res == 0) {
 
                if (task->errbuf && task->errbuf[0]) {
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -5074,7 +5074,6 @@ rel_select_exp(mvc *sql, sql_rel *rel, S
        return rel;
 }
 
-
 static sql_rel *
 rel_query(mvc *sql, sql_rel *rel, symbol *sq, int toplevel, exp_kind ek, int 
apply)
 {
@@ -5097,10 +5096,11 @@ rel_query(mvc *sql, sql_rel *rel, symbol
 
 
        sql->use_views = 1;
-       if (sn->from) {         /* keep variable list with tables and names */
+       if (sn->from) { 
                dlist *fl = sn->from->data.lval;
                dnode *n = NULL;
                sql_rel *fnd = NULL;
+               list *aliases =  sa_list(sql->sa);
 
                for (n = fl->h; n ; n = n->next) {
                        fnd = table_ref(sql, NULL, n->data.sym);
@@ -5126,10 +5126,14 @@ rel_query(mvc *sql, sql_rel *rel, symbol
 
                        if (!fnd)
                                break;
-                       if (res)
+                       if (res && list_find(aliases, rel_name(fnd), 
(fcmp)&strcmp)) 
+                               return sql_error(sql, ERR_AMBIGUOUS, "SELECT: 
identifier '%s' ambiguous", rel_name(fnd));
+                       else if (res)
                                res = rel_crossproduct(sql->sa, res, fnd, 
op_join);
-                       else
+                       else 
                                res = fnd;
+                       if (rel_name(fnd))
+                               list_append(aliases, rel_name(fnd));
                }
                if (!fnd) {
                        if (res)
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -3754,314 +3754,315 @@ def main(argv) :
         URLPREFIX = None
 
     global SOCK, HOST
-    if SOCK:
-        # 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
-            os.environ['MAPIHOST'] = HOST
-        except:
-            SOCK = ""
-    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 
%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']    = CheckExec(env['MALCLIENT'].split(None, 1)[0])  
, '%s -i -e --host=%s --port=%s' % (env['MALCLIENT'], HOST, env['MAPIPORT'])
-        exe['SQL_Client']    = CheckExec(env['SQLCLIENT'].split(None, 1)[0])   
, '%s -i -e --host=%s --port=%s' % (env['SQLCLIENT'], HOST, env['MAPIPORT'])
-        exe['SQL_Dump']      = CheckExec(env['SQLDUMP'].split(None, 1)[0])     
, '%s --host=%s --port=%s' % (env['SQLDUMP'], HOST, env['MAPIPORT'])
-        exe['JAQL_Client']   = CheckExec(env['JAQLCLIENT'].split(None, 1)[0])  
 , '%s -i -e --host=%s --port=%s' % (env['JAQLCLIENT'], HOST, env['MAPIPORT'])
-        if par['TIMEOUT'] == 0 or not exe['Mtimeout'][0]:
-            exe['Mtimeout'] = '', ''
-        env['exe'] = exe
-        if not quiet:
-            SetExecEnv(exe,1)
+    try:                        # try/finally to clean up sockdir
+        # check for executables, set their standard options and export them
+        if THISFILE == "Mtest.py":
+            if SOCK:
+                # 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
+                    os.environ['MAPIHOST'] = HOST
+                except:
+                    SOCK = ""
+            else:
+                SOCK = ""
+
+            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 
%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']    = CheckExec(env['MALCLIENT'].split(None, 
1)[0])  , '%s -i -e --host=%s --port=%s' % (env['MALCLIENT'], HOST, 
env['MAPIPORT'])
+            exe['SQL_Client']    = CheckExec(env['SQLCLIENT'].split(None, 
1)[0])   , '%s -i -e --host=%s --port=%s' % (env['SQLCLIENT'], HOST, 
env['MAPIPORT'])
+            exe['SQL_Dump']      = CheckExec(env['SQLDUMP'].split(None, 1)[0]) 
    , '%s --host=%s --port=%s' % (env['SQLDUMP'], HOST, env['MAPIPORT'])
+            exe['JAQL_Client']   = CheckExec(env['JAQLCLIENT'].split(None, 
1)[0])   , '%s -i -e --host=%s --port=%s' % (env['JAQLCLIENT'], HOST, 
env['MAPIPORT'])
+            if par['TIMEOUT'] == 0 or not exe['Mtimeout'][0]:
+                exe['Mtimeout'] = '', ''
+            env['exe'] = exe
+            if not quiet:
+                SetExecEnv(exe,1)
+            else:
+                SetExecEnv(exe,0)
+
+            #TODO:
+            #exe['JAVA']       = 'java'
+            #exe['JAVAC']      = 'javac'
+
+        # parse commandline arguments
+        testdirs = []
+        testlist = []
+        dirlist = []
+        if   len(args) == 1:
+            if   os.path.isdir(args[0]):
+                d = os.path.realpath(args[0])
+                if startswithpath(d + os.sep, TSTSRCBASE + os.sep):
+                    dirlist.append(d)
+                #TODO:
+                #else:
+                    # WARNING/ERROR
+            elif args[0].find(os.sep) != -1:
+                ErrXit("'%s` is neither a valid directory in %s nor a valid 
test-name!" % (args[0], os.getcwd()))
+            elif args[0] != "All":
+                #TODO:
+                # check, whether args[0] in All
+                testlist.append(args[0])
+        elif len(args) > 1:
+            i = 0
+            while i < len(args)  and  os.path.isdir(args[i]):
+                d = os.path.realpath(args[i])
+                if startswithpath(d + os.sep, TSTSRCBASE + os.sep):
+                    dirlist.append(os.path.realpath(args[i]))
+                #TODO:
+                #else:
+                    # WARNING/ERROR
+                i = i + 1
+            if len(dirlist) == 1  and  i < len(args)  and  args[i] != "All":
+                while i < len(args):
+                    if args[i].find(os.sep) == -1:
+                        #TODO:
+                        # check, whether args[i] in All
+                        testlist.append(args[i])
+                    #TODO
+                    #else:
+                        # ERROR/WARNING
+                    i = i + 1
+            else:
+                if i < len(args)  and  args[i] == "All":
+                    i = i + 1
+                #TODO:
+                #if i < len(args):
+                    #if len(dirlist) > 1:
+                        # Warn: dirlist => ignore testlist, assume All
+                    #else:
+                        # Warn: All => ignore testlist
         else:
-            SetExecEnv(exe,0)
-
-        #TODO:
-        #exe['JAVA']       = 'java'
-        #exe['JAVAC']      = 'javac'
-
-    # parse commandline arguments
-    testdirs = []
-    testlist = []
-    dirlist = []
-    if   len(args) == 1:
-        if   os.path.isdir(args[0]):
-            d = os.path.realpath(args[0])
-            if startswithpath(d + os.sep, TSTSRCBASE + os.sep):
-                dirlist.append(d)
-            #TODO:
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to