Skip to content

Commit

Permalink
Set stmt_id to -1 only for mariadb_stmt_execute_direct
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Nov 4, 2016
1 parent 884ee22 commit 4d1af73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libmariadb/mariadb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ mysql_real_connect(MYSQL *mysql, const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,unsigned long client_flag)
{
char *end;
char *end= NULL;
char *connection_handler= (mysql->options.extension) ?
mysql->options.extension->connection_handler : 0;

Expand Down
3 changes: 2 additions & 1 deletion libmariadb/mariadb_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql)
/* fill mysql's stmt list */
stmt->list.data= stmt;
stmt->mysql= mysql;
stmt->stmt_id= -1;
stmt->stmt_id= 0;
mysql->stmts= list_add(mysql->stmts, &stmt->list);


Expand Down Expand Up @@ -2119,6 +2119,7 @@ int STDCALL mariadb_stmt_execute_direct(MYSQL_STMT *stmt,
sizeof(stmt_id), 1, stmt))
goto fail;
}
stmt->stmt_id= -1;
if (mysql->methods->db_command(mysql, COM_STMT_PREPARE, stmt_str, length, 1, stmt))
goto fail;

Expand Down

0 comments on commit 4d1af73

Please sign in to comment.