ibm_db 4.0.0 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/README +2 -2
  3. data/ext/Makefile +266 -0
  4. data/ext/extconf.rb +34 -3
  5. data/ext/gil_release_version +3 -0
  6. data/ext/ibm_db.c +100 -108
  7. data/ext/mkmf.log +103 -0
  8. data/ext/unicode_support_version +3 -0
  9. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +256 -175
  10. data/test/cases/attribute_decorators_test.rb +2 -1
  11. data/test/cases/cache_key_test.rb +2 -1
  12. data/test/cases/comment_test.rb +4 -2
  13. data/test/cases/date_time_precision_test.rb +2 -1
  14. data/test/cases/defaults_test.rb +2 -1
  15. data/test/cases/migration/foreign_key_test.rb +4 -2
  16. data/test/cases/migration/helper.rb +1 -1
  17. data/test/cases/migration/references_foreign_key_test.rb +10 -5
  18. data/test/cases/migrator_test.rb +2 -1
  19. data/test/cases/schema_dumper_test.rb +3 -3
  20. data/test/cases/time_precision_test.rb +2 -1
  21. data/test/cases/transactions_test.rb +3 -2
  22. data/test/config.yml +154 -154
  23. data/test/connections/native_ibm_db/connection.rb +44 -0
  24. data/test/fixtures/admin/randomly_named_a9.yml +7 -7
  25. data/test/fixtures/admin/randomly_named_b0.yml +7 -7
  26. data/test/fixtures/developers.yml +1 -1
  27. data/test/fixtures/pirates.yml +0 -3
  28. data/test/fixtures/randomly_named_a9.yml +7 -7
  29. data/test/ibm_db_test.rb +24 -24
  30. data/test/models/admin.rb +1 -1
  31. data/test/models/admin/account.rb +1 -1
  32. data/test/models/admin/randomly_named_c1.rb +7 -7
  33. data/test/models/binary.rb +1 -1
  34. data/test/models/event.rb +1 -1
  35. data/test/models/guid.rb +1 -1
  36. data/test/models/randomly_named_c1.rb +3 -3
  37. data/test/models/ship_part.rb +1 -1
  38. data/test/schema/i5/ibm_db_specific_schema.rb +137 -0
  39. data/test/schema/ids/ibm_db_specific_schema.rb +140 -0
  40. data/test/schema/luw/ibm_db_specific_schema.rb +137 -0
  41. data/test/schema/zOS/ibm_db_specific_schema.rb +208 -0
  42. metadata +24 -13
  43. data/test/fixtures/author_addresses.original +0 -11
  44. data/test/fixtures/authors.original +0 -17
@@ -28,7 +28,8 @@ module ActiveRecord
28
28
 
29
29
  teardown do
30
30
  return unless @connection
31
- @connection.drop_table 'attribute_decorators_model', if_exists: true
31
+ @connection.drop_table 'attribute_decorators_model'
32
+ #, if_exists: true
32
33
  Model.attribute_type_decorations.clear
33
34
  Model.reset_column_information
34
35
  end
@@ -12,7 +12,8 @@ module ActiveRecord
12
12
  end
13
13
 
14
14
  teardown do
15
- @connection.drop_table :cache_mes, if_exists: true
15
+ @connection.drop_table :cache_mes
16
+ #, if_exists: true
16
17
  end
17
18
 
18
19
  test "test_cache_key_format_is_not_too_precise" do
@@ -39,8 +39,10 @@ class CommentTest < ActiveRecord::TestCase
39
39
  end
40
40
 
41
41
  teardown do
42
- @connection.drop_table 'commenteds', if_exists: true
43
- @connection.drop_table 'blank_comments', if_exists: true
42
+ @connection.drop_table 'commenteds'
43
+ #, if_exists: true
44
+ @connection.drop_table 'blank_comments'
45
+ #, if_exists: true
44
46
  end
45
47
 
46
48
  def test_column_created_in_block
@@ -14,7 +14,8 @@ class DateTimePrecisionTest < ActiveRecord::TestCase
14
14
  end
15
15
 
16
16
  teardown do
17
- @connection.drop_table :foos, if_exists: true
17
+ @connection.drop_table :foos
18
+ #, if_exists: true
18
19
  end
19
20
 
20
21
  def test_datetime_data_type_with_precision
@@ -34,7 +34,8 @@ class DefaultNumbersTest < ActiveRecord::TestCase
34
34
  end
35
35
 
36
36
  teardown do
37
- @connection.drop_table :default_numbers, if_exists: true
37
+ @connection.drop_table :default_numbers
38
+ #, if_exists: true
38
39
  end
39
40
 
40
41
  def test_default_positive_integer
@@ -30,8 +30,10 @@ module ActiveRecord
30
30
 
31
31
  teardown do
32
32
  if defined?(@connection)
33
- @connection.drop_table "astronauts", if_exists: true
34
- @connection.drop_table "rockets", if_exists: true
33
+ @connection.drop_table "astronauts"
34
+ #, if_exists: true
35
+ @connection.drop_table "rockets"
36
+ #, if_exists: true
35
37
  end
36
38
  end
37
39
 
@@ -28,7 +28,7 @@ module ActiveRecord
28
28
  super
29
29
  TestModel.reset_table_name
30
30
  TestModel.reset_sequence_name
31
- connection.drop_table :test_models, if_exists: true
31
+ connection.drop_table :test_models rescue nil
32
32
  end
33
33
 
34
34
  private
@@ -10,8 +10,10 @@ module ActiveRecord
10
10
  end
11
11
 
12
12
  teardown do
13
- @connection.drop_table "testings", if_exists: true
14
- @connection.drop_table "testing_parents", if_exists: true
13
+ @connection.drop_table "testings"
14
+ #, if_exists: true
15
+ @connection.drop_table "testing_parents"
16
+ #, if_exists: true
15
17
  end
16
18
 
17
19
  test "foreign keys can be created with the table" do
@@ -141,7 +143,8 @@ module ActiveRecord
141
143
  end
142
144
  ensure
143
145
  ActiveRecord::Base.pluralize_table_names = original_pluralize_table_names
144
- @connection.drop_table "testing", if_exists: true
146
+ @connection.drop_table "testing"
147
+ #, if_exists: true
145
148
  end
146
149
  end
147
150
 
@@ -201,8 +204,10 @@ class ReferencesWithoutForeignKeySupportTest < ActiveRecord::TestCase
201
204
  end
202
205
 
203
206
  teardown do
204
- @connection.drop_table("testings", if_exists: true)
205
- @connection.drop_table("testing_parents", if_exists: true)
207
+ @connection.drop_table("testings")
208
+ #, if_exists: true)
209
+ @connection.drop_table("testing_parents")
210
+ #, if_exists: true)
206
211
  end
207
212
 
208
213
  test "ignores foreign keys defined with the table" do
@@ -394,7 +394,8 @@ class MigratorTest < ActiveRecord::TestCase
394
394
  def test_migrator_db_has_no_schema_migrations_table
395
395
  _, migrator = migrator_class(3)
396
396
 
397
- ActiveRecord::Base.connection.drop_table "schema_migrations", if_exists: true
397
+ ActiveRecord::Base.connection.drop_table "schema_migrations"
398
+ #, if_exists: true
398
399
  ActiveSupport::Deprecation.silence { assert_not ActiveRecord::Base.connection.table_exists?('schema_migrations') }
399
400
  migrator.migrate("valid", 1)
400
401
  ActiveSupport::Deprecation.silence { assert ActiveRecord::Base.connection.table_exists?('schema_migrations') }
@@ -318,8 +318,7 @@ class SchemaDumperTest < ActiveRecord::TestCase
318
318
  assert_match %r{t\.integer\s+"atoms_in_universe",\s+precision: 38}, output
319
319
  elsif current_adapter?(:IBM_DBAdapter)
320
320
  # DB2 supports precision up to 31
321
- assert_match %r{t.decimal\s+"atoms_in_universe",\s+precision: 31,\s+scale: 0}, output
322
- else
321
+ assert_match %r{t.decimal\s+"atoms_in_universe",\s+precision: 31,\s+scale: 0}, output
323
322
  elsif current_adapter?(:FbAdapter)
324
323
  assert_match %r{t\.integer\s+"atoms_in_universe",\s+precision: 18}, output
325
324
  else
@@ -443,7 +442,8 @@ class SchemaDumperDefaultsTest < ActiveRecord::TestCase
443
442
 
444
443
  teardown do
445
444
  return unless @connection
446
- @connection.drop_table 'defaults', if_exists: true
445
+ @connection.drop_table 'defaults'
446
+ #, if_exists: true
447
447
  end
448
448
 
449
449
  def test_schema_dump_defaults_with_universally_supported_types
@@ -14,7 +14,8 @@ class TimePrecisionTest < ActiveRecord::TestCase
14
14
  end
15
15
 
16
16
  teardown do
17
- @connection.drop_table :foos, if_exists: true
17
+ @connection.drop_table :foos
18
+ #, if_exists: true
18
19
  end
19
20
 
20
21
  def test_time_data_type_with_precision
@@ -10,7 +10,7 @@ require 'models/movie'
10
10
 
11
11
  class TransactionTest < ActiveRecord::TestCase
12
12
  self.use_transactional_tests = false
13
- fixtures :topics, :developers, :authors, :posts
13
+ fixtures :topics, :developers, :authors, :posts, :author_addresses
14
14
 
15
15
  def setup
16
16
  @first, @second = Topic.find(1, 2).sort_by(&:id)
@@ -703,7 +703,8 @@ class TransactionTest < ActiveRecord::TestCase
703
703
  end
704
704
  end
705
705
  ensure
706
- connection.drop_table 'transaction_without_primary_keys', if_exists: true
706
+ connection.drop_table 'transaction_without_primary_keys'
707
+ #, if_exists: true
707
708
  end
708
709
 
709
710
  private
@@ -1,154 +1,154 @@
1
- default_connection: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %>
2
-
3
- connections:
4
- jdbcderby:
5
- arunit: activerecord_unittest
6
- arunit2: activerecord_unittest2
7
-
8
- jdbch2:
9
- arunit: activerecord_unittest
10
- arunit2: activerecord_unittest2
11
-
12
- jdbchsqldb:
13
- arunit: activerecord_unittest
14
- arunit2: activerecord_unittest2
15
-
16
- jdbcmysql:
17
- arunit:
18
- username: rails
19
- encoding: utf8
20
- arunit2:
21
- username: rails
22
- encoding: utf8
23
-
24
- jdbcpostgresql:
25
- arunit:
26
- username: <%= ENV['user'] || 'rails' %>
27
- arunit2:
28
- username: <%= ENV['user'] || 'rails' %>
29
-
30
- jdbcsqlite3:
31
- arunit:
32
- database: <%= FIXTURES_ROOT %>/fixture_database.sqlite3
33
- timeout: 5000
34
- arunit2:
35
- database: <%= FIXTURES_ROOT %>/fixture_database_2.sqlite3
36
- timeout: 5000
37
-
38
- db2:
39
- arunit:
40
- host: localhost
41
- username: arunit
42
- password: arunit
43
- database: arunit
44
- arunit2:
45
- host: localhost
46
- username: arunit
47
- password: arunit
48
- database: arunit2
49
-
50
- ibm_db:
51
- arunit:
52
- username: db2user
53
- password: secret
54
- database: railsdb
55
- start_id: 1000
56
- arunit2:
57
- username: db2user
58
- password: secret
59
- database: railsdb
60
- start_id: 1000
61
-
62
- firebird:
63
- arunit:
64
- host: localhost
65
- username: rails
66
- password: rails
67
- charset: UTF8
68
- arunit2:
69
- host: localhost
70
- username: rails
71
- password: rails
72
- charset: UTF8
73
-
74
- frontbase:
75
- arunit:
76
- host: localhost
77
- username: rails
78
- session_name: unittest-<%= $$ %>
79
- arunit2:
80
- host: localhost
81
- username: rails
82
- session_name: unittest-<%= $$ %>
83
-
84
- mysql:
85
- arunit:
86
- username: root
87
- password: root123
88
- port: 3306
89
- database: railsdb
90
- encoding: utf8
91
- arunit2:
92
- username: root
93
- password: root123
94
- port: 3306
95
- database: railsdb
96
- encoding: utf8
97
-
98
- mysql2:
99
- arunit:
100
- username: rails
101
- encoding: utf8
102
- arunit2:
103
- username: rails
104
- encoding: utf8
105
-
106
- openbase:
107
- arunit:
108
- username: admin
109
- arunit2:
110
- username: admin
111
-
112
- oracle:
113
- arunit:
114
- adapter: oracle_enhanced
115
- database: <%= ENV['ARUNIT_DB_NAME'] || 'orcl' %>
116
- username: <%= ENV['ARUNIT_USER_NAME'] || 'arunit' %>
117
- password: <%= ENV['ARUNIT_PASSWORD'] || 'arunit' %>
118
- emulate_oracle_adapter: true
119
- arunit2:
120
- adapter: oracle_enhanced
121
- database: <%= ENV['ARUNIT_DB_NAME'] || 'orcl' %>
122
- username: <%= ENV['ARUNIT2_USER_NAME'] || 'arunit2' %>
123
- password: <%= ENV['ARUNIT2_PASSWORD'] || 'arunit2' %>
124
- emulate_oracle_adapter: true
125
-
126
- postgresql:
127
- arunit:
128
- min_messages: warning
129
- arunit2:
130
- min_messages: warning
131
-
132
- sqlite3:
133
- arunit:
134
- database: <%= FIXTURES_ROOT %>/fixture_database.sqlite3
135
- timeout: 5000
136
- arunit2:
137
- database: <%= FIXTURES_ROOT %>/fixture_database_2.sqlite3
138
- timeout: 5000
139
-
140
- sqlite3_mem:
141
- arunit:
142
- adapter: sqlite3
143
- database: ':memory:'
144
- arunit2:
145
- adapter: sqlite3
146
- database: ':memory:'
147
-
148
- sybase:
149
- arunit:
150
- host: database_ASE
151
- username: sa
152
- arunit2:
153
- host: database_ASE
154
- username: sa
1
+ default_connection: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %>
2
+
3
+ connections:
4
+ jdbcderby:
5
+ arunit: activerecord_unittest
6
+ arunit2: activerecord_unittest2
7
+
8
+ jdbch2:
9
+ arunit: activerecord_unittest
10
+ arunit2: activerecord_unittest2
11
+
12
+ jdbchsqldb:
13
+ arunit: activerecord_unittest
14
+ arunit2: activerecord_unittest2
15
+
16
+ jdbcmysql:
17
+ arunit:
18
+ username: rails
19
+ encoding: utf8
20
+ arunit2:
21
+ username: rails
22
+ encoding: utf8
23
+
24
+ jdbcpostgresql:
25
+ arunit:
26
+ username: <%= ENV['user'] || 'rails' %>
27
+ arunit2:
28
+ username: <%= ENV['user'] || 'rails' %>
29
+
30
+ jdbcsqlite3:
31
+ arunit:
32
+ database: <%= FIXTURES_ROOT %>/fixture_database.sqlite3
33
+ timeout: 5000
34
+ arunit2:
35
+ database: <%= FIXTURES_ROOT %>/fixture_database_2.sqlite3
36
+ timeout: 5000
37
+
38
+ db2:
39
+ arunit:
40
+ host: localhost
41
+ username: arunit
42
+ password: arunit
43
+ database: arunit
44
+ arunit2:
45
+ host: localhost
46
+ username: arunit
47
+ password: arunit
48
+ database: arunit2
49
+
50
+ ibm_db:
51
+ arunit:
52
+ username: db2user
53
+ password: secret
54
+ database: railsdb
55
+ start_id: 1000
56
+ arunit2:
57
+ username: db2user
58
+ password: secret
59
+ database: railsdb
60
+ start_id: 1000
61
+
62
+ firebird:
63
+ arunit:
64
+ host: localhost
65
+ username: rails
66
+ password: rails
67
+ charset: UTF8
68
+ arunit2:
69
+ host: localhost
70
+ username: rails
71
+ password: rails
72
+ charset: UTF8
73
+
74
+ frontbase:
75
+ arunit:
76
+ host: localhost
77
+ username: rails
78
+ session_name: unittest-<%= $$ %>
79
+ arunit2:
80
+ host: localhost
81
+ username: rails
82
+ session_name: unittest-<%= $$ %>
83
+
84
+ mysql:
85
+ arunit:
86
+ username: root
87
+ password: root123
88
+ port: 3306
89
+ database: railsdb
90
+ encoding: utf8
91
+ arunit2:
92
+ username: root
93
+ password: root123
94
+ port: 3306
95
+ database: railsdb
96
+ encoding: utf8
97
+
98
+ mysql2:
99
+ arunit:
100
+ username: rails
101
+ encoding: utf8
102
+ arunit2:
103
+ username: rails
104
+ encoding: utf8
105
+
106
+ openbase:
107
+ arunit:
108
+ username: admin
109
+ arunit2:
110
+ username: admin
111
+
112
+ oracle:
113
+ arunit:
114
+ adapter: oracle_enhanced
115
+ database: <%= ENV['ARUNIT_DB_NAME'] || 'orcl' %>
116
+ username: <%= ENV['ARUNIT_USER_NAME'] || 'arunit' %>
117
+ password: <%= ENV['ARUNIT_PASSWORD'] || 'arunit' %>
118
+ emulate_oracle_adapter: true
119
+ arunit2:
120
+ adapter: oracle_enhanced
121
+ database: <%= ENV['ARUNIT_DB_NAME'] || 'orcl' %>
122
+ username: <%= ENV['ARUNIT2_USER_NAME'] || 'arunit2' %>
123
+ password: <%= ENV['ARUNIT2_PASSWORD'] || 'arunit2' %>
124
+ emulate_oracle_adapter: true
125
+
126
+ postgresql:
127
+ arunit:
128
+ min_messages: warning
129
+ arunit2:
130
+ min_messages: warning
131
+
132
+ sqlite3:
133
+ arunit:
134
+ database: <%= FIXTURES_ROOT %>/fixture_database.sqlite3
135
+ timeout: 5000
136
+ arunit2:
137
+ database: <%= FIXTURES_ROOT %>/fixture_database_2.sqlite3
138
+ timeout: 5000
139
+
140
+ sqlite3_mem:
141
+ arunit:
142
+ adapter: sqlite3
143
+ database: ':memory:'
144
+ arunit2:
145
+ adapter: sqlite3
146
+ database: ':memory:'
147
+
148
+ sybase:
149
+ arunit:
150
+ host: database_ASE
151
+ username: sa
152
+ arunit2:
153
+ host: database_ASE
154
+ username: sa