Changeset: 66b3b6e904cd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/66b3b6e904cd
Branch: sqloptimizer
Log Message:

Merged with default


diffs (211 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -757,3 +757,4 @@ 00463fdd0d51d7ce058549a82bc74efaea6035a2
 00463fdd0d51d7ce058549a82bc74efaea6035a2 Jul2021_SP3_release
 db3cec8ea853884e857fcfb413428116cb95e786 Jul2021_17
 8c015afafb5903ea59b0e2cffac1138a0d82e007 Jul2021_19
+8c015afafb5903ea59b0e2cffac1138a0d82e007 Jul2021_SP4_release
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -4358,7 +4358,7 @@ read_into_cache(MapiHdl hdl, int lookahe
        for (;;) {
                line = read_line(mid);
                if (line == NULL) {
-                       if (mnstr_eof(mid->from)) {
+                       if (mid->from && mnstr_eof(mid->from)) {
                                mapi_log_record(mid, "unexpected end of file");
                                mapi_log_record(mid, __func__);
                                close_connection(mid);
diff --git a/documentation/source/developers_handbook.rst 
b/documentation/source/developers_handbook.rst
--- a/documentation/source/developers_handbook.rst
+++ b/documentation/source/developers_handbook.rst
@@ -120,7 +120,7 @@ Consider the following single client con
 Alternatively existing ``.sql`` scripts can be converted to sqllogic tests 
(.test) with ``Mconvert.py``.
 For example::
 
-    $Mconvert.py  --auto <module>/Tests <convert_me>.sql
+    $ Mconvert.py  --auto <module>/Tests <convert_me>.sql
 
 All new tests need to be placed in the appropriate test folder and their name 
respectively in the
 index ``All`` file.
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
@@ -3769,7 +3769,7 @@ static sql_exp *
                        if (a) {
                                list *nexps = NULL;
 
-                               if (!(nexps = 
check_arguments_and_find_largest_any_type(sql, *rel, exps, a, 0))) {
+                               if (!(nexps = 
check_arguments_and_find_largest_any_type(sql, rel ? *rel : NULL, exps, a, 0))) 
{
                                        a = NULL;
                                        /* reset error */
                                        sql->session->status = 0;
@@ -3794,7 +3794,7 @@ static sql_exp *
                                sql->errstr[0] = '\0';
                        }
                        a = NULL;
-                       if (rel_convert_types(sql, *rel, *rel, &l, &r, 1/*fix 
scale*/, type_equal) >= 0) {
+                       if (rel_convert_types(sql, rel ? *rel : NULL, rel ? 
*rel : NULL, &l, &r, 1/*fix scale*/, type_equal) >= 0) {
                                list *tps = sa_list(sql->sa);
 
                                t1 = exp_subtype(l);
@@ -3839,7 +3839,7 @@ static sql_exp *
                        a = sql_bind_func_(sql, sname, aname, 
exp_types(sql->sa, nexps), F_AGGR, false);
 
                        if (a) {
-                               if (!(nexps = 
check_arguments_and_find_largest_any_type(sql, *rel, exps, a, 0))) {
+                               if (!(nexps = 
check_arguments_and_find_largest_any_type(sql, rel ? *rel : NULL, exps, a, 0))) 
{
                                        a = NULL;
                                        /* reset error */
                                        sql->session->status = 0;
@@ -3868,7 +3868,7 @@ static sql_exp *
                                list *nexps = NULL;
                                sql_subfunc *sf = (sql_subfunc *) n->data;
 
-                               if (!list_empty(exps) && !(nexps = 
check_arguments_and_find_largest_any_type(sql, *rel, exps, sf, 0))) {
+                               if (!list_empty(exps) && !(nexps = 
check_arguments_and_find_largest_any_type(sql, rel ? *rel : NULL, exps, sf, 
0))) {
                                        /* reset error */
                                        sql->session->status = 0;
                                        sql->errstr[0] = '\0';
diff --git a/sql/test/SQLancer/Tests/sqlancer23.test 
b/sql/test/SQLancer/Tests/sqlancer23.test
--- a/sql/test/SQLancer/Tests/sqlancer23.test
+++ b/sql/test/SQLancer/Tests/sqlancer23.test
@@ -232,3 +232,6 @@ SELECT (SELECT 1 FROM (SELECT 1) x(x) HA
 
 statement error 42000!MIN: aggregate functions cannot be nested
 SELECT (SELECT min(min(x.x + y.y)) FROM (SELECT 1) x(x)) FROM (SELECT 1) y(y)
+
+statement error 42000!SELECT: cannot use non GROUP BY column 'x.x' in query 
results without an aggregate function
+SELECT (VALUES (prod(x.x - 1)), (x.x)) FROM (VALUES (1), (0.058128458)) x(x)
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -301,7 +301,7 @@ def splitcommand(cmd):
 def remove(file):
     try:
         os.remove(file)
-    except FileNotFound:
+    except FileNotFoundError:
         pass
     except:
         Warn('could not remove {}'.format(file))
@@ -643,7 +643,7 @@ def startswithpath(str,pre) :
 ##def url(str) :
 ##    return str.replace(os.sep, '/')
 ### url(str) #
-import urllib.request
+import urllib.request, urllib.parse
 path = urllib.request.url2pathname
 def url(str) :
     url = urllib.request.pathname2url(str)
@@ -2294,6 +2294,51 @@ def RunTest(env, TST, COND, oktests, len
             else:
                 diff_html.write('<!--NoDiffs-->\n')
             diff_html.close()
+
+            if verbosity <= 1:
+                if verbosity == 0 and (FailedOut > F_WARN or FailedErr > 
F_WARN):
+                    print('\r', ' '*(ttywidth or 100), end='', sep='')
+                    print('\r', end='', sep='')
+                if tres == 'socket':
+                    prpurple('SOCKET')
+                elif tres == 'timeout':
+                    prpurple('TIMEOUT')
+                elif tres == 'recursion':
+                    prpurple('RECURSION')
+                elif tres == 'segfault':
+                    prpurple('CRASHED')
+                elif tres == 'abort':
+                    prpurple('ABORTED')
+                elif tres == 'signal':
+                    prpurple('SIGNALED')
+                elif verbosity == 0 and (FailedOut > F_WARN or FailedErr > 
F_WARN):
+                    prred('ERROR')
+                elif verbosity == 1:
+                    if FailedOut == F_OK:
+                        prgreen('OK   ')
+                    elif FailedOut == F_WARN:
+                        prgreen('minor')
+                    else:
+                        prred('ERROR')
+                    print(' ', end='')
+                    if FailedErr == F_OK:
+                        prgreen('OK')
+                    elif FailedErr == F_WARN:
+                        prgreen('minor')
+                    else:
+                        prred('ERROR')
+                if verbosity == 0 and (FailedOut > F_WARN or FailedErr > 
F_WARN):
+                    print(':', os.path.join(TSTDIR, TST + EXT))
+        elif FailedOut > F_WARN or FailedErr > F_WARN:
+            print()
+            print('========================================')
+            prred('ERROR: ')
+            print(os.path.join(TSTDIR, TST + EXT))
+            print('========================================')
+            with openutf8(TestErrFile, 'r') as f:
+                print(f.read())
+            print()
+
         if FailedOut == F_OK and FailedErr == F_OK and testweb:
             for f in ['%s.out.diff.html' % TST, '%s.test.out' % TST,
                       '%s.server.out' % TST, '%s.client.out' % TST,
@@ -2309,35 +2354,6 @@ def RunTest(env, TST, COND, oktests, len
             elem = AddTstToHtmlIndex(env, TST, STABLEout, STABLEerr, EXT,
                                      FailedOut, FailedErr)
 
-        if verbosity == 1:
-            if tres == 'socket':
-                prpurple('SOCKET')
-            elif tres == 'timeout':
-                prpurple('TIMEOUT')
-            elif tres == 'recursion':
-                prpurple('RECURSION')
-            elif tres == 'segfault':
-                prpurple('CRASHED')
-            elif tres == 'abort':
-                prpurple('ABORTED')
-            elif tres == 'signal':
-                prpurple('SIGNALED')
-            else:
-                if FailedOut == F_OK:
-                    prgreen('OK   ')
-                elif FailedOut == F_WARN:
-                    prgreen('minor')
-                else:
-                    prred('MAJOR')
-                print(' ', end='')
-                if FailedErr == F_OK:
-                    prgreen('OK')
-                elif FailedErr == F_WARN:
-                    prgreen('minor')
-                else:
-                    prred('MAJOR')
-            print()
-
     return TX,FailedOut,FailedErr,elem,reason,links
 ### RunTest(env, TST, COND, oktests) #
 
@@ -4117,6 +4133,8 @@ VALUES (%s, '%s', '%s', '%s',
                 prgreen('OK')
             print()
             print('failed={}, skipped={}'.format(Failed, len(Failure[F_SKIP])))
+            if produce_html and Failed:
+                print('see 
{}'.format(urllib.parse.urlunsplit(('file','',urllib.request.pathname2url(os.path.join(TSTTRGBASE,
 TSTPREF, "index.html")),'',''))))
             print('Ran {} tests in {:7.3f}s'.format(num_tests - 
len(Failure[F_SKIP]), t_))
         elif Failed:
             print("""\
diff --git a/testing/SQLogicConvertNotes b/testing/SQLogicConvertNotes
--- a/testing/SQLogicConvertNotes
+++ b/testing/SQLogicConvertNotes
@@ -2,7 +2,7 @@ Mconvert.py
 -----------
 Converts one test folder at the time. Only relevant option is `--auto`. When 
present a sqlogic test will be created for each matching .sql test. By default 
prints all to stdout. As initial dry run probably is a good idea to run without 
`--auto` option to see whether something goes wrong. 
 
-$Mconvert.py --auto sql/test/BugTracker-2008 
+$ Mconvert.py --auto sql/test/BugTracker-2008
 
 (deprecated) testing/convert_to_sqllogic.sh 
 ------------------------------
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to