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

Re-enable Query Builder for ODBC driver #5197

Closed
wants to merge 1 commit into from

Conversation

simplysites
Copy link

Undo of a change made in CI 3.1.0: ODBC driver does not support Query Builder usage any more.

Undo of a change made in CI 3.1.0: ODBC driver does not support Query Builder usage any more.
@narfbg
Copy link
Contributor

narfbg commented Jul 24, 2017

It was disabled for a reason.

@narfbg narfbg closed this Jul 24, 2017
@simplysites
Copy link
Author

And what might that reason be? Breaking existing code without a proper explanation (not found in the change log) is not exactly best practice. We rely on query builder throughout a lot of projects and as such can not update to 3.1.0 or more recent versions.

@narfbg
Copy link
Contributor

narfbg commented Jul 24, 2017

I know it doesn't say much, but the changelog entry is this:

  • Fixed an SQL injection in the ‘odbc’ database driver.

Disabling the query builder is the fix, as QB relies on escaping, which is something ODBC doesn't have APIs for.

Proper explanation was in the release announcement: https://forum.codeigniter.com/thread-65803.html
And that includes saying it was 3.1.0 instead of 3.0.6 exactly because of the breaking change.

@simplysites
Copy link
Author

Dear Andrey,

Thanks for your explanation, now it is clear to me. Is this a temporary fix or a final solution?
Should there be an interest in implementing a proper prepared statement and escaping mechanism in the driver, I am willing to spend some time on that.

Best regards,
Mattias

@narfbg
Copy link
Contributor

narfbg commented Jul 25, 2017

Escaping isn't possible, only prepared statements with bound params - until we can do that, it's as good as permanent.

But that isn't an easy or small task, and if you want to contribute to it, you have to know that this can't be limited to ODBC. All drivers have to be transitioned to proper prepared statements, keeping the same APIs, but with as less BC breaks as possible.

@simplysites
Copy link
Author

Personally I only have experience with MySQL/MySQLi and ODBC, but I'm certainly willing to help out.

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

Successfully merging this pull request may close these issues.

None yet

2 participants