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

[PHQL] Add placeholders support to LIMIT #1023

Merged
merged 9 commits into from Aug 8, 2013
Prev Previous commit
Next Next commit
Use BIND_PARAM_STR for not specified parameter types
  • Loading branch information
sjinks committed Aug 7, 2013
commit 57d2f8e947c2240b3935dd7814d4e968f90c369c
7 changes: 7 additions & 0 deletions ext/db/adapter/pdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,15 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, executePrepared){
Z_UNSET_ISREF_P(cast_value);

} else {
PHALCON_INIT_NVAR(type);
ZVAL_LONG(type, 2 /* BIND_PARAM_STR */);
Z_SET_ISREF_P(value);
phalcon_call_method_p3_noret(statement, "bindparam", parameter, value, type);
Z_UNSET_ISREF_P(value);
/*
PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "Invalid bind type parameter");
return;
*/
Copy link
Author

Choose a reason for hiding this comment

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

Default to BIND_PARAM_STR for all unspecified bound parameter types.

Not strictly necessary but allows one to write less code.

}
} else {
Z_SET_ISREF_P(value);
Expand Down