Merge branch '2.2' into develop
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* MXS-1824: Debug assertion with two open cursors
|
||||
* MXS-1824: Debug expection with two open cursors
|
||||
*
|
||||
* https://jira.mariadb.org/browse/MXS-1824
|
||||
*/
|
||||
@ -18,9 +18,9 @@ void double_cursor(TestConnections& test, MYSQL* conn)
|
||||
MYSQL_STMT* stmt1 = mysql_stmt_init(conn);
|
||||
const char* query = "SELECT id FROM test.t1";
|
||||
int rc = mysql_stmt_prepare(stmt1, query, strlen(query));
|
||||
test.assert(rc == 0, "First prepare should work: %s %s", mysql_stmt_error(stmt1), mysql_error(conn));
|
||||
test.expect(rc == 0, "First prepare should work: %s %s", mysql_stmt_error(stmt1), mysql_error(conn));
|
||||
unsigned long type = CURSOR_TYPE_READ_ONLY;
|
||||
test.assert(mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, &type) == 0,
|
||||
test.expect(mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, &type) == 0,
|
||||
"Set of first attribute should work: %s %s",
|
||||
mysql_stmt_error(stmt1),
|
||||
mysql_error(conn));
|
||||
@ -31,35 +31,35 @@ void double_cursor(TestConnections& test, MYSQL* conn)
|
||||
bind[0].buffer = &id;
|
||||
mysql_stmt_bind_result(stmt1, bind);
|
||||
|
||||
test.assert(mysql_stmt_execute(stmt1) == 0,
|
||||
test.expect(mysql_stmt_execute(stmt1) == 0,
|
||||
"Execute of first statement should work: %s %s",
|
||||
mysql_stmt_error(stmt1),
|
||||
mysql_error(conn));
|
||||
test.assert(mysql_stmt_fetch(stmt1) == 0,
|
||||
test.expect(mysql_stmt_fetch(stmt1) == 0,
|
||||
"First fetch should work: %s %s",
|
||||
mysql_stmt_error(stmt1),
|
||||
mysql_error(conn));
|
||||
|
||||
MYSQL_STMT* stmt2 = mysql_stmt_init(conn);
|
||||
rc = mysql_stmt_prepare(stmt2, query, strlen(query));
|
||||
test.assert(rc == 0, "Second prepare should work: %s %s", mysql_stmt_error(stmt2), mysql_error(conn));
|
||||
test.assert(mysql_stmt_attr_set(stmt2, STMT_ATTR_CURSOR_TYPE, &type) == 0,
|
||||
test.expect(rc == 0, "Second prepare should work: %s %s", mysql_stmt_error(stmt2), mysql_error(conn));
|
||||
test.expect(mysql_stmt_attr_set(stmt2, STMT_ATTR_CURSOR_TYPE, &type) == 0,
|
||||
"Set of second attribute should work: %s %s",
|
||||
mysql_stmt_error(stmt2),
|
||||
mysql_error(conn));
|
||||
mysql_stmt_bind_result(stmt2, bind);
|
||||
|
||||
test.assert(mysql_stmt_execute(stmt2) == 0,
|
||||
test.expect(mysql_stmt_execute(stmt2) == 0,
|
||||
"Execute of second statement should work: %s %s",
|
||||
mysql_stmt_error(stmt2),
|
||||
mysql_error(conn));
|
||||
test.assert(mysql_stmt_fetch(stmt2) == 0,
|
||||
test.expect(mysql_stmt_fetch(stmt2) == 0,
|
||||
"Second fetch should work: %s %s",
|
||||
mysql_stmt_error(stmt2),
|
||||
mysql_error(conn));
|
||||
mysql_stmt_reset(stmt2);
|
||||
|
||||
test.assert(mysql_stmt_fetch(stmt1) == 0,
|
||||
test.expect(mysql_stmt_fetch(stmt1) == 0,
|
||||
"Third fetch should work: %s %s",
|
||||
mysql_stmt_error(stmt1),
|
||||
mysql_error(conn));
|
||||
|
||||
Reference in New Issue
Block a user