Skip to content

Binding Parameters Bug Fix and Version Bump #15

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

Merged
merged 2 commits into from
Jan 24, 2012
Merged

Conversation

wankdanker
Copy link
Collaborator

Fix binding-params queries and only use them when needed

  • [binding-params] Accept optional params array as an argument to the query method
  • [binding-params] Bypass binding parameters and use SQLExecDirect if there is no params array

The original pull request for binding params seems to have missed some critical parts. This
commit fixes these shortcomings. The issues were:

  • odbc.js's query method was modified to accept a params array, but this array was not passed on to the cpp side of things
  • Database.ccp was modified to populate prep_req->params if arg[1] was an array, but it was never an array because it wasn't passed from javascript land.
  • SQLPrepare and SQLExecute were always used even when there was no need to if no parameter array was passed.

I have also bumped the version to v0.3.1 which should be inline for the next npm release.

*[binding-params] Accept optional params array as an argument to the query method
*[binding-params] Bypass binding parameters and use SQLExecDirect if there is no params array

The original pull request for binding params seems to have missed some critical parts. This
commit fixes these shortcomings. The issues were:

	* odbc.js's query method was modified to accept a `params` array, but this array was
		not passed on to the cpp side of things
	* Database.ccp was modified to populate prep_req->params if arg[1] was an array, but
		it was never an array because it wasn't passed from javascript land.
	* SQLPrepare and SQLExecute were always used even when there was no need to if no
		parameter array was passed.
w1nk added a commit that referenced this pull request Jan 24, 2012
Binding Parameters Bug Fix and Version Bump
@w1nk w1nk merged commit 21296ee into w1nk:master Jan 24, 2012
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.

2 participants