Digging into this a bit more - it does both. The shutdown() and then close() occurs immediately so we'd never see the reply to the mysql-level QUIT. I'll edit the comment a bit to reflect this.