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

GH-2915 Oracledb tests are failing #2924

Merged
merged 3 commits into from Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dialects/oracledb/query/compiler.js
Expand Up @@ -284,7 +284,7 @@ _.assign(Oracledb_Compiler.prototype, {
const self = this;
const sql = {};
const outBindPrep = this._prepOutbindings(
this.single.update,
this.single.update || this.single.counter,
this.single.returning
);
const outBinding = outBindPrep.outBinding;
Expand All @@ -297,7 +297,7 @@ _.assign(Oracledb_Compiler.prototype, {
let intoClause = '';

if (
_.isEmpty(this.single.update) &&
_.isEmpty(updates) &&
typeof this.single.update !== 'function'
) {
return '';
Expand Down
12 changes: 7 additions & 5 deletions test/integration/builder/unions.js
Expand Up @@ -87,16 +87,18 @@ module.exports = function(knex) {
return knex('accounts')
.select('*')
.where('id', '=', 1)
.union(knex.raw('select * from accounts where id = ?', [2]));
.union(
knex.raw('select * from ?? where ?? = ?', ['accounts', 'id', 2])
);
});

it('handles unions with an array raw queries', function() {
return knex('accounts')
.select('*')
.where('id', '=', 1)
.union([
knex.raw('select * from accounts where id = ?', [2]),
knex.raw('select * from accounts where id = ?', [3]),
knex.raw('select * from ?? where ?? = ?', ['accounts', 'id', 2]),
knex.raw('select * from ?? where ?? = ?', ['accounts', 'id', 3]),
]);
});

Expand All @@ -105,8 +107,8 @@ module.exports = function(knex) {
.select('*')
.where('id', '=', 1)
.union(
knex.raw('select * from accounts where id = ?', [2]),
knex.raw('select * from accounts where id = ?', [3])
knex.raw('select * from ?? where ?? = ?', ['accounts', 'id', 2]),
knex.raw('select * from ?? where ?? = ?', ['accounts', 'id', 3])
);
});
});
Expand Down
4 changes: 4 additions & 0 deletions test/integration/migrate/index.js
Expand Up @@ -192,6 +192,10 @@ module.exports = function(knex) {
'fileName',
'20150109002832_invalid_migration.js'
);
})
.then(function(data) {
// Clean up lock for other tests
return knex('knex_migrations_lock').update({ is_locked: 0 });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any ideas why this only remains locked for Oracle? I wonder if something with transactions is wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kibertoad sometimes this is failing sometimes not, not very consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also suspecting that oracle's transaction code has something done wrong. I tried to look into it some months ago, but wasn't able to reproduce nor fix it.

It would be important to still add comment about how to make testbench to fail again to be able to really fix the underlying problem in oracle. And to add bug report issue to github pointing to disabled test.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Could you please check if this is what you've had in mind or if we are still missing something?

});
});

Expand Down