Changeset: 43a561e9cab2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43a561e9cab2
Modified Files:
monetdb5/modules/mal/tablet.c
sql/backends/monet5/UDF/udf.c
sql/backends/monet5/UDF/udf_impl.h
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
Branch: default
Log Message:
merge with default
diffs (162 lines):
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
@@ -1064,8 +1064,8 @@ SQLinsert_val(Column *fmt, char *s, char
bunins_failed:
if (*err == NULL) {
snprintf(buf, BUFSIZ,
- "parsing error from line " BUNFMT " field %d
not inserted\n",
- BATcount(fmt->c[0]) + 1, col);
+ "value from line " BUNFMT " field %d not
inserted: %s\n",
+ BATcount(fmt->c[0]) + 1, col, GDKerrbuf);
*err = GDKstrdup(buf);
}
return -1;
diff --git a/sql/backends/monet5/UDF/udf.c b/sql/backends/monet5/UDF/udf.c
--- a/sql/backends/monet5/UDF/udf.c
+++ b/sql/backends/monet5/UDF/udf.c
@@ -254,15 +254,15 @@ UDFBATfuse_(BAT **ret, const BAT *bone,
switch (bone->ttype) {
case TYPE_bte:
msg = UDFBATfuse_bte_sht ( bres, bone, btwo, n,
- &two_tail_sorted_unsigned, &two_tail_revsorted_unsigned
);
+ &two_tail_sorted_unsigned, &two_tail_revsorted_unsigned
);
break;
case TYPE_sht:
msg = UDFBATfuse_sht_int ( bres, bone, btwo, n,
- &two_tail_sorted_unsigned, &two_tail_revsorted_unsigned
);
+ &two_tail_sorted_unsigned, &two_tail_revsorted_unsigned
);
break;
case TYPE_int:
msg = UDFBATfuse_int_lng ( bres, bone, btwo, n,
- &two_tail_sorted_unsigned, &two_tail_revsorted_unsigned
);
+ &two_tail_sorted_unsigned, &two_tail_revsorted_unsigned
);
break;
default:
BBPreleaseref(bres->batCacheid);
diff --git a/sql/backends/monet5/UDF/udf_impl.h
b/sql/backends/monet5/UDF/udf_impl.h
--- a/sql/backends/monet5/UDF/udf_impl.h
+++ b/sql/backends/monet5/UDF/udf_impl.h
@@ -41,7 +41,7 @@
static char *
UF(UDFfuse_,UI,UO,_) ( UO *ret , UI one , UI two )
{
- int shift = sizeof(UI) * 8;
+ int shift = sizeof(UI) * 8;
/* assert calling sanity */
assert(ret != NULL);
@@ -71,16 +71,37 @@ UF(UDFfuse_,UI,UO,) ( UO *ret , const UI
* accessing value arrays directly.
*/
-/* type-specific core algorithm */
+/* type-specific core algorithm on arrays */
+static char *
+UF(UDFarrayfuse_,UI,UO,) ( UO *res, const UI *one, const UI *two, BUN n )
+{
+ BUN i;
+ int shift = sizeof(UI) * 8;
+
+ /* assert calling sanity */
+ assert(res != NULL && one != NULL && two != NULL);
+
+ /* iterate over all values/tuples and do the work */
+ for (i = 0; i < n; i++)
+ if (one[i] == UN(UI) || two[i] == UN(UI))
+ /* NULL/nil in => NULL/nil out */
+ res[i] = UN(UO);
+ else
+ /* do the work; watch out for sign bits */
+ res[i] = ((UO) (UU) one[i] << shift) | (UU) two[i];
+
+ return MAL_SUCCEED;
+}
+
+/* type-specific core algorithm on BATs */
static char *
UF(UDFBATfuse_,UI,UO,) ( const BAT *bres, const BAT *bone, const BAT *btwo,
BUN n,
- bit *two_tail_sorted_unsigned,
- bit *two_tail_revsorted_unsigned )
+ bit *two_tail_sorted_unsigned,
+ bit *two_tail_revsorted_unsigned )
{
UI *one = NULL, *two = NULL;
UO *res = NULL;
- BUN i;
- int shift = sizeof(UI) * 8;
+ str msg = NULL;
/* assert calling sanity */
assert(bres != NULL && bone != NULL && btwo != NULL);
@@ -93,14 +114,11 @@ UF(UDFBATfuse_,UI,UO,) ( const BAT *bre
one = (UI*) Tloc(bone, BUNfirst(bone));
two = (UI*) Tloc(btwo, BUNfirst(btwo));
res = (UO*) Tloc(bres, BUNfirst(bres));
- /* iterate over all values/tuples and do the work */
- for (i = 0; i < n; i++)
- if (one[i] == UN(UI) || two[i] == UN(UI))
- /* NULL/nil in => NULL/nil out */
- res[i] = UN(UO);
- else
- /* do the work; watch out for sign bits */
- res[i] = ((UO) (UU) one[i] << shift) | (UU) two[i];
+
+ /* call core function on arrays */
+ msg = UF(UDFarrayfuse_,UI,UO,) ( res, one, two , n );
+ if (msg != MAL_SUCCEED)
+ return msg;
*two_tail_sorted_unsigned =
BATtordered(btwo) && (two[0] >= 0 || two[n-1] < 0);
diff --git
a/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
b/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
--- a/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
+++ b/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
@@ -31,16 +31,16 @@ Ready.
| | | | | | | table(sys._tables) [ _tables.id as p.id, _tables.type as p.type
] COUNT |
| | | | | | ) [ p.type != smallint[tinyint "2"] ]
|
| | | | | ) [ p.id as tables.id ]
|
-| | | | ) [ ] [ sys.count() NOT NULL as L1 ],
|
+| | | | ) [ ] [ sys.count() NOT NULL as L1.L1 ],
|
| | | | group by (
|
| | | | | project (
|
| | | | | | select (
|
| | | | | | | table(tmp._tables) [ _tables.id as t.id, _tables.type as t.type
] COUNT |
| | | | | | ) [ t.type != smallint[tinyint "2"] ]
|
| | | | | ) [ t.id as tables.id ]
|
-| | | | ) [ ] [ sys.count() NOT NULL as L1 ]
|
-| | | ) [ L1 ]
|
-| | ) [ ] [ sys.sum no nil (L1) as L1 ]
|
+| | | | ) [ ] [ sys.count() NOT NULL as L1.L1 ]
|
+| | | ) [ L1.L1 ]
|
+| | ) [ ] [ sys.sum no nil (L1.L1) as L1.L1 ]
|
| ) [ L1 NOT NULL as L1.L1 ]
|
+--------------------------------------------------------------------------------------+
20 rows
@@ -50,7 +50,7 @@ Operation successful
+--------------------------------------------------------------------------+
| mal |
+==========================================================================+
-| function user.s1_1{autoCommit=true}():void; |
+| function user.s3_1{autoCommit=true}():void; |
| X_3:bat[:oid,:wrd] := bat.new(nil:oid,nil:wrd); |
| X_2 := sql.mvc(); |
| X_9 := sql.bind(X_2,"sys","_tables","type",0); |
@@ -60,7 +60,7 @@ Operation successful
| X_68 := algebra.subselect(r1_12,2:sht,2:sht,true,true,true); |
| X_15 := sql.bind(X_2,"sys","_tables","type",1); |
| X_69 := algebra.subselect(X_15,X_6,2:sht,2:sht,true,true,true); |
-| X_17 := sql.subdelta(X_67,X_6,X_12,X_68,X_69);
|
+| X_17 := sql.subdelta(X_67,X_6,X_12,X_68,X_69); |
| X_18 := sql.bind(X_2,"sys","_tables","id",0); |
| (X_20,r1_28) := sql.bind(X_2,"sys","_tables","id",2); |
| X_22 := sql.bind(X_2,"sys","_tables","id",1); |
@@ -80,7 +80,7 @@ Operation successful
| X_43 := algebra.selectNotNil(X_41); |
| X_44:wrd := aggr.sum(X_43); |
| sql.exportValue(1,".L1","L1","wrd",32,0,6,X_44,""); |
-| end s1_1; |
+| end s3_1; |
| # querylog.define("explain select count(*) from tables;","default_pipe") |
+--------------------------------------------------------------------------+
32 rows
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list