activerecord-oracle_enhanced-adapter 6.1.1 → 6.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +36 -0
- data/VERSION +1 -1
- data/lib/active_record/connection_adapters/oracle_enhanced/database_tasks.rb +5 -5
- data/lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb +6 -3
- data/lib/active_record/connection_adapters/oracle_enhanced/quoting.rb +5 -8
- data/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +2 -2
- data/spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b17060d198e5da1dcccae49e4c50e114a2fc52c84d7a529271a8c7fc1948c8a4
|
4
|
+
data.tar.gz: fbc916077b37c9a31f2a3e315b7ddec8559aaaadd5eb4898d67703914586a1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1654bf5c9d946e7f795075ae030e8b46560c8f1f680cbe203e953f1d3a596d5f4d20395c56e4bfc0d137cd1adb712f7ceaa50bcedbacae83583f7796d98a6ad
|
7
|
+
data.tar.gz: cc75b8f1cd8e2abd4ffa8268ba62bba9bbc1fae23d20502226ec95d3c0f56a4a90837e77bf650160b6c5b940db6284608bb191fd7f5b12c0c96eaf07989b75c4
|
data/History.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
## 6.1.6 / 2022-01-21
|
2
|
+
|
3
|
+
* Changes and bug fixes
|
4
|
+
* Fix `columns_for_distinct` when using Rails 6.1 [#2249 #2252 rails/rails#31966]
|
5
|
+
|
6
|
+
## 6.1.5 / 2021-12-07
|
7
|
+
|
8
|
+
* Changes and bug fixes
|
9
|
+
* get root cause if something went wrong with jdbc.OracleDriver [#2180 #2181]
|
10
|
+
|
11
|
+
* CI
|
12
|
+
* Bump CRuby versions at Travis CI for release61 branch [#2192]
|
13
|
+
|
14
|
+
## 6.1.4 / 2021-04-01
|
15
|
+
|
16
|
+
* Changes and bug fixes
|
17
|
+
* Support use of ojdbc11.jar [#2155, #2168]
|
18
|
+
* Add missing default granted permission "ulimited tablespace" [#2156, #2167]
|
19
|
+
* Prevent from including ojdbc8.jar file to gem file [#2163, #2164, #2165]
|
20
|
+
* Oracle enhanced adapter 6.1.3 has been yanked since #2163
|
21
|
+
|
22
|
+
* CI
|
23
|
+
* Allow-failure CI against jruby-head for release61 branch [#2166]
|
24
|
+
|
25
|
+
## 6.1.3 / 2021-03-31
|
26
|
+
|
27
|
+
* Changes and bug fixes
|
28
|
+
* Address FrozenError (can't modify frozen Hash): error [#2139 #2151 #2160]
|
29
|
+
|
30
|
+
* CI
|
31
|
+
* CI against JRuby 9.2.15.0 [#2150]
|
32
|
+
|
33
|
+
## 6.1.2 / 2021-02-10
|
34
|
+
* Changes and bug fixes
|
35
|
+
* Fixed ORA-01935: missing user or role name with config read issue [#1943 #2135, #2142]
|
36
|
+
|
1
37
|
## 6.1.1 / 2021-01-14
|
2
38
|
|
3
39
|
* Changes and bug fixes
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.1.
|
1
|
+
6.1.6
|
@@ -17,19 +17,19 @@ module ActiveRecord
|
|
17
17
|
print "Please provide the SYSTEM password for your Oracle installation (set ORACLE_SYSTEM_PASSWORD to avoid this prompt)\n>"
|
18
18
|
$stdin.gets.strip
|
19
19
|
}
|
20
|
-
establish_connection(@config.merge(
|
20
|
+
establish_connection(@config.merge(username: "SYSTEM", password: system_password))
|
21
21
|
begin
|
22
|
-
connection.execute "CREATE USER #{@config[
|
22
|
+
connection.execute "CREATE USER #{@config[:username]} IDENTIFIED BY #{@config[:password]}"
|
23
23
|
rescue => e
|
24
24
|
if /ORA-01920/.match?(e.message) # user name conflicts with another user or role name
|
25
|
-
connection.execute "ALTER USER #{@config[
|
25
|
+
connection.execute "ALTER USER #{@config[:username]} IDENTIFIED BY #{@config[:password]}"
|
26
26
|
else
|
27
27
|
raise e
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
OracleEnhancedAdapter.permissions.each do |permission|
|
32
|
-
connection.execute "GRANT #{permission} TO #{@config[
|
32
|
+
connection.execute "GRANT #{permission} TO #{@config[:username]}"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -46,7 +46,7 @@ module ActiveRecord
|
|
46
46
|
def structure_dump(filename, extra_flags)
|
47
47
|
establish_connection(@config)
|
48
48
|
File.open(filename, "w:utf-8") { |f| f << connection.structure_dump }
|
49
|
-
if @config[
|
49
|
+
if @config[:structure_dump] == "db_stored_code"
|
50
50
|
File.open(filename, "a") { |f| f << connection.structure_dump_db_stored_code }
|
51
51
|
end
|
52
52
|
end
|
@@ -16,7 +16,8 @@ begin
|
|
16
16
|
# Oracle 11g client ojdbc6.jar is also compatible with Java 1.7
|
17
17
|
# Oracle 12c Release 1 client provides ojdbc7.jar
|
18
18
|
# Oracle 12c Release 2 client provides ojdbc8.jar
|
19
|
-
|
19
|
+
# Oracle 21c provides ojdbc11.jar for Java 11 and above
|
20
|
+
ojdbc_jars = %w(ojdbc11.jar ojdbc8.jar ojdbc7.jar ojdbc6.jar)
|
20
21
|
|
21
22
|
if !ENV_JAVA["java.class.path"]&.match?(Regexp.new(ojdbc_jars.join("|")))
|
22
23
|
# On Unix environment variable should be PATH, on Windows it is sometimes Path
|
@@ -42,9 +43,9 @@ begin
|
|
42
43
|
java.lang.System.set_property("oracle.net.tns_admin", ENV["TNS_ADMIN"])
|
43
44
|
end
|
44
45
|
|
45
|
-
rescue LoadError, NameError
|
46
|
+
rescue LoadError, NameError => e
|
46
47
|
# JDBC driver is unavailable.
|
47
|
-
raise LoadError, "ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install #{ojdbc_jars.join(' or ') } library."
|
48
|
+
raise LoadError, "ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install #{ojdbc_jars.join(' or ') } library.\n#{e.class}:#{e.message}"
|
48
49
|
end
|
49
50
|
|
50
51
|
module ActiveRecord
|
@@ -98,6 +99,8 @@ module ActiveRecord
|
|
98
99
|
@raw_connection = @raw_connection.underlying_connection
|
99
100
|
end
|
100
101
|
|
102
|
+
# Workaround FrozenError (can't modify frozen Hash):
|
103
|
+
config = config.dup
|
101
104
|
config[:driver] ||= @raw_connection.meta_data.connection.java_class.name
|
102
105
|
username = @raw_connection.meta_data.user_name
|
103
106
|
else
|
@@ -10,14 +10,11 @@ module ActiveRecord
|
|
10
10
|
|
11
11
|
def quote_column_name(name) #:nodoc:
|
12
12
|
name = name.to_s
|
13
|
-
self.class.quoted_column_names[name] ||=
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# remove double quotes which cannot be used inside quoted identifier
|
19
|
-
"\"#{name.gsub('"', '')}\""
|
20
|
-
end
|
13
|
+
self.class.quoted_column_names[name] ||= if /\A[a-z][a-z_0-9\$#]*\Z/.match?(name)
|
14
|
+
"\"#{name.upcase}\""
|
15
|
+
else
|
16
|
+
# remove double quotes which cannot be used inside quoted identifier
|
17
|
+
"\"#{name.gsub('"', '')}\""
|
21
18
|
end
|
22
19
|
end
|
23
20
|
|
@@ -226,7 +226,7 @@ module ActiveRecord
|
|
226
226
|
# ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.permissions =
|
227
227
|
# ["create session", "create table", "create view", "create sequence", "create trigger", "ctxapp"]
|
228
228
|
cattr_accessor :permissions
|
229
|
-
self.permissions = ["create session", "create table", "create view", "create sequence"]
|
229
|
+
self.permissions = ["unlimited tablespace", "create session", "create table", "create view", "create sequence"]
|
230
230
|
|
231
231
|
##
|
232
232
|
# :singleton-method:
|
@@ -661,7 +661,7 @@ module ActiveRecord
|
|
661
661
|
}.reject(&:blank?).map.with_index { |column, i|
|
662
662
|
"FIRST_VALUE(#{column}) OVER (PARTITION BY #{columns} ORDER BY #{column}) AS alias_#{i}__"
|
663
663
|
}
|
664
|
-
|
664
|
+
(order_columns << super).join(", ")
|
665
665
|
end
|
666
666
|
|
667
667
|
def temporary_table?(table_name) #:nodoc:
|
@@ -16,11 +16,11 @@ describe "Oracle Enhanced adapter database tasks" do
|
|
16
16
|
ActiveRecord::Tasks::DatabaseTasks.create(new_user_config)
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
it "creates user" do
|
20
20
|
query = "SELECT COUNT(*) FROM dba_users WHERE UPPER(username) = '#{new_user_config[:username].upcase}'"
|
21
21
|
expect(ActiveRecord::Base.connection.select_value(query)).to eq(1)
|
22
22
|
end
|
23
|
-
|
23
|
+
it "grants permissions defined by OracleEnhancedAdapter.persmissions" do
|
24
24
|
query = "SELECT COUNT(*) FROM DBA_SYS_PRIVS WHERE GRANTEE = '#{new_user_config[:username].upcase}'"
|
25
25
|
permissions_count = ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.permissions.size
|
26
26
|
expect(ActiveRecord::Base.connection.select_value(query)).to eq(permissions_count)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-oracle_enhanced-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raimonds Simanovskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 1.8.11
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.2.
|
140
|
+
rubygems_version: 3.2.32
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Oracle enhanced adapter for ActiveRecord
|