-
mysqlbinlog only prints "use $database" statements to its output stream when the active default database changes between events. This will cause "No Database Selected" error when dropping and recreating that database. To fix the problem, we clear print_event_info->db when printing an event of CREATE/DROP/ALTER database statements, so that the Query_log_event after such statements will be printed with the use 'db' anyway except transaction keywords.
dbb832c0