Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

r3372@asus: jeremy | 2005-12-07 20:25:20 -0800

 Apply [3233] to stable.  Oracle: use syntax compatible with Oracle 8.  Closes #3131.

git-svn-id: 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 966b027c714aa68f7c76e7daaa1fd29bcb2a1cf2 1 parent 2c5d342
@jeremy jeremy authored
2  activerecord/CHANGELOG
@@ -1,5 +1,7 @@
* SVN*
+* Oracle: use syntax compatible with Oracle 8. #3131 [Michael Schoen]
* MySQL: work around ruby-mysql/mysql-ruby inconsistency with mysql.stat. Eliminate usage of because it doesn't guarantee reconnect. Explicitly close and reopen the connection instead. [Jeremy Kemper]
* When AbstractAdapter#log rescues an exception, attempt to detect and reconnect to an inactive database connection. Connection adapter must respond to the active? and reconnect! instance methods. Initial support for PostgreSQL, MySQL, and SQLite. Make certain that all statements which may need reconnection are performed within a logged block: for example, this means no avoiding log(sql, name) { } if @logger.nil? [Jeremy Kemper]
11 activerecord/lib/active_record/connection_adapters/oci_adapter.rb
@@ -339,11 +339,10 @@ def columns(table_name, name = nil) #:nodoc:
table_cols = %Q{
select column_name, data_type, data_default, nullable,
- case when data_type = 'NUMBER' then data_precision
- when data_type = 'VARCHAR2' then data_length
- else null end as length,
- case when data_type = 'NUMBER' then data_scale
- else null end as scale
+ decode(data_type, 'NUMBER', data_precision,
+ 'VARCHAR2', data_length,
+ null) as length,
+ decode(data_type, 'NUMBER', data_scale, null) as scale
from #{scope}_catalog cat, #{scope}_synonyms syn, all_tab_columns col
where cat.table_name = #{table}
and syn.synonym_name (+)= cat.table_name
@@ -515,7 +514,7 @@ class OCIConnectionFactory
def new_connection(username, password, host)
conn = username, password, host
conn.exec %q{alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'}
- conn.exec %q{alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS'}
+ conn.exec %q{alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS'} rescue nil
conn.autocommit = true
Please sign in to comment.
Something went wrong with that request. Please try again.