Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL)
-
None
Description
SHOW GRANTS (and probably many more statements) fail with CR_COMMANDS_OUT_OF_SYNC upon execute with CURSOR_TYPE_READ_ONLY. For example, with MTR
Run with --cursor-protocol
show grants;
|
10.2 5d57e04b |
mysqltest: At line 1: query 'show grants' failed: 2014: Commands out of sync; you can't run this command now |
I'm getting the same error with something like
const char* query="show grants"; |
|
mysql_stmt_prepare(stmt,query,strlen(query)); |
unsigned long cursor = CURSOR_TYPE_READ_ONLY; |
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, &cursor);
|
|
if (mysql_stmt_execute(stmt)) |
fprintf(stderr,"Got error on execute of query: %s\n", mysql_stmt_error(stmt)); |
else |
fprintf(stderr,"Didn't get an error on execute of query\n"); |
|
mysql_stmt_fetch(stmt);
|
So chances are, it's not mysqltest problem.
Reproducible with libmariadb but not with libmysqlclient from 10.1 or from MySQL 8.0.