Skip to content

Commit 97ded96

Browse files
committed
MDEV-10318 : Fix crash in embedded, in case prepared statement has parameter placeholders, but does not bind parameters
1 parent e81455b commit 97ded96

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libmysqld/lib_sql.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
341341
THD *thd;
342342
my_bool res;
343343

344+
if (stmt->param_count && !stmt->bind_param_done)
345+
{
346+
set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate, NULL);
347+
DBUG_RETURN(1);
348+
}
349+
344350
int4store(header, stmt->stmt_id);
345351
header[4]= (uchar) stmt->flags;
346352
thd= (THD*)stmt->mysql->thd;

0 commit comments

Comments
 (0)