Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORA-00923: FROM keyword not found where expected on migrate #4844

Closed
gabriofr opened this issue Nov 23, 2021 · 6 comments
Closed

ORA-00923: FROM keyword not found where expected on migrate #4844

gabriofr opened this issue Nov 23, 2021 · 6 comments

Comments

@gabriofr
Copy link

gabriofr commented Nov 23, 2021

Environment

Knex version: 0.95.14
Database + version: Oracle 19c EE
OS: OS X + Windows + Linux

@atiertant

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do

The resulting SQL when running eg. knex migrate:up or knex migrate:latest is not valid SQL as the from keyword is missing, it works fine if you rollback to knex v0.95.13 'v0.95.0`

Here's the debug output, the bug is right after the bind var:

  method: 'insert',
  options: {},
  timeout: false,
  cancelOnTimeout: false,
  bindings: [ 0 ],
  __knexQueryUid: 'rmTUdvIclHOrzEcalFRiU',
  sql: 'insert into "knex_migrations_lock" ("is_locked") select ? where not exists (select * from "knex_migrations_lock")'
}
insert into "knex_migrations_lock" ("is_locked") select :1 where not exists (select * from "knex_migrations_lock") - ORA-00923: FROM keyword not found where expected
Error: insert into "knex_migrations_lock" ("is_locked") select :1 where not exists (select * from "knex_migrations_lock") - ORA-00923: FROM keyword not found where expected
  1. Error message
    Error: insert into "knex_migrations_lock" ("is_locked") select :1 where not exists (select * from "knex_migrations_lock") - ORA-00923: FROM keyword not found where expected

  2. Reduced test code
    Just run a migration on any project that uses knex 0.9.14 and oracledb

@OlivierCavadenti
Copy link
Collaborator

Maybe could be the same problem here : #4835

@OlivierCavadenti
Copy link
Collaborator

As I can see select without from is not standard, so could be the problem here.
https://modern-sql.com/use-case/select-without-from

@gabriofr
Copy link
Author

gabriofr commented Nov 24, 2021

Maybe could be the same problem here : #4835

Jupp, can confirm the bugs are related. If I roll back to 0.95.11 and run the migration it will succeed, after that I can go back to 0.95.14 and migrations will work again..

@OlivierCavadenti
Copy link
Collaborator

I assume that fix 'this.select(trxOrKnex.raw('?', [0]))' in _insertLockRowIfNeeded will be enough.

@OlivierCavadenti
Copy link
Collaborator

Resolved by #4865

@kibertoad
Copy link
Collaborator

Released in 0.95.15

Oreilles added a commit to directus/directus that referenced this issue Jan 17, 2022
rijkvanzanten added a commit to directus/directus that referenced this issue Jan 19, 2022
* Enable end-to-end tests for Oracle and SQLite

* Add Oracle back to allVendors

* Use yum

* Use dnf

* Actually use yum

* Actually use dnf

* Actually use yum

* Try again

* Try manual install

* Fix env declaration

* Bump knex version (because knex/knex#4844)

* Set max pool size for Oracle

* Add awaitDatabaseConnection

* Cache install and build step

* Run different tests sequentially

* Fix workflow name

* Show test results

* Fix names

* Fix success check

* Fix outputs

* Add oracle driver install

* Fix env

* Revert to previous structure to benchmark performance

* Only build specs and drive packages for unit tests

* Don't install everything to run linters

* Use this branch

* Fix missing lint dep

* Revert "Don't install everything to run linters", also build shared package

* Skip app build for tests

* Don't serve app for e2e tests

* Change time fields to timestamp becaues of inconsistencies between vendors

* Make npm ci faster

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants