[ruby-oci8-commit] [524] trunk/ruby-oci8: Merge pull request #13 from timon/temp_lob at github .
nobody at rubyforge.org
nobody at rubyforge.org
Fri May 25 11:41:20 UTC 2012
Revision: 524
Author: kubo
Date: 2012-05-25 11:41:19 +0000 (Fri, 25 May 2012)
Log Message:
-----------
Merge pull request #13 from timon/temp_lob at github.
If 's' is a temporary lob, use OCILobLocatorAssign instead.
Modified Paths:
--------------
trunk/ruby-oci8/ChangeLog
trunk/ruby-oci8/ext/oci8/lob.c
Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog 2012-05-20 07:44:50 UTC (rev 523)
+++ trunk/ruby-oci8/ChangeLog 2012-05-25 11:41:19 UTC (rev 524)
@@ -1,3 +1,7 @@
+2012-05-25 KUBO Takehiro <kubo at jiubao.org>
+ * ext/oci8/lob.c: Merge pull request #13 from timon/temp_lob at github.
+ If 's' is a temporary lob, use OCILobLocatorAssign instead.
+
2012-05-20 KUBO Takehiro <kubo at jiubao.org>
* ext/oci8/oci8.c, test/test_oci8.rb: add OCI8's class variables:
@@environment_handle and @@process_handle.
Modified: trunk/ruby-oci8/ext/oci8/lob.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/lob.c 2012-05-20 07:44:50 UTC (rev 523)
+++ trunk/ruby-oci8/ext/oci8/lob.c 2012-05-25 11:41:19 UTC (rev 524)
@@ -36,13 +36,19 @@
static VALUE oci8_make_lob(VALUE klass, oci8_svcctx_t *svcctx, OCILobLocator *s)
{
oci8_lob_t *lob;
+ boolean is_temp;
VALUE lob_obj;
lob_obj = rb_funcall(klass, oci8_id_new, 1, svcctx->base.self);
lob = DATA_PTR(lob_obj);
/* If 's' is a temporary lob, use OCILobLocatorAssign instead. */
- chker2(OCILobAssign(oci8_envhp, oci8_errhp, s, &lob->base.hp.lob),
- &svcctx->base);
+ chker2(OCILobIsTemporary(oci8_envhp, oci8_errhp, s, &is_temp), &svcctx->base);
+ if (is_temp)
+ chker2(OCILobLocatorAssign(svcctx->base.hp.svc, oci8_errhp, s, &lob->base.hp.lob),
+ &svcctx->base);
+ else
+ chker2(OCILobAssign(oci8_envhp, oci8_errhp, s, &lob->base.hp.lob),
+ &svcctx->base);
return lob_obj;
}
More information about the ruby-oci8-commit
mailing list