Skip to content

Commit ee6ed3c

Browse files
palichoroba
authored andcommitted
Revert "Change mariadb_st_internal_execute41 function argument num_params to bool has_params"
This reverts commit ee26e0b. For MySQL 8.3.0 is needed to know number of parameters in mariadb_st_internal_execute41() function. Number of parameter will be used in follow up change.
1 parent ecc5fcb commit ee6ed3c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

dbdimp.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,7 @@ int mariadb_db_login6_sv(SV *dbh, imp_dbh_t *imp_dbh, SV *dsn, SV *user, SV *pas
26822682

26832683

26842684
static my_ulonglong mariadb_st_internal_execute(SV *h, char *sbuf, STRLEN slen, int num_params, imp_sth_ph_t *params, MYSQL_RES **result, MYSQL **svsock, bool use_mysql_use_result);
2685-
static my_ulonglong mariadb_st_internal_execute41(SV *h, char *sbuf, STRLEN slen, bool has_params, MYSQL_RES **result, MYSQL_STMT **stmt_ptr, MYSQL_BIND *bind, MYSQL **svsock, bool *has_been_bound);
2685+
static my_ulonglong mariadb_st_internal_execute41(SV *h, char *sbuf, STRLEN slen, int num_params, MYSQL_RES **result, MYSQL_STMT **stmt_ptr, MYSQL_BIND *bind, MYSQL **svsock, bool *has_been_bound);
26862686

26872687
/**************************************************************************
26882688
*
@@ -4601,7 +4601,7 @@ static my_ulonglong mariadb_st_internal_execute(
46014601
* Inputs: h - object handle, for storing error messages
46024602
* statement - query being executed
46034603
* attribs - statement attributes, currently ignored
4604-
* has_params - non-zero parameters being bound
4604+
* num_params - number of parameters being bound
46054605
* params - parameter array
46064606
* result - where to store results, if any
46074607
* svsock - socket connected to the database
@@ -4612,7 +4612,7 @@ static my_ulonglong mariadb_st_internal_execute41(
46124612
SV *h,
46134613
char *sbuf,
46144614
STRLEN slen,
4615-
bool has_params,
4615+
int num_params,
46164616
MYSQL_RES **result,
46174617
MYSQL_STMT **stmt_ptr,
46184618
MYSQL_BIND *bind,
@@ -4655,7 +4655,7 @@ static my_ulonglong mariadb_st_internal_execute41(
46554655
we have to rebind them
46564656
*/
46574657

4658-
if (!reconnected && has_params && !(*has_been_bound))
4658+
if (!reconnected && num_params > 0 && !(*has_been_bound))
46594659
{
46604660
if (mysql_stmt_bind_param(stmt,bind) == 0)
46614661
{
@@ -4670,7 +4670,9 @@ static my_ulonglong mariadb_st_internal_execute41(
46704670
}
46714671

46724672
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
4673-
PerlIO_printf(DBIc_LOGPIO(imp_xxh), "\t\tmariadb_st_internal_execute41 calling mysql_execute\n");
4673+
PerlIO_printf(DBIc_LOGPIO(imp_xxh),
4674+
"\t\tmariadb_st_internal_execute41 calling mysql_execute with %d num_params\n",
4675+
num_params);
46744676

46754677
if (!reconnected)
46764678
{
@@ -4695,7 +4697,7 @@ static my_ulonglong mariadb_st_internal_execute41(
46954697
}
46964698
mysql_stmt_close(*stmt_ptr);
46974699
*stmt_ptr = stmt;
4698-
if (has_params)
4700+
if (num_params > 0)
46994701
{
47004702
if (mysql_stmt_bind_param(stmt,bind))
47014703
goto error;
@@ -4856,7 +4858,7 @@ IV mariadb_st_execute_iv(SV* sth, imp_sth_t* imp_sth)
48564858
sth,
48574859
imp_sth->statement,
48584860
imp_sth->statement_len,
4859-
!!(DBIc_NUM_PARAMS(imp_sth) > 0),
4861+
DBIc_NUM_PARAMS(imp_sth),
48604862
&imp_sth->result,
48614863
&imp_sth->stmt,
48624864
imp_sth->bind,

0 commit comments

Comments
 (0)