ruby-oci8 2.1.3-x86-mingw32 → 2.1.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,53 @@
1
+ 2013-01-06 KUBO Takehiro <kubo@jiubao.org>
2
+ * NEWS: add changes between 2.1.4 and 2.1.3
3
+ * VERSION: change the version to 2.1.4.
4
+ * docs/platform-specific-issues.md: update solaris-specific document.
5
+ * ext/oci8/connection_pool.c, ext/oci8/encoding.c, ext/oci8/metadata.c,
6
+ ext/oci8/oci8.c,lib/oci8.rb.in, lib/oci8/metadata.rb, lib/oci8/oci8.rb,
7
+ lib/oci8/oracle_version.rb, lib/oci8/properties.rb: update comments for yard.
8
+ * test/test_clob.rb: change a lob size when ORA-24817 is raised to
9
+ pass tests on Windows.
10
+
11
+ 2013-01-03 KUBO Takehiro <kubo@jiubao.org>
12
+ * ext/oci8/oci8.c, lib/oci8/properties.rb: add OCI8.properties[:events_mode]
13
+ to support Fast Application Notification (FAN).
14
+
15
+ 2013-01-03 KUBO Takehiro <kubo@jiubao.org>
16
+ * ext/oci8/extconf.rb, lib/oci8.rb.in: add languange mode to the extension
17
+ library name when ths ruby engine is rubinius and explicitly claim that
18
+ jruby is not supported when it is jruby.
19
+
20
+ 2013-01-03 KUBO Takehiro <kubo@jiubao.org>
21
+ * ext/oci8/encoding.c, lib/oci8/encoding-init.rb: delete an internal method
22
+ OCI8.nls_ratio= when the ruby is 1.9 or greater. nls_ratio is set by
23
+ OCI8.encoding=.
24
+
25
+ 2012-12-23 KUBO Takehiro <kubo@jiubao.org>
26
+ * ext/oci8/lob.c, ext/oci8/oci8.h, ext/oci8/oci8lib.c, test/test_clob.rb:
27
+ fix SEGV when a temporary LOB is freed when OCILobRead returns OCI_NEED_DATA.
28
+ (github issue #20 reported by Edgars Beigarts)
29
+
30
+ 2012-12-18 KUBO Takehiro <kubo@jiubao.org>
31
+ * ext/oci8/error.c, lib/oci8/oci8.rb: change the OCIError constructor to
32
+ accept an Oracle error code as the first parameter and create a message
33
+ which depends on NLS_LANG.
34
+ * lib/oci8/metadata.rb: fix OCI8.describe_table not to follow synonyms
35
+ until stack overflow. Now the recursive level is limited to 20.
36
+ (github issue #26 reported by Brian Henderson)
37
+
38
+ 2012-12-16 KUBO Takehiro <kubo@jiubao.org>
39
+ * ext/oci8/extconf.rb, lib/oci8.rb.in: use RUBY_VERSION instead of
40
+ RbConfig::CONFIG['ruby_version'] to know the ruby ABI version.
41
+ The latter may be changed by the configure option --with-ruby-version.
42
+ (github issue #24 reported by suhrawardi)
43
+
44
+ 2012-12-03 KUBO Takehiro <kubo@jiubao.org>
45
+ * ext/oci8/oraconf.rb: add a script encoding magic comment for ruby 2.0.0 preview2.
46
+ (github issue #25 reported by aboltart)
47
+
48
+ 2012-12-02 KUBO Takehiro <kubo@jiubao.org>
49
+ * test/test_encoding.rb: fix to pass tests with ruby 2.0.0 preview2.
50
+
1
51
  2012-11-11 KUBO Takehiro <kubo@jiubao.org>
2
52
  * ext/oci8/lob.c: use OCILobLocatorAssign_nb (non-blocking version)
3
53
  instead of OCILobLocatorAssign (blocking version).
data/NEWS CHANGED
@@ -1,5 +1,46 @@
1
1
  # @markup markdown
2
2
 
3
+ 2.1.4
4
+ =====
5
+
6
+ New Features
7
+ ------------
8
+
9
+ ### Fast Application Notification (FAN) support
10
+
11
+ Look at {http://php.net/manual/en/oci8.connection.php} to know what is FAN.
12
+ [oci8.events](http://php.net/manual/en/oci8.configuration.php#ini.oci8.events) in PHP
13
+ corresponds to {OCI8.properties OCI8.properties[:events_mode]} in ruby-oci8.
14
+
15
+ Note: You need to set `OCI8.properties[:events_mode]` after `"require 'oci8'"` and before
16
+ any methods which call Oracle OCI functions.
17
+
18
+ Fixed Issues
19
+ ------------
20
+
21
+ - fix SEGV when a temporary LOB is freed when `OCILobRead` returns `OCI_NEED_DATA`.
22
+ See: [github issue #20](https://github.com/kubo/ruby-oci8/issues/20)
23
+
24
+ (reported by Edgars Beigarts)
25
+
26
+ - use `RUBY_VERSION` instead of `RbConfig::CONFIG['ruby_version']` to know the
27
+ ruby ABI version. The latter may be changed by the configure option
28
+ --with-ruby-version.
29
+ See: [github issue #24](https://github.com/kubo/ruby-oci8/issues/24)
30
+
31
+ (reported by suhrawardi)
32
+
33
+ - add a script encoding magic comment for ruby 2.0.0 preview2.
34
+ See: [github issue #25](https://github.com/kubo/ruby-oci8/issues/25)
35
+
36
+ (reported by aboltart)
37
+
38
+ - fix {OCI8#describe_table} not to follow synonyms until stack overflow.
39
+ Now the recursive level is limited to 20.
40
+ See: [github issue #26](https://github.com/kubo/ruby-oci8/issues/26)
41
+
42
+ (reported by Brian Henderson)
43
+
3
44
  2.1.3
4
45
  =====
5
46
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.3
1
+ 2.1.4
@@ -71,15 +71,23 @@ Solaris
71
71
  =======
72
72
 
73
73
  You need a same compiler which is used to make ruby itself.
74
-
75
- There are two ruby packages.
76
-
77
- * [Sunfreeware.com](http://www.sunfreeware.com/)
78
- * [Blastwave.org](http://www.blastwave.org/)
79
-
80
- The former is compiled by gcc. The latter is compiled by
81
- [Sun Studio](http://developers.sun.com/sunstudio/).
82
- The both compilers are freely available.
74
+ For example, if the ruby is compiled by gcc, you need gcc. If it is compiled by Oracle Solaris Studio
75
+ (formerly called as Sun Studio), you need Oracle Solaris Studio.
76
+
77
+ If ruby is compiled by gcc and "require 'oci8'" raises "OCI Library Initialization Error",
78
+ you may need to recompile ruby as follows:
79
+
80
+ $ bzip2 -dc ruby-1.9.3-pxxx.tar.bz2 | tar xvf -
81
+ $ cd ruby-1.9.3-pxxx
82
+ $ vi main.c # <- Add RUBY_FUNC_EXPORTED just before "int main(..)" as follows:
83
+ -------------
84
+ RUBY_FUNC_EXPORTED /* Add this line */
85
+ int
86
+ main(int argc, char **argv)
87
+ -------------
88
+ $ ./configure
89
+ $ make
90
+ $ make install
83
91
 
84
92
  If you use Blastwave.org's ruby and want not to install Sun Studio,
85
93
  you can edit rbconfig.rb by your self. [(look at here)](http://forum.textdrive.com/viewtopic.php?id=12630)
@@ -91,8 +99,8 @@ If you use Sunfreeware.com's ruby and
91
99
  prints "yes", you may need to edit rbconfig.rb distributed with the ruby
92
100
  as follows:
93
101
 
94
- from: CONFIG["LDFLAGS"] = "-L. -Wl,-E"
95
- to: CONFIG["LDFLAGS"] = "-L. "
102
+ from: CONFIG["LDFLAGS"] = "-L. -Wl,-E"
103
+ to: CONFIG["LDFLAGS"] = "-L. "
96
104
 
97
105
  FreeBSD
98
106
  =======
@@ -26,14 +26,34 @@ end
26
26
  ruby_engine = (defined? RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
27
27
 
28
28
  so_basename = 'oci8lib_'
29
- if ruby_engine == 'ruby'
30
- # The suffix number indicates the ruby API version.
31
- # 1.8 - ruby 1.8.x
32
- # 1.9.1 - ruby 1.9.1, 1.9.2
33
- # 2.0.0 - ruby 2.0.0-dev at the present time.
29
+ case ruby_engine
30
+ when 'ruby'
31
+ # The extension library name includes the ruby ABI (application binary interface)
32
+ # version. It is for binary gems which contain more than one extension library
33
+ # and use correct one depending on the ABI version.
34
+ #
35
+ # ruby version | ABI version
36
+ # --------------+--------------
37
+ # 1.8.6 | 1.8
38
+ # 1.8.7 | 1.8
39
+ # --------------+--------------
40
+ # 1.9.0 | 1.9.0
41
+ # 1.9.1 | 1.9.1
42
+ # 1.9.2 | 1.9.1
43
+ # 1.9.3 | 1.9.1
44
+ # --------------+--------------
45
+ # 2.0.0 | 2.0.0
46
+ # 2.0.1 | 2.0.1 (See: [ruby-core:49578])
47
+ # ... | ...
48
+ #
49
+ # Note: The ruby ABI version is same with RbConfig::CONFIG['ruby_version']
50
+ # if it wasn't explicitly changed by the configure option --with-ruby-version.
51
+ #
34
52
  case RUBY_VERSION
35
53
  when /^2\.0/
36
- so_basename += '200'
54
+ so_basename += RUBY_VERSION.gsub(/\W/, '')
55
+ when /^1\.9\.0/
56
+ raise 'unsupported ruby version: 1.9.0'
37
57
  when /^1\.9/
38
58
  so_basename += '191'
39
59
  when /^1\.8/
@@ -41,15 +61,29 @@ if ruby_engine == 'ruby'
41
61
  else
42
62
  raise 'unsupported ruby version: ' + RUBY_VERSION
43
63
  end
64
+ when 'rbx'
65
+ # "rbx -X18" and "rbx -X19" use different C header files.
66
+ case RUBY_VERSION
67
+ when /^2\.0/
68
+ so_basename += 'rbx20'
69
+ when /^1\.9/
70
+ so_basename += 'rbx19'
71
+ when /^1\.8/
72
+ so_basename += 'rbx18'
73
+ else
74
+ raise 'unsupported language mode: ' + RUBY_VERSION
75
+ end
76
+ when 'jruby'
77
+ raise "Ruby-oci8 doesn't support jruby because its C extension support is in development in jruby 1.6 and deprecated in jruby 1.7."
44
78
  else
45
- so_basename += ruby_engine
79
+ raise 'unsupported ruby engine: ' + RUBY_ENGINE
46
80
  end
47
81
  require so_basename
48
82
 
49
- if OCI8::VERSION != '2.1.3'
83
+ if OCI8::VERSION != '2.1.4'
50
84
  require 'rbconfig'
51
85
  so_name = so_basename + "." + Config::CONFIG['DLEXT']
52
- raise "VERSION MISMATCH! #{so_name} version is #{OCI8::VERSION}, but oci8.rb version is 2.1.3."
86
+ raise "VERSION MISMATCH! #{so_name} version is #{OCI8::VERSION}, but oci8.rb version is 2.1.4."
53
87
  end
54
88
 
55
89
  require 'oci8/encoding-init.rb'
@@ -89,6 +123,7 @@ class OCI8
89
123
  # OCIClientVersion().
90
124
  #
91
125
  # @return [OCI8::OracleVersion] Oracle client version
126
+ # @see OCI8#oracle_server_version
92
127
  def self.oracle_client_version
93
128
  @@oracle_client_version
94
129
  end
@@ -26,14 +26,34 @@ end
26
26
  ruby_engine = (defined? RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
27
27
 
28
28
  so_basename = 'oci8lib_'
29
- if ruby_engine == 'ruby'
30
- # The suffix number indicates the ruby API version.
31
- # 1.8 - ruby 1.8.x
32
- # 1.9.1 - ruby 1.9.1, 1.9.2
33
- # 2.0.0 - ruby 2.0.0-dev at the present time.
29
+ case ruby_engine
30
+ when 'ruby'
31
+ # The extension library name includes the ruby ABI (application binary interface)
32
+ # version. It is for binary gems which contain more than one extension library
33
+ # and use correct one depending on the ABI version.
34
+ #
35
+ # ruby version | ABI version
36
+ # --------------+--------------
37
+ # 1.8.6 | 1.8
38
+ # 1.8.7 | 1.8
39
+ # --------------+--------------
40
+ # 1.9.0 | 1.9.0
41
+ # 1.9.1 | 1.9.1
42
+ # 1.9.2 | 1.9.1
43
+ # 1.9.3 | 1.9.1
44
+ # --------------+--------------
45
+ # 2.0.0 | 2.0.0
46
+ # 2.0.1 | 2.0.1 (See: [ruby-core:49578])
47
+ # ... | ...
48
+ #
49
+ # Note: The ruby ABI version is same with RbConfig::CONFIG['ruby_version']
50
+ # if it wasn't explicitly changed by the configure option --with-ruby-version.
51
+ #
34
52
  case RUBY_VERSION
35
53
  when /^2\.0/
36
- so_basename += '200'
54
+ so_basename += RUBY_VERSION.gsub(/\W/, '')
55
+ when /^1\.9\.0/
56
+ raise 'unsupported ruby version: 1.9.0'
37
57
  when /^1\.9/
38
58
  so_basename += '191'
39
59
  when /^1\.8/
@@ -41,8 +61,22 @@ if ruby_engine == 'ruby'
41
61
  else
42
62
  raise 'unsupported ruby version: ' + RUBY_VERSION
43
63
  end
64
+ when 'rbx'
65
+ # "rbx -X18" and "rbx -X19" use different C header files.
66
+ case RUBY_VERSION
67
+ when /^2\.0/
68
+ so_basename += 'rbx20'
69
+ when /^1\.9/
70
+ so_basename += 'rbx19'
71
+ when /^1\.8/
72
+ so_basename += 'rbx18'
73
+ else
74
+ raise 'unsupported language mode: ' + RUBY_VERSION
75
+ end
76
+ when 'jruby'
77
+ raise "Ruby-oci8 doesn't support jruby because its C extension support is in development in jruby 1.6 and deprecated in jruby 1.7."
44
78
  else
45
- so_basename += ruby_engine
79
+ raise 'unsupported ruby engine: ' + RUBY_ENGINE
46
80
  end
47
81
  require so_basename
48
82
 
@@ -89,6 +123,7 @@ class OCI8
89
123
  # OCIClientVersion().
90
124
  #
91
125
  # @return [OCI8::OracleVersion] Oracle client version
126
+ # @see OCI8#oracle_server_version
92
127
  def self.oracle_client_version
93
128
  @@oracle_client_version
94
129
  end
@@ -39,26 +39,6 @@ class OCI8
39
39
  @@client_charset_name = 'US7ASCII'
40
40
  end
41
41
 
42
- # NLS ratio, maximum number of bytes per one chracter
43
- case @@client_charset_name
44
- when 'UTF8'
45
- OCI8.nls_ratio = 3
46
- when 'AL16UTF16'
47
- OCI8.nls_ratio = 4
48
- when /^[[:alpha:]]+(\d+)/
49
- # convert maximum number of bits per one chracter to NLS ratio.
50
- # charset name max bits max bytes
51
- # ------------ -------- ---------
52
- # US7ASCII 7 1
53
- # WE8ISO8859P1 8 1
54
- # JA16SJIS 16 2
55
- # AL32UTF8 32 4
56
- # ...
57
- OCI8.nls_ratio = (($1.to_i + 7) >> 3)
58
- else
59
- raise "Unknown NLS character set name format: #{@@client_charset_name}"
60
- end
61
-
62
42
  # Ruby encoding name for ruby 1.9.
63
43
  if OCI8.respond_to? :encoding
64
44
  if defined? DEFAULT_OCI8_ENCODING
@@ -75,5 +55,25 @@ class OCI8
75
55
  end
76
56
  end
77
57
  OCI8.encoding = enc
58
+ else
59
+ # NLS ratio, maximum number of bytes per one chracter
60
+ case @@client_charset_name
61
+ when 'UTF8'
62
+ OCI8.nls_ratio = 3
63
+ when 'AL16UTF16'
64
+ OCI8.nls_ratio = 4
65
+ when /^[[:alpha:]]+(\d+)/
66
+ # convert maximum number of bits per one chracter to NLS ratio.
67
+ # charset name max bits max bytes
68
+ # ------------ -------- ---------
69
+ # US7ASCII 7 1
70
+ # WE8ISO8859P1 8 1
71
+ # JA16SJIS 16 2
72
+ # AL32UTF8 32 4
73
+ # ...
74
+ OCI8.nls_ratio = (($1.to_i + 7) >> 3)
75
+ else
76
+ raise "Unknown NLS character set name format: #{@@client_charset_name}"
77
+ end
78
78
  end
79
79
  end
@@ -1985,72 +1985,115 @@ class OCI8
1985
1985
  =end
1986
1986
  end # OCI8::Metadata
1987
1987
 
1988
- # return a subclass of OCI8::Metadata::Base
1989
- # which has information about _object_name_.
1990
- # OCI8::Metadata::Table, OCI8::Metadata::View,
1991
- # OCI8::Metadata::Procedure, OCI8::Metadata::Function,
1992
- # OCI8::Metadata::Package, OCI8::Metadata::Type,
1993
- # OCI8::Metadata::Synonym or OCI8::Metadata::Sequence
1988
+ # Returns object information.
1989
+ #
1990
+ # The return type is depends on the object type.
1991
+ #
1992
+ # Oracle type:: Ruby type
1993
+ # Table:: {OCI8::Metadata::Table}
1994
+ # View:: {OCI8::Metadata::View}
1995
+ # Procedure:: {OCI8::Metadata::Procedure}
1996
+ # Function:: {OCI8::Metadata::Function}
1997
+ # Package:: {OCI8::Metadata::Package}
1998
+ # Type:: {OCI8::Metadata::Type}
1999
+ # Synonym:: {OCI8::Metadata::Synonym}
2000
+ # Sequence:: {OCI8::Metadata::Sequence}
2001
+ #
2002
+ # @param [String] object_name
2003
+ # @return [a subclass of OCI8::Metadata::Base]
1994
2004
  def describe_any(object_name)
1995
2005
  __describe(object_name, OCI8::Metadata::Unknown, true)
1996
2006
  end
1997
- # returns a OCI8::Metadata::Table or a OCI8::Metadata::View. If the
1998
- # name is a current schema's synonym name or a public synonym name,
1999
- # it returns a OCI8::Metadata::Table or a OCI8::Metadata::View which
2007
+ # Returns table or view information. If the name is a current schema's synonym
2008
+ # name or a public synonym name, it returns table or view information which
2000
2009
  # the synonym refers.
2001
2010
  #
2002
- # If the second argument is true, this returns a
2003
- # OCI8::Metadata::Table in the current schema.
2011
+ # If +table_only+ is true, it checks tables in the current schema.
2012
+ #
2013
+ # @param [String] table_name
2014
+ # @param [Boolean] table_only (default: false)
2015
+ # @return [OCI8::Metadata::Table or OCI8::Metadata::View]
2004
2016
  def describe_table(table_name, table_only = false)
2005
2017
  if table_only
2006
2018
  # check my own tables only.
2007
2019
  __describe(table_name, OCI8::Metadata::Table, false)
2008
2020
  else
2009
2021
  # check tables, views, synonyms and public synonyms.
2010
- metadata = __describe(table_name, OCI8::Metadata::Unknown, true)
2011
- case metadata
2012
- when OCI8::Metadata::Table, OCI8::Metadata::View
2013
- metadata
2014
- when OCI8::Metadata::Synonym
2015
- describe_table(metadata.translated_name)
2016
- else
2017
- raise OCIError.new("ORA-04043: object #{table_name} does not exist", 4043)
2022
+ recursive_level = 20
2023
+ recursive_level.times do
2024
+ metadata = __describe(table_name, OCI8::Metadata::Unknown, true)
2025
+ case metadata
2026
+ when OCI8::Metadata::Table, OCI8::Metadata::View
2027
+ return metadata
2028
+ when OCI8::Metadata::Synonym
2029
+ table_name = metadata.translated_name
2030
+ else
2031
+ raise OCIError.new(4043, table_name) # ORA-04043: object %s does not exist
2032
+ end
2018
2033
  end
2034
+ raise OCIError.new(36, recursive_level) # ORA-00036: maximum number of recursive SQL levels (%s) exceeded
2019
2035
  end
2020
2036
  end
2021
- # returns a OCI8::Metadata::View in the current schema.
2037
+ # Returns view information
2038
+ #
2039
+ # @param [String] view_name
2040
+ # @return [OCI8::Metadata::View]
2022
2041
  def describe_view(view_name)
2023
2042
  __describe(view_name, OCI8::Metadata::View, false)
2024
2043
  end
2025
- # returns a OCI8::Metadata::Procedure in the current schema.
2044
+ # Returns procedure information
2045
+ #
2046
+ # @param [String] procedure_name
2047
+ # @return [OCI8::Metadata::Procedure]
2026
2048
  def describe_procedure(procedure_name)
2027
2049
  __describe(procedure_name, OCI8::Metadata::Procedure, false)
2028
2050
  end
2029
- # returns a OCI8::Metadata::Function in the current schema.
2051
+ # Returns function information
2052
+ #
2053
+ # @param [String] function_name
2054
+ # @return [OCI8::Metadata::Function]
2030
2055
  def describe_function(function_name)
2031
2056
  __describe(function_name, OCI8::Metadata::Function, false)
2032
2057
  end
2033
- # returns a OCI8::Metadata::Package in the current schema.
2058
+ # Returns package information
2059
+ #
2060
+ # @param [String] package_name
2061
+ # @return [OCI8::Metadata::Package]
2034
2062
  def describe_package(package_name)
2035
2063
  __describe(package_name, OCI8::Metadata::Package, false)
2036
2064
  end
2037
- # returns a OCI8::Metadata::Type in the current schema.
2065
+ # Returns type information
2066
+ #
2067
+ # @param [String] type_name
2068
+ # @return [OCI8::Metadata::Type]
2038
2069
  def describe_type(type_name)
2039
2070
  __describe(type_name, OCI8::Metadata::Type, false)
2040
2071
  end
2041
- # returns a OCI8::Metadata::Synonym in the current schema.
2072
+ # Returns synonym information
2073
+ #
2074
+ # @param [String] synonym_name
2075
+ # @return [OCI8::Metadata::Synonym]
2042
2076
  def describe_synonym(synonym_name, check_public_also = true)
2043
2077
  __describe(synonym_name, OCI8::Metadata::Synonym, check_public_also)
2044
2078
  end
2045
- # returns a OCI8::Metadata::Sequence in the current schema.
2079
+ # Returns sequence information
2080
+ #
2081
+ # @param [String] sequence_name
2082
+ # @return [OCI8::Metadata::Sequence]
2046
2083
  def describe_sequence(sequence_name)
2047
2084
  __describe(sequence_name, OCI8::Metadata::Sequence, false)
2048
2085
  end
2049
- # returns a OCI8::Metadata::Schema in the database.
2086
+ # Returns schema information
2087
+ #
2088
+ # @param [String] schema_name
2089
+ # @return [OCI8::Metadata::Schema]
2050
2090
  def describe_schema(schema_name)
2051
2091
  __describe(schema_name, OCI8::Metadata::Schema, false)
2052
2092
  end
2053
- # returns a OCI8::Metadata::Database.
2093
+ # Returns database information
2094
+ #
2095
+ # @param [String] database_name
2096
+ # @return [OCI8::Metadata::Database]
2054
2097
  def describe_database(database_name)
2055
2098
  __describe(database_name, OCI8::Metadata::Database, false)
2056
2099
  end