ibm_db 2.5.17-x86-mingw32 → 2.5.18-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 185896a1af83a056e947422556c89297d38d9470
4
+ data.tar.gz: 347076fbb41da4aeebaeaa1b02c06382154a6414
5
+ SHA512:
6
+ metadata.gz: 238797e6f88b82b1e564494fcf378be834ba8ad3253594fdad456301412c08b005c2034bd037c7cc9247623864126d5c7e7ca92183844d24914b1a2f4eacceae
7
+ data.tar.gz: d79c8f7bbbf664275683f46043aea05d2cfb5783c12884873f1d213ca5438811499e0db5fd2e7d02182bb0facbea4ec57afb6588eb0bd6ae67047d8ebc9bbabc
data/CHANGES CHANGED
@@ -1,5 +1,9 @@
1
1
  Change Log
2
2
  ==============
3
+ 2014/08/03 (IBM_DB adapter 2.5.18, driver 2.5.14) :
4
+ - Support for Rails 4.1.x
5
+ - Enhanced installation to pull IBM Data Server Driver automatically if not present
6
+
3
7
  2014/03/03 (IBM_DB adapter 2.5.17, driver 2.5.14) :
4
8
  - Shipping binaries compatible with Ruby 2.0 for linux x86_64 systems (#29871)
5
9
  - Fixed #29869
data/ext/extconf.rb CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'net/http'
3
+ require 'open-uri'
4
+ require 'rubygems/package'
5
+ require 'zlib'
6
+ require 'fileutils'
2
7
 
3
8
  # +----------------------------------------------------------------------+
4
9
  # | Licensed Materials - Property of IBM |
@@ -6,6 +11,8 @@
6
11
  # | (C) Copyright IBM Corporation 2006 - 2012 |
7
12
  # +----------------------------------------------------------------------+
8
13
 
14
+ TAR_LONGLINK = '././@LongLink'
15
+
9
16
  WIN = RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/
10
17
 
11
18
  # use ENV['IBM_DB_HOME'] or latest db2 you can find
@@ -15,6 +22,14 @@ machine_bits = ['ibm'].pack('p').size * 8
15
22
 
16
23
  is64Bit = true
17
24
 
25
+ if machine_bits == 64
26
+ is64Bit = true
27
+ puts "Detected 64-bit Ruby\n "
28
+ else
29
+ is64Bit = false
30
+ puts "Detected 32-bit Ruby\n "
31
+ end
32
+
18
33
  module Kernel
19
34
  def suppress_warnings
20
35
  origVerbosity = $VERBOSE
@@ -25,12 +40,102 @@ module Kernel
25
40
  end
26
41
  end
27
42
 
28
- if machine_bits == 64
29
- is64Bit = true
30
- puts "Detected 64-bit Ruby\n "
31
- else
32
- is64Bit = false
33
- puts "Detected 32-bit Ruby\n "
43
+ DOWNLOADLINK = ''
44
+
45
+ if(RUBY_PLATFORM =~ /aix/i)
46
+ #AIX
47
+ if(is64Bit)
48
+ puts "Detected platform - aix 64"
49
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix64_odbc_cli.tar.gz"
50
+ else
51
+ puts "Detected platform - aix 32"
52
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix32_odbc_cli.tar.gz"
53
+ end
54
+ elsif (RUBY_PLATFORM =~ /powerpc/ || RUBY_PLATFORM =~ /ppc/)
55
+ #PPC
56
+ if(is64Bit)
57
+ puts "Detected platform - ppc linux 64"
58
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc64_odbc_cli.tar.gz"
59
+ else
60
+ puts "Detected platform - ppc linux 64"
61
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc32_odbc_cli.tar.gz"
62
+ end
63
+ elsif (RUBY_PLATFORM =~ /linux/)
64
+ #x86
65
+ if(is64Bit)
66
+ puts "Detected platform - linux x86 64"
67
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz"
68
+ else
69
+ puts "Detected platform - linux 32"
70
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz"
71
+ end
72
+ elsif (RUBY_PLATFORM =~ /sparc/i)
73
+ #Solaris
74
+ if(is64Bit)
75
+ puts "Detected platform - sun sparc64"
76
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun64_odbc_cli.tar.gz"
77
+ else
78
+ puts "Detected platform - sun sparc32"
79
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun32_odbc_cli.tar.gz"
80
+ end
81
+ elsif (RUBY_PLATFORM =~ /solaris/i)
82
+ if(is64Bit)
83
+ puts "Detected platform - sun amd64"
84
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd64_odbc_cli.tar.gz"
85
+ else
86
+ puts "Detected platform - sun amd32"
87
+ DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz"
88
+ end
89
+ end
90
+
91
+ def downloadCLIPackage(destination, link = nil)
92
+ if(link.nil?)
93
+ downloadLink = DOWNLOADLINK
94
+ else
95
+ downloadLink = link
96
+ end
97
+
98
+ uri = URI.parse(downloadLink)
99
+ filename = "#{destination}/clidriver.tar.gz"
100
+
101
+ headers = {
102
+ 'Accept-Encoding' => 'identity',
103
+ }
104
+
105
+ request = Net::HTTP::Get.new(uri.request_uri, headers)
106
+ http = Net::HTTP.new(uri.host, uri.port)
107
+ response = http.request(request)
108
+
109
+ f = open(filename, 'wb')
110
+ f.write(response.body)
111
+ f.close()
112
+
113
+ filename
114
+ end
115
+
116
+ def untarCLIPackage(archive,destination)
117
+ Gem::Package::TarReader.new( Zlib::GzipReader.open(archive) ) do |tar|
118
+ tar.each do |entry|
119
+ file = nil
120
+ if entry.full_name == $TAR_LONGLINK
121
+ file = File.join destination, entry.read.strip
122
+ next
123
+ end
124
+ file ||= File.join destination, entry.full_name
125
+ if entry.directory?
126
+ File.delete file if File.file? file
127
+ FileUtils.mkdir_p file, :mode => entry.header.mode, :verbose => false
128
+ elsif entry.file?
129
+ FileUtils.rm_rf file if File.directory? file
130
+ File.open file, "wb" do |f|
131
+ f.print entry.read
132
+ end
133
+ FileUtils.chmod entry.header.mode, file, :verbose => false
134
+ elsif entry.header.typeflag == '2' #Symlink!
135
+ File.symlink entry.header.linkname, file
136
+ end
137
+ end
138
+ end
34
139
  end
35
140
 
36
141
  if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
@@ -40,8 +145,21 @@ if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
40
145
  if( ( (IBM_DB_INCLUDE.nil?) || (IBM_DB_LIB.nil?) ) ||
41
146
  ( IBM_DB_INCLUDE == '' || IBM_DB_LIB == '' )
42
147
  )
43
- puts "Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry gem install.\n "
44
- exit 1
148
+ if(!DOWNLOADLINK.nil? && !DOWNLOADLINK.empty?)
149
+ puts "Environment variable IBM_DB_HOME is not set. Downloading and setting up the DB2 client driver\n"
150
+ destination = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/../lib"
151
+
152
+ archive = downloadCLIPackage(destination)
153
+ untarCLIPackage(archive,destination)
154
+
155
+ IBM_DB_HOME="#{destination}/clidriver"
156
+
157
+ IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
158
+ IBM_DB_LIB="#{IBM_DB_HOME}/lib"
159
+ else
160
+ puts "Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry gem install.\n "
161
+ exit 1
162
+ end
45
163
  end
46
164
  else
47
165
  IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
@@ -111,14 +229,16 @@ end
111
229
 
112
230
  alias :libpathflag0 :libpathflag
113
231
  def libpathflag(libpath)
114
- libpathflag0 + case Config::CONFIG["arch"]
232
+ ldflags = case Config::CONFIG["arch"]
115
233
  when /solaris2/
116
234
  libpath[0..-2].map {|path| " -R#{path}"}.join
117
235
  when /linux/
118
- libpath[0..-2].map {|path| " -Wl,-rpath,#{path}"}.join
236
+ libpath[0..-2].map {|path| " -R#{path} "}.join
119
237
  else
120
238
  ""
121
239
  end
240
+ #libpathflag0 + " '-Wl,-R$$ORIGIN/clidriver/lib #{ldflags}' "
241
+ libpathflag0 + " '-Wl,-R$$ORIGIN/clidriver/lib' "
122
242
  end
123
243
 
124
244
  have_header('gil_release_version')
@@ -64,9 +64,9 @@ module ActiveRecord
64
64
  # the actual large object through a prepared statement (param binding).
65
65
  after_save :handle_lobs
66
66
  def handle_lobs()
67
- if connection.kind_of?(ConnectionAdapters::IBM_DBAdapter)
67
+ if self.class.connection.kind_of?(ConnectionAdapters::IBM_DBAdapter)
68
68
  # Checks that the insert or update had at least a BLOB, CLOB or XML field
69
- connection.sql.each do |clob_sql|
69
+ self.class.connection.sql.each do |clob_sql|
70
70
  if clob_sql =~ /BLOB\('(.*)'\)/i ||
71
71
  clob_sql =~ /@@@IBMTEXT@@@/i ||
72
72
  clob_sql =~ /@@@IBMXML@@@/i ||
@@ -119,20 +119,20 @@ module ActiveRecord
119
119
  values << self[self.class.primary_key.downcase]
120
120
 
121
121
  begin
122
- unless stmt = IBM_DB.prepare(connection.connection, update_query)
123
- error_msg = IBM_DB.getErrormsg( connection.connection, IBM_DB::DB_CONN )
122
+ unless stmt = IBM_DB.prepare(self.class.connection.connection, update_query)
123
+ error_msg = IBM_DB.getErrormsg( self.class.connection.connection, IBM_DB::DB_CONN )
124
124
  if error_msg && !error_msg.empty?
125
125
  raise "Statement prepare for updating LOB/XML column failed : #{error_msg}"
126
126
  else
127
127
  raise StandardError.new('An unexpected error occurred during update of LOB/XML column')
128
128
  end
129
129
  end
130
- connection.log_query(update_query,'update of LOB/XML field(s)in handle_lobs')
130
+ self.class.connection.log_query(update_query,'update of LOB/XML field(s)in handle_lobs')
131
131
 
132
132
  # rollback any failed LOB/XML field updates (and remove associated marker)
133
133
  unless IBM_DB.execute(stmt, values)
134
134
  error_msg = "Failed to insert/update LOB/XML field(s) due to: #{IBM_DB.getErrormsg( stmt, IBM_DB::DB_STMT )}"
135
- connection.execute("ROLLBACK")
135
+ self.class.connection.execute("ROLLBACK")
136
136
  raise error_msg
137
137
  end
138
138
  rescue StandardError => error
@@ -142,7 +142,7 @@ module ActiveRecord
142
142
  end
143
143
  end # if clob_sql
144
144
  end #connection.sql.each
145
- connection.handle_lobs_triggered = true
145
+ self.class.connection.handle_lobs_triggered = true
146
146
  end # if connection.kind_of?
147
147
  end # handle_lobs
148
148
  private :handle_lobs
@@ -279,7 +279,7 @@ module ActiveRecord
279
279
 
280
280
  module ConnectionAdapters
281
281
  module SchemaStatements
282
- def create_table_definition(name, temporary, options)
282
+ def create_table_definition(name, temporary, options,as = nil)
283
283
  TableDefinition.new self, name, temporary, options
284
284
  end
285
285
  end
@@ -745,6 +745,10 @@ module ActiveRecord
745
745
  true
746
746
  end
747
747
 
748
+ def supports_foreign_keys?
749
+ false
750
+ end
751
+
748
752
  # This Adapter supports DDL transactions.
749
753
  # This means CREATE TABLE and other DDL statements can be carried out as a transaction.
750
754
  # That is the statements executed can be ROLLED BACK in case of any error during the process.
@@ -977,13 +981,20 @@ module ActiveRecord
977
981
  #Returns an array of arrays containing the field values.
978
982
  #This is an implementation for the abstract method
979
983
  #+sql+ is the select query and +name+ is an optional description for logging
980
- def select_rows(sql, name = nil)
984
+ def select_rows(sql, name = nil,binds = [])
981
985
  # Replaces {"= NULL" with " IS NULL"} OR {"IN (NULL)" with " IS NULL"}
982
986
  sql.gsub!( /(=\s*NULL|IN\s*\(NULL\))/i, " IS NULL" )
983
987
 
984
988
  results = []
985
989
  # Invokes the method +execute+ in order to log and execute the SQL
986
990
  # IBM_DB.Statement is returned from which results can be fetched
991
+ if !binds.nil? && !binds.empty?
992
+ param_array = binds.map do |column,value|
993
+ quote_value_for_pstmt(value, column)
994
+ end
995
+ return prepared_select({"sqlSegment" => sql, "paramArray" => param_array})
996
+ end
997
+
987
998
  stmt = execute(sql, name)
988
999
  if(stmt)
989
1000
  begin
metadata CHANGED
@@ -1,34 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.17
5
- prerelease:
4
+ version: 2.5.18
6
5
  platform: x86-mingw32
7
6
  authors:
8
7
  - IBM
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-02 00:00:00.000000000 Z
11
+ date: 2014-08-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activerecord
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.15.1
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.15.1
30
27
  description:
31
- email: rubyibm-developers@rubyforge.org
28
+ email: opendev@us.ibm.com
32
29
  executables: []
33
30
  extensions: []
34
31
  extra_rdoc_files:
@@ -83,31 +80,35 @@ files:
83
80
  - test/schema/luw/ibm_db_specific_schema.rb
84
81
  - test/schema/schema.rb
85
82
  - test/schema/zOS/ibm_db_specific_schema.rb
86
- homepage: http://rubyforge.org/projects/rubyibm/
83
+ homepage: https://github.com/ibmdb/ruby-ibmdb
87
84
  licenses: []
88
- post_install_message:
85
+ metadata: {}
86
+ post_install_message: |2+
87
+
88
+ *****************************************************************************
89
+ Successfully installed ibm_db, the Ruby gem for IBM DB2/Informix. The Ruby gem is licensed under the MIT License. The package also includes IBM ODBC and CLI Driver from IBM, which could have been automatically downloaded as the Ruby gem is installed on your system/device. The license agreement to the IBM driver is available in the folder "$GEM_HOME/ibm_db-*/lib/clidriver/license". Check for additional dependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If you do not accept the terms of any license agreement(s), then delete the relevant component(s) from your system/device.
90
+ *****************************************************************************
91
+
89
92
  rdoc_options: []
90
93
  require_paths:
91
94
  - lib
92
95
  required_ruby_version: !ruby/object:Gem::Requirement
93
- none: false
94
96
  requirements:
95
- - - ! '>='
97
+ - - '>='
96
98
  - !ruby/object:Gem::Version
97
99
  version: 1.8.6
98
100
  required_rubygems_version: !ruby/object:Gem::Requirement
99
- none: false
100
101
  requirements:
101
- - - ! '>='
102
+ - - '>='
102
103
  - !ruby/object:Gem::Version
103
104
  version: '0'
104
105
  requirements:
105
106
  - ActiveRecord, at least 1.15.1
106
107
  rubyforge_project: rubyibm
107
- rubygems_version: 1.8.23
108
+ rubygems_version: 2.0.14
108
109
  signing_key:
109
- specification_version: 3
110
- summary: ! 'Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows,
110
+ specification_version: 4
111
+ summary: 'Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows,
111
112
  DB2 on zOS, DB2 on i5/OS, Informix (IDS)}'
112
113
  test_files:
113
114
  - test/ibm_db_test.rb