Skip to content

Instantly share code, notes, and snippets.

@wconrad
Created February 23, 2015 14:37
Show Gist options
  • Save wconrad/ee056b63084e3f9ac9ca to your computer and use it in GitHub Desktop.
Save wconrad/ee056b63084e3f9ac9ca to your computer and use it in GitHub Desktop.
reproduce oracle-enhanced-adapter issue i546 (rails42: missing right paren when creating table with timestamp)
source "https://rubygems.org"
gem "activerecord", "~> 4.2.0"
gem "activerecord-oracle_enhanced-adapter",
git: '[email protected]:rsim/oracle-enhanced.git',
branch: 'rails42',
ref: '518dc3cf6a1f6e3593751d30d392518dc69d1a3a'
gem "ruby-oci8"
gem "arel", "~> 6.0.0"
GIT
remote: [email protected]:rsim/oracle-enhanced.git
revision: 518dc3cf6a1f6e3593751d30d392518dc69d1a3a
ref: 518dc3cf6a1f6e3593751d30d392518dc69d1a3a
branch: rails42
specs:
activerecord-oracle_enhanced-adapter (1.5.5)
GEM
remote: https://rubygems.org/
specs:
activemodel (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
arel (~> 6.0)
activesupport (4.2.0)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.0)
builder (3.2.2)
i18n (0.7.0)
json (1.8.2)
minitest (5.5.1)
ruby-oci8 (2.1.7)
thread_safe (0.3.4)
tzinfo (1.2.2)
thread_safe (~> 0.1)
PLATFORMS
ruby
DEPENDENCIES
activerecord (~> 4.2.0)
activerecord-oracle_enhanced-adapter!
arel (~> 6.0.0)
ruby-oci8
#!/usr/bin/env ruby
require 'bundler'
Bundler.setup
require 'active_record'
require 'logger'
ActiveRecord::Base.establish_connection(adapter: 'oracle_enhanced',
host: 'localhost',
database: 'orcl.internal.databill.com',
username: 'sandbox1',
password: ENV['PASSWORD'])
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table "jobs", force: true do |t|
t.timestamp "run_time", limit: 6
end
end
-- create_table("jobs", {:force=>true})
D, [2015-02-23T07:33:43.356535 #29286] DEBUG -- : (2.1ms) CREATE TABLE "JOBS" ("ID" NUMBER(38) NOT NULL PRIMARY KEY, "RUN_TIME" DATE(6))
E, [2015-02-23T07:33:43.356854 #29286] ERROR -- : OCIError: ORA-00907: missing right parenthesis: CREATE TABLE "JOBS" ("ID" NUMBER(38) NOT NULL PRIMARY KEY, "RUN_TIME" DATE(6))
stmt.c:230:in oci8lib_220.so: OCIError: ORA-00907: missing right parenthesis: CREATE TABLE "JOBS" ("ID" NUMBER(38) NOT NULL PRIMARY KEY, "RUN_TIME" DATE(6)) (ActiveRecord::StatementInvalid)
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/ruby-oci8-2.1.7/lib/oci8/cursor.rb:129:in `exec'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/ruby-oci8-2.1.7/lib/oci8/oci8.rb:278:in `exec_internal'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/ruby-oci8-2.1.7/lib/oci8/oci8.rb:269:in `exec'
from /home/wayne/.rvm/gems/ruby-2.2.0/bundler/gems/oracle-enhanced-518dc3cf6a1f/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:429:in `exec'
from /home/wayne/.rvm/gems/ruby-2.2.0/bundler/gems/oracle-enhanced-518dc3cf6a1f/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:88:in `exec'
from /home/wayne/.rvm/gems/ruby-2.2.0/bundler/gems/oracle-enhanced-518dc3cf6a1f/lib/active_record/connection_adapters/oracle_enhanced_database_statements.rb:10:in `block in execute'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `block in log'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:460:in `log'
from /home/wayne/.rvm/gems/ruby-2.2.0/bundler/gems/oracle-enhanced-518dc3cf6a1f/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:1288:in `log'
from /home/wayne/.rvm/gems/ruby-2.2.0/bundler/gems/oracle-enhanced-518dc3cf6a1f/lib/active_record/connection_adapters/oracle_enhanced_database_statements.rb:10:in `execute'
from /home/wayne/.rvm/gems/ruby-2.2.0/bundler/gems/oracle-enhanced-518dc3cf6a1f/lib/active_record/connection_adapters/oracle_enhanced_schema_statements.rb:82:in `create_table'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in `block in method_missing'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `block in say_with_time'
from /home/wayne/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/benchmark.rb:288:in `measure'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `say_with_time'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:652:in `method_missing'
from ./missing_right_paren.rb:16:in `block in <main>'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/schema.rb:41:in `instance_eval'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/schema.rb:41:in `define'
from /home/wayne/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/schema.rb:61:in `define'
from ./missing_right_paren.rb:15:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment