ibm_db 2.5.26-universal-darwin-14 → 2.6.1-universal-darwin-14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +11 -0
  3. data/MANIFEST +14 -14
  4. data/README +225 -225
  5. data/ext/Makefile.nt32 +181 -181
  6. data/ext/Makefile.nt32.191 +212 -212
  7. data/ext/extconf.rb +264 -261
  8. data/ext/extconf_MacOS.rb +269 -0
  9. data/ext/ibm_db.c +11879 -11793
  10. data/ext/ruby_ibm_db.h +241 -240
  11. data/ext/ruby_ibm_db_cli.c +851 -845
  12. data/ext/ruby_ibm_db_cli.h +500 -489
  13. data/init.rb +41 -41
  14. data/lib/IBM_DB.rb +27 -19
  15. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +3339 -3289
  16. data/lib/active_record/connection_adapters/ibmdb_adapter.rb +1 -1
  17. data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -328
  18. data/test/cases/adapter_test.rb +207 -207
  19. data/test/cases/associations/belongs_to_associations_test.rb +711 -711
  20. data/test/cases/associations/cascaded_eager_loading_test.rb +181 -181
  21. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +851 -851
  22. data/test/cases/associations/join_model_test.rb +743 -743
  23. data/test/cases/attribute_methods_test.rb +822 -822
  24. data/test/cases/base_test.rb +2133 -2133
  25. data/test/cases/calculations_test.rb +482 -482
  26. data/test/cases/migration_test.rb +2408 -2408
  27. data/test/cases/persistence_test.rb +642 -642
  28. data/test/cases/query_cache_test.rb +257 -257
  29. data/test/cases/relations_test.rb +1182 -1182
  30. data/test/cases/schema_dumper_test.rb +256 -256
  31. data/test/cases/transaction_callbacks_test.rb +300 -300
  32. data/test/cases/validations/uniqueness_validation_test.rb +299 -299
  33. data/test/cases/xml_serialization_test.rb +408 -408
  34. data/test/config.yml +154 -154
  35. data/test/connections/native_ibm_db/connection.rb +43 -43
  36. data/test/ibm_db_test.rb +24 -24
  37. data/test/models/warehouse_thing.rb +4 -4
  38. data/test/schema/schema.rb +751 -751
  39. metadata +6 -8
  40. data/lib/linux/rb18x/ibm_db.bundle +0 -0
  41. data/lib/linux/rb19x/ibm_db.bundle +0 -0
  42. data/lib/linux/rb20x/ibm_db.bundle +0 -0
  43. data/lib/linux/rb21x/ibm_db.bundle +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a89f1df0cada9ef8370f10f1d7ecf6c46ad3bf6d
4
- data.tar.gz: d1b0b8b53098c0df958acf9f92ed04d46deb071a
3
+ metadata.gz: e92edeb97c8d756fd745a51edce4abd6faf3c86b
4
+ data.tar.gz: 329143fcf323dbaea384aa8bd6841694acee8e4e
5
5
  SHA512:
6
- metadata.gz: beac5f73962c134c4c67f89b56b7a51510a75712370f422f614e94ff8861406e1fa7a9f9198dd5f623c4b550b3fa1d64ec8b026d41408ed71a88cd059516f701
7
- data.tar.gz: 2c5889a07c785a3e824f7c423e1686c5984d6493b8391cf26150098cd63c9dff7f2a492050b78c8acc37cfd9709d415ab87a5b35e285a4cf00a6a9089f16a4ce
6
+ metadata.gz: e4272ee2751e950b4e1cdcbb220a5f3eee4a1a05b7a163581c1820c9b5bb5cc1f171216a03f135a10d70ee7dbb1084d6c4dd690beed18704d156d1f7a2da193a
7
+ data.tar.gz: ed8a6e43cf250a3fd79b4f33117bbeca7ef78d0fc4a79c380aaf23effe7e581858fd880013b5315996d52510dba9f4d641763cb5b84b3242d7daa0b55e21a501
data/CHANGES CHANGED
@@ -1,5 +1,16 @@
1
1
  Change Log
2
2
  ==============
3
+ 2015/07/14 (IBM_DB adapter 2.6.1, driver 2.6.1)
4
+ - Foreign key support
5
+
6
+ 2015/06/29 (IBM_DB adapter 2.6.0, driver 2.6.0)
7
+ - Enhanced installation for Windows to pull IBM Data Server Driver automatically on first use if not present
8
+ - Enhanced installation for Mac OS to pull IBM Data Server Driver automatically if not present
9
+ - Removed support for Ruby 1.9.3
10
+
11
+ 2015/06/08 (IBM_DB adapter 2.5.27, driver 2.5.27)
12
+ - Support for Ruby 2.2.x on Windows and Linux platform
13
+ - Fixed bug#28 Create table fails on db:migrate task in ActiveRecord 4.2.1 if database adapter not support foreign_keys.
3
14
 
4
15
  2015/04/08 (IBM_DB adapter 2.5.26, driver 2.5.26)
5
16
  - Fixed bug#22 - Error 'undefined method lookup_cast_type encountered' with rails version lesser than 4.2
data/MANIFEST CHANGED
@@ -1,14 +1,14 @@
1
- CHANGES
2
- README
3
- LICENSE
4
- ext/extconf.rb
5
- ext/ibm_db.c
6
- ext/ruby_ibm_db.h
7
- lib/IBM_DB.rb
8
- lib/linux32/ibm_db.so
9
- lib/mswin32/ibm_db.so
10
- lib/active_record/connection_adapters/ibm_db_adapter.rb
11
- lib/active_record/vendor/db2-i5-zOS.yaml
12
- test/activerecord/native_ibm_db/connection.rb
13
- test/ibm_db_test.rb
14
- MANIFEST
1
+ CHANGES
2
+ README
3
+ LICENSE
4
+ ext/extconf.rb
5
+ ext/ibm_db.c
6
+ ext/ruby_ibm_db.h
7
+ lib/IBM_DB.rb
8
+ lib/linux32/ibm_db.so
9
+ lib/mswin32/ibm_db.so
10
+ lib/active_record/connection_adapters/ibm_db_adapter.rb
11
+ lib/active_record/vendor/db2-i5-zOS.yaml
12
+ test/activerecord/native_ibm_db/connection.rb
13
+ test/ibm_db_test.rb
14
+ MANIFEST
data/README CHANGED
@@ -1,225 +1,225 @@
1
- =====================================================================
2
- README for the IBM_DB Adapter (2.5.26) and Driver (2.5.26) (2015/04/08)
3
- For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
4
- =====================================================================
5
-
6
- Supported Operating Systems
7
- ============================
8
- - Linux 32/64 bit
9
- - Microsoft Windows 32 bit
10
- - IBM AIX 32/64 bit
11
- - HP-UX 32/64 bit
12
- - Sun Solaris 32/64 bit
13
-
14
-
15
- Supported Databases
16
- ====================
17
- - IBM DB2 Universal Database on Linux/Unix/Windows versions 9 Fixpak2 and above
18
- - Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
19
- Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
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, 9 and 10
22
- - Informix Dynamic Server 11.10 and beyond.
23
- Please ensure that the IBM DataServer Viper 2 client is installed.
24
-
25
-
26
- Installing the IBM_DB adapter and driver as a Ruby gem
27
- =======================================================
28
- The IBM_DB gem is an ActiveRecord adapter. Installing the IBM_DB adapter and driver as a gem enables any application in the
29
- Ruby environment, including Rails, to interact with IBM data servers.
30
-
31
- Note : - 1) If using activerecord version below 2.0 then it requires that the ibm_db adapter be registered with the list of connection adapters by manually adding ibm_db at line 77 (approx) in the file activerecord.rb (GEM_HOME\activerecord-<version>\lib\).
32
-
33
- 2) The IBM_DB driver can also be built separately (from source) and used in direct API calls.
34
-
35
- 1. Windows platforms:
36
- =====================
37
- INSTALL (as Ruby gem)
38
- To remove previous gem version (optionally):
39
- D:\>gem uninstall ibm_db
40
- Successfully uninstalled ibm_db version 1.0.0
41
-
42
- Example:
43
- D:\>gem install ibm_db
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:
51
- 1) Currently Ruby-2.0 64-bit version on Windows is not supported as there are issues related to SQL definitions with the mingW compiler
52
- [Details can be found here https://sourceforge.net/p/mingw/bugs/2041/ ].
53
- Support will be enabled after the abive reported issue is resolved.
54
-
55
- 2)The manual step after install if using activerecord version below 2.0:
56
- add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
57
-
58
- 2. Linux and Unix platforms:
59
- ============================
60
-
61
- INSTALL (as Ruby gem)
62
- To remove previous gem version (optionally):
63
- $ gem uninstall ibm_db
64
- Successfully uninstalled ibm_db version 0.6.0
65
-
66
- Note: DB2 environment is required while using an arbitrary user account
67
- (other than the DB2 install user account)
68
- $ . /home/db2inst1/sqllib/db2profile
69
- $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
70
- $ gem install ibm_db
71
- Building native extensions. This could take a while...
72
- Successfully installed ibm_db-2.5.9
73
- 1 gem installed
74
- Installing ri documentation for ibm_db-2.5.9...
75
- Installing RDoc documentation for ibm_db-2.5.9...
76
-
77
- BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
78
- 1. Download source from Rubyforge
79
- http://rubyforge.org/frs/?group_id=2361
80
- 2. Build gem from specification (IBM_DB.gemspec)
81
- $ cd IBM_DB_Adapter/ibm_db
82
- $ gem build IBM_DB.gemspec
83
-
84
- Note: The manual step after install if using activerecord version below 2.0:
85
- add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
86
-
87
- TEST (simple gem install verification)
88
- ======================================
89
- $ rails new myApp -d ibm_db
90
- $ cd myApp
91
- $ rails generate scaffold Wood name:string price:float
92
- $ vi config/database.yml
93
- $ rake db:migrate
94
- $ rails console #rails server
95
-
96
- Instructions for building and installing the IBM_DB driver from source
97
- =======================================================================
98
- Building the driver manually as described below is not required if the install
99
- process above has been pursued. This manual procedure is in fact automated
100
- on Linux and UNIX platforms by the IBM_DB gem install, but is presented
101
- here only for reference.
102
-
103
- Prerequisites:
104
- Install Ruby from:
105
- http://rubyforge.org
106
-
107
- Setup the environment
108
-
109
- Linux and Unix platforms:
110
- Note: commands may vary depending on the shell used
111
- - To setup DB2 environment while using an arbitrary user account
112
- (other than the DB2 install user account):
113
- Example:
114
- $ . /home/db2inst1/sqllib/db2profile
115
-
116
- - To compile and link with DB2 client libraries:
117
- $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
118
-
119
- Windows platforms:
120
- - Set ruby devkit environment:
121
- - To compile and link with DB2 client libraries:
122
- $ set IBM_DB_HOME=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
123
-
124
- Build the driver:
125
- - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
126
- - $ ruby extconf.rb
127
- - $ make
128
-
129
- Build the ibm_db gem
130
- - $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
131
- # Not on windows separate binaries are generated for 1.8 and 1.9 version of ruby
132
- # 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
133
- # 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
134
- - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db
135
- - $ gem build IBM_DB.gemspec
136
-
137
- Running tests
138
- =============
139
- Testing the IBM_DB Adapter
140
-
141
- 1) a) Copy the files under test directory of ibm_db gem to the test directory of Activerecord following the same directory structure.
142
- 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.
143
- b) Rename warhouse-things.yml to warehouse_things.yml under fixtures directory
144
- 2) Edit the Rakefile to include ibm_db in list of adapters
145
- %w( mysql mysql2 postgresql sqlite3 sqlite3_mem firebird db2 oracle sybase openbase ibm_db frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
146
- 3) Configure the connection information in test/config.yml for ibm_db
147
- 4) run the test suite - rake test_ibm_db
148
-
149
- Running IBM_DB driver test suite
150
-
151
- 1) Copy over the test directory under source to lib directory of installed ibm_db under $GEM_HOME
152
- 2) Edit config.yml file to provide database connection information
153
- 3) Run the test suite
154
- $ rake onlytests
155
- 4) To run single test
156
- export SINGLE_RUBY_TEST=<test file name> #Eg: export SINGLE_RUBY_TEST=test_000_PrepareDb.rb
157
- rake onlytests
158
-
159
- Limitations and known problems
160
- ==============================
161
- - ActiveRecord remove_column method is not supported for DB2 zOS
162
- - The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
163
- To fix this, please ensure that the following configuration keyword PATCH2=58 is set
164
- in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
165
- - set: db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58
166
- - verify: db2 GET CLI CFG FOR SECTION COMMON
167
- Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
168
- for more information.
169
- - The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
170
- The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
171
- the order of the rows returned is unpredictable and independent of the order of insertion.
172
- This issue may be addressed in a future release.
173
- - Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
174
- set to or above 1024. You will need to set this parameter for each database for which you will be
175
- running DB2 on Rails applications. Following is the command syntax for updating the
176
- applheapsz parameter:
177
- > db2 update db cfg for <database_name> using APPLHEAPSZ 1024
178
- To enable this parameter, you need to restart your DB2 instance.
179
- - If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
180
- Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
181
- - IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
182
- 'You may install other gems, but keep in mind that libraries with C extension dependencies
183
- will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
184
- The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
185
- CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
186
- implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
187
- - When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
188
- http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
189
- The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
190
- which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
191
- http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations
192
- - 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
193
- - test_read_attributes_before_type_cast_on_datetime
194
- - test_to_xml
195
- - test_native_types
196
- - test_counting
197
- - test_counting_with_column_name_and_hash
198
- - test_counting_with_empty_hash_conditions
199
- - test_counting_with_single_conditions
200
- - test_counting_with_single_hash
201
- Note :- 1) The test cases from HasManyAssociations (4-8) above are found failing only when run as part of
202
- the complete suite. However they pass when run standalone.
203
- 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.
204
- To have these test cases passing rename the fixtures file warehouse-things to warehouse_things.
205
- - Usage with Rails-3.0.3/Rails-3.0.4
206
- - To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
207
-
208
- Unicode Support
209
- ===============
210
- - Available only with Ruby version 1.9 and above
211
- - Data returned from the driver will be in UTF8 encoding format.
212
- - The input data to the driver can be in any Ruby supported encoding format.
213
-
214
- To Do
215
- ====
216
- - Support ActiveRecord remove_column method for DB2 zOS version 9
217
-
218
-
219
- Feedback
220
- ========
221
- Your feedback is very much appreciated and expected through Rubyforge:
222
- - rubyibm project: http://rubyforge.org/projects/rubyibm/
223
- - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
224
- - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
225
- - IBM_DB developers: rubyibm-developers@rubyforge.org
1
+ =====================================================================
2
+ README for the IBM_DB Adapter (2.6.1) and Driver (2.6.1) (2015/07/14)
3
+ For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
4
+ =====================================================================
5
+
6
+ Supported Operating Systems
7
+ ============================
8
+ - Linux 32/64 bit
9
+ - Microsoft Windows 32 bit
10
+ - IBM AIX 32/64 bit
11
+ - HP-UX 32/64 bit
12
+ - Sun Solaris 32/64 bit
13
+
14
+
15
+ Supported Databases
16
+ ====================
17
+ - IBM DB2 Universal Database on Linux/Unix/Windows versions 9 Fixpak2 and above
18
+ - Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
19
+ Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
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, 9 and 10
22
+ - Informix Dynamic Server 11.10 and beyond.
23
+ Please ensure that the IBM DataServer Viper 2 client is installed.
24
+
25
+
26
+ Installing the IBM_DB adapter and driver as a Ruby gem
27
+ =======================================================
28
+ The IBM_DB gem is an ActiveRecord adapter. Installing the IBM_DB adapter and driver as a gem enables any application in the
29
+ Ruby environment, including Rails, to interact with IBM data servers.
30
+
31
+ Note : - 1) If using activerecord version below 2.0 then it requires that the ibm_db adapter be registered with the list of connection adapters by manually adding ibm_db at line 77 (approx) in the file activerecord.rb (GEM_HOME\activerecord-<version>\lib\).
32
+
33
+ 2) The IBM_DB driver can also be built separately (from source) and used in direct API calls.
34
+
35
+ 1. Windows platforms:
36
+ =====================
37
+ INSTALL (as Ruby gem)
38
+ To remove previous gem version (optionally):
39
+ D:\>gem uninstall ibm_db
40
+ Successfully uninstalled ibm_db version 1.0.0
41
+
42
+ Example:
43
+ D:\>gem install ibm_db
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:
51
+ 1) Currently Ruby-2.0 64-bit version on Windows is not supported as there are issues related to SQL definitions with the mingW compiler
52
+ [Details can be found here https://sourceforge.net/p/mingw/bugs/2041/ ].
53
+ Support will be enabled after the abive reported issue is resolved.
54
+
55
+ 2)The manual step after install if using activerecord version below 2.0:
56
+ add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
57
+
58
+ 2. Linux and Unix platforms:
59
+ ============================
60
+
61
+ INSTALL (as Ruby gem)
62
+ To remove previous gem version (optionally):
63
+ $ gem uninstall ibm_db
64
+ Successfully uninstalled ibm_db version 0.6.0
65
+
66
+ Note: DB2 environment is required while using an arbitrary user account
67
+ (other than the DB2 install user account)
68
+ $ . /home/db2inst1/sqllib/db2profile
69
+ $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
70
+ $ gem install ibm_db
71
+ Building native extensions. This could take a while...
72
+ Successfully installed ibm_db-2.5.9
73
+ 1 gem installed
74
+ Installing ri documentation for ibm_db-2.5.9...
75
+ Installing RDoc documentation for ibm_db-2.5.9...
76
+
77
+ BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
78
+ 1. Download source from Rubyforge
79
+ http://rubyforge.org/frs/?group_id=2361
80
+ 2. Build gem from specification (IBM_DB.gemspec)
81
+ $ cd IBM_DB_Adapter/ibm_db
82
+ $ gem build IBM_DB.gemspec
83
+
84
+ Note: The manual step after install if using activerecord version below 2.0:
85
+ add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
86
+
87
+ TEST (simple gem install verification)
88
+ ======================================
89
+ $ rails new myApp -d ibm_db
90
+ $ cd myApp
91
+ $ rails generate scaffold Wood name:string price:float
92
+ $ vi config/database.yml
93
+ $ rake db:migrate
94
+ $ rails console #rails server
95
+
96
+ Instructions for building and installing the IBM_DB driver from source
97
+ =======================================================================
98
+ Building the driver manually as described below is not required if the install
99
+ process above has been pursued. This manual procedure is in fact automated
100
+ on Linux and UNIX platforms by the IBM_DB gem install, but is presented
101
+ here only for reference.
102
+
103
+ Prerequisites:
104
+ Install Ruby from:
105
+ http://rubyforge.org
106
+
107
+ Setup the environment
108
+
109
+ Linux and Unix platforms:
110
+ Note: commands may vary depending on the shell used
111
+ - To setup DB2 environment while using an arbitrary user account
112
+ (other than the DB2 install user account):
113
+ Example:
114
+ $ . /home/db2inst1/sqllib/db2profile
115
+
116
+ - To compile and link with DB2 client libraries:
117
+ $ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
118
+
119
+ Windows platforms:
120
+ - Set ruby devkit environment:
121
+ - To compile and link with DB2 client libraries:
122
+ $ set IBM_DB_HOME=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
123
+
124
+ Build the driver:
125
+ - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
126
+ - $ ruby extconf.rb
127
+ - $ make
128
+
129
+ Build the ibm_db gem
130
+ - $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
131
+ # Not on windows separate binaries are generated for 1.8 and 1.9 version of ruby
132
+ # 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
133
+ # 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
134
+ - $ cd rubyibm_source/IBM_DB_Adapter/ibm_db
135
+ - $ gem build IBM_DB.gemspec
136
+
137
+ Running tests
138
+ =============
139
+ Testing the IBM_DB Adapter
140
+
141
+ 1) a) Copy the files under test directory of ibm_db gem to the test directory of Activerecord following the same directory structure.
142
+ 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.
143
+ b) Rename warhouse-things.yml to warehouse_things.yml under fixtures directory
144
+ 2) Edit the Rakefile to include ibm_db in list of adapters
145
+ %w( mysql mysql2 postgresql sqlite3 sqlite3_mem firebird db2 oracle sybase openbase ibm_db frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
146
+ 3) Configure the connection information in test/config.yml for ibm_db
147
+ 4) run the test suite - rake test_ibm_db
148
+
149
+ Running IBM_DB driver test suite
150
+
151
+ 1) Copy over the test directory under source to lib directory of installed ibm_db under $GEM_HOME
152
+ 2) Edit config.yml file to provide database connection information
153
+ 3) Run the test suite
154
+ $ rake onlytests
155
+ 4) To run single test
156
+ export SINGLE_RUBY_TEST=<test file name> #Eg: export SINGLE_RUBY_TEST=test_000_PrepareDb.rb
157
+ rake onlytests
158
+
159
+ Limitations and known problems
160
+ ==============================
161
+ - ActiveRecord remove_column method is not supported for DB2 zOS
162
+ - The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
163
+ To fix this, please ensure that the following configuration keyword PATCH2=58 is set
164
+ in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
165
+ - set: db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58
166
+ - verify: db2 GET CLI CFG FOR SECTION COMMON
167
+ Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
168
+ for more information.
169
+ - The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
170
+ The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
171
+ the order of the rows returned is unpredictable and independent of the order of insertion.
172
+ This issue may be addressed in a future release.
173
+ - Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
174
+ set to or above 1024. You will need to set this parameter for each database for which you will be
175
+ running DB2 on Rails applications. Following is the command syntax for updating the
176
+ applheapsz parameter:
177
+ > db2 update db cfg for <database_name> using APPLHEAPSZ 1024
178
+ To enable this parameter, you need to restart your DB2 instance.
179
+ - If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
180
+ Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
181
+ - IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
182
+ 'You may install other gems, but keep in mind that libraries with C extension dependencies
183
+ will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
184
+ The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
185
+ CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
186
+ implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
187
+ - When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
188
+ http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
189
+ The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
190
+ which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
191
+ http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations
192
+ - 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
193
+ - test_read_attributes_before_type_cast_on_datetime
194
+ - test_to_xml
195
+ - test_native_types
196
+ - test_counting
197
+ - test_counting_with_column_name_and_hash
198
+ - test_counting_with_empty_hash_conditions
199
+ - test_counting_with_single_conditions
200
+ - test_counting_with_single_hash
201
+ Note :- 1) The test cases from HasManyAssociations (4-8) above are found failing only when run as part of
202
+ the complete suite. However they pass when run standalone.
203
+ 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.
204
+ To have these test cases passing rename the fixtures file warehouse-things to warehouse_things.
205
+ - Usage with Rails-3.0.3/Rails-3.0.4
206
+ - To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
207
+
208
+ Unicode Support
209
+ ===============
210
+ - Available only with Ruby version 1.9 and above
211
+ - Data returned from the driver will be in UTF8 encoding format.
212
+ - The input data to the driver can be in any Ruby supported encoding format.
213
+
214
+ To Do
215
+ ====
216
+ - Support ActiveRecord remove_column method for DB2 zOS version 9
217
+
218
+
219
+ Feedback
220
+ ========
221
+ Your feedback is very much appreciated and expected through Rubyforge:
222
+ - rubyibm project: http://rubyforge.org/projects/rubyibm/
223
+ - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
224
+ - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
225
+ - IBM_DB developers: rubyibm-developers@rubyforge.org