From nobody at rubyforge.org Sun Jan 8 00:01:44 2012 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 8 Jan 2012 00:01:44 -0500 (EST) Subject: [ruby-oci8-commit] [489] trunk/ruby-oci8: remove obsolete documents. Message-ID: <20120108050144.4101C1678362@rubyforge.org> Revision: 489 Author: kubo Date: 2012-01-08 00:01:43 -0500 (Sun, 08 Jan 2012) Log Message: ----------- remove obsolete documents. Modified Paths: -------------- trunk/ruby-oci8/ChangeLog Removed Paths: ------------- trunk/ruby-oci8/doc/ Modified: trunk/ruby-oci8/ChangeLog =================================================================== --- trunk/ruby-oci8/ChangeLog 2011-12-15 14:40:27 UTC (rev 488) +++ trunk/ruby-oci8/ChangeLog 2012-01-08 05:01:43 UTC (rev 489) @@ -1,3 +1,6 @@ +2012-01-08 KUBO Takehiro + * doc/*: remove obsolete documents. + 2011-12-15 KUBO Takehiro * lib/oci8/object.rb, test/setup_test_object.sql, test/test_object.rb: fix "wrong number of arguments (1 for 2)" when date datatype in a object From nobody at rubyforge.org Mon Jan 9 02:23:26 2012 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Mon, 9 Jan 2012 02:23:26 -0500 (EST) Subject: [ruby-oci8-commit] [490] trunk/ruby-oci8: add a new document file. Message-ID: <20120109072326.C37111D783DF@rubyforge.org> Revision: 490 Author: kubo Date: 2012-01-09 02:23:25 -0500 (Mon, 09 Jan 2012) Log Message: ----------- add a new document file. Modified Paths: -------------- trunk/ruby-oci8/.gitignore trunk/ruby-oci8/ChangeLog trunk/ruby-oci8/dist-files Added Paths: ----------- trunk/ruby-oci8/docs/ trunk/ruby-oci8/docs/install-full-client.md Property Changed: ---------------- trunk/ruby-oci8/ Property changes on: trunk/ruby-oci8 ___________________________________________________________________ Modified: svn:ignore - config.save sqlnet.log *.rbc + config.save sqlnet.log *.rbc .git doc .yardoc Modified: trunk/ruby-oci8/.gitignore =================================================================== --- trunk/ruby-oci8/.gitignore 2012-01-08 05:01:43 UTC (rev 489) +++ trunk/ruby-oci8/.gitignore 2012-01-09 07:23:25 UTC (rev 490) @@ -1,6 +1,8 @@ .svn +.yardoc config.save -doc/.svn +doc +docs/.svn ext/.svn ext/oci8/.svn ext/oci8/apiwrap.h Modified: trunk/ruby-oci8/ChangeLog =================================================================== --- trunk/ruby-oci8/ChangeLog 2012-01-08 05:01:43 UTC (rev 489) +++ trunk/ruby-oci8/ChangeLog 2012-01-09 07:23:25 UTC (rev 490) @@ -1,3 +1,6 @@ +2012-01-09 KUBO Takehiro + * docs/install-full-client.md: add a new document file. + 2012-01-08 KUBO Takehiro * doc/*: remove obsolete documents. Modified: trunk/ruby-oci8/dist-files =================================================================== --- trunk/ruby-oci8/dist-files 2012-01-08 05:01:43 UTC (rev 489) +++ trunk/ruby-oci8/dist-files 2012-01-09 07:23:25 UTC (rev 490) @@ -8,11 +8,7 @@ pre-distclean.rb ruby-oci8.gemspec setup.rb -doc/api.en.html -doc/api.en.rd -doc/api.ja.html -doc/api.ja.rd -doc/manual.css +docs/install-full-client.md ext/oci8/.document ext/oci8/MANIFEST ext/oci8/apiwrap.c.tmpl Added: trunk/ruby-oci8/docs/install-full-client.md =================================================================== --- trunk/ruby-oci8/docs/install-full-client.md (rev 0) +++ trunk/ruby-oci8/docs/install-full-client.md 2012-01-09 07:23:25 UTC (rev 490) @@ -0,0 +1,108 @@ +# @title Install for Oracle Full Client + +Introduction +============ + +This page explains the way to install ruby-oci8 for Oracle Full Client +installations. + +For Oracle Instant Client, look at {file:docs/install-instant-client.md}. +For Windows, look at {file:docs/install-binary-package.md} unless you +have a special need to compile ruby-oci8 by yourself. + +Check the environment +===================== + +Oracle installation +------------------- + +Run the following command and confirm it works fine. If it doesn't +work well, you need to ask to your database administrator. + + sqlplus USERNAME/PASSWORD + +ruby installation +----------------- + +Run the following command. If it ends with "can't find header files +for ruby" or "ruby: no such file to load -- mkmf (LoadError)", you need +to install ruby-devel(redhat) or ruby-dev(debian/ubuntu). + + ruby -r mkmf -e "" + +development tools +----------------- + +You need a C compiler and development tools such as make or nmake. +Note that they must be same with ones used to compile the ruby. +For example, you need Oracle Solaris Studio, not gcc, for ruby +compiled by Oracle Solaris Studio. + +Installation +============ + +Download the source code +------------------------ + +Download the latest tar.gz package such as ruby-oci8 2.1.0.tar.gz, +which is the latest version at the time of writing, from [rubyforge][]. + +Set the library search path +----------------------- + +### UNIX + +Set the library search path, whose name depends on the OS, to point to +$ORACLE_HOME/lib. If the database is 64-bit and the ruby is 32-bit, +use $ORACLE_HOME/lib32 instead. + + + + + + + + + + + + + + + +
OS library search path
Linux LD_LIBRARY_PATH
Solaris 32-bit ruby LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH
Solaris 64-bit ruby LD_LIBRARY_PATH_64 or LD_LIBRARY_PATH
HP-UX PA-RISC 32-bit ruby SHLIB_PATH
HP-UX PA-RISC 64-bit ruby LD_LIBRARY_PATH
HP-UX IA64 LD_LIBRARY_PATH
Mac OS X DYLD_LIBRARY_PATH
AIX LIBPATH
+ +Do not forget to export the variable as follows: + + $ LD_LIBRARY_PATH=$ORACLE_HOME/lib + $ export LD_LIBRARY_PATH + +### Windows(mswin32, mingw32, cygwin) + +If sqlplus runs correctly, library search path has no problem. + +Run make and install +-------------------- + +### UNIX or Windows(mingw32, cygwin) + + gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf - + cd ruby-oci8-VERSION + make + make install + +note: If you use '''sudo''', use it only when running 'make install'. +sudo doesn't pass library search path to the executing command for security reasons. + +### Windows(mswin32) + + + gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf - + cd ruby-oci8-VERSION + nmake + nmake install + +If you have a problem, look at {file:docs/platform-specific-issues.md} +and {file:docs/report-installation-issue.md}. + +[rubyforge]: http://rubyforge.org/frs/?group_id=256 From nobody at rubyforge.org Thu Jan 19 06:56:20 2012 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 19 Jan 2012 06:56:20 -0500 (EST) Subject: [ruby-oci8-commit] [491] trunk/ruby-oci8: replace OCILogon() with OCILogon2() and use the latter to use ConnectionPool. Message-ID: <20120119115620.987CF185838D@rubyforge.org> Revision: 491 Author: kubo Date: 2012-01-19 06:56:19 -0500 (Thu, 19 Jan 2012) Log Message: ----------- replace OCILogon() with OCILogon2() and use the latter to use ConnectionPool. Modified Paths: -------------- trunk/ruby-oci8/ChangeLog trunk/ruby-oci8/ext/oci8/apiwrap.yml trunk/ruby-oci8/ext/oci8/oci8.c trunk/ruby-oci8/lib/oci8/oci8.rb trunk/ruby-oci8/test/config.rb Modified: trunk/ruby-oci8/ChangeLog =================================================================== --- trunk/ruby-oci8/ChangeLog 2012-01-09 07:23:25 UTC (rev 490) +++ trunk/ruby-oci8/ChangeLog 2012-01-19 11:56:19 UTC (rev 491) @@ -1,3 +1,9 @@ +2012-01-19 KUBO Takehiro + * ext/oci8/apiwrap.yml, ext/oci8/oci8.c, lib/oci8/oci8.rb: replace + OCILogon() with OCILogon2() and use the latter to use + ConnectionPool. + * test/config.rb: fix to pass lob tests. + 2012-01-09 KUBO Takehiro * docs/install-full-client.md: add a new document file. Modified: trunk/ruby-oci8/ext/oci8/apiwrap.yml =================================================================== --- trunk/ruby-oci8/ext/oci8/apiwrap.yml 2012-01-09 07:23:25 UTC (rev 490) +++ trunk/ruby-oci8/ext/oci8/apiwrap.yml 2012-01-19 11:56:19 UTC (rev 491) @@ -379,20 +379,6 @@ - OCISvcCtx *svchp - OCIError *errhp -# round trip: 1 -OCILogon_nb: - :version: 800 - :args: - - OCIEnv *envhp - - OCIError *errhp - - OCISvcCtx **svchp - - CONST text *username - - ub4 uname_len - - CONST text *password - - ub4 passwd_len - - CONST text *dbname - - ub4 dbname_len - # round trip: 0 OCINumberAbs: :version: 800 @@ -1301,6 +1287,21 @@ - sb4 mnth - OCIInterval *result +# round trip: 1 +OCILogon2_nb: + :version: 900 + :args: + - OCIEnv *envhp + - OCIError *errhp + - OCISvcCtx **svchp + - CONST text *username + - ub4 uname_len + - CONST text *password + - ub4 passwd_len + - CONST text *dbname + - ub4 dbname_len + - ub4 mode + # round trip: 0 (not docmented. I guess.) OCIRowidToChar: :version: 900 Modified: trunk/ruby-oci8/ext/oci8/oci8.c =================================================================== --- trunk/ruby-oci8/ext/oci8/oci8.c 2012-01-09 07:23:25 UTC (rev 490) +++ trunk/ruby-oci8/ext/oci8/oci8.c 2012-01-19 11:56:19 UTC (rev 491) @@ -329,13 +329,13 @@ /* * call-seq: - * logon(username, password, dbname) -> connection + * logon2(username, password, dbname, mode) -> connection * * internal use only * - * Creates a simple logon session by the OCI function OCILogon(). + * Creates a simple logon session by the OCI function OCILogon2(). */ -static VALUE oci8_logon(VALUE self, VALUE username, VALUE password, VALUE dbname) +static VALUE oci8_logon2(VALUE self, VALUE username, VALUE password, VALUE dbname, VALUE mode) { oci8_svcctx_t *svcctx = DATA_PTR(self); @@ -352,11 +352,11 @@ /* logon */ svcctx->base.type = OCI_HTYPE_SVCCTX; - chker2(OCILogon_nb(svcctx, oci8_envhp, oci8_errhp, &svcctx->base.hp.svc, - RSTRING_ORATEXT(username), RSTRING_LEN(username), - RSTRING_ORATEXT(password), RSTRING_LEN(password), - NIL_P(dbname) ? NULL : RSTRING_ORATEXT(dbname), - NIL_P(dbname) ? 0 : RSTRING_LEN(dbname)), + chker2(OCILogon2_nb(svcctx, oci8_envhp, oci8_errhp, &svcctx->base.hp.svc, + RSTRING_ORATEXT(username), RSTRING_LEN(username), + RSTRING_ORATEXT(password), RSTRING_LEN(password), + NIL_P(dbname) ? NULL : RSTRING_ORATEXT(dbname), + NIL_P(dbname) ? 0 : RSTRING_LEN(dbname), NUM2UINT(mode)), &svcctx->base); svcctx->logoff_strategy = &simple_logoff; @@ -1099,7 +1099,7 @@ rb_define_singleton_method_nodoc(cOCI8, "__set_property", oci8_s_set_property, 2); rb_define_singleton_method(cOCI8, "error_message", oci8_s_error_message, 1); rb_define_private_method(cOCI8, "parse_connect_string", oci8_parse_connect_string, 1); - rb_define_private_method(cOCI8, "logon", oci8_logon, 3); + rb_define_private_method(cOCI8, "logon2", oci8_logon2, 4); rb_define_private_method(cOCI8, "allocate_handles", oci8_allocate_handles, 0); rb_define_private_method(cOCI8, "session_handle", oci8_get_session_handle, 0); rb_define_private_method(cOCI8, "server_handle", oci8_get_server_handle, 0); Modified: trunk/ruby-oci8/lib/oci8/oci8.rb =================================================================== --- trunk/ruby-oci8/lib/oci8/oci8.rb 2012-01-09 07:23:25 UTC (rev 490) +++ trunk/ruby-oci8/lib/oci8/oci8.rb 2012-01-19 11:56:19 UTC (rev 491) @@ -118,17 +118,22 @@ raise "unknown privilege type #{mode}" end - if mode.nil? and cred.nil? and (not dbname.is_a? OCI8::ConnectionPool) - # logon by the OCI function OCILogon(). - logon(username, password, dbname) + if mode.nil? and cred.nil? + # logon by the OCI function OCILogon2(). + logon2_mode = 0 + if dbname.is_a? OCI8::ConnectionPool + @pool = dbname # to prevent GC from freeing the connection pool. + dbname = dbname.send(:pool_name) + logon2_mode |= 0x0200 # OCI_LOGON2_CPOOL + end + logon2(username, password, dbname, logon2_mode) else # logon by the OCI function OCISessionBegin(). + attach_mode = 0 if dbname.is_a? OCI8::ConnectionPool @pool = dbname # to prevent GC from freeing the connection pool. - attach_mode = OCI_CPOOL dbname = dbname.send(:pool_name) - else - attach_mode = OCI_DEFAULT + attach_mode |= 0x0200 # OCI_CPOOL end allocate_handles() Modified: trunk/ruby-oci8/test/config.rb =================================================================== --- trunk/ruby-oci8/test/config.rb 2012-01-09 07:23:25 UTC (rev 490) +++ trunk/ruby-oci8/test/config.rb 2012-01-19 11:56:19 UTC (rev 491) @@ -13,12 +13,7 @@ nls_lang = ENV['NLS_LANG'] nls_lang = nls_lang.split('.')[1] unless nls_lang.nil? nls_lang = nls_lang.upcase unless nls_lang.nil? -case nls_lang -when 'JA16EUC' - $lobfile = File.dirname(__FILE__) + '/../doc/api.ja.rd' # EUC-JP file -else - $lobfile = File.dirname(__FILE__) + '/../doc/api.en.rd' # ASCII file -end +$lobfile = File.dirname(__FILE__) + '/../setup.rb' $lobreadnum = 256 # counts in charactors # don't modify below. From nobody at rubyforge.org Thu Jan 19 08:42:26 2012 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 19 Jan 2012 08:42:26 -0500 (EST) Subject: [ruby-oci8-commit] [492] trunk/ruby-oci8: enable statement caching per session in OCI layer if the Oracle client is 9iR2 or upper . Message-ID: <20120119134226.9A1461858391@rubyforge.org> Revision: 492 Author: kubo Date: 2012-01-19 08:42:25 -0500 (Thu, 19 Jan 2012) Log Message: ----------- enable statement caching per session in OCI layer if the Oracle client is 9iR2 or upper. Modified Paths: -------------- trunk/ruby-oci8/ChangeLog trunk/ruby-oci8/ext/oci8/apiwrap.yml trunk/ruby-oci8/ext/oci8/stmt.c trunk/ruby-oci8/lib/oci8/oci8.rb trunk/ruby-oci8/lib/oci8/properties.rb Modified: trunk/ruby-oci8/ChangeLog =================================================================== --- trunk/ruby-oci8/ChangeLog 2012-01-19 11:56:19 UTC (rev 491) +++ trunk/ruby-oci8/ChangeLog 2012-01-19 13:42:25 UTC (rev 492) @@ -1,4 +1,9 @@ 2012-01-19 KUBO Takehiro + * ext/oci8/apiwrap.yml, ext/oci8/stmt.c, lib/oci8/oci8.rb, + lib/oci8/properties.rb: enable statement caching per session in OCI layer + if the Oracle client is 9iR2 or upper. + +2012-01-19 KUBO Takehiro * ext/oci8/apiwrap.yml, ext/oci8/oci8.c, lib/oci8/oci8.rb: replace OCILogon() with OCILogon2() and use the latter to use ConnectionPool. Modified: trunk/ruby-oci8/ext/oci8/apiwrap.yml =================================================================== --- trunk/ruby-oci8/ext/oci8/apiwrap.yml 2012-01-19 11:56:19 UTC (rev 491) +++ trunk/ruby-oci8/ext/oci8/apiwrap.yml 2012-01-19 13:42:25 UTC (rev 492) @@ -1343,6 +1343,28 @@ - dvoid *envhp - const oratext *name +OCIStmtPrepare2: + :version: 920 + :args: + - OCISvcCtx *svchp + - OCIStmt **stmtp + - OCIError *errhp + - const OraText *stmt + - ub4 stmt_len + - const OraText *key + - ub4 key_len + - ub4 language + - ub4 mode + +OCIStmtRelease: + :version: 920 + :args: + - OCIStmt *stmtp + - OCIError *errhp + - const OraText *key + - ub4 key_len + - ub4 mode + # # Oracle 10.1 # Modified: trunk/ruby-oci8/ext/oci8/stmt.c =================================================================== --- trunk/ruby-oci8/ext/oci8/stmt.c 2012-01-19 11:56:19 UTC (rev 491) +++ trunk/ruby-oci8/ext/oci8/stmt.c 2012-01-19 13:42:25 UTC (rev 492) @@ -35,6 +35,7 @@ VALUE svc; VALUE binds; VALUE defns; + int use_stmt_release; } oci8_stmt_t; static void oci8_stmt_mark(oci8_base_t *base) @@ -51,6 +52,11 @@ stmt->svc = Qnil; stmt->binds = Qnil; stmt->defns = Qnil; + if (stmt->use_stmt_release) { + OCIStmtRelease(base->hp.stmt, oci8_errhp, NULL, 0, OCI_DEFAULT); + base->type = 0; + stmt->use_stmt_release = 0; + } } static oci8_base_vtable_t oci8_stmt_vtable = { @@ -62,20 +68,38 @@ static VALUE oci8_stmt_initialize(int argc, VALUE *argv, VALUE self) { oci8_stmt_t *stmt = DATA_PTR(self); + oci8_svcctx_t *svcctx; VALUE svc; VALUE sql; sword rv; rb_scan_args(argc, argv, "11", &svc, &sql); - oci8_check_pid_consistency(oci8_get_svcctx(svc)); - if (argc > 1) + svcctx = oci8_get_svcctx(svc); + oci8_check_pid_consistency(svcctx); + if (argc > 1 && oracle_client_version >= ORAVER_9_2) { OCI8SafeStringValue(sql); - rv = OCIHandleAlloc(oci8_envhp, &stmt->base.hp.ptr, OCI_HTYPE_STMT, 0, NULL); - if (rv != OCI_SUCCESS) - oci8_env_raise(oci8_envhp, rv); - stmt->base.type = OCI_HTYPE_STMT; + rv = OCIStmtPrepare2(svcctx->base.hp.svc, &stmt->base.hp.stmt, oci8_errhp, RSTRING_ORATEXT(sql), RSTRING_LEN(sql), NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT); + if (IS_OCI_ERROR(rv)) { + chker2(rv, &svcctx->base); + } + stmt->base.type = OCI_HTYPE_STMT; + stmt->use_stmt_release = 1; + } else { + rv = OCIHandleAlloc(oci8_envhp, &stmt->base.hp.ptr, OCI_HTYPE_STMT, 0, NULL); + if (rv != OCI_SUCCESS) { + oci8_env_raise(oci8_envhp, rv); + } + stmt->base.type = OCI_HTYPE_STMT; + if (argc > 1) { + OCI8SafeStringValue(sql); + rv = OCIStmtPrepare(stmt->base.hp.stmt, oci8_errhp, RSTRING_ORATEXT(sql), RSTRING_LEN(sql), OCI_NTV_SYNTAX, OCI_DEFAULT); + if (IS_OCI_ERROR(rv)) { + chker3(rv, &svcctx->base, stmt->base.hp.stmt); + } + } + } stmt->svc = svc; stmt->binds = rb_hash_new(); stmt->defns = rb_ary_new(); @@ -84,12 +108,6 @@ rb_ivar_set(stmt->base.self, id_at_con, svc); rb_ivar_set(stmt->base.self, id_at_max_array_size, Qnil); - if (argc > 1) { - rv = OCIStmtPrepare(stmt->base.hp.stmt, oci8_errhp, RSTRING_ORATEXT(sql), RSTRING_LEN(sql), OCI_NTV_SYNTAX, OCI_DEFAULT); - if (IS_OCI_ERROR(rv)) { - chker3(rv, &stmt->base, stmt->base.hp.stmt); - } - } oci8_link_to_parent((oci8_base_t*)stmt, (oci8_base_t*)DATA_PTR(svc)); return Qnil; } Modified: trunk/ruby-oci8/lib/oci8/oci8.rb =================================================================== --- trunk/ruby-oci8/lib/oci8/oci8.rb 2012-01-19 11:56:19 UTC (rev 491) +++ trunk/ruby-oci8/lib/oci8/oci8.rb 2012-01-19 13:42:25 UTC (rev 492) @@ -118,6 +118,8 @@ raise "unknown privilege type #{mode}" end + stmt_cache_size = OCI8.properties[:statement_cache_size] + if mode.nil? and cred.nil? # logon by the OCI function OCILogon2(). logon2_mode = 0 @@ -126,7 +128,17 @@ dbname = dbname.send(:pool_name) logon2_mode |= 0x0200 # OCI_LOGON2_CPOOL end + if stmt_cache_size + # enable statement caching + logon2_mode |= 0x0004 # OCI_LOGON2_STMTCACHE + end + logon2(username, password, dbname, logon2_mode) + + if stmt_cache_size + # set statement cache size + attr_set_ub4(176, stmt_cache_size) # 176: OCI_ATTR_STMTCACHESIZE + end else # logon by the OCI function OCISessionBegin(). attach_mode = 0 @@ -135,12 +147,21 @@ dbname = dbname.send(:pool_name) attach_mode |= 0x0200 # OCI_CPOOL end + if stmt_cache_size + # enable statement caching + attach_mode |= 0x0004 # OCI_STMT_CACHE + end allocate_handles() session_handle.send(:attr_set_string, OCI_ATTR_USERNAME, username) if username session_handle.send(:attr_set_string, OCI_ATTR_PASSWORD, password) if password server_attach(dbname, attach_mode) session_begin(cred ? cred : OCI_CRED_RDBMS, mode ? mode : OCI_DEFAULT) + + if stmt_cache_size + # set statement cache size + attr_set_ub4(176, stmt_cache_size) # 176: OCI_ATTR_STMTCACHESIZE + end end @prefetch_rows = nil Modified: trunk/ruby-oci8/lib/oci8/properties.rb =================================================================== --- trunk/ruby-oci8/lib/oci8/properties.rb 2012-01-19 11:56:19 UTC (rev 491) +++ trunk/ruby-oci8/lib/oci8/properties.rb 2012-01-19 13:42:25 UTC (rev 492) @@ -8,8 +8,13 @@ :length_semantics => :byte, :bind_string_as_nchar => false, :float_conversion_type => :ruby, + :statement_cache_size => 20, } + if OCI8.oracle_client_version < OCI8::ORAVER_9_2 + @@properties[:statement_cache_size] = nil + end + def @@properties.[](name) raise IndexError, "No such property name: #{name}" unless @@properties.has_key?(name) super(name) @@ -27,6 +32,12 @@ when :float_conversion_type # handled by native code in oci8lib_xx.so. OCI8.__set_property(name, val) + when :statement_cache_size + if OCI8.oracle_client_version < OCI8::ORAVER_9_2 + raise RuntimeError, ":statement_cache_size is disabled on Oracle 9iR1 client." + end + val = val.to_i + raise ArgumentError, "The property value for :statement_cache_size must not be negative." if val < 0 end super(name, val) end @@ -74,6 +85,13 @@ # 15.700000000000001 by Float#to_s. # See: http://rubyforge.org/forum/forum.php?thread_id=50030&forum_id=1078 # + # [:statement_cache_size] + # (new in 2.1.1) + # + # The statement cache size per each session. The default value is 20 statements. + # This feature is available on Oracle 9iR2 or later. + # See: http://docs.oracle.com/cd/E11882_01/appdev.112/e10646/oci09adv.htm#i471377 + # def self.properties @@properties end From nobody at rubyforge.org Thu Jan 19 09:15:36 2012 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Thu, 19 Jan 2012 09:15:36 -0500 (EST) Subject: [ruby-oci8-commit] [493] trunk/ruby-oci8: create map files of oci8lib_*. so on mingw32 in case of analyzing a core (minidump) file. Message-ID: <20120119141536.BF3FB1678366@rubyforge.org> Revision: 493 Author: kubo Date: 2012-01-19 09:15:36 -0500 (Thu, 19 Jan 2012) Log Message: ----------- create map files of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file. Modified Paths: -------------- trunk/ruby-oci8/ChangeLog trunk/ruby-oci8/ext/oci8/extconf.rb trunk/ruby-oci8/pre-distclean.rb trunk/ruby-oci8/ruby-oci8.gemspec Modified: trunk/ruby-oci8/ChangeLog =================================================================== --- trunk/ruby-oci8/ChangeLog 2012-01-19 13:42:25 UTC (rev 492) +++ trunk/ruby-oci8/ChangeLog 2012-01-19 14:15:36 UTC (rev 493) @@ -1,4 +1,8 @@ 2012-01-19 KUBO Takehiro + * ext/oci8/extconf.rb, pre-distclean.rb, ruby-oci8.gemspec: create map files + of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file. + +2012-01-19 KUBO Takehiro * ext/oci8/apiwrap.yml, ext/oci8/stmt.c, lib/oci8/oci8.rb, lib/oci8/properties.rb: enable statement caching per session in OCI layer if the Oracle client is 9iR2 or upper. Modified: trunk/ruby-oci8/ext/oci8/extconf.rb =================================================================== --- trunk/ruby-oci8/ext/oci8/extconf.rb 2012-01-19 13:42:25 UTC (rev 492) +++ trunk/ruby-oci8/ext/oci8/extconf.rb 2012-01-19 14:15:36 UTC (rev 493) @@ -136,9 +136,8 @@ # Config::CONFIG["ruby_version"] indicates the ruby API version. # 1.8 - ruby 1.8.x -# 1.9.1 - ruby 1.9.1 and 1.9.2 -# 1.9.x - ruby 1.9.x future version which will break the API compatibility -so_basename += Config::CONFIG["ruby_version"].gsub(/\W/, '') +# 1.9.1 - ruby 1.9.1, 1.9.2 and 2.0.0-dev at the present time. +so_basename += RbConfig::CONFIG["ruby_version"].gsub(/\W/, '') $defs << "-DInit_oci8lib=Init_#{so_basename}" $defs << "-Doci8lib=#{so_basename}" @@ -174,6 +173,23 @@ create_apiwrap() +case RUBY_PLATFORM +when /mingw32/ + # Drop '-s' option from LDSHARED and explicitly run 'strip' to get the map file. + if RbConfig::MAKEFILE_CONFIG["LDSHARED"].gsub!(/-s\b/, '') + alias :oci8_configuration_orig :configuration + def configuration(*args) + oci8_configuration_orig(*args) << < $(TARGET).map + strip -s $(DLLIB) +EOS + end + end +end + create_makefile(so_basename) exit 0 Modified: trunk/ruby-oci8/pre-distclean.rb =================================================================== --- trunk/ruby-oci8/pre-distclean.rb 2012-01-19 13:42:25 UTC (rev 492) +++ trunk/ruby-oci8/pre-distclean.rb 2012-01-19 14:15:36 UTC (rev 493) @@ -1,7 +1,7 @@ rm_f "#{curr_objdir}/lib/oci8.rb" +rm_f "#{curr_objdir}/ext/oci8/oci8lib_18.map" +rm_f "#{curr_objdir}/ext/oci8/oci8lib_191.map" if RUBY_PLATFORM =~ /cygwin/ rm_f "#{curr_objdir}/ext/oci8/OCI.def" rm_f "#{curr_objdir}/ext/oci8/libOCI.a" -else - rm_f "#{curr_objdir}/ext/oci8/oracle_objs.a" end Modified: trunk/ruby-oci8/ruby-oci8.gemspec =================================================================== --- trunk/ruby-oci8/ruby-oci8.gemspec 2012-01-19 13:42:25 UTC (rev 492) +++ trunk/ruby-oci8/ruby-oci8.gemspec 2012-01-19 14:15:36 UTC (rev 493) @@ -54,6 +54,10 @@ else raise "No compiled binary are found. Run make in advance." end + # add map files to analyze a core (minidump) file. + so_files << 'ext/oci8/oci8lib_18.map' if has_1_8 and 'ext/coi8/oci8lib_18.map' + so_files << 'ext/oci8/oci8lib_191.map' if has_1_9_1 and 'ext/coi8/oci8lib_191.map' + FileUtils.copy so_files, 'lib', :preserve => true files.reject! do |fname| fname =~ /^ext/ From nobody at rubyforge.org Sun Jan 22 09:34:17 2012 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Sun, 22 Jan 2012 09:34:17 -0500 (EST) Subject: [ruby-oci8-commit] [494] trunk/ruby-oci8: Use isnan() and isinf() instead of fpclassify() for platforms which don't have fpclassify(). Message-ID: <20120122143417.DDC4D1779954@rubyforge.org> Revision: 494 Author: kubo Date: 2012-01-22 09:34:17 -0500 (Sun, 22 Jan 2012) Log Message: ----------- Use isnan() and isinf() instead of fpclassify() for platforms which don't have fpclassify(). Modified Paths: -------------- trunk/ruby-oci8/ChangeLog trunk/ruby-oci8/ext/oci8/ocinumber.c Modified: trunk/ruby-oci8/ChangeLog =================================================================== --- trunk/ruby-oci8/ChangeLog 2012-01-19 14:15:36 UTC (rev 493) +++ trunk/ruby-oci8/ChangeLog 2012-01-22 14:34:17 UTC (rev 494) @@ -1,3 +1,8 @@ +2012-01-22 KUBO Takehiro + * ext/oci8/ocinumber.c: Use isnan() and isinf() instead of fpclassify() + for platforms which don't have fpclassify(). + (reported by John Beckwith) + 2012-01-19 KUBO Takehiro * ext/oci8/extconf.rb, pre-distclean.rb, ruby-oci8.gemspec: create map files of oci8lib_*.so on mingw32 in case of analyzing a core (minidump) file. Modified: trunk/ruby-oci8/ext/oci8/ocinumber.c =================================================================== --- trunk/ruby-oci8/ext/oci8/ocinumber.c 2012-01-19 14:15:36 UTC (rev 493) +++ trunk/ruby-oci8/ext/oci8/ocinumber.c 2012-01-22 14:34:17 UTC (rev 494) @@ -332,12 +332,10 @@ OCINumber *oci8_dbl_to_onum(OCINumber *result, double dbl, OCIError *errhp) { - switch (fpclassify(dbl)) { - case FP_NAN: + if (isnan(dbl)) { rb_raise(rb_eFloatDomainError, "NaN"); /* never reach here */ - break; - case FP_INFINITE: + } else if (isinf(dbl)) { if (dbl > 0.0) { oranumber_from_str(result, "~", 1); } else {