#1298 ✓resolved
mrruby

oracle adapter has information schema bug

Reported by mrruby | May 30th, 2010 @ 12:07 PM | in 1.1

using a simple two table data model

I get following error when doing an auto_migrate

~ ORA-00942: table or view does not exist (code: 942, sql state: , query: SELECT COUNT(*) FROM "information_s chema"."table_constraints" WHERE "constraint_type" = 'FOREIGN KEY' AND "table_schema" = :1 AND "table_name" =
:2 AND "constraint_name" = :3, uri: ......

Seems that mysql stuff is used for oracle: information_schema.table_constraints?

Best Regards,
Ad.

Comments and changes to this ticket

  • mrruby

    mrruby May 30th, 2010 @ 12:09 PM

    note schema used was:

    class Optcase
    include DataMapper::Resource property :id, Serial property :name, String, :length => 250, :required => true has n, :optcase_param end

    class OptcaseParam
    include DataMapper::Resource property :id, Serial property :name, String, :required => true property :value, String, :required => true belongs_to :optcase end

    BR,
    Ad.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) May 30th, 2010 @ 09:21 PM

    • State changed from “new” to “unconfirmed”
    • Assigned user changed from “Dan Kubb (dkubb)” to “Raimonds Simanovskis”

    The information_schema database is actually a standard set of tables that databases can implement that provides details about other databases. PostgreSQL supports it in addition to MySQL. Even Oracle has some support for it, but apparently it is limited.

    Assigning this to Raimonds to look at, as he may have more information to share, and if there are known work-arounds to get the same information from an Oracle specific API.

  • Daniel Neighman

    Daniel Neighman June 20th, 2010 @ 10:28 PM

    I also get this error when trying to access the oracle database. This seems to be somewhat of a new issue and it is preventing our application from going out :(

  • Daniel Neighman

    Daniel Neighman June 22nd, 2010 @ 06:34 PM

    I've updated the dm-constraints gem (The cause of this issue) in our NZX repo at https://github.com/NZX/dm-constraints

    This update is for all of the oracle constraint related issues that I've been able to find.

    https://github.com/NZX/dm-constraints/commit/b29624cac9ac23eb84fc8e...

  • Daniel Neighman

    Daniel Neighman June 22nd, 2010 @ 06:45 PM

    On a related note, I also updated dm-migrations so that it could drop tables correctly.

    this is available at http://github.com/NZX/dm-migrations

    http://github.com/NZX/dm-migrations/commit/b02450ed622a884a65417d0c...

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) January 14th, 2011 @ 09:05 PM

    • Milestone order changed from “0” to “0”

    (from [b6cfda15f326a42901b3e6845cb81158d529ce1b]) Updates the oracle adapter to have a more robust drop table statement.

    [#1298] https://github.com/datamapper/dm-migrations/commit/b6cfda15f326a429...

  • Dan Kubb (dkubb)
  • Dan Kubb (dkubb)
  • Martin Gamsjaeger (snusnu)

    Martin Gamsjaeger (snusnu) January 14th, 2011 @ 09:06 PM

    • State changed from “unconfirmed” to “resolved”
    • Milestone set to 1.1
    • Milestone order changed from “196200” to “0”

    Thx for the patches Daniel!

  • mrruby

    mrruby January 28th, 2011 @ 05:00 PM

    Hi,

    Is there an easy way to get this 1.1 milestone today?

    All I would like to do is to issue a command like:

    gem install data_mapper dm-oracle-adapter --no-ri --no-rdoc

    But today this gives me the 1.0.2 version.

    BR,
    Ad.

  • mrruby

    mrruby January 29th, 2011 @ 03:00 AM

    Note: ofcourse I mean how to get what is today already available of the 1.1 milestone.

  • mrruby

    mrruby January 29th, 2011 @ 01:27 PM

    • Assigned user changed from “Raimonds Simanovskis” to “Dan Kubb (dkubb)”

    I could fetch the two master (dm-migrations & dm-constraints) and replace the 1.0.2 milestone gem with these new gems.

    Unfortunately DataMapper.auto_migrate! gives following exception:

    undefined method source_repository_name' for #<Array:0x373b178><br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/adapters/dm-do-adapter.rb:106:invalid
    _relationship_for_constraint?' c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/adapters/dm-do-adapter.rb:78:in destro<br/> y\_relationship\_constraint'<br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/migrations.rb:51:insend'
    c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/migrations.rb:51:in execute_each_relat<br/> ionship'<br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/migrations.rb:50:ineach'
    c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/migrations.rb:50:in execute_each_relat<br/> ionship'<br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/migrations.rb:38:inauto_migrate_down_
    constraints!'
    c:/ruby/lib/ruby/gems/1.8/gems/dm-migrations-1.0.2/lib/dm-migrations/auto_migration.rb:45:in send'<br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-migrations-1.0.2/lib/dm-migrations/auto_migration.rb:45:inrepository_execu
    te'
    c:/ruby/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/support/descendant_set.rb:68:in each'<br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/support/descendant_set.rb:67:ineach'
    c:/ruby/lib/ruby/gems/1.8/gems/dm-migrations-1.0.2/lib/dm-migrations/auto_migration.rb:44:in repository_execu<br/> te'<br/> c:/ruby/lib/ruby/gems/1.8/gems/dm-constraints-1.0.2/lib/dm-constraints/migrations.rb:10:inauto_migrate!'
    D:/agRuby/ag2010/oracle-datamapper-trial/rakefile:14
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in invoke_with_call_chain'<br/> c:/ruby/lib/ruby/1.8/monitor.rb:238:insynchronize'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in run'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run'<br/> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31<br/> c:/ruby/bin/rake:19:inload'
    c:/ruby/bin/rake:19

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Referenced by

Pages