Is it possible to set MySQL client flags when using the command line client?
I would like to set the CLIENT_FOUND_ROWS
client flag, but the manpages of the mysql client do not mention the setting of client flags. This is only documented in the documentation of the mysql_real_connect()
function.
Is using client flags in the command line client at all possible? If so, how?
The problem at hand is this. I am using the command line mysql client. After an update statement, I would like to be able to issue a SELECT ROW_COUNT() command, and have it return the number of rows matched, not the number of rows changed. When accessing the database via a library where you can call the mysql_real_connect() function, this can be achieved by setting the CLIENT_FOUND_ROWS client flag. I would like to achive the same behaviour but with the command line client instead.
I know I could screen scrape the output of the sql update statement, but I'd prefer not to.
CLIENT_FOUND_ROWS
isn't a flag for the command line because the command line already tells you how many rows it matched/updated. That option only works for themysql_real_connect()
function because it tells the function to return the number of rows as part of the return value (otherwise that data would be lost.)