summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rw-r--r--ext/pdo_mysql/mysql_statement.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 180a4616ef..0d0df4ca6d 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -367,6 +367,10 @@ static const char * const pdo_param_event_names[] =
"PDO_PARAM_EVT_NORMALIZE",
};
+#ifndef PDO_USE_MYSQLND
+static unsigned char libmysql_false_buffer = 0;
+static unsigned char libmysql_true_buffer = 1;
+#endif
static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */
{
@@ -503,6 +507,16 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
*b->length = Z_STRLEN_P(parameter);
PDO_DBG_RETURN(1);
+ case IS_FALSE:
+ b->buffer_type = MYSQL_TYPE_TINY;
+ b->buffer = &libmysql_false_buffer;
+ PDO_DBG_RETURN(1);
+
+ case IS_TRUE:
+ b->buffer_type = MYSQL_TYPE_TINY;
+ b->buffer = &libmysql_true_buffer;
+ PDO_DBG_RETURN(1);
+
case IS_LONG:
b->buffer_type = MYSQL_TYPE_LONG;
b->buffer = &Z_LVAL_P(parameter);