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
fix(oracle): For Raw queries avoid converting the input parameters passed #16067
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for this?
* fix: modify testcase to repeat bind names for 3 times * fix: modify the order of bindnames in test case * fix: space missing
Yes. changed the existing test case. The issue happened when bind values were sent as array and they are treated like replacements (?) . I modified the existing test case to change the order of bind names like ' select :one as foo, :one as bar, :two as baz FROM DUAL' instead of 'select :one as foo, :two as bar, :one as baz FROM DUAL'. The test fails with Oracle dialect with error 'ORA-01008: not all variables bound' . With the fix to retain the bind values as it is { one: 1, two: 2 } , the test case passed. |
🎉 This PR is included in version 6.32.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request Checklist
Description Of Change
For Sequelize Raw queries such as below , the input bind value parameter, { one: 1, two: 2 } is converted to array [1,2] which is not required. Hence fixed code to avoid the same.
const result = await this.sequelize.query(select $one${typeCast} as foo, $two${typeCast} as bar${Support.addDualInSelect()}, { raw: true, bind: { one: 1, two: 2 }, logging(s) { logSql = s; } });
Todos