You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Test fix for test_bug4236
This commit is contained in:
committed by
Sergei Golubchik
parent
558ad7d68d
commit
1d3fd5818a
@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
|||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("unrecocognized option: %s", argv[1]);
|
printf("unrecognized option: %s", argv[1]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@@ -2474,12 +2474,10 @@ static int test_bug4231(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_bug4236(MYSQL *mysql)
|
static int test_bug4236(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
MYSQL_STMT *stmt, *stmt1;
|
MYSQL_STMT *stmt;
|
||||||
const char *stmt_text;
|
const char *stmt_text;
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL_STMT backup;
|
MYSQL_STMT backup;
|
||||||
MYSQL *mysql1;
|
|
||||||
|
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
@@ -2493,20 +2491,6 @@ static int test_bug4236(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
|
|
||||||
/* lets try to hack with a new connection */
|
|
||||||
mysql1= test_connect(NULL);
|
|
||||||
stmt1= mysql_stmt_init(mysql1);
|
|
||||||
stmt_text= "SELECT 2";
|
|
||||||
rc= mysql_stmt_prepare(stmt1, SL(stmt_text));
|
|
||||||
check_stmt_rc(rc, stmt);
|
|
||||||
|
|
||||||
stmt->stmt_id= stmt1->stmt_id;
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
|
||||||
FAIL_IF(!rc, "Error expected");
|
|
||||||
|
|
||||||
mysql_stmt_close(stmt1);
|
|
||||||
mysql_close(mysql1);
|
|
||||||
|
|
||||||
/* Restore original statement id to be able to reprepare it */
|
/* Restore original statement id to be able to reprepare it */
|
||||||
stmt->stmt_id= backup.stmt_id;
|
stmt->stmt_id= backup.stmt_id;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user