Changeset: b6dd34110bff for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b6dd34110bff Modified Files: gdk/gdk_atoms.h sql/backends/monet5/sql_result.c Branch: protocol Log Message:
Add back in some code that was accidently removed. diffs (103 lines): diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h --- a/gdk/gdk_atoms.h +++ b/gdk/gdk_atoms.h @@ -36,6 +36,30 @@ #define atom_HASH(v,id,dst) ((dst) ATOMhash(id, v)) /* + * @- maximum atomic string lengths + */ +#define bitStrlen 8 +#define bteStrlen 8 +#define shtStrlen 12 +#define intStrlen 24 +#if SIZEOF_OID == SIZEOF_INT +#define oidStrlen 24 +#else +#define oidStrlen 48 +#endif +#if SIZEOF_PTR == SIZEOF_INT +#define ptrStrlen 24 +#else +#define ptrStrlen 48 +#endif +#define lngStrlen 48 +#ifdef HAVE_HGE +#define hgeStrlen 96 +#endif +#define fltStrlen 48 +#define dblStrlen 96 + +/* * The system comes with the traditional atomic types: int (4 bytes), * bool(1 byte) and str (variable). In addition, we support the notion * of an OID type, which ensures uniqueness of its members. This diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c --- a/sql/backends/monet5/sql_result.c +++ b/sql/backends/monet5/sql_result.c @@ -23,6 +23,47 @@ #define llabs(x) ((x) < 0 ? -(x) : (x)) #endif +// stpcpy definition, for systems that do not have stpcpy +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +mystpcpy (char *yydest, const char *yysrc) { + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} + +#ifdef _MSC_VER +/* use intrinsic functions on Windows */ +#define short_int_SWAP(s) ((short) _byteswap_ushort((unsigned short) (s))) +/* on Windows, long is the same size as int */ +#define normal_int_SWAP(s) ((int) _byteswap_ulong((unsigned long) (s))) +#define long_long_SWAP(l) ((lng) _byteswap_uint64((unsigned __int64) (s))) +#else +#define short_int_SWAP(s) ((short)(((0x00ff&(s))<<8) | ((0xff00&(s))>>8))) + +#define normal_int_SWAP(i) (((0x000000ff&(i))<<24) | ((0x0000ff00&(i))<<8) | \ + ((0x00ff0000&(i))>>8) | ((0xff000000&(i))>>24)) +#define long_long_SWAP(l) \ + ((((lng)normal_int_SWAP(l))<<32) |\ + (0xffffffff&normal_int_SWAP(l>>32))) +#endif + +#ifdef HAVE_HGE +#define huge_int_SWAP(h) \ + ((((hge)long_long_SWAP(h))<<64) |\ + (0xffffffffffffffff&long_long_SWAP(h>>64))) +#endif + +static lng +mnstr_swap_lng(stream *s, lng lngval) { + return mnstr_byteorder(s) != 1234 ? long_long_SWAP(lngval) : lngval; +} + #define DEC_TOSTR(TYPE) \ do { \ char buf[64]; \ @@ -1363,7 +1404,7 @@ mvc_export_table_prot10(backend *b, stre BAT *b = BATdescriptor(c->b); int mtype = b->ttype; int typelen = ATOMsize(mtype); - int convert_to_string = !type_supports_binary_transfer(c->type.type) && b->ttype != TYPE_json; + int convert_to_string = !type_supports_binary_transfer(c->type.type); sql_type *type = c->type.type; iterators[i] = bat_iterator(b); @@ -2040,7 +2081,7 @@ mvc_export_head_prot10(backend *b, strea int nil_len = -1; int nil_type = ATOMstorage(mtype); int retval = -1; - int convert_to_string = !type_supports_binary_transfer(c->type.type) && b->ttype != TYPE_json; + int convert_to_string = !type_supports_binary_transfer(c->type.type); sql_type *type = c->type.type; lng print_width = -1; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list