struct pdo_bound_param_data *param;
HashTable *ht;
+ if (stmt->dbh->skip_param_evt & (1 << event_type)) {
+ return 1;
+ }
+
if (!stmt->methods->param_hook) {
return 1;
}
/* when set, convert int/floats to strings */
unsigned stringify:1;
+ /* bitmap for pdo_param_event(s) to skip in dispatch_param_event */
+ unsigned skip_param_evt:7;
+
/* the sum of the number of bits here and the bit fields preceding should
* equal 32 */
- unsigned _reserved_flags:21;
+ unsigned _reserved_flags:14;
/* data source string used to open this handle */
const char *data_source;
dbh->driver_data = H;
+ dbh->skip_param_evt =
+ 1 << PDO_PARAM_EVT_FREE |
+ 1 << PDO_PARAM_EVT_EXEC_POST |
+ 1 << PDO_PARAM_EVT_FETCH_PRE |
+ 1 << PDO_PARAM_EVT_FETCH_POST |
+ 1 << PDO_PARAM_EVT_NORMALIZE;
+
#ifndef PDO_USE_MYSQLND
H->max_buffer_size = 1024*1024;
#endif
H = pecalloc(1, sizeof(*H), dbh->is_persistent);
dbh->driver_data = H;
+ dbh->skip_param_evt =
+ 1 << PDO_PARAM_EVT_FETCH_PRE |
+ 1 << PDO_PARAM_EVT_FETCH_POST |
+ 1 << PDO_PARAM_EVT_NORMALIZE;
+
H->prefetch = PDO_OCI_PREFETCH_DEFAULT;
/* allocate an environment */
H = pecalloc(1, sizeof(pdo_pgsql_db_handle), dbh->is_persistent);
dbh->driver_data = H;
+ dbh->skip_param_evt =
+ 1 << PDO_PARAM_EVT_EXEC_POST |
+ 1 << PDO_PARAM_EVT_FETCH_PRE |
+ 1 << PDO_PARAM_EVT_FETCH_POST;
+
H->einfo.errcode = 0;
H->einfo.errmsg = NULL;
}
break;
}
- } else if (param->is_param) {
+ } else if (param->is_param && event_type == PDO_PARAM_EVT_NORMALIZE) {
/* We need to manually convert to a pg native boolean value */
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL &&
((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) {
H->einfo.errmsg = NULL;
dbh->driver_data = H;
+ /* skip all but this one param event */
+ dbh->skip_param_evt = 0x7F ^ (1 << PDO_PARAM_EVT_EXEC_PRE);
+
filename = make_filename_safe(dbh->data_source);
if (!filename) {