Subject | Re: [firebird-support] Blob write to Embedded on Linux performance |
---|---|
Author | Mike Ro |
Post date | 2014-06-03T22:08:50Z |
Unfortunately I haven't had any success in trying this because blob_put_segment() is causing Firebird embedded to throw an instance of "Firebird::status_exception" followed by a core dump that I really can't get to the bottom of. All the other blob functions work fine (such as blob_get_segment) and return correct results.are using a udf s.th. like:
void EXPORT fn_b_load ( char* s , BLOB b )
{
unsigned char *buffer;
if ( b->blob_handle )
{
int buffsize = 4096;
FILE *file;
unsigned char *fname = intern_recode(s);
file= fopen ( fname, "rb" );
if ( file )
{
buffer= ( unsigned char * ) malloc ( buffsize );
if ( buffer )
{
int readSize;
for ( ;; )
{
readSize = fread ( buffer,1,buffsize, file );
( *b->blob_put_segment ) ( b->blob_handle, buffer,readSize );
if ( readSize != buffsize )
break;
}
free ( buffer );
}
fclose ( file );
}
free( fname);
}
}