Andy would be almost immediately disbarred and might also be held in contempt of court.
Andy would be disbarred for the acts. Violation of the duty of confidentiality owed by Andy to his client under Rule of Professional Conduct 1.6 in a context like this would be considered an open and shut blatant violation of one of the highest and most serious ethical obligations that an attorney has, and is neck and neck with the rule against stealing money from your clients as a ground for near automatic disbarment. The clarity and severity of the breach of professional ethics by Andy in this regard (and other aspects such as his fiduciary duties to his clients and duty of zealous and diligent advocacy for his client) leaves no ambiguity regarding the appropriate level of discipline.
Andy might be held in contempt of court for reasons including knowingly disrupting a court proceeding in which he was or is an attorney of record. He can't quit representing Dave until the court grants his permission to do so.
Dave's trial would probably not go forward or his conviction would be set aside. In all likelihood, a trial with a new prosecutor not exposed to the information would be arranged to avoid the taint of the breach of privilege.
This would be because providing the prosecutor with inadmissible evidence taints the ability of the prosecutor to proceed untainted by inadmissible evidence and would constitute ineffective assistance of counsel which is one of the grounds for setting aside a conviction for a violation of the 6th Amendment to the US Constitution, which grants the right to effective counsel.