ext/odbc.c in ruby-odbc-0.99992 vs ext/odbc.c in ruby-odbc-0.99993
- old
+ new
@@ -6,11 +6,11 @@
*
* See the file "COPYING" for information on usage
* and redistribution of this file and for a
* DISCLAIMER OF ALL WARRANTIES.
*
- * $Id: odbc.c,v 1.70 2010/09/16 06:52:23 chw Exp chw $
+ * $Id: odbc.c,v 1.71 2010/12/24 16:24:21 chw Exp chw $
*/
#undef ODBCVER
#if defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__)
@@ -249,11 +249,10 @@
static ID IDString;
static ID IDFixnum;
static ID IDtable_names;
static ID IDnew;
static ID IDnow;
-static ID IDlocal;
static ID IDname;
static ID IDtable;
static ID IDtype;
static ID IDlength;
static ID IDnullable;
@@ -274,10 +273,11 @@
static ID IDencode;
#endif
static ID IDparse;
static ID IDutc;
static ID IDlocal;
+static ID IDto_s;
/*
* Modes for dbc_info
*/
@@ -4118,16 +4118,17 @@
rb_ensure(dbc_commit, self, dbc_nop, self);
a = rb_ary_new2(2);
rb_ary_store(a, 0, self);
rb_ary_store(a, 1, Qnil);
if ((ret = rb_rescue2(dbc_transbody, a, dbc_transfail, a,
- rb_eException)) != Qundef) {
+ rb_eException, (VALUE) 0)) != Qundef) {
dbc_commit(self);
return ret;
}
ret = rb_ary_entry(a, 1);
- rb_exc_raise(rb_exc_new3(CLASS_OF(ret), ret));
+ rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
+ rb_funcall(ret, IDto_s, 0, 0)));
return Qnil;
}
/*
*----------------------------------------------------------------------
@@ -8043,10 +8044,11 @@
#ifdef USE_RB_ENC
{ &IDencode, "encode" },
#endif
{ &IDparse, "parse" },
{ &IDutc, "utc" },
- { &IDlocal, "local" }
+ { &IDlocal, "local" },
+ { &IDto_s, "to_s" }
};
/*
*----------------------------------------------------------------------
*