db2 2.5.10 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGES +0 -17
- data/LICENSE +18 -0
- data/ParameterizedQueries README +39 -0
- data/README +141 -79
- data/ext/Makefile.nt32 +181 -0
- data/ext/extconf.rb +14 -75
- data/ext/ibm_db.c +11166 -0
- data/ext/ruby_ibm_db.h +236 -0
- data/ext/ruby_ibm_db_cli.c +738 -0
- data/ext/ruby_ibm_db_cli.h +431 -0
- data/init.rb +42 -0
- data/lib/IBM_DB.rb +2 -0
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +2557 -0
- data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1965 -0
- data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
- data/test/cases/adapter_test.rb +202 -0
- data/test/cases/associations/belongs_to_associations_test.rb +486 -0
- data/test/cases/associations/cascaded_eager_loading_test.rb +183 -0
- data/test/cases/associations/eager_test.rb +862 -0
- data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +917 -0
- data/test/cases/associations/has_many_through_associations_test.rb +461 -0
- data/test/cases/associations/join_model_test.rb +793 -0
- data/test/cases/attribute_methods_test.rb +621 -0
- data/test/cases/base_test.rb +1486 -0
- data/test/cases/calculations_test.rb +362 -0
- data/test/cases/finder_test.rb +1088 -0
- data/test/cases/fixtures_test.rb +684 -0
- data/test/cases/migration_test.rb +2014 -0
- data/test/cases/schema_dumper_test.rb +232 -0
- data/test/cases/validations/uniqueness_validation_test.rb +283 -0
- data/test/connections/native_ibm_db/connection.rb +42 -0
- data/test/ibm_db_test.rb +25 -0
- data/test/models/warehouse_thing.rb +5 -0
- data/test/schema/i5/ibm_db_specific_schema.rb +135 -0
- data/test/schema/ids/ibm_db_specific_schema.rb +138 -0
- data/test/schema/luw/ibm_db_specific_schema.rb +135 -0
- data/test/schema/schema.rb +647 -0
- data/test/schema/zOS/ibm_db_specific_schema.rb +206 -0
- metadata +68 -32
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/CHANGES
CHANGED
@@ -1,22 +1,5 @@
|
|
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
|
-
|
20
3
|
2011/02/07 (IBM_DB adapter 2.5.6, driver 2.5.6) :
|
21
4
|
- Fixed Bug #28622, #28881
|
22
5
|
- Decimal datatypes will now be returned as BigDecimal type from the driver
|
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.
|
@@ -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
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=====================================================================
|
2
|
-
README for the IBM_DB Adapter (2.5.
|
2
|
+
README for the IBM_DB Adapter (2.5.5) and Driver (2.5.5) (2011/02/07)
|
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 9 Fixpak2 and above
|
17
|
+
- IBM DB2 Universal Database on Linux/Unix/Windows versions 8 Fixpak15 or 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
|
21
|
+
- Remote connections to IBM DB2 Universal Database on z/OS version 8 and 9
|
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,18 +37,32 @@ 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
|
40
|
+
Successfully uninstalled ibm_db version 0.6.0
|
41
41
|
|
42
42
|
Example:
|
43
43
|
D:\>gem install ibm_db
|
44
|
-
|
45
|
-
|
46
|
-
1
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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:
|
51
57
|
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
|
+
|
52
66
|
|
53
67
|
2. Linux and Unix platforms:
|
54
68
|
============================
|
@@ -61,13 +75,32 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
|
|
61
75
|
Note: DB2 environment is required while using an arbitrary user account
|
62
76
|
(other than the DB2 install user account)
|
63
77
|
$ . /home/db2inst1/sqllib/db2profile
|
64
|
-
$ export
|
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)
|
65
80
|
$ 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
|
66
91
|
Building native extensions. This could take a while...
|
67
|
-
Successfully installed ibm_db-
|
68
|
-
|
69
|
-
Installing
|
70
|
-
|
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
|
+
$
|
71
104
|
|
72
105
|
BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
|
73
106
|
1. Download source from Rubyforge
|
@@ -76,84 +109,80 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
|
|
76
109
|
$ cd IBM_DB_Adapter/ibm_db
|
77
110
|
$ gem build IBM_DB.gemspec
|
78
111
|
|
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)
|
81
112
|
|
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
|
-
|
91
113
|
Instructions for building and installing the IBM_DB driver from source
|
92
114
|
=======================================================================
|
93
115
|
Building the driver manually as described below is not required if the install
|
94
116
|
process above has been pursued. This manual procedure is in fact automated
|
95
117
|
on Linux and UNIX platforms by the IBM_DB gem install, but is presented
|
96
|
-
here only for reference.
|
118
|
+
here only for reference, and also involves running the unit tests.
|
97
119
|
|
98
120
|
Prerequisites:
|
99
121
|
Install Ruby from:
|
100
122
|
http://rubyforge.org
|
101
123
|
|
102
|
-
|
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
|
103
157
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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
|
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
|
+
|
153
168
|
|
154
169
|
Limitations and known problems
|
155
170
|
==============================
|
171
|
+
- ActiveRecord rename_column method is not supported for DB2 LUW, zOS and i5
|
156
172
|
- 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
|
157
186
|
- The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
|
158
187
|
To fix this, please ensure that the following configuration keyword PATCH2=58 is set
|
159
188
|
in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
|
@@ -162,7 +191,7 @@ Limitations and known problems
|
|
162
191
|
Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
|
163
192
|
for more information.
|
164
193
|
- The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
|
165
|
-
The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
|
194
|
+
The first record (i.e. the record with the minimum id) may be not be retrieved. In a relational model,
|
166
195
|
the order of the rows returned is unpredictable and independent of the order of insertion.
|
167
196
|
This issue may be addressed in a future release.
|
168
197
|
- Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
|
@@ -173,17 +202,32 @@ Limitations and known problems
|
|
173
202
|
To enable this parameter, you need to restart your DB2 instance.
|
174
203
|
- If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
|
175
204
|
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
|
176
218
|
- IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
|
177
219
|
'You may install other gems, but keep in mind that libraries with C extension dependencies
|
178
220
|
will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
|
179
221
|
The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
|
180
222
|
CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
|
181
223
|
implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
|
224
|
+
- Query caching feature of ActiveRecord-2.0 not supported
|
182
225
|
- When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
|
183
226
|
http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
|
184
227
|
The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
|
185
228
|
which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
|
186
229
|
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)
|
187
231
|
- 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
|
188
232
|
- test_read_attributes_before_type_cast_on_datetime
|
189
233
|
- test_to_xml
|
@@ -197,6 +241,24 @@ Limitations and known problems
|
|
197
241
|
the complete suite. However they pass when run standalone.
|
198
242
|
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.
|
199
243
|
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
|
200
262
|
- Usage with Rails-3.0.3/Rails-3.0.4
|
201
263
|
- To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
|
202
264
|
|
data/ext/Makefile.nt32
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = .
|
7
|
+
topdir =$(TOP)/opendbad/win/ruby_1.8.6/lib/ruby/1.8/i386-mswin32
|
8
|
+
hdrdir = $(topdir)
|
9
|
+
VPATH = $(srcdir);$(topdir);$(hdrdir)
|
10
|
+
|
11
|
+
|
12
|
+
DESTDIR = $(TOP)/opendbad/win
|
13
|
+
prefix = $(DESTDIR)/ruby_1.8.6
|
14
|
+
exec_prefix = $(DESTDIR)/ruby_1.8.6
|
15
|
+
sitedir = $(prefix)/lib/ruby/site_ruby
|
16
|
+
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
17
|
+
archdir = $(rubylibdir)/$(arch)
|
18
|
+
sbindir = $(exec_prefix)/sbin
|
19
|
+
datadir = $(prefix)/share
|
20
|
+
includedir = $(prefix)/include
|
21
|
+
infodir = $(prefix)/info
|
22
|
+
sysconfdir = $(prefix)/etc
|
23
|
+
mandir = $(prefix)/man
|
24
|
+
libdir = $(DESTDIR)/ruby_1.8.6/lib
|
25
|
+
sharedstatedir = $(DESTDIR)/etc
|
26
|
+
oldincludedir = $(DESTDIR)/usr/include
|
27
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
28
|
+
localstatedir = $(DESTDIR)/var
|
29
|
+
bindir = $(exec_prefix)/bin
|
30
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
31
|
+
libexecdir = $(exec_prefix)/libexec
|
32
|
+
|
33
|
+
CC = cl -nologo
|
34
|
+
LIBRUBY = $(RUBY_SO_NAME).lib
|
35
|
+
LIBRUBY_A = msvcrt-ruby18-static.lib
|
36
|
+
LIBRUBYARG_SHARED = $(LIBRUBY)
|
37
|
+
LIBRUBYARG_STATIC = $(LIBRUBY_A)
|
38
|
+
|
39
|
+
RUBY_EXTCONF_H =
|
40
|
+
CFLAGS = -MT -Zi -O2b2xg- -G6
|
41
|
+
INCFLAGS = -I. -I. -I$(topdir) -I.
|
42
|
+
CPPFLAGS =
|
43
|
+
CXXFLAGS = $(CFLAGS)
|
44
|
+
DLDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH) -def:$(DEFFILE) -implib:$(*F:.so=)-$(arch).lib -pdb:$(*F:.so=)-$(arch).pdb
|
45
|
+
LDSHARED = cl -nologo -LD
|
46
|
+
AR = lib -nologo
|
47
|
+
EXEEXT = .exe
|
48
|
+
|
49
|
+
RUBY_INSTALL_NAME = ruby
|
50
|
+
RUBY_SO_NAME = msvcrt-ruby18
|
51
|
+
arch = i386-mswin32
|
52
|
+
sitearch = i386-msvcrt
|
53
|
+
ruby_version = 1.8
|
54
|
+
ruby = $(TOP)/opendbad/win/ruby_1.8.6/bin/ruby.exe
|
55
|
+
RUBY = $(ruby:/=\)
|
56
|
+
RM = $(RUBY) -run -e rm -- -f
|
57
|
+
MAKEDIRS = @$(RUBY) -run -e mkdir -- -p
|
58
|
+
INSTALL = @$(RUBY) -run -e install -- -vp
|
59
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
60
|
+
INSTALL_DATA = $(INSTALL) -m 0644
|
61
|
+
COPY = copy > nul
|
62
|
+
|
63
|
+
#### End of system configuration section. ####
|
64
|
+
|
65
|
+
preload =
|
66
|
+
|
67
|
+
libpath = $(libdir)
|
68
|
+
LIBPATH = -libpath:"$(libdir)"
|
69
|
+
DEFFILE = $(TARGET)-$(arch).def
|
70
|
+
|
71
|
+
CLEANFILES =
|
72
|
+
DISTCLEANFILES = vc*.pdb $(DEFFILE)
|
73
|
+
|
74
|
+
extout =
|
75
|
+
extout_prefix =
|
76
|
+
target_prefix =
|
77
|
+
LOCAL_LIBS =
|
78
|
+
LIBS = $(LIBRUBYARG_SHARED) db2cli.lib oldnames.lib user32.lib advapi32.lib ws2_32.lib libcmt.lib
|
79
|
+
SRCS = ibm_db.c ruby_ibm_db_cli.c
|
80
|
+
OBJS = ibm_db.obj ruby_ibm_db_cli.obj
|
81
|
+
TARGET = ibm_db
|
82
|
+
DLLIB = $(TARGET).so
|
83
|
+
EXTSTATIC =
|
84
|
+
STATIC_LIB =
|
85
|
+
|
86
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
87
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
88
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
89
|
+
|
90
|
+
TARGET_SO = $(DLLIB)
|
91
|
+
CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
|
92
|
+
CLEANOBJS = *.obj *.lib *.s[ol] *.pdb *.exp *.bak
|
93
|
+
|
94
|
+
all: $(DLLIB)
|
95
|
+
static: $(STATIC_LIB)
|
96
|
+
|
97
|
+
clean:
|
98
|
+
@-$(RM) $(CLEANLIBS:/=\) $(CLEANOBJS:/=\) $(CLEANFILES:/=\)
|
99
|
+
|
100
|
+
distclean: clean
|
101
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
102
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES:/=\)
|
103
|
+
|
104
|
+
realclean: distclean
|
105
|
+
install: install-so install-rb
|
106
|
+
|
107
|
+
install-so: $(RUBYARCHDIR)
|
108
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
109
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
110
|
+
$(INSTALL_PROG) $(DLLIB:/=\) $(RUBYARCHDIR:/=\)
|
111
|
+
install-rb: pre-install-rb install-rb-default
|
112
|
+
install-rb-default: pre-install-rb-default
|
113
|
+
pre-install-rb: Makefile
|
114
|
+
pre-install-rb-default: Makefile
|
115
|
+
$(RUBYARCHDIR):
|
116
|
+
$(MAKEDIRS) $@
|
117
|
+
|
118
|
+
site-install: site-install-so site-install-rb
|
119
|
+
site-install-so: install-so
|
120
|
+
site-install-rb: install-rb
|
121
|
+
|
122
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .obj
|
123
|
+
|
124
|
+
{$(srcdir)}.cc{}.obj:
|
125
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
126
|
+
|
127
|
+
{$(topdir)}.cc{}.obj:
|
128
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
129
|
+
|
130
|
+
{$(hdrdir)}.cc{}.obj:
|
131
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
132
|
+
|
133
|
+
.cc.obj:
|
134
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
135
|
+
|
136
|
+
{$(srcdir)}.cxx{}.obj:
|
137
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
138
|
+
|
139
|
+
{$(topdir)}.cxx{}.obj:
|
140
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
141
|
+
|
142
|
+
{$(hdrdir)}.cxx{}.obj:
|
143
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
144
|
+
|
145
|
+
.cxx.obj:
|
146
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
147
|
+
|
148
|
+
{$(srcdir)}.cpp{}.obj:
|
149
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
150
|
+
|
151
|
+
{$(topdir)}.cpp{}.obj:
|
152
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
153
|
+
|
154
|
+
{$(hdrdir)}.cpp{}.obj:
|
155
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
156
|
+
|
157
|
+
.cpp.obj:
|
158
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
159
|
+
|
160
|
+
{$(srcdir)}.c{}.obj:
|
161
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
162
|
+
|
163
|
+
{$(topdir)}.c{}.obj:
|
164
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
165
|
+
|
166
|
+
{$(hdrdir)}.c{}.obj:
|
167
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
168
|
+
|
169
|
+
.c.obj:
|
170
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
171
|
+
|
172
|
+
$(DLLIB): $(DEFFILE) $(OBJS)
|
173
|
+
@-$(RM) $@
|
174
|
+
$(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS)
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
$(DEFFILE):
|
179
|
+
$(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@
|
180
|
+
|
181
|
+
$(OBJS): {.;$(srcdir);$(topdir);$(hdrdir)}ruby.h {.;$(srcdir);$(topdir);$(hdrdir)}defines.h
|