Changeset: 93f1e02fb478 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/93f1e02fb478
Modified Files:
        cmake/monetdb-functions.cmake
        testing/Mz.py.in
Branch: default
Log Message:

Merged with Jul2021


diffs (truncated from 360 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1688,10 +1688,27 @@ dump_table_data(Mapi mid, const char *sc
                goto bailout;
        }
        while ((mapi_fetch_row(hdl)) != 0) {
-               if (strcmp(mapi_fetch_field(hdl, 2), "1") == 0) {
+               const char *ttype = mapi_fetch_field(hdl, 2);
+               if (strcmp(ttype, "1") == 0) {
                        /* the table is actually a view */
                        goto doreturn;
                }
+               if (strcmp(ttype, "3") == 0) {
+                       /* merge table */
+                       goto doreturn;
+               }
+               if (strcmp(ttype, "4") == 0) {
+                       /* stream table */
+                       goto doreturn;
+               }
+               if (strcmp(ttype, "5") == 0) {
+                       /* remote table */
+                       goto doreturn;
+               }
+               if (strcmp(ttype, "6") == 0) {
+                       /* replica table */
+                       goto doreturn;
+               }
        }
        if (mapi_error(mid))
                goto bailout;
diff --git a/ctest/tools/monetdbe/test_helper_template.h 
b/ctest/tools/monetdbe/test_helper_template.h
--- a/ctest/tools/monetdbe/test_helper_template.h
+++ b/ctest/tools/monetdbe/test_helper_template.h
@@ -22,7 +22,7 @@ bool CHECK_COLUMN_FUNC (
     char* err = monetdbe_result_fetch(result, &rcol, column_index);
     if (err != NULL) {
 
-        printf("Error while fetching column result values from column %ld: 
%s\n", column_index, err);
+        printf("Error while fetching column result values from column %zu: 
%s\n", column_index, err);
 
         return false;
     }
@@ -48,7 +48,7 @@ bool CHECK_COLUMN_FUNC (
 
     for (size_t i = 0; i < expected_nr_column_entries; i++) {
         if (! ((col_x->is_null(&col_x->data[i]) && 
expected_column[i]._is_null) || EQUALS(col_x->data[i], 
expected_column[i].data))) {
-            printf("Mismatch between expected and actual column values: values 
differ at index %ld\n", i);
+            printf("Mismatch between expected and actual column values: values 
differ at index %zu\n", i);
             return false;
         }
     }
diff --git a/monetdb5/modules/mal/txtsim.c b/monetdb5/modules/mal/txtsim.c
--- a/monetdb5/modules/mal/txtsim.c
+++ b/monetdb5/modules/mal/txtsim.c
@@ -227,13 +227,14 @@ SCode(unsigned char c)
 }
 
 static str
-soundex_code(char *Name, char *Key)
+soundex_code(const char *Name, char *Key)
 {
        char LastLetter;
        int Index;
 
-       if ((*Name & 0x80) != 0)
-               throw(MAL,"soundex", SQLSTATE(42000) "Soundex function not 
available for non ASCII strings");
+       for (const char *p = Name; *p; p++)
+               if ((*p & 0x80) != 0)
+                       throw(MAL,"soundex", SQLSTATE(42000) "Soundex function 
not available for non ASCII strings");
 
        /* set default key */
        strcpy(Key, SoundexKey);
diff --git a/monetdb5/optimizer/opt_pushselect.c 
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -325,7 +325,7 @@ OPTpushselectImplementation(Client cntxt
                                InstrPtr q = mb->stmt[vars[var]]; /* BEWARE: 
the optimizer may not add or remove statements ! */
 
                                if (isLikeOp(q) &&
-                                       isVarConstant(mb, getArg(q, 2)) && /* 
pattern is a value */
+                                       !isaBatType(getArgType(mb, q, 2)) && 
isVarConstant(mb, getArg(q, 2)) && /* pattern is a value */
                                        isVarConstant(mb, getArg(q, 3)) && /* 
escape is a value */
                                        isVarConstant(mb, getArg(q, 4)) && /* 
isensitive flag is a value */
                                        strcmp(getVarName(mb, getArg(q,0)), 
getVarName(mb, getArg(p,1))) == 0 /* the output variable from batalgebra.like 
is the input one for [theta]select */) {
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -1542,7 +1542,7 @@ update_col(sql_trans *tr, sql_column *c,
 
        assert(delta && delta->cs.ts == tr->tid);
        if ((!inTransaction(tr, c->t) && (odelta != delta || isTempTable(c->t)) 
&& isGlobal(c->t)) || (!isNew(c->t) && isLocalTemp(c->t)))
-               trans_add(tr, &c->base, delta, &tc_gc_col, &commit_update_col, 
isLocalTemp(c->t)?NULL:&log_update_col);
+               trans_add(tr, &c->base, delta, &tc_gc_col, &commit_update_col, 
isTempTable(c->t)?NULL:&log_update_col);
 
        return update_col_execute(tr, delta, c->t, isNew(c), tids, upd, tpe == 
TYPE_bat);
 }
@@ -1599,7 +1599,7 @@ update_idx(sql_trans *tr, sql_idx * i, v
 
        assert(delta && delta->cs.ts == tr->tid);
        if ((!inTransaction(tr, i->t) && (odelta != delta || isTempTable(i->t)) 
&& isGlobal(i->t)) || (!isNew(i->t) && isLocalTemp(i->t)))
-               trans_add(tr, &i->base, delta, &tc_gc_idx, &commit_update_idx, 
isLocalTemp(i->t)?NULL:&log_update_idx);
+               trans_add(tr, &i->base, delta, &tc_gc_idx, &commit_update_idx, 
isTempTable(i->t)?NULL:&log_update_idx);
 
        return update_col_execute(tr, delta, i->t, isNew(i), tids, upd, tpe == 
TYPE_bat);
 }
@@ -1727,7 +1727,7 @@ append_col(sql_trans *tr, sql_column *c,
        assert(delta && (!isTempTable(c->t) || delta->cs.ts == tr->tid));
        if (isTempTable(c->t))
        if ((!inTransaction(tr, c->t) && (odelta != delta || 
!segments_in_transaction(tr, c->t) || isTempTable(c->t)) && isGlobal(c->t)) || 
(!isNew(c->t) && isLocalTemp(c->t)))
-               trans_add(tr, &c->base, delta, &tc_gc_col, &commit_update_col, 
isLocalTemp(c->t)?NULL:&log_update_col);
+               trans_add(tr, &c->base, delta, &tc_gc_col, &commit_update_col, 
isTempTable(c->t)?NULL:&log_update_col);
 
        return append_col_execute(tr, delta, c->base.id, offset, offsets, i, 
cnt, tpe == TYPE_bat);
 }
@@ -1743,7 +1743,7 @@ append_idx(sql_trans *tr, sql_idx * i, B
        assert(delta && (!isTempTable(i->t) || delta->cs.ts == tr->tid));
        if (isTempTable(i->t))
        if ((!inTransaction(tr, i->t) && (odelta != delta || 
!segments_in_transaction(tr, i->t) || isTempTable(i->t)) && isGlobal(i->t)) || 
(!isNew(i->t) && isLocalTemp(i->t)))
-               trans_add(tr, &i->base, delta, &tc_gc_idx, &commit_update_idx, 
isLocalTemp(i->t)?NULL:&log_update_idx);
+               trans_add(tr, &i->base, delta, &tc_gc_idx, &commit_update_idx, 
isTempTable(i->t)?NULL:&log_update_idx);
 
        return append_col_execute(tr, delta, i->base.id, offset, offsets, data, 
cnt, tpe == TYPE_bat);
 }
@@ -1792,7 +1792,7 @@ storage_delete_val(sql_trans *tr, sql_ta
        }
        unlock_table(tr->store, t->base.id);
        if ((!inTransaction(tr, t) && !in_transaction && isGlobal(t)) || 
(!isNew(t) && isLocalTemp(t)))
-               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isLocalTemp(t)?NULL:&log_update_del);
+               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isTempTable(t)?NULL:&log_update_del);
        return LOG_OK;
 }
 
@@ -1910,7 +1910,7 @@ storage_delete_bat(sql_trans *tr, sql_ta
        if (i != oi)
                bat_destroy(i);
        if ((!inTransaction(tr, t) && !in_transaction && isGlobal(t)) || 
(!isNew(t) && isLocalTemp(t)))
-               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isLocalTemp(t)?NULL:&log_update_del);
+               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isTempTable(t)?NULL:&log_update_del);
        return ok;
 }
 
@@ -2884,7 +2884,7 @@ clear_col(sql_trans *tr, sql_column *c, 
        if ((delta = bind_col_data(tr, c, renew?&update_conflict:NULL)) == NULL)
                return update_conflict ? LOG_CONFLICT : LOG_ERR;
        if ((!inTransaction(tr, c->t) && (odelta != delta || isTempTable(c->t)) 
&& isGlobal(c->t)) || (!isNew(c->t) && isLocalTemp(c->t)))
-               trans_add(tr, &c->base, delta, &tc_gc_col, &commit_update_col, 
isLocalTemp(c->t)?NULL:&log_update_col);
+               trans_add(tr, &c->base, delta, &tc_gc_col, &commit_update_col, 
isTempTable(c->t)?NULL:&log_update_col);
        if (delta)
                return clear_cs(tr, &delta->cs, renew, isTempTable(c->t));
        return 0;
@@ -2901,7 +2901,7 @@ clear_idx(sql_trans *tr, sql_idx *i, boo
        if ((delta = bind_idx_data(tr, i, renew?&update_conflict:NULL)) == NULL)
                return update_conflict ? LOG_CONFLICT : LOG_ERR;
        if ((!inTransaction(tr, i->t) && (odelta != delta || isTempTable(i->t)) 
&& isGlobal(i->t)) || (!isNew(i->t) && isLocalTemp(i->t)))
-               trans_add(tr, &i->base, delta, &tc_gc_idx, &commit_update_idx, 
isLocalTemp(i->t)?NULL:&log_update_idx);
+               trans_add(tr, &i->base, delta, &tc_gc_idx, &commit_update_idx, 
isTempTable(i->t)?NULL:&log_update_idx);
        if (delta)
                return clear_cs(tr, &delta->cs, renew, isTempTable(i->t));
        return 0;
@@ -2942,7 +2942,7 @@ clear_del(sql_trans *tr, sql_table *t, i
                unlock_table(tr->store, t->base.id);
        }
        if ((!inTransaction(tr, t) && !in_transaction && isGlobal(t)) || 
(!isNew(t) && isLocalTemp(t)))
-               trans_add(tr, &t->base, bat, &tc_gc_del, &commit_update_del, 
isLocalTemp(t)?NULL:&log_update_del);
+               trans_add(tr, &t->base, bat, &tc_gc_del, &commit_update_del, 
isTempTable(t)?NULL:&log_update_del);
        if (clear && ok == LOG_OK)
                return clear_storage(tr, t, bat);
        if (ok == LOG_ERR)
@@ -3729,10 +3729,11 @@ claim_segmentsV2(sql_trans *tr, sql_tabl
 
        /* hard to only add this once per transaction (probably want to change 
to once per new segment) */
        if ((!inTransaction(tr, t) && !in_transaction && isGlobal(t)) || 
(!isNew(t) && isLocalTemp(t))) {
-               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isLocalTemp(t)?NULL:&log_update_del);
-               if (!isLocalTemp(t))
-                       tr->logchanges += (int) total;
+               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isTempTable(t)?NULL:&log_update_del);
+               in_transaction = true;
        }
+       if (in_transaction && !isTempTable(t))
+               tr->logchanges += (int) total;
        if (*offsets) {
                BAT *pos = *offsets;
                assert(BATcount(pos) == total);
@@ -3804,10 +3805,11 @@ claim_segments(sql_trans *tr, sql_table 
 
        /* hard to only add this once per transaction (probably want to change 
to once per new segment) */
        if ((!inTransaction(tr, t) && !in_transaction && isGlobal(t)) || 
(!isNew(t) && isLocalTemp(t))) {
-               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isLocalTemp(t)?NULL:&log_update_del);
-               if (!isLocalTemp(t))
-                       tr->logchanges += (int) cnt;
+               trans_add(tr, &t->base, s, &tc_gc_del, &commit_update_del, 
isTempTable(t)?NULL:&log_update_del);
+               in_transaction = true;
        }
+       if (in_transaction && !isTempTable(t))
+               tr->logchanges += (int) cnt;
        if (ok == LOG_OK) {
                *offset = slot;
                return LOG_OK;
diff --git a/sql/test/mapi/Tests/python3_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python3_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
@@ -3,8 +3,5 @@
 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
-set PYTHONPATH=%PYTHON3PATH%
 
-"%PYTHON3%" "%testpath%/sqlsample.py" %MAPIPORT% %TSTDB% %MAPIHOST%
+"%PYTHON%" "%testpath%/sqlsample.py" %MAPIPORT% %TSTDB% %MAPIHOST%
diff --git a/sql/test/mapi/Tests/python3_dbapi.SQL.sh 
b/sql/test/mapi/Tests/python3_dbapi.SQL.sh
--- a/sql/test/mapi/Tests/python3_dbapi.SQL.sh
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.sh
@@ -3,9 +3,5 @@
 # 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
-PYTHONPATH=${PYTHON3PATH}
-export PYTHONPATH
 
-${PYTHON3} ${testpath}/sqlsample.py $MAPIPORT $TSTDB $MAPIHOST
+${PYTHON} ${testpath}/sqlsample.py $MAPIPORT $TSTDB $MAPIHOST
diff --git a/sql/test/mapi/Tests/python3_dec38.SQL.bat 
b/sql/test/mapi/Tests/python3_dec38.SQL.bat
--- a/sql/test/mapi/Tests/python3_dec38.SQL.bat
+++ b/sql/test/mapi/Tests/python3_dec38.SQL.bat
@@ -3,10 +3,7 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCDIR%
-rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
-rem Python that runs Mtest (currently always Python 3)
-set PYTHONPATH=%testpath%;%PYTHON3PATH%
 
 prompt # $t $g  
 
-"%PYTHON3%" "%testpath%/python_dec38.py %MAPIPORT% %TSTDB% %MAPIHOST%"
+"%PYTHON%" "%testpath%/python_dec38.py %MAPIPORT% %TSTDB% %MAPIHOST%"
diff --git a/sql/test/mapi/Tests/python3_dec38.SQL.sh 
b/sql/test/mapi/Tests/python3_dec38.SQL.sh
--- a/sql/test/mapi/Tests/python3_dec38.SQL.sh
+++ b/sql/test/mapi/Tests/python3_dec38.SQL.sh
@@ -3,9 +3,5 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath="$TSTSRCDIR"
-# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
-# Python that runs Mtest (currently always Python 3)
-PYTHONPATH=$testpath:${PYTHON3PATH}
-export PYTHONPATH
 
-${PYTHON3} $testpath/python_dec38.py $MAPIPORT $TSTDB $MAPIHOST
+${PYTHON} $testpath/python_dec38.py $MAPIPORT $TSTDB $MAPIHOST
diff --git a/sql/test/mapi/Tests/python3_int128.SQL.bat 
b/sql/test/mapi/Tests/python3_int128.SQL.bat
--- a/sql/test/mapi/Tests/python3_int128.SQL.bat
+++ b/sql/test/mapi/Tests/python3_int128.SQL.bat
@@ -3,10 +3,7 @@
 rem must be aligned with the installation directory chosen in
 rem clients/python/test/Makefile.ag
 set testpath=%TSTSRCDIR%
-rem ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
-rem Python that runs Mtest (currently always Python 3)
-set PYTHONPATH=%testpath%;%PYTHON3PATH%
 
 prompt # $t $g  
 
-"%PYTHON3%" "%testpath%/python_int128.py %MAPIPORT% %TSTDB% %MAPIHOST%"
+"%PYTHON%" "%testpath%/python_int128.py %MAPIPORT% %TSTDB% %MAPIHOST%"
diff --git a/sql/test/mapi/Tests/python3_int128.SQL.sh 
b/sql/test/mapi/Tests/python3_int128.SQL.sh
--- a/sql/test/mapi/Tests/python3_int128.SQL.sh
+++ b/sql/test/mapi/Tests/python3_int128.SQL.sh
@@ -3,9 +3,5 @@
 # must be aligned with the installation directory chosen in
 # clients/python/test/Makefile.ag
 testpath="$TSTSRCDIR"
-# ignore PYTHONPATH from Mtest, it is hardcoded to the dirs for the
-# Python that runs Mtest (currently always Python 3)
-PYTHONPATH=$testpath:${PYTHON3PATH}
-export PYTHONPATH
 
-${PYTHON3} $testpath/python_int128.py $MAPIPORT $TSTDB $MAPIHOST
+${PYTHON} $testpath/python_int128.py $MAPIPORT $TSTDB $MAPIHOST
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2044,9 +2044,6 @@ def RunTest(env, TST, COND, oktests, len
     elif EXT == ".malS" and not env['exe']['mserver5'][0]:
         reason = "as %s is not available." % env['MSERVER'].split(None, 1)[0]
         elem = SkipTest(env, TST, EXT, reason, length)
-    elif CALL == "python"  and  not env['exe']['python'][0]:
-        reason = "as python is not available."
-        elem = SkipTest(env, TST, EXT, reason, length)
         #TODO:
         #elif [ "$EXT" = "java"  -a  ! "`type -path java`" ] ; then
         #elem = SkipTest(env, TST, EXT, "as java is not in $PATH.", length)
@@ -2786,7 +2783,7 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
                 cmd = [os.path.join(".", TST + EXT), TST]
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to