Skip to content

Checking whether table exists uses "limit" which is unknown to Oracle #61

@mirelon

Description

@mirelon

The problem is in this method:

  private[activerecord] def isCreated: Boolean = inTransaction {
    all.headOption.exists{ t =>
      try {
        val name = config.adapter.quoteName(t.prefixedName)
        execute("select 1 from " + name + " limit 1", false)
        true
      } catch {
        case e: Throwable => false
      }
    }
  }

When I run Tables.initialize on the empty database, it runs ok. The second run checks for each table presence. The SQL throws an exception, which is caught, returning false. The initialize method then thinks the table is not created and tries to create it causing:

java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions