1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Set stmt_id to -1 only for mariadb_stmt_execute_direct

This commit is contained in:
Georg Richter
2016-11-04 16:02:08 +01:00
parent 884ee2262d
commit 4d1af73242
2 changed files with 3 additions and 2 deletions

View File

@@ -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;

View File

@@ -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);
@@ -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;