ibm_db 2.5.17-universal-darwin-13 → 2.5.18-universal-darwin-13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fea2b65f9dd0e6630bb1b017972f536350a5f2e
4
- data.tar.gz: dc5e7850a3e1b3a7e2bdc637b59db9e55ce88f19
3
+ metadata.gz: 2b2eedce5130575df772ad881a0cdf64d5873c6f
4
+ data.tar.gz: 09d2c19de6922abdd25c5d741a4c8071831bb9ff
5
5
  SHA512:
6
- metadata.gz: f6c5e50515a452bc6138af2a7a7635b21beb971f66f8008aedf825474be2105176b792339fd94d76418aebc48431b62e5047f60f8deead75ec9d2149cc29141e
7
- data.tar.gz: da381ee2f22873eee644210b0c86bb0ba8a68de84ee9b9378fde1618f96409388c623158e4b3e097a77870e8d12c3f0574c8353d4f5484cb8c2a98635f1a7eca
6
+ metadata.gz: f2fdf68cfd2e4e4b346b24ba4111cffae48bf85e47dda2699af32266af74405c9ced68069cc91991eb50506744acf33dc6651de38d0fdf661fe438d19d02f4ff
7
+ data.tar.gz: 09fdf52f59b67debc4c21614889ad462b706061cc29af1ee1c17eedc655b63ed97d573d89871690cc46fc8c193fa8f7ff37a250dfd05982b097c6b955851f34d
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
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.17
4
+ version: 2.5.18
5
5
  platform: universal-darwin-13
6
6
  authors:
7
7
  - IBM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-06 00:00:00.000000000 Z
11
+ date: 2014-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.15.1
27
27
  description:
28
- email: rubyibm-developers@rubyforge.org
28
+ email: opendev@us.ibm.com
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files:
@@ -80,10 +80,15 @@ files:
80
80
  - test/schema/luw/ibm_db_specific_schema.rb
81
81
  - test/schema/schema.rb
82
82
  - test/schema/zOS/ibm_db_specific_schema.rb
83
- homepage: http://rubyforge.org/projects/rubyibm/
83
+ homepage: https://github.com/ibmdb/ruby-ibmdb
84
84
  licenses: []
85
85
  metadata: {}
86
- post_install_message:
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
+
87
92
  rdoc_options: []
88
93
  require_paths:
89
94
  - lib