Changeset: 60ea34f1f9fc for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=60ea34f1f9fc Modified Files: clients/mapilib/mapi.c sql/backends/monet5/sql_result.c Branch: protocol Log Message:
Remove debug flags because they are not needed anymore and they make the code harder to read. diffs (146 lines): diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c --- a/clients/mapilib/mapi.c +++ b/clients/mapilib/mapi.c @@ -5542,9 +5542,6 @@ mapi_fetch_row(MapiHdl hdl) struct MapiResultSet *result; if (hdl->mid->protocol == prot10 || hdl->mid->protocol == prot10compressed) { -#ifdef PROT10_DEBUG - char *initbuf; -#endif char* buf; result = hdl->result; @@ -5589,32 +5586,17 @@ mapi_fetch_row(MapiHdl hdl) //bs2_resetbuf(hdl->mid->from); - -#ifdef PROT10_DEBUG - fprintf(stderr, "Read block: %llu - %llu (out of %lld, nrow=%lld)\n", result->rows_read, result->rows_read + nrows, result->row_count, nrows); - initbuf = (char*) bs2_getbuf(hdl->mid->from); -#endif - buf = (char*) bs2_getbuf(hdl->mid->from) + sizeof(lng); // iterate over cols for (i = 0; i < (size_t) result->fieldcnt; i++) { -#ifdef PROT10_DEBUG - fprintf(stderr, "Column %zu\n", i); -#endif result->fields[i].buffer_ptr = buf; if (result->fields[i].columnlength < 0) { // variable-length column lng col_len = *((lng*) buf); -#ifdef PROT10_DEBUG - fprintf(stderr, "Read lng %lld from position %zu\n", col_len, buf - initbuf); -#endif assert((size_t) col_len < hdl->mid->blocksize && col_len > 0); result->fields[i].buffer_ptr += sizeof(lng); buf += col_len + sizeof(lng); -#ifdef PROT10_DEBUG - fprintf(stderr, "Read strings from position %zu\n", result->fields[i].buffer_ptr - initbuf); -#endif } else { #ifdef HAVE_PFOR if (hdl->mid->colcomp == COLUMN_COMPRESSION_PFOR && strcasecmp(result->fields[i].columntype, "int") == 0) { @@ -5626,16 +5608,10 @@ mapi_fetch_row(MapiHdl hdl) uint8_t *resbuffer = malloc(nrows * sizeof(int)); simdunpack_length((const __m128i *)buf, nrows, (uint32_t*) resbuffer, b); result->fields[i].buffer_ptr = resbuffer; -#ifdef PROT10_DEBUG - fprintf(stderr, "Read PFOR compressed elements (b=%lld,length=%lld) from position %zu\n", b, length, (buf - 2 * sizeof(lng)) - initbuf); -#endif buf += length; } else { #endif buf += nrows * result->fields[i].columnlength; -#ifdef PROT10_DEBUG - fprintf(stderr, "Read elements from position %zu\n", result->fields[i].buffer_ptr - initbuf); -#endif #ifdef HAVE_PFOR } #endif 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 @@ -2024,10 +2024,6 @@ static int mvc_export_resultset_prot10(r #else (void) c; #endif -#ifdef PROT10_DEBUG - size_t bufpos; -#endif - if (varsized == 0) { // no varsized elements, so we can immediately compute the amount of elements row = srow + bytes_left / fixed_lengths; @@ -2087,11 +2083,6 @@ static int mvc_export_resultset_prot10(r } #endif -#ifdef PROT10_DEBUG - fprintf(stderr, "Write block: %zu - %zu (out of %lld, nrow=%lld)\n", srow, row, count, (lng)(row - srow)); - bufpos = sizeof(lng); -#endif - assert(bs2_buffer(s).pos == 0); if (!mnstr_writeLng(s, (lng)(row - srow))) { @@ -2102,27 +2093,16 @@ static int mvc_export_resultset_prot10(r for (i = 0; i < (size_t) t->nr_cols; i++) { res_col *c = t->cols + i; int mtype = c->type.type->localtype; -#ifdef PROT10_DEBUG - fprintf(stderr, "Column %d\n", i); -#endif if (ATOMvarsized(mtype)) { // FIXME support other types than string assert(mtype == TYPE_str); assert((size_t) var_col_len[i] < bsize); -#ifdef PROT10_DEBUG - fprintf(stderr, "Write lng %lld to %zu\n", var_col_len[i], bufpos); - bufpos += sizeof(lng); - fprintf(stderr, "Write strings to %zu\n", bufpos); -#endif if (!mnstr_writeLng(s, var_col_len[i])) { fres = -1; goto cleanup; } for (crow = srow; crow < row; crow++) { -#ifdef PROT10_DEBUG - bufpos += strlen((char*) BUNtail(iterators[i], crow)) + 1; -#endif if (!write_str_term(s, (char*) BUNtail(iterators[i], crow))) { fres = -1; goto cleanup; @@ -2157,18 +2137,10 @@ static int mvc_export_resultset_prot10(r printf("Compression failed.\n"); goto cleanup; } -#ifdef PROT10_DEBUG - fprintf(stderr, "Write PFOR compressed elements (b=%lld, length=%lld) to position %lld\n", b, length, bufpos); - bufpos += sizeof(lng) * 2 + length; -#endif free(buffer); } else { #endif -#ifdef PROT10_DEBUG - fprintf(stderr, "Write elements of size %zu to position %lld\n", atom_size * (row - srow), bufpos); - bufpos += (atom_size * (row - srow)); -#endif if (mnstr_write(s, Tloc(iterators[i].b, srow), atom_size, row - srow) != (ssize_t) (row - srow)) { fres = -1; goto cleanup; @@ -2179,9 +2151,6 @@ static int mvc_export_resultset_prot10(r } } -#ifdef PROT10_DEBUG - fprintf(stderr, "Flushing %zu bytes.\n", bs2_buffer(s).pos); -#endif if (mnstr_flush(s) < 0) { fprintf(stderr, "Failed to flush.\n"); fres = -1; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list