A line of SQL like @@SESSION.sql_log_bin = 0; ends up with '@ @' <-- note the space between, which clobbers the intended meaning. Otherwise, it's working perfectly for our use case, thanks!