Changeset: af7b1262e523 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/af7b1262e523
Branch: strimps_v3
Log Message:
Merge with default
diffs (truncated from 1497 to 300 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
@@ -899,6 +899,7 @@ const char dblRef[];
void debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int
first, int size);
const char decompressRef[];
int defConstant(MalBlkPtr mb, int type, ValPtr cst);
+const char defaultfastRef[];
const char defineRef[];
void delArgument(InstrPtr p, int varid);
const char deleteRef[];
@@ -1427,13 +1428,6 @@ char *UDFfuse_int_lng(lng *ret, const in
char *UDFfuse_lng_hge(hge *ret, const lng *one, const lng *two);
char *UDFfuse_sht_int(int *ret, const sht *one, const sht *two);
str UDFreverse(str *ret, const str *arg);
-str VLTgenerator_join(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str VLTgenerator_noop(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str VLTgenerator_projection(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
-str VLTgenerator_rangejoin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-str VLTgenerator_subselect(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-str VLTgenerator_table(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-str VLTgenerator_thetasubselect(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
str append_to_table_from_emit(Client cntxt, char *sname, char *tname,
sql_emit_col *columns, size_t ncols);
str batbte_dec2_bte(bat *res, const int *s1, const bat *v, const bat *sid);
str batbte_dec2_dbl(bat *res, const int *s1, const bat *v, const bat *sid);
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -120,6 +120,9 @@ Print usage information and exit.
\fB\-\-version\fP (\fB\-v\fP)
Print version information and exit.
.TP
+\fB\-\-quiet\fP (\fB\-q\fP)
+Be quiet: don't print welcome message at startup.
+.TP
\fB\-\-encoding=\fP\fIencoding\fP (\fB\-E\fP \fIencoding\fP)
Specify the character encoding of the input.
The option applies to both the standard input of
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3280,6 +3280,7 @@ usage(const char *prog, int xit)
mnstr_printf(stderr_stream, " -| cmd | --pager=cmd for
pagination\n");
#endif
mnstr_printf(stderr_stream, " -v | --version show
version information and exit\n");
+ mnstr_printf(stderr_stream, " -q | --quiet don't
print welcome message\n");
mnstr_printf(stderr_stream, " -? | --help show
this usage message\n");
mnstr_printf(stderr_stream, "\nSQL specific options \n");
@@ -3355,6 +3356,7 @@ main(int argc, char **argv)
bool trace = false;
bool dump = false;
bool useinserts = false;
+ bool quiet = false;
int c = 0;
Mapi mid;
bool save_history = false;
@@ -3387,6 +3389,7 @@ main(int argc, char **argv)
{"pager", 1, 0, '|'},
#endif
{"port", 1, 0, 'p'},
+ {"quiet", 0, 0, 'q'},
{"rows", 1, 0, 'r'},
{"statement", 1, 0, 's'},
{"user", 1, 0, 'u'},
@@ -3469,7 +3472,7 @@ main(int argc, char **argv)
#ifdef HAVE_ICONV
"E:"
#endif
- "f:h:Hil:L:n:Np:P:r:Rs:t:u:vw:Xz"
+ "f:h:Hil:L:n:Np:P:qr:Rs:t:u:vw:Xz"
#ifdef HAVE_POPEN
"|:"
#endif
@@ -3553,6 +3556,9 @@ main(int argc, char **argv)
passwd = optarg;
passwd_set_as_flag = true;
break;
+ case 'q':
+ quiet = true;
+ break;
case 'r':
assert(optarg);
rowsperpage = atoi(optarg);
@@ -3765,7 +3771,7 @@ main(int argc, char **argv)
mapi_trace(mid, trace);
/* give the user a welcome message with some general info */
- if (!has_fileargs && command == NULL && isatty(fileno(stdin))) {
+ if (!quiet && !has_fileargs && command == NULL &&
isatty(fileno(stdin))) {
char *lang;
catch_interrupts(mid);
diff --git a/clients/odbc/tests/ODBCmetadata.c
b/clients/odbc/tests/ODBCmetadata.c
--- a/clients/odbc/tests/ODBCmetadata.c
+++ b/clients/odbc/tests/ODBCmetadata.c
@@ -1535,7 +1535,7 @@ main(int argc, char **argv)
compareResult(stmt, ret, "EXPLAIN SELECT * from odbctst.\"LINES\"",
nrServerThreads > 1 ?
"Resultset with 1 columns\n"
- "Resultset with 46 rows\n"
+ "Resultset with 17 rows\n"
"mal\n"
"WLONGVARCHAR(174)\n"
"function user.main():void;\n"
@@ -1553,13 +1553,10 @@ main(int argc, char **argv)
"\n"
" X_37:int := sql.resultSet(X_38:bat[:str], X_39:bat[:str],
X_40:bat[:str], X_41:bat[:int], X_42:bat[:int], X_33:bat[:int], X_34:bat[:int],
X_35:bat[:int], X_36:bat[:int]);\n"
"end user.main;\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n"
+ "\n\n"
:
"Resultset with 1 columns\n"
- "Resultset with 44 rows\n"
+ "Resultset with 15 rows\n"
"mal\n"
"WLONGVARCHAR(174)\n"
"function user.main():void;\n"
@@ -1575,10 +1572,7 @@ main(int argc, char **argv)
" X_42:bat[:int] := bat.pack(0:int, 0:int, 0:int, 3:int);\n"
" X_37:int := sql.resultSet(X_38:bat[:str], X_39:bat[:str],
X_40:bat[:str], X_41:bat[:int], X_42:bat[:int], X_33:bat[:int], X_34:bat[:int],
X_35:bat[:int], X_36:bat[:int]);\n"
"end user.main;\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n\n\n\n\n\n\n\n\n\n"
- "\n");
+ "\n\n");
// test TRACE SELECT query.
// This will return two resultsets: first with the query results and
next with the trace results
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1518,11 +1518,13 @@ BATsettrivprop(BAT *b)
b->tnil = !b->tnonil;
b->trevsorted = true;
b->tkey = b->batCount <= 1;
+ b->tunique_est = b->batCount == 0 ? 0.0 : 1.0;
} else {
b->tnonil = true;
b->tnil = false;
b->tkey = true;
b->trevsorted = b->batCount <= 1;
+ b->tunique_est = (double) b->batCount;
}
b->tsorted = true;
} else if (b->batCount <= 1) {
@@ -1591,11 +1593,15 @@ BATsettrivprop(BAT *b)
b->tnokey[0] = 0;
b->tnokey[1] = !b->tkey;
b->tunique_est = (double) (1 + b->tkey);
- } else if (!ATOMlinear(b->ttype)) {
- b->tsorted = false;
- b->trevsorted = false;
- b->tminpos = BUN_NONE;
- b->tmaxpos = BUN_NONE;
+ } else {
+ if (!ATOMlinear(b->ttype)) {
+ b->tsorted = false;
+ b->trevsorted = false;
+ b->tminpos = BUN_NONE;
+ b->tmaxpos = BUN_NONE;
+ }
+ if (b->tkey)
+ b->tunique_est = (double) b->batCount;
}
}
@@ -1663,9 +1669,7 @@ BATnegateprops(BAT *b)
* this is a NULL pointer.
*/
#define GDKMAXERRLEN 10240
-#define GDKWARNING "!WARNING: "
#define GDKERROR "!ERROR: "
-#define GDKMESSAGE "!OS: "
#define GDKFATAL "!FATAL: "
/* Data Distilleries uses ICU for internationalization of some MonetDB error
messages */
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -788,7 +788,9 @@ BATappend2(BAT *b, BAT *n, BAT *s, bool
b->tminpos = BUN_NONE;
}
}
- if (ci.ncand > BATcount(b) / gdk_unique_estimate_keep_fraction) {
+ if (BATcount(b) == 0 && ci.ncand == ni.count)
+ b->tunique_est = ni.unique_est;
+ else if (ci.ncand > BATcount(b) / gdk_unique_estimate_keep_fraction) {
b->tunique_est = 0;
}
MT_lock_unset(&b->theaplock);
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2810,7 +2810,7 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
break; \
} \
HASHLOOPBODY(); \
- if (semi && !max_one) \
+ if (semi) \
break; \
} \
} else if (rci->tpe != cand_dense) { \
@@ -2825,7 +2825,7 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
break; \
} \
HASHLOOPBODY(); \
- if (semi && !max_one) \
+ if (semi) \
break; \
} \
} \
@@ -2841,7 +2841,7 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
} \
ro = (oid) (rb - roff + rseq); \
HASHLOOPBODY(); \
- if (semi && !max_one) \
+ if (semi) \
break; \
} \
} \
@@ -3083,6 +3083,16 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
goto bailout;
}
+ /* from here on, semi is used to bail out early from the
+ * collision lists; if right is key, it's effectively a
+ * semi-join, and max_one is automatically satisfied; otherwise,
+ * we need to continue looking if max_one is specified to make
+ * sure there is only one match */
+ if (r->tkey)
+ semi = true;
+ else if (max_one)
+ semi = false;
+
r1 = *r1p;
r2 = r2p ? *r2p : NULL;
r3 = r3p ? *r3p : NULL;
@@ -3143,7 +3153,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
break;
}
HASHLOOPBODY();
- if (semi && !max_one)
+ if (semi)
break;
}
} else if (hsh == NULL) {
@@ -3159,7 +3169,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
break;
}
HASHLOOPBODY();
- if (semi && !max_one)
+ if (semi)
break;
}
}
@@ -3175,7 +3185,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
break;
}
HASHLOOPBODY();
- if (semi && !max_one)
+ if (semi)
break;
}
}
@@ -3191,7 +3201,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
}
ro = (oid) (rb - roff + rseq);
HASHLOOPBODY();
- if (semi && !max_one)
+ if (semi)
break;
}
}
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -340,7 +340,7 @@ ilog2(BUN x)
ATOMname(b->ttype), \
b->ttype==TYPE_str?b->twidth==1?"1":b->twidth==2?"2":b->twidth==4?"4":"8":"", \
!b->batTransient ? "P" : b->theap && b->theap->parentid !=
b->batCacheid ? "V" : b->tvheap && b->tvheap->parentid != b->batCacheid ? "v" :
"T", \
- BATtdense(b) ? "D" : b->ttype == TYPE_void && b->tvheap ? "X" :
ATOMstorage(b->ttype) == TYPE_str && GDK_ELIMDOUBLES(b->tvheap) ? "E" : "", \
+ BATtdense(b) ? "D" : b->ttype == TYPE_void && b->tvheap ? "X" :
ATOMstorage(b->ttype) == TYPE_str && b->tvheap && GDK_ELIMDOUBLES(b->tvheap) ?
"E" : "", \
b->tsorted ? "S" : b->tnosorted ? "!s" : "", \
b->trevsorted ? "R" : b->tnorevsorted ? "!r" : "", \
b->tkey ? "K" : b->tnokey[1] ? "!k" : "", \
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -276,7 +276,7 @@ MCinitClientRecord(Client c, oid user, b
c->profticks = c->profstmt = c->profevents = NULL;
c->error_row = c->error_fld = c->error_msg = c->error_input = NULL;
- c->sqlprofiler = 0;
+ c->sqlprofiler = false;
c->blocksize = BLOCK;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]