mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.0'
* PHP-8.0: PDO MySQL: Handle boolean parameter binding with libmysql
This commit is contained in:
commit
9718e5987f
1 changed files with 14 additions and 0 deletions
|
@ -368,6 +368,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) /* {{{ */
|
||||
{
|
||||
|
@ -504,6 +508,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue