ibm_db 2.5.17-universal-darwin-13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +221 -0
  3. data/LICENSE +18 -0
  4. data/MANIFEST +14 -0
  5. data/ParameterizedQueries README +39 -0
  6. data/README +225 -0
  7. data/ext/Makefile.nt32 +181 -0
  8. data/ext/Makefile.nt32.191 +212 -0
  9. data/ext/extconf.rb +127 -0
  10. data/ext/ibm_db.c +11719 -0
  11. data/ext/ruby_ibm_db.h +240 -0
  12. data/ext/ruby_ibm_db_cli.c +845 -0
  13. data/ext/ruby_ibm_db_cli.h +489 -0
  14. data/init.rb +42 -0
  15. data/lib/IBM_DB.rb +16 -0
  16. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +3031 -0
  17. data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1965 -0
  18. data/lib/active_record/connection_adapters/ibmdb_adapter.rb +2 -0
  19. data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
  20. data/lib/linux/rb18x/ibm_db.bundle +0 -0
  21. data/lib/linux/rb19x/ibm_db.bundle +0 -0
  22. data/lib/linux/rb20x/ibm_db.bundle +0 -0
  23. data/lib/linux/rb21x/ibm_db.bundle +0 -0
  24. data/test/cases/adapter_test.rb +207 -0
  25. data/test/cases/associations/belongs_to_associations_test.rb +711 -0
  26. data/test/cases/associations/cascaded_eager_loading_test.rb +181 -0
  27. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +851 -0
  28. data/test/cases/associations/join_model_test.rb +743 -0
  29. data/test/cases/attribute_methods_test.rb +822 -0
  30. data/test/cases/base_test.rb +2133 -0
  31. data/test/cases/calculations_test.rb +482 -0
  32. data/test/cases/migration_test.rb +2408 -0
  33. data/test/cases/persistence_test.rb +642 -0
  34. data/test/cases/query_cache_test.rb +257 -0
  35. data/test/cases/relations_test.rb +1182 -0
  36. data/test/cases/schema_dumper_test.rb +256 -0
  37. data/test/cases/transaction_callbacks_test.rb +300 -0
  38. data/test/cases/validations/uniqueness_validation_test.rb +299 -0
  39. data/test/cases/xml_serialization_test.rb +408 -0
  40. data/test/config.yml +154 -0
  41. data/test/connections/native_ibm_db/connection.rb +44 -0
  42. data/test/ibm_db_test.rb +25 -0
  43. data/test/models/warehouse_thing.rb +5 -0
  44. data/test/schema/i5/ibm_db_specific_schema.rb +137 -0
  45. data/test/schema/ids/ibm_db_specific_schema.rb +140 -0
  46. data/test/schema/luw/ibm_db_specific_schema.rb +137 -0
  47. data/test/schema/schema.rb +751 -0
  48. data/test/schema/zOS/ibm_db_specific_schema.rb +208 -0
  49. metadata +109 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7fea2b65f9dd0e6630bb1b017972f536350a5f2e
4
+ data.tar.gz: dc5e7850a3e1b3a7e2bdc637b59db9e55ce88f19
5
+ SHA512:
6
+ metadata.gz: f6c5e50515a452bc6138af2a7a7635b21beb971f66f8008aedf825474be2105176b792339fd94d76418aebc48431b62e5047f60f8deead75ec9d2149cc29141e
7
+ data.tar.gz: da381ee2f22873eee644210b0c86bb0ba8a68de84ee9b9378fde1618f96409388c623158e4b3e097a77870e8d12c3f0574c8353d4f5484cb8c2a98635f1a7eca
data/CHANGES ADDED
@@ -0,0 +1,221 @@
1
+ Change Log
2
+ ==============
3
+ 2014/03/03 (IBM_DB adapter 2.5.17, driver 2.5.14) :
4
+ - Shipping binaries compatible with Ruby 2.0 for linux x86_64 systems (#29871)
5
+ - Fixed #29869
6
+ - Support microsecond timestamp.
7
+
8
+ 2014/02/26 (IBM_DB adapter 2.5.16, driver 2.5.14) :
9
+ - Yanked version 2.5.15. Hence using new version number
10
+
11
+ 2014/02/17 (IBM_DB adapter 2.5.15, driver 2.5.14) :
12
+ - Yanked version 2.5.14. Hence using new version number
13
+
14
+ 2014/02/11 (IBM_DB adapter 2.5.14, driver 2.5.14) :
15
+ - Support for Rails 4
16
+ - Support for ruby-2.0
17
+
18
+ 2014/01/28 (IBM_DB adapter 2.5.12, driver 2.5.11) :
19
+ - Supporting usage of name ibmdb as adapter along with current name ibm_db to support requirements of cloud environments
20
+
21
+ 2012/12/07 (IBM_DB adapter 2.5.11, driver 2.5.11) :
22
+ - Fixed bug #29633 - Deletes cause too many handles to be consumed and not freed
23
+ - Support for Mac OS CLI library loading to check create and drop db functionality - #29625
24
+ - Fixed #29657 - @servertype of IBM_DBAdapter could end up being nil on DB2 for Z/OS version 9
25
+
26
+ 2012/05/01 (IBM_DB adapter 2.5.10, driver 2.5.10) :
27
+ - Support for Rails-3.2
28
+ - Changes in installation process. Now user should set only one environment variable IBM_DB_HOME to DB2/IBM_Data_Server_Driver installation directory
29
+ - Fixed bug #29541 - Serialize data when corresponding field maps to CLOB type on Database
30
+ - Fixed bug #29561 - Fixed data truncation error when client and server codepages are different
31
+ - Updated IBM_DB specifics of AR test suite as per Rails-3.2.3
32
+
33
+ 2012/01/03 (IBM_DB adapter 2.5.9, driver 2.5.9) :
34
+ - Support for Create and Drop database on DB2 LUW with DB2 client version V97fp4 and above
35
+ - Fixed bug #29482 - Fixed bigint being returned as string in the adapter
36
+
37
+ 2011/09/18 (IBM_DB adapter 2.5.7, driver 2.5.7) :
38
+ - Support for Rails-3.1.0
39
+ - Fixed bug #29052 -> prepare results in empty error message
40
+ - Support for continuation of method IBM_DB.conn_error and IBM_DB.conn_errormsg - #29324
41
+ - Test suite update as for Rails-3.1.0
42
+
43
+ 2011/02/07 (IBM_DB adapter 2.5.6, driver 2.5.6) :
44
+ - Fixed Bug #28622, #28881
45
+ - Decimal datatypes will now be returned as BigDecimal type from the driver
46
+ - Changes to rollback any active transaction in the connection destructor method if connection is not explicitly closed
47
+ - Changes to have a single gem file for ruby 1.8 and ruby 1.9
48
+ 2010/07/15 (IBM_DB adapter 2.5.5, driver 2.5.5) :
49
+ - Support for datatype Graphic and Vargraphic in driver and adapter [27965]
50
+ - Support for Bigint datatype in adapter.
51
+ - Fixed bug [28295] --> IBM_DB, Unicode Version, fails with encoding error against Informix Server
52
+
53
+ 2010/05/12 (IBM_DB adapter 2.5.0, driver 2.5.0) :
54
+ - Support for Unicode with Ruby 1.9 [Data from the IBM_DB driver is returned in UTF8 format]
55
+ - Fixed bug [27954] --> Fixed Truncation of char for bit data containing a Null Terminator
56
+ - Removed handling of NilClass type data in quote method. Super class will handle appropriately.
57
+
58
+ 2010/01/21 (IBM_DB adapter 2.0.0, driver 2.0.0) :
59
+ - Support for usage of parameterized SQL queries
60
+ - Exposed constant VERSION in the driver [Feature Request: #27231]
61
+
62
+ 2009/08/21 (IBM_DB adapter 1.5.0, driver 1.5.0) :
63
+ - non-block enhancement in the ruby driver made for Ruby version 1.9. [support request #25023]
64
+ - New API's getErrormsg and getErrorstate for retrieving error messages/state added
65
+ - Re-defined raising of exception from driver. [Bug #26544]
66
+ - Made adapter changes as per the new API's exposed in the driver for retrieving error messages
67
+ - API's conn_errormsg and stmt_errormsg is been deprecated.
68
+
69
+ 2009/07/28 (IBM_DB adapter 1.1.1, driver 1.1.0) :
70
+ - Fixed bug [26705] --> Fixed the problem of primary key value starting with 100
71
+ - Support for Activerecord-2.3.3
72
+ - Added method primary_key, which returns the primary key column name of the specified table
73
+ - Test suite updated
74
+
75
+ 2009/06/17 (IBM_DB adapter 1.1.0, driver 1.1.0) :
76
+ - Support for Activerecord's Query Cache Mechanism
77
+ - rename_column support for DB2 on LUW version 9.7, DB2 on zOS 9 and enhanced rename_column support for Informix Dynamic Server
78
+ - Support for parameterized timestamp datatype feature of DB2 on LUW Version 9.7
79
+ - Enhanced support for Bigint datatype along with support for Bigserial datatype (with client version 9.7 and above) of IDS
80
+ - Callback method handle_lobs enhanced by making it to use prepared statements completely
81
+ - Handling of exceptions during fetch operations enabled
82
+
83
+ 2009/03/24 (IBM_DB adapter 1.0.5, driver 1.0.5) :
84
+ - Support for Ruby-1.9.1
85
+ - Support for SQLRowcount in driver
86
+ - Support for Activerecord-2.3.2 [test suite updated]
87
+ - Fixed bug [24663] --> Fixed pre-mature clearing of the sql array in handle_lobs
88
+ - Fixed bug [23115] --> Fixed truncation of a nested query during update
89
+ - Fixed wrong setting of SQLID for schema on zOS 8 dataserver when schema is explicitly specified.
90
+
91
+ 2009/03/06 (IBM_DB adapter 1.0.2, driver 1.0.1) :
92
+ - Support for specifying connection timeout in adapter
93
+ - Fixed Bug [23317] --> Fixed assumption of id as the primary key while updation/insertion of lob fields
94
+ - Fixed Bug [23389] --> Provided proper exception handling.
95
+ - Fixed the insertion of incorrect value for lob objects in case of has_and_belongs_to_many associations.
96
+
97
+ 2008/12/18 (IBM_DB adapter 1.0.1, driver 1.0.1) :
98
+ - Support for datatype decfloat
99
+ - Changes in installation process. Now user should set IBM_DB_INCLUDE env variable instead of IBM_DB_DIR
100
+ - Support for specifying the Authentication type to be used during connection in adapter
101
+ - Corrected the ignorance of a connection, when the connection is successful with a warning
102
+ - ActiveRecord-2.2.2 test suite changes for IBM_DB
103
+ 2008/11/06 (IBM_DB adapter 1.0.0, driver 0.10.0):
104
+ - Support for short-hand migration syntax for datatype char and double in create_table
105
+ - Support for short-hand migration syntax for datatypes xml, char and double in change_table
106
+ - Support for secure connections using SSL (SECURITY=SSL) feature of DB2 in Adapter
107
+ Note: - This is supported from client version V9.5fp2 and onwards
108
+ - Support for altering the nullability constraint of a column.
109
+ - Added correct mapping for datatype :double for DB2 and Informix (double precision)
110
+ - Method support_ddl_transactions? overridden to return true. Feature of Rails2.2
111
+ IBM Dataservers support transactional migrations.
112
+ - Change in the style of accessing driver methods
113
+ Changed from scope resolution operator to dot operator
114
+ IBM_DB::connect '<db_name>','<username>','<pwd>' to IBM_DB.connect '<db_name>','<username>','<pwd>'
115
+ - Fixed Bug [#22430] --> Fixed limit ignorance for type character [char]
116
+ - ActiveRecord-2.1.2 test suite changes for IBM_DB
117
+
118
+ 2008/09/01 (IBM_DB adapter 0.10.0, driver 0.10.0):
119
+ - Added Trusted Context support in Driver
120
+ - Made changes for the correct Mapping of Informix DataTypes to Ruby DataTypes
121
+ - ActiveRecord-2.1.0 test suite changes appropriate for DB2/IDS is been updated
122
+
123
+ 2008/06/24 (IBM_DB adapter 0.9.5, driver 0.9.5):
124
+ - Fixed Bug [#19222] --> Fixed fixture insertion of LOB columns for DB2
125
+ - Fixed Bug [#19970] --> Fixed Table schema dumper also dump views
126
+ - Fixed Bug [#20053] --> Fixed CLOB data with special chars contains null characters upon retrieval
127
+ - Fixed Bug [#20762] --> IBM_DB adapter with Rails 2.1 fails on rake db:migrate
128
+ - Cleaned up fix for Bug [#19223] and [#19224], indexes are now dumped as array without schema qualified name.
129
+ - Support for Rails-2.0.2
130
+ - Support for Rails-2.1.0
131
+ Rails-2.1.0 contains changes that generates Non-standard SQL in 2 noticed cases which won't work with SQL compliant databases like DB2
132
+ a. Handling Nullable columns in Table creation. [http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/398-non-standard-sql-generated-in-column-definition-for-nullable-columns-in-create-table-ddl-rails-2-1#ticket-398-2]
133
+ A workaround for this problem is provided from within ibm_db adapter.
134
+ b. Handling has_and_belongs_to_many association. [http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations].
135
+ It is not possible to provide a workaround for this from within the ibm_db adapter.
136
+ To workaround this problem please patch ActiveRecord-2.1.0 with the patch available at [http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff]
137
+
138
+ 2008/04/28 (IBM_DB adapter 0.9.4, driver 0.9.4):
139
+ - Fixed bug [#19679]--> invalid values being returned for blank or null in fetch_assoc
140
+ - Fixed bug [#19223] and [#19224]--> handling of composite and unique indexes incorrect
141
+ - Support for the Rails2.0 type of migrations for columns of type xml [t.xml :xml_col1,:xml_col2]
142
+
143
+ 2008/03/10 (IBM_DB adapter 0.9.3, driver 0.9.3):
144
+ - Resolved the issue of truncation of output when stored procedure was called
145
+
146
+ 2007/11/30 (IBM_DB adapter 0.9.2, driver 0.9.1):
147
+ - Lifted index length limitation (18 chars) and fixed multiple index creation
148
+ - Fixed [#13294] limit/offset breaks subselect in db2 adapter
149
+ - Fixed error handling for metadata retrieval (tables, columns, indexes)
150
+
151
+ 2007/11/07 (IBM_DB adapter 0.9.1, driver 0.9.1):
152
+ - Fixed ibm_db driver VC80 runtime issue on Windows
153
+
154
+ 2007/09/28 (IBM_DB adapter 0.9.0, driver 0.9.0):
155
+ - Fixed ibm_db gem 0.8.5 incompatibility with DB2 CLI 9.1 FP3 and below
156
+
157
+ 2007/09/13 (IBM_DB adapter 0.8.5, driver 0.8.5):
158
+ - Fixed Ruby driver crash on Windows Vista [#13357]
159
+
160
+ 2007/07/05 (IBM_DB adapter 0.8.0, driver 0.7.0):
161
+ - Support for Informix Dynamic Server 11.10
162
+ - New driver method get_last_serial_value to retrieve last inserted serial
163
+ value for Informix Dynamic Server
164
+
165
+ 2007/06/19 (IBM_DB adapter 0.7.5, driver 0.6.0):
166
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
167
+ - Fixed client attributes initialization on connection setup [11264]
168
+ - Fixed rake db:schema:dump native data types limits incompatible with table create
169
+
170
+ 2007/06/01 (IBM_DB adapter 0.7.0, driver 0.6.0):
171
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
172
+ - Fixed remaining failure on {:null => true} option for XML data type [#10877]
173
+ - Fixed handling of {:id => false} option during table creation in DB2 for zOS
174
+ - Fixed handle_lobs failures in table creation for has_many/belongs_to [#10701]
175
+ - Fixe db2-i5-zOS.yaml content (removed inadvertent tab) [#11234]
176
+
177
+ 2007/05/10 (IBM_DB adapter 0.6.5, driver 0.6.0):
178
+ - Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
179
+ - Fixed regression for reconnect after being inactive (connection recycle)
180
+ - Fixed rake db:schema:load failures on boolean data type [#10683]
181
+ - Fixed XML default option (:null => true for XML data type) [#10754]
182
+ - Fixed DB2 for zOS version 9 handling of column changes for DEFAULT NULL
183
+
184
+ 2007/04/30 (0.6.0):
185
+ - Support for remote connections to DB2 Universal Database on z/OS version 9
186
+ - Support for result set pagination via ActiveRecord add_limit_offset! method
187
+ for DB2 Universal Database on z/OS and i5/OS
188
+ - Defect fixes
189
+ - Improved documentation
190
+
191
+ 2007/04/20 (0.4.6):
192
+ - Fixed XML columns creation default value (NOT NULL)
193
+ - Fixed border case for IS NULL in where clauses
194
+ - Improved documentation (connection attributes)
195
+
196
+ 2007/04/20 (0.4.5):
197
+ - Fixed reconnect problems: driver (IBM_DB::active) and adapter (active)
198
+ - Client connection attribute rename (app_user to replace user)
199
+ - Improved support for ROWID data type (DB2 for zOS version 8 and 9)
200
+
201
+ 2007/03/21 (0.4.0):
202
+ - Support added for remote connectivity to DB2 zOS version 8
203
+ - Support added for remote connectivity to DB2 i5 v5r3 and v5r4
204
+ - Improved migration support (added change_column method)
205
+ - Support for setting and retrieving values for client attributes (user,
206
+ account, application, workstation)
207
+
208
+ 2006/10/31 (0.2.0):
209
+ - Significant performance improvements
210
+ - Improved stored procedure support at driver level
211
+ - Added support for Large Object data types (LOBs) greater than 32K (BLOB, CLOB, XML) in size
212
+ - Added XML data type support for native storage of XML documents
213
+ - Significant quality improvements, through many bug fixes in the driver and adapter
214
+ - Improved migration support (added add_column and remove_column methods)
215
+
216
+ 2006/06/07 (0.1.0):
217
+
218
+ - Fixed compatibility issue with other adapters
219
+ - If a schema is omitted in database.yml, the username is now used as default schema
220
+ - Introduced descriptive CLI error messages when a connection or an execute statement fails
221
+ - Introduced check against schema in method 'indexes'
data/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2006, 2007, 2008, 2009, 2010 IBM Corporation
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the Software
8
+ is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included
11
+ in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
16
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/MANIFEST ADDED
@@ -0,0 +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
@@ -0,0 +1,39 @@
1
+ +-------------------------------------------+-------------------------------------------+
2
+ | README for Parameterized Queries Support in Ruby-on-Rails/ Activerecord applications |
3
+ +-------------------------------------------+-------------------------------------------+
4
+
5
+ Enabling Usage of Parameterized Queries with Ruby-on-Rails / Activerecord applications
6
+ ======================================================================================
7
+ To enable usage of parameterized SQL queries with Ruby-on-Rails/ActiveRecord applications, in your connection configuration (database.yml), set "parameterized" to true. By default "parameterized" is false (if not specified). A sample database.yml file showing development section with parameterized queries enabled looks as below
8
+
9
+ development:
10
+ adapter: ibm_db
11
+ username: db2inst1
12
+ password: secret
13
+ database: devdb
14
+ #schema: db2inst1
15
+ #host: localhost
16
+ #port: 50000
17
+ #account: my_account
18
+ #app_user: my_app_user
19
+ #application: my_application
20
+ #workstation: my_workstation
21
+ parameterized: true
22
+
23
+ Similarly for the other sections (test/production) of the database.yml file set "parameterized" to true to enable usage of parameterized SQL queries
24
+
25
+ Supported Activerecord Versions
26
+ ===============================
27
+ Activerecord-2.3.3, Activerecord-2.3.4, Activerecord-2.3.5
28
+
29
+ Supported Operating Systems and Databases
30
+ =========================================
31
+ Refer the main README
32
+
33
+ Feedback
34
+ ========
35
+ Your feedback is very much appreciated and expected through Rubyforge:
36
+ - rubyibm project: http://rubyforge.org/projects/rubyibm/
37
+ - rubyibm forum: http://rubyforge.org/forum/?group_id=2361
38
+ - rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
39
+ - IBM_DB developers: rubyibm-developers@rubyforge.org
data/README ADDED
@@ -0,0 +1,225 @@
1
+ =====================================================================
2
+ README for the IBM_DB Adapter (2.5.14) and Driver (2.5.14) (2014/02/11)
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