@ -114,31 +114,43 @@ int main(int argc, char** argv) {
goto cleanup ;
}
bool exp_mysql_srv_st = mysql - > server_status = = 2 ;
ok ( exp_mysql_srv_st , " MySQL init server status should match expected '%d' " , mysql - > server_status ) ;
int exp_mysql_srv_st = SERVER_STATUS_AUTOCOMMIT ;
ok (
exp_mysql_srv_st = = SERVER_STATUS_AUTOCOMMIT ,
" MySQL init server status should match expected - exp: '%d', act:'%d' " ,
exp_mysql_srv_st , mysql - > server_status
) ;
mysql_query ( mysql , " SET SESSION session_track_transaction_info= \" CHARACTERISTICS \" " ) ;
mysql_query ( mysql , " START TRANSACTION " ) ;
exp_mysql_srv_st =
mysql - > server_status & SERVER_STATUS_AUTOCOMMIT & &
mysql - > server_status & SERVER_STATUS_IN_TRANS & &
mysql - > server_status & SERVER_SESSION_STATE_CHANGED ;
exp_mysql_srv_st = SERVER_STATUS_AUTOCOMMIT | SERVER_STATUS_IN_TRANS | SERVER_SESSION_STATE_CHANGED ;
ok ( exp_mysql_srv_st , " MySQL new server status should match expected '%d' " , mysql - > server_status ) ;
ok (
exp_mysql_srv_st = = mysql - > server_status ,
" MySQL new server status should match expected - exp: '%d', act:'%d' " ,
exp_mysql_srv_st , mysql - > server_status
) ;
// TODO-FIXME: Expected to fail due to ProxySQL bug
bool exp_proxy_srv_st = proxy - > server_status = = 2 ;
ok ( exp_proxy_srv_st , " ProxySQL init server status should match expected '%d' " , proxy - > server_status ) ;
// TODO-FIXME: We are setting here '0' as expecting to see 'SERVER_STATUS_AUTOCOMMIT' to be false.
// This is a bug that should be addressed, and this test revisited.
ok (
proxy - > server_status = = 0 ,
" ProxySQL init server status should match expected - exp: '%d', act:'%d' " ,
0 , proxy - > server_status
) ;
mysql_query ( proxy , " SET SESSION session_track_transaction_info= \" CHARACTERISTICS \" " ) ;
mysql_query ( proxy , " START TRANSACTION " ) ;
exp_proxy_srv_st =
mysql - > server_status & SERVER_STATUS_AUTOCOMMIT & &
mysql - > server_status & SERVER_STATUS_IN_TRANS ;
uint32_t exp_proxy_srv_st = SERVER_STATUS_AUTOCOMMIT | SERVER_STATUS_IN_TRANS ;
ok ( exp_proxy_srv_st , " ProxySQL new server status should match expected '%d' " , proxy - > server_status ) ;
ok (
exp_proxy_srv_st = = proxy - > server_status ,
" ProxySQL new server status should match expected - exp: '%d', act:'%d' " ,
exp_proxy_srv_st , proxy - > server_status
) ;
}
cleanup :