diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2016-07-11 17:03:03 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2016-07-11 22:16:39 +0000 |
commit | 97ded96a33abb98190537e10e94c7dadf5bd0a5f (patch) | |
tree | 2110bb519059ff18a2223bf9af15109352fc1040 /libmysqld | |
parent | e81455bb1617e574faab93f0846a6339064968b3 (diff) | |
download | mariadb-git-97ded96a33abb98190537e10e94c7dadf5bd0a5f.tar.gz |
MDEV-10318 : Fix crash in embedded, in case prepared statement has parameter placeholders, but does not bind parameters
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/lib_sql.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 3d6ca5a3810..623569c18de 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -341,6 +341,12 @@ static int emb_stmt_execute(MYSQL_STMT *stmt) THD *thd; my_bool res; + if (stmt->param_count && !stmt->bind_param_done) + { + set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + int4store(header, stmt->stmt_id); header[4]= (uchar) stmt->flags; thd= (THD*)stmt->mysql->thd; |