Changeset: 0a52d21b0e40 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0a52d21b0e40 Modified Files: sql/backends/monet5/sql_bincopyconvert.c sql/backends/monet5/sql_bincopyconvert.h sql/backends/monet5/sql_bincopyfrom.c Branch: copyintobinary Log Message:
Pass byteswap parameter to loaders and dumpers Happens not to be needed by current one but should be there for completeness. diffs (51 lines): diff --git a/sql/backends/monet5/sql_bincopyconvert.c b/sql/backends/monet5/sql_bincopyconvert.c --- a/sql/backends/monet5/sql_bincopyconvert.c +++ b/sql/backends/monet5/sql_bincopyconvert.c @@ -289,8 +289,9 @@ bad_utf8: // Load items from the stream and put them in the BAT. // Because it's text read from a binary stream, we replace \r\n with \n. static str -load_zero_terminated_text(BAT *bat, stream *s, int *eof_reached) +load_zero_terminated_text(BAT *bat, stream *s, int *eof_reached, bool byteswap) { + (void)byteswap; const char *mal_operator = "sql.importColumn"; str msg = MAL_SUCCEED; bstream *bs = NULL; diff --git a/sql/backends/monet5/sql_bincopyconvert.h b/sql/backends/monet5/sql_bincopyconvert.h --- a/sql/backends/monet5/sql_bincopyconvert.h +++ b/sql/backends/monet5/sql_bincopyconvert.h @@ -36,10 +36,10 @@ // the BAT. typedef str (*bincopy_decoder_t)(void *dst,void *src, size_t count, bool byteswap); -typedef str (*bincopy_loader_t)(BAT *bat, stream *s, int *eof_reached); +typedef str (*bincopy_loader_t)(BAT *bat, stream *s, int *eof_reached, bool byteswap); typedef str (*bincopy_encoder_t)(void *dst, void *src, size_t count, bool byteswap); -typedef str (*bincopy_dumper_t)(BAT *bat, stream *s); +typedef str (*bincopy_dumper_t)(BAT *bat, stream *s, bool byteswap); struct type_record_t { char *method; diff --git a/sql/backends/monet5/sql_bincopyfrom.c b/sql/backends/monet5/sql_bincopyfrom.c --- a/sql/backends/monet5/sql_bincopyfrom.c +++ b/sql/backends/monet5/sql_bincopyfrom.c @@ -177,7 +177,7 @@ load_column(type_record_t *rec, const ch assert( rec->loader == NULL || !rec->trivial_if_no_byteswap); if (rec->loader) { - msg = rec->loader(bat, s, eof_reached); + msg = rec->loader(bat, s, eof_reached, byteswap); } else if (rec->decoder == NULL || (rec->trivial_if_no_byteswap && !byteswap)) { // load the bytes directly into the bat, as-is msg = load_trivial(bat, s, rows_estimate, eof_reached); @@ -383,7 +383,7 @@ dump_column(const struct type_record_t * assert(rec->dumper || rec->encoder || BATttype(b) == TYPE_bit); if (rec->dumper) { - msg = rec->dumper(b, s); + msg = rec->dumper(b, s, byteswap); } else if (rec->encoder == NULL || (rec->trivial_if_no_byteswap && !byteswap)) { msg = dump_trivial(b, s); } else { _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org