db2 2.5.6 → 2.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/CHANGES +17 -0
  2. data/README +79 -141
  3. data/ext/extconf.rb +75 -14
  4. metadata +32 -68
  5. data/.gitignore +0 -1
  6. data/LICENSE +0 -18
  7. data/ParameterizedQueries README +0 -39
  8. data/ext/Makefile.nt32 +0 -181
  9. data/ext/ibm_db.c +0 -11166
  10. data/ext/ruby_ibm_db.h +0 -236
  11. data/ext/ruby_ibm_db_cli.c +0 -738
  12. data/ext/ruby_ibm_db_cli.h +0 -431
  13. data/init.rb +0 -42
  14. data/lib/IBM_DB.rb +0 -2
  15. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +0 -2558
  16. data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +0 -1965
  17. data/lib/active_record/vendor/db2-i5-zOS.yaml +0 -328
  18. data/test/cases/adapter_test.rb +0 -202
  19. data/test/cases/associations/belongs_to_associations_test.rb +0 -486
  20. data/test/cases/associations/cascaded_eager_loading_test.rb +0 -183
  21. data/test/cases/associations/eager_test.rb +0 -862
  22. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +0 -917
  23. data/test/cases/associations/has_many_through_associations_test.rb +0 -461
  24. data/test/cases/associations/join_model_test.rb +0 -793
  25. data/test/cases/attribute_methods_test.rb +0 -621
  26. data/test/cases/base_test.rb +0 -1486
  27. data/test/cases/calculations_test.rb +0 -362
  28. data/test/cases/finder_test.rb +0 -1088
  29. data/test/cases/fixtures_test.rb +0 -684
  30. data/test/cases/migration_test.rb +0 -2014
  31. data/test/cases/schema_dumper_test.rb +0 -232
  32. data/test/cases/validations/uniqueness_validation_test.rb +0 -283
  33. data/test/connections/native_ibm_db/connection.rb +0 -42
  34. data/test/ibm_db_test.rb +0 -25
  35. data/test/models/warehouse_thing.rb +0 -5
  36. data/test/schema/i5/ibm_db_specific_schema.rb +0 -135
  37. data/test/schema/ids/ibm_db_specific_schema.rb +0 -138
  38. data/test/schema/luw/ibm_db_specific_schema.rb +0 -135
  39. data/test/schema/schema.rb +0 -647
  40. data/test/schema/zOS/ibm_db_specific_schema.rb +0 -206
data/CHANGES CHANGED
@@ -1,5 +1,22 @@
1
1
  Change Log
2
2
  ==============
3
+ 2012/05/01 (IBM_DB adapter 2.5.10, driver 2.5.10) :
4
+ - Support for Rails-3.2
5
+ - Changes in installation process. Now user should set only one environment variable IBM_DB_HOME to DB2/IBM_Data_Server_Driver installation directory
6
+ - Fixed bug #29541 - Serialize data when corresponding field maps to CLOB type on Database
7
+ - Fixed bug #29561 - Fixed data truncation error when client and server codepages are different
8
+ - Updated IBM_DB specifics of AR test suite as per Rails-3.2.3
9
+
10
+ 2012/01/03 (IBM_DB adapter 2.5.9, driver 2.5.9) :
11
+ - Support for Create and Drop database on DB2 LUW with DB2 client version V97fp4 and above
12
+ - Fixed bug #29482 - Fixed bigint being returned as string in the adapter
13
+
14
+ 2011/09/18 (IBM_DB adapter 2.5.7, driver 2.5.7) :
15
+ - Support for Rails-3.1.0
16
+ - Fixed bug #29052 -> prepare results in empty error message
17
+ - Support for continuation of method IBM_DB.conn_error and IBM_DB.conn_errormsg - #29324
18
+ - Test suite update as for Rails-3.1.0
19
+
3
20
  2011/02/07 (IBM_DB adapter 2.5.6, driver 2.5.6) :
4
21
  - Fixed Bug #28622, #28881
5
22
  - Decimal datatypes will now be returned as BigDecimal type from the driver
data/README CHANGED
@@ -1,5 +1,5 @@
1
1
  =====================================================================
2
- README for the IBM_DB Adapter (2.5.5) and Driver (2.5.5) (2011/02/07)
2
+ README for the IBM_DB Adapter (2.5.10) and Driver (2.5.10) (2012/04/30)
3
3
  For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
4
4
  =====================================================================
5
5
 
@@ -14,11 +14,11 @@ Supported Operating Systems
14
14
 
15
15
  Supported Databases
16
16
  ====================
17
- - IBM DB2 Universal Database on Linux/Unix/Windows versions 8 Fixpak15 or 9 Fixpak2 and above
17
+ - IBM DB2 Universal Database on Linux/Unix/Windows versions 9 Fixpak2 and above
18
18
  - Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
19
19
  Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
20
20
  and PTF SI27256 is installed while using i5/OS version 5R4.
21
- - Remote connections to IBM DB2 Universal Database on z/OS version 8 and 9
21
+ - Remote connections to IBM DB2 Universal Database on z/OS version 8, 9 and 10
22
22
  - Informix Dynamic Server 11.10 and beyond.
23
23
  Please ensure that the IBM DataServer Viper 2 client is installed.
24
24
 
@@ -37,32 +37,18 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
37
37
  INSTALL (as Ruby gem)
38
38
  To remove previous gem version (optionally):
39
39
  D:\>gem uninstall ibm_db
40
- Successfully uninstalled ibm_db version 0.6.0
40
+ Successfully uninstalled ibm_db version 1.0.0
41
41
 
42
42
  Example:
43
43
  D:\>gem install ibm_db
44
- Bulk updating gem source index for: http://gems.rubyforge.org
45
- Select which gem to install for your platform (i386-mswin32)
46
- 1. ibm_db 1.0.0 (mswin32)
47
- 2. ibm_db 1.0.0 (ruby)
48
- 3. ibm_db 0.10.0 (mswin32)
49
- 4. ibm_db 0.10.0 (ruby)
50
-
51
- Running gem install ibm_db you are presented with two choices for each release
52
- (mswin32 or ruby)choose mswin32. This will install the IBM_DB gem containing
53
- the pre-built binary file of the driver which is a C-extension of Ruby.
54
-
55
- TEST (simple gem install verification)
56
- Note: The manual step after install if using activerecord version below 2.0:
44
+ Fetching: ibm_db-2.5.9-x86-mingw32.gem (100%)
45
+ Successfully installed ibm_db-2.5.9-x86-mingw32
46
+ 1 gem installed
47
+ Installing ri documentation for ibm_db-2.5.9-x86-mingw32...
48
+ Installing RDoc documentation for ibm_db-2.5.9-x86-mingw32...
49
+
50
+ Note: The manual step after install if using activerecord version below 2.0:
57
51
  add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
58
- D:\rails NewApp
59
- D:\cd NewApp
60
- D:\NewApp>irb
61
- irb(main):001:0> gem 'ibm_db'
62
- irb(main):002:0> require 'mswin32/ibm_db' // notice the [mswin32] in the library path
63
- irb(main):003:0> IBM_DB.connect 'sample', 'db2admin', 'secret'
64
- D:\NewApp>ruby script\console
65
-
66
52
 
67
53
  2. Linux and Unix platforms:
68
54
  ============================
@@ -75,32 +61,13 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
75
61
  Note: DB2 environment is required while using an arbitrary user account
76
62
  (other than the DB2 install user account)
77
63
  $ . /home/db2inst1/sqllib/db2profile
78
- $ export IBM_DB_INCLUDE=DB2HOME/include (eg. /home/db2inst1/sqllib/include or /opt/ibm/db2/v9.5/include)
79
- $ export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib or /opt/ibm/db2/V9.5/lib32)
64
+ $ export IBM_DB_DIR=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
80
65
  $ gem install ibm_db
81
- Select which gem to install for your platform (i686-linux)
82
- 1. ibm_db 1.0.0 (mswin32)
83
- 2. ibm_db 1.0.0 (ruby)
84
- 3. ibm_db 0.10.0 (ruby)
85
- 4. ibm_db 0.10.0 (mswin32)
86
- ...
87
- Running gem install ibm_db you are presented with two choices for each release
88
- (mswin32 or ruby) choose ruby. This will build the native extension (ibm_db driver) and installs the ibm_db gem.
89
- ...
90
- > 2
91
66
  Building native extensions. This could take a while...
92
- Successfully installed ibm_db-0.6.5
93
- Installing ri documentation for ibm_db-0.6.5...
94
- Installing RDoc documentation for ibm_db-0.6.5...
95
-
96
- TEST (simple gem install verification)
97
- Note: The manual step after install, if using activerecord version below 2.0 is:
98
- add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
99
- $ irb
100
- irb(main):001:0> gem 'ibm_db'
101
- irb(main):002:0> require 'ibm_db' // notice the library path (different on win32, use require 'mswin32/ibm_db')
102
- irb(main):003:0> IBM_DB.connect 'sample', 'db2admin', 'secret'
103
- $
67
+ Successfully installed ibm_db-2.5.9
68
+ 1 gem installed
69
+ Installing ri documentation for ibm_db-2.5.9...
70
+ Installing RDoc documentation for ibm_db-2.5.9...
104
71
 
105
72
  BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
106
73
  1. Download source from Rubyforge
@@ -109,80 +76,84 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
109
76
  $ cd IBM_DB_Adapter/ibm_db
110
77
  $ gem build IBM_DB.gemspec
111
78
 
79
+ Note: The manual step after install if using activerecord version below 2.0:
80
+ add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
112
81
 
82
+ TEST (simple gem install verification)
83
+ ======================================
84
+ $ rails new myApp -d ibm_db
85
+ $ cd myApp
86
+ $ rails generate scaffold Wood name:string price:float
87
+ $ vi config/database.yml
88
+ $ rake db:migrate
89
+ $ rails console #rails server
90
+
113
91
  Instructions for building and installing the IBM_DB driver from source
114
92
  =======================================================================
115
93
  Building the driver manually as described below is not required if the install
116
94
  process above has been pursued. This manual procedure is in fact automated
117
95
  on Linux and UNIX platforms by the IBM_DB gem install, but is presented
118
- here only for reference, and also involves running the unit tests.
96
+ here only for reference.
119
97
 
120
98
  Prerequisites:
121
99
  Install Ruby from:
122
100
  http://rubyforge.org
123
101
 
124
- Linux and Unix platforms:
125
- Note: commands may vary depending on the shell used
126
- - To setup DB2 environment while using an arbitrary user account
127
- (other than the DB2 install user account):
128
- Example:
129
- $ . /home/db2inst1/sqllib/db2profile
130
-
131
- - To configure test database:
132
- DB2 v9.x: some IBM_DB driver tests require a UTF-8 database:
133
- $ db2 CREATE DATABASE testdrv USING CODESET UTF-8 \
134
- TERRITORY US COLLATE USING SYSTEM PAGESIZE 32768
135
- DB2 v8.x: driver tests 195 and 52949 requires XML functionality
136
- only available in DB2 v9.x
137
-
138
- - To configure database connection parameters edit config.yaml
139
- Example:
140
- database: testdrv
141
- user: db2inst1
142
- password: password
143
- hostname: localhost
144
- port: 50000
145
-
146
- - To compile and link with DB2 client libraries:
147
- $ export IBM_DB_INCLUDE=DB2HOME/include (eg. /home/db2inst1/sqllib/include or /opt/ibm/db2/v9.5/include)
148
- $ export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib or /opt/ibm/db2/V9.5/lib32)
149
-
150
- Windows platforms:
151
- - Install Visual C++ 2005, Platform SDK (latest), .Net SDK (latest)
152
- - Set environment:
153
- CALL "C:\Program Files\Microsoft Platform SDK for Windows Server 2005\SetEnv.Cmd"
154
- CALL "C:\Program Files\Microsoft Visual C++ Toolkit 2005\vcvars32.bat"
155
- SET LIB=%LIB%;C:\Program Files\Microsoft Visual Studio .NET 2005\Vc8\lib
156
- - To configure database connection parameters edit config.yml
102
+ Setup the environment
157
103
 
158
- Build and Execution:
159
- rake
160
-
161
- Execution of tests without compilation (must have .so in ibm_db source directory):
162
- rake onlytests
163
-
164
- Execution of a single test inside the tests directory can be done by the following:
165
- export SINGLE_RUBY_TEST=test_001_CtlgConn.rb
166
- rake
167
-
104
+ Linux and Unix platforms:
105
+ Note: commands may vary depending on the shell used
106
+ - To setup DB2 environment while using an arbitrary user account
107
+ (other than the DB2 install user account):
108
+ Example:
109
+ $ . /home/db2inst1/sqllib/db2profile
110
+
111
+ - To compile and link with DB2 client libraries:
112
+ $ export IBM_DB_DIR=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
113
+
114
+ Windows platforms:
115
+ - Set ruby devkit environment:
116
+ - To compile and link with DB2 client libraries:
117
+ $ set IBM_DB_DIR=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
118
+
119
+ Build the driver:
120
+ - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
121
+ - $ ruby extconf.rb
122
+ - $ make
123
+
124
+ Build the ibm_db gem
125
+ - $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
126
+ # Not on windows separate binaries are generated for 1.8 and 1.9 version of ruby
127
+ # and placed under rb18x and rb19x directories respectively. The file ibm_db_mswin32.rb is renamed to ibm_db.rb to ensure proper binary is loaded based on runtime
128
+ # You will need to similarly ensure that the generated binary is placed on rb18x or rb19x directory under lib based on ruby version being used
129
+ - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db
130
+ - $ gem build IBM_DB.gemspec
131
+
132
+ Running tests
133
+ =============
134
+ Testing the IBM_DB Adapter
135
+
136
+ 1) a) Copy the files under test directory of ibm_db gem to the test directory of Activerecord following the same directory structure.
137
+ These files contain modifications in some test files of AR suite to handle ibm_db specifics. Hence make sure these files are replaced in the AR test suite properly.
138
+ b) Rename warhouse-things.yml to warehouse_things.yml under fixtures directory
139
+ 2) Edit the Rakefile to include ibm_db in list of adapters
140
+ %w( mysql mysql2 postgresql sqlite3 sqlite3_mem firebird db2 oracle sybase openbase ibm_db frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
141
+ 3) Configure the connection information in test/config.yml for ibm_db
142
+ 4) run the test suite - rake test_ibm_db
143
+
144
+ Running IBM_DB driver test suite
145
+
146
+ 1) Copy over the test directory under source to lib directory of installed ibm_db under $GEM_HOME
147
+ 2) Edit config.yml file to provide database connection information
148
+ 3) Run the test suite
149
+ $ rake onlytests
150
+ 4) To run single test
151
+ export SINGLE_RUBY_TEST=<test file name> #Eg: export SINGLE_RUBY_TEST=test_000_PrepareDb.rb
152
+ rake onlytests
168
153
 
169
154
  Limitations and known problems
170
155
  ==============================
171
- - ActiveRecord rename_column method is not supported for DB2 LUW, zOS and i5
172
156
  - ActiveRecord remove_column method is not supported for DB2 zOS
173
- - The following tests from the ActiveRecord 1.15.3 test suite with ibm_db gem < 0.9.5 are expected to fail
174
- - test_limited_eager_with_multiple_order_columns
175
- - test_limited_eager_with_order
176
- - test_assign_ids_ignoring_blanks
177
- - test_build_by_new_record
178
- - test_get_ids
179
- - test_select_limited_ids_list
180
- - test_add_index
181
- - The following tests from the driver test suite are expected to fail on DB2 version 8
182
- on Linux/Unix/Windows and Informix Dynamic Server because of missing native XML support. If you want to
183
- make use of the native XML features in DB2, please upgrade to version 9 or later
184
- - test_195.rb
185
- - test_52949.rb
186
157
  - The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
187
158
  To fix this, please ensure that the following configuration keyword PATCH2=58 is set
188
159
  in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
@@ -191,7 +162,7 @@ Limitations and known problems
191
162
  Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
192
163
  for more information.
193
164
  - The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
194
- The first record (i.e. the record with the minimum id) may be not be retrieved. In a relational model,
165
+ The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
195
166
  the order of the rows returned is unpredictable and independent of the order of insertion.
196
167
  This issue may be addressed in a future release.
197
168
  - Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
@@ -202,32 +173,17 @@ Limitations and known problems
202
173
  To enable this parameter, you need to restart your DB2 instance.
203
174
  - If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
204
175
  Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
205
- - The following tests from the ActiveRecord 1.15.3 test suite with ibm_db gem < 0.9.5 are expected to fail on Informix Dynamic Server
206
- - test_quote
207
- - test_to_xml
208
- - test_should_calculate_grouped_by_function
209
- - test_should_calculate_grouped_by_function_with_table_alias
210
- - test_inserts_with_pre_and_suffix
211
- - test_add_table_with_decimals
212
- - test_no_limits_datatypes_IBM_DB
213
- - test_instance_update_should_quote_pkey
214
- - test_integer_columns
215
- - test_arguments_line_up
216
- - test_no_dump_errors
217
- - test_schema_dump_includes_decimal_options
218
176
  - IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
219
177
  'You may install other gems, but keep in mind that libraries with C extension dependencies
220
178
  will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
221
179
  The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
222
180
  CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
223
181
  implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
224
- - Query caching feature of ActiveRecord-2.0 not supported
225
182
  - When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
226
183
  http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
227
184
  The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
228
185
  which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
229
186
  http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations
230
- - ActiveRecord-2.1.0 test suite changes appropriate for DB2/IDS will be updated in the next release of the gem.(Updated in release 0.10.0)
231
187
  - The following tests from the ActiveRecord 2.1.0 test suite with ibm_db gem 0.10.0 are expected to fail on DB2 LUW
232
188
  - test_read_attributes_before_type_cast_on_datetime
233
189
  - test_to_xml
@@ -241,24 +197,6 @@ Limitations and known problems
241
197
  the complete suite. However they pass when run standalone.
242
198
  2) Also there are two test cases (test_validate_uniqueness_with_non_standard_table_names, test_update_all_with_non_standard_table_name)which run against table with non-standard name. Given that DB2/IDS is standard compliant these test cases are expected to fail.
243
199
  To have these test cases passing rename the fixtures file warehouse-things to warehouse_things.
244
- - The following tests from the ActiveRecord 2.1.0 test suite with ibm_db gem 0.10.0 are expected to fail on Informix Dynamic Server
245
- - test_attributes_on_dummy_time
246
- - test_quote
247
- - test_read_attributes_before_type_cast_on_datetime
248
- - test_save_for_record_with_only_primary_key
249
- - test_save_for_record_with_only_primary_key_that_is_provided
250
- - test_to_xml
251
- - test_utc_as_time_zone
252
- - test_should_calculate_grouped_by_function
253
- - test_should_calculate_grouped_by_function_with_table_alias
254
- - test_include_query
255
- - test_binary_in_fixtures
256
- - test_inserts_with_pre_and_suffix
257
- - test_create
258
- - test_add_column_with_precision_and_scale
259
- - test_add_table_with_decimals
260
- - test_native_types
261
- - test_schema_dump_includes_decimal_options
262
200
  - Usage with Rails-3.0.3/Rails-3.0.4
263
201
  - To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
264
202
 
@@ -3,19 +3,81 @@
3
3
  # +----------------------------------------------------------------------+
4
4
  # | Licensed Materials - Property of IBM |
5
5
  # | |
6
- # | (C) Copyright IBM Corporation 2006, 2007,2008 |
6
+ # | (C) Copyright IBM Corporation 2006 - 2012 |
7
7
  # +----------------------------------------------------------------------+
8
8
 
9
+ WIN = RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/
10
+
11
+ # use ENV['IBM_DB_HOME'] or latest db2 you can find
12
+ IBM_DB_HOME = ENV['IBM_DB_HOME']
13
+
14
+ machine_bits = ['ibm'].pack('p').size * 8
15
+
16
+ is64Bit = true
17
+
18
+ module Kernel
19
+ def suppress_warnings
20
+ origVerbosity = $VERBOSE
21
+ $VERBOSE = nil
22
+ result = yield
23
+ $VERBOSE = origVerbosity
24
+ return result
25
+ end
26
+ end
27
+
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 "
34
+ end
35
+
36
+ if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
37
+ IBM_DB_INCLUDE = ENV['IBM_DB_INCLUDE']
38
+ IBM_DB_LIB = ENV['IBM_DB_LIB']
39
+
40
+ if( ( (IBM_DB_INCLUDE.nil?) || (IBM_DB_LIB.nil?) ) ||
41
+ ( IBM_DB_INCLUDE == '' || IBM_DB_LIB == '' )
42
+ )
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
45
+ end
46
+ else
47
+ IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
48
+
49
+ if(is64Bit)
50
+ IBM_DB_LIB="#{IBM_DB_HOME}/lib64"
51
+ else
52
+ IBM_DB_LIB="#{IBM_DB_HOME}/lib32"
53
+ end
54
+ end
55
+
56
+ if( !(File.directory?(IBM_DB_LIB)) )
57
+ suppress_warnings{IBM_DB_LIB = "#{IBM_DB_HOME}/lib"}
58
+ if( !(File.directory?(IBM_DB_LIB)) )
59
+ puts "Cannot find #{IBM_DB_LIB} directory. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
60
+ exit 1
61
+ end
62
+ notifyString = "Detected usage of IBM Data Server Driver package. Ensure you have downloaded "
63
+
64
+ if(is64Bit)
65
+ notifyString = notifyString + "64-bit package "
66
+ else
67
+ notifyString = notifyString + "32-bit package "
68
+ end
69
+ notifyString = notifyString + "of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command\n "
70
+
71
+ puts notifyString
72
+ end
73
+
74
+ if( !(File.directory?(IBM_DB_INCLUDE)) )
75
+ puts " #{IBM_DB_HOME}/include folder not found. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
76
+ exit 1
77
+ end
78
+
9
79
  require 'mkmf'
10
- WIN = RUBY_PLATFORM =~ /mswin/
11
-
12
- # use ENV['DB2DIR'] or latest db2 you can find
13
- # (we need to revisit default when db2 10.x comes out)
14
- IBM_DB_INCLUDE = (ENV['IBM_DB_INCLUDE'] or
15
- (Dir['/opt/*/db2/*/include'].sort_by {|f| File.basename(f)}).last )
16
- IBM_DB_LIB = (ENV['IBM_DB_LIB'] or
17
- (Dir['/opt/*/db2/*/lib32'].sort_by {|f| File.basename(f)}).last )
18
-
80
+
19
81
  dir_config('IBM_DB',IBM_DB_INCLUDE,IBM_DB_LIB)
20
82
 
21
83
  def crash(str)
@@ -30,18 +92,17 @@ end
30
92
 
31
93
  unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB))
32
94
  crash(<<EOL)
33
- Unable to locate DB2 libraries.
95
+ Unable to locate libdb2.so/a under #{IBM_DB_LIB}
34
96
 
35
97
  Follow the steps below and retry
36
98
 
37
99
  Step 1: - Install IBM DB2 Universal Database Server/Client
38
100
 
39
- step 2: - Set the environment variables IBM_DB_INCLUDE and IBM_DB_LIB as below
101
+ step 2: - Set the environment variable IBM_DB_HOME as below
40
102
 
41
103
  (assuming bash shell)
42
104
 
43
- export IBM_DB_INCLUDE=DB2HOME/include (eg. /home/db2inst1/sqllib/include or /opt/ibm/db2/v9.5/include)
44
- export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib or /opt/ibm/db2/V9.5/lib32)
105
+ export IBM_DB_HOME=<DB2/IBM_Data_Server_Driver installation directory> #(Eg: export IBM_DB_HOME=/opt/ibm/db2/v10)
45
106
 
46
107
  step 3: - Retry gem install
47
108
 
metadata CHANGED
@@ -2,78 +2,42 @@
2
2
  name: db2
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.5.6
5
+ version: 2.5.10
6
6
  platform: ruby
7
7
  authors:
8
- - IBM
8
+ - IBM
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-08 00:00:00 -08:00
14
- default_executable:
13
+ date: 2012-05-01 00:00:00 Z
15
14
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: activerecord
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: 1.15.1
25
- type: :runtime
26
- version_requirements: *id001
15
+ - !ruby/object:Gem::Dependency
16
+ name: activerecord
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.15.1
24
+ type: :runtime
25
+ version_requirements: *id001
27
26
  description:
28
27
  email: rubyibm-developers@rubyforge.org
29
28
  executables: []
30
29
 
31
30
  extensions:
32
- - ext/extconf.rb
33
- extra_rdoc_files: []
34
-
31
+ - ext/extconf.rb
32
+ extra_rdoc_files:
33
+ - CHANGES
34
+ - README
35
+ - MANIFEST
35
36
  files:
36
- - .gitignore
37
- - CHANGES
38
- - LICENSE
39
- - MANIFEST
40
- - ParameterizedQueries README
41
- - README
42
- - ext/Makefile.nt32
43
- - ext/extconf.rb
44
- - ext/ibm_db.c
45
- - ext/ruby_ibm_db.h
46
- - ext/ruby_ibm_db_cli.c
47
- - ext/ruby_ibm_db_cli.h
48
- - init.rb
49
- - lib/IBM_DB.rb
50
- - lib/active_record/connection_adapters/ibm_db_adapter.rb
51
- - lib/active_record/connection_adapters/ibm_db_pstmt.rb
52
- - lib/active_record/vendor/db2-i5-zOS.yaml
53
- - test/cases/adapter_test.rb
54
- - test/cases/associations/belongs_to_associations_test.rb
55
- - test/cases/associations/cascaded_eager_loading_test.rb
56
- - test/cases/associations/eager_test.rb
57
- - test/cases/associations/has_and_belongs_to_many_associations_test.rb
58
- - test/cases/associations/has_many_through_associations_test.rb
59
- - test/cases/associations/join_model_test.rb
60
- - test/cases/attribute_methods_test.rb
61
- - test/cases/base_test.rb
62
- - test/cases/calculations_test.rb
63
- - test/cases/finder_test.rb
64
- - test/cases/fixtures_test.rb
65
- - test/cases/migration_test.rb
66
- - test/cases/schema_dumper_test.rb
67
- - test/cases/validations/uniqueness_validation_test.rb
68
- - test/connections/native_ibm_db/connection.rb
69
- - test/ibm_db_test.rb
70
- - test/models/warehouse_thing.rb
71
- - test/schema/i5/ibm_db_specific_schema.rb
72
- - test/schema/ids/ibm_db_specific_schema.rb
73
- - test/schema/luw/ibm_db_specific_schema.rb
74
- - test/schema/schema.rb
75
- - test/schema/zOS/ibm_db_specific_schema.rb
76
- has_rdoc: true
37
+ - CHANGES
38
+ - README
39
+ - MANIFEST
40
+ - ext/extconf.rb
77
41
  homepage: http://rubyforge.org/projects/rubyibm/
78
42
  licenses: []
79
43
 
@@ -81,23 +45,23 @@ post_install_message:
81
45
  rdoc_options: []
82
46
 
83
47
  require_paths:
84
- - lib
48
+ - lib
85
49
  required_ruby_version: !ruby/object:Gem::Requirement
86
50
  none: false
87
51
  requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: 1.8.6
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.8.6
91
55
  required_rubygems_version: !ruby/object:Gem::Requirement
92
56
  none: false
93
57
  requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: "0"
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: "0"
97
61
  requirements:
98
- - ActiveRecord, at least 1.15.1
62
+ - ActiveRecord, at least 1.15.1
99
63
  rubyforge_project: rubyibm
100
- rubygems_version: 1.6.2
64
+ rubygems_version: 1.8.24
101
65
  signing_key:
102
66
  specification_version: 3
103
67
  summary: "Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows, DB2 on zOS, DB2 on i5/OS, Informix (IDS)}"