File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -322,25 +322,25 @@ static void set_sqlite3_func_result(sqlite3_context * ctx, VALUE result)
322322 sqlite3_result_double (ctx , NUM2DBL (result ));
323323 break ;
324324 case T_STRING :
325+ if (CLASS_OF (result ) == cSqlite3Blob
325326#ifdef HAVE_RUBY_ENCODING_H
326- if (rb_enc_get_index (result ) == rb_ascii8bit_encindex ()) {
327+ || rb_enc_get_index (result ) == rb_ascii8bit_encindex ()
328+ #endif
329+ ) {
327330 sqlite3_result_blob (
328331 ctx ,
329332 (const void * )StringValuePtr (result ),
330333 (int )RSTRING_LEN (result ),
331334 SQLITE_TRANSIENT
332335 );
333336 } else {
334- #endif
335337 sqlite3_result_text (
336338 ctx ,
337339 (const char * )StringValuePtr (result ),
338340 (int )RSTRING_LEN (result ),
339341 SQLITE_TRANSIENT
340342 );
341- #ifdef HAVE_RUBY_ENCODING_H
342343 }
343- #endif
344344 break ;
345345 default :
346346 rb_raise (rb_eRuntimeError , "can't return %s" ,
You can’t perform that action at this time.
0 commit comments