Fix attribute assignment in mxs1824_double_cursor
Used correct type, checked for return value.
This commit is contained in:
parent
238a00f29d
commit
600d459079
@ -19,8 +19,10 @@ void double_cursor(TestConnections& test, MYSQL* 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));
|
||||
int type = CURSOR_TYPE_READ_ONLY;
|
||||
mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, &type);
|
||||
unsigned long type = CURSOR_TYPE_READ_ONLY;
|
||||
test.assert(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));
|
||||
|
||||
MYSQL_BIND bind[1] {};
|
||||
uint32_t id;
|
||||
@ -36,7 +38,9 @@ void double_cursor(TestConnections& test, MYSQL* 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));
|
||||
mysql_stmt_attr_set(stmt2, STMT_ATTR_CURSOR_TYPE, &type);
|
||||
test.assert(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, "Execute of second statement should work: %s %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user