Changeset: 3bb82b596875 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3bb82b596875
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/mal_mapi.h
monetdb5/modules/mal/mal_mapi.mal
Branch: int128
Log Message:
added int128 / "hge" support in monetdb5/modules/mal/mal_mapi.*
diffs (88 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
@@ -2122,6 +2122,7 @@ str SERVERexplain(str *ret, int *idx);
str SERVERfetch_all_rows(lng *ret, int *idx);
str SERVERfetch_field_bat(int *bid, int *idx);
str SERVERfetch_field_bte(bte *ret, int *idx, int *fnr);
+str SERVERfetch_field_hge(hge *ret, int *idx, int *fnr);
str SERVERfetch_field_int(int *ret, int *idx, int *fnr);
str SERVERfetch_field_lng(lng *ret, int *idx, int *fnr);
str SERVERfetch_field_oid(oid *ret, int *idx, int *fnr);
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -1140,6 +1140,22 @@ SERVERfetch_field_lng(lng *ret, int *key
return MAL_SUCCEED;
}
+#ifdef HAVE_HGE
+str
+SERVERfetch_field_hge(hge *ret, int *key, int *fnr){
+ Mapi mid;
+ int i;
+ str fld;
+ accessTest(*key, "fetch_field");
+ fld= mapi_fetch_field(SERVERsessions[i].hdl,*fnr);
+ *ret= fld? atol(fld): hge_nil;
+ if( mapi_error(mid) )
+ throw(MAL, "mapi.fetch_field_hge", "%s",
+ mapi_result_error(SERVERsessions[i].hdl));
+ return MAL_SUCCEED;
+}
+#endif
+
str
SERVERfetch_field_sht(sht *ret, int *key, int *fnr){
Mapi mid;
@@ -1350,6 +1366,13 @@ static void SERVERfieldAnalysis(str fld,
v->val.lval= lng_nil;
else v->val.lval= (lng) atol(fld);
break;
+#ifdef HAVE_HGE
+ case TYPE_hge:
+ if(fld==0 || strcmp(fld,"nil")==0)
+ v->val.hval= hge_nil;
+ else v->val.hval= (hge) atol(fld);
+ break;
+#endif
case TYPE_flt:
if(fld==0 || strcmp(fld,"nil")==0)
v->val.fval= flt_nil;
@@ -1423,6 +1446,9 @@ SERVERmapi_rpc_single_row(Client cntxt,
case TYPE_int:
case TYPE_wrd:
case TYPE_lng:
+#ifdef HAVE_HGE
+ case TYPE_hge:
+#endif
case TYPE_flt:
case TYPE_dbl:
case TYPE_str:
diff --git a/monetdb5/modules/mal/mal_mapi.h b/monetdb5/modules/mal/mal_mapi.h
--- a/monetdb5/modules/mal/mal_mapi.h
+++ b/monetdb5/modules/mal/mal_mapi.h
@@ -82,6 +82,9 @@ mal_mapi_export str SERVERfetch_all_rows
mal_mapi_export str SERVERfetch_field_str(str *ret, int *idx, int *fnr);
mal_mapi_export str SERVERfetch_field_int(int *ret, int *idx, int *fnr);
mal_mapi_export str SERVERfetch_field_lng(lng *ret, int *idx, int *fnr);
+#ifdef HAVE_HGE
+mal_mapi_export str SERVERfetch_field_hge(hge *ret, int *idx, int *fnr);
+#endif
mal_mapi_export str SERVERfetch_field_sht(sht *ret, int *idx, int *fnr);
mal_mapi_export str SERVERfetch_field_void(oid *ret, int *idx, int *fnr);
mal_mapi_export str SERVERfetch_field_oid(oid *ret, int *idx, int *fnr);
diff --git a/monetdb5/modules/mal/mal_mapi.mal
b/monetdb5/modules/mal/mal_mapi.mal
--- a/monetdb5/modules/mal/mal_mapi.mal
+++ b/monetdb5/modules/mal/mal_mapi.mal
@@ -144,6 +144,10 @@ command fetch_field(hdl:int,fnr:int):lng
address SERVERfetch_field_lng
comment "Retrieve a single lng field.";
+command fetch_field(hdl:int,fnr:int):hge
+address SERVERfetch_field_hge
+comment "Retrieve a single hge field.";
+
command fetch_field(hdl:int,fnr:int):sht
address SERVERfetch_field_sht
comment "Retrieve a single sht field.";
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list