ext/statement.cc in swift-0.5.1 vs ext/statement.cc in swift-0.6.0
- old
+ new
@@ -35,13 +35,11 @@
Query query;
query.statement = statement;
if (RARRAY_LEN(bind_values) > 0) query_bind_values(&query, bind_values);
if (dbi::_trace) dbi::logMessage(dbi::_trace_fd, dbi::formatParams(statement->command(), query.bind));
- // TODO: http://redmine.ruby-lang.org/issues/show/3762
- // rb_thread_blocking_region and C++ exceptions don't mix in 1.9.2.
- // rb_thread_blocking_region(((VALUE (*)(void*))query_execute_statement), &query, RUBY_UBF_IO, 0);
- query_execute_statement(&query);
+ if (rb_thread_blocking_region(((VALUE (*)(void*))query_execute_statement), &query, RUBY_UBF_IO, 0) == Qfalse)
+ rb_raise(eSwiftRuntimeError, "%s", query.error);
}
CATCH_DBI_EXCEPTIONS();
if (rb_block_given_p()) return result_each(self);
return self;