BUGFIX: prevent failed query with session not fully initialized and
mysql driver