Ok, here is a workaround
[though I suspect that performance is going to degrade (with respect to CHAR column for example[1]) because BUNtail is being called for each row...]
sql_column *col = mvc_bind_column(m, tbl, colname[icol]);
BAT *b = table_funcs.full_column(m->session->tr, col); //read the entire column into continuous memory on the tail heap of the BAT b
BATiter *iterators = NULL;
blob *blob_record;
int ib;
iterators = GDKzalloc(sizeof(BATiter));
iterators[0] = bat_iterator(b); // blob column iterator
for (irow=0; irow < nrow; irow++) {
blob_record = (blob*) BUNtail(iterators[0], irow);
for (ib=0; ib < blob_record->nitems; ib++) {
printf("blob data = %c, %02x\n", blob_record->data[ib], blob_record->data[ib]);
}
}
p.s.
[1]
//For CHAR column it would look like this:
sql_column *col = mvc_bind_column(m, tbl, colname[icol]);
BAT *b = table_funcs.full_column(m->session->tr, col); //read the entire column into continuous memory on the tail heap of the BAT b
char *tvbase, *cptr;
unsigned char *readucrows;
tvbase = (char *) b->T.vheap->base + GDK_VAROFFSET;
readucrows = (unsigned char *) b->T.heap.base;
for (irow=0; irow < nrow; irow++) {
cptr = tvbase + *readucrows++;
}
Anton