I am trying to parse the OK packet of mysql server to get the value of
But I meet an odd phenomenon:
If I start mysqld with option autocommit=0, and I send a query
"create table XXX",
the return OK packet will be with SERVER_STATUS_AUTOCOMMIT=1.
short a =(server_status & SERVER_STATUS_AUTOCOMMIT)?1:0;
a is equal to 1.
I read the mysql code of mysql 5.5, I found that the thd->server_status
will always be inited with SERVER_STATUS_AUTOCOMMIT=1, and this flag only
be reset when the user change the global/session variable autocommit with a
So If I start mysqld with option autocommit=0, and do not execute a query
"set autocommit=1", the thd->server_status will be 1 all the time, with a
different value with the global/session variable.
Is it correct?
Looking forward to any responses, and thanks in advance.
|• SERVER_STATUS is always inited with SERVER_STATUS_AUTOCOMMIT=1||xiaoxin gao||14 Sep|