SQL mandates that syntax and semantic errors be reported by PREPARE, without postponing them to EXECUTE. So, PREPARE needs to do at least parsing and resolution, to spot any such error. Then there is an implementation question: when it receives "EXECUTE stmt", how can MySQL remember what “stmt” is? The simplest, most obvious solution would be, during PREPARE, to simply store "stmt" => "SELECT * FR