Bug #44711 Prepared statements should be lazy to send metadata at execute stage
Submitted: 7 May 2009 9:12
Reporter: Domas Mituzas Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Prepared statements Severity:S4 (Feature request)
Version:5.1, ... OS:Any
Assigned to: CPU Architecture:Any

[7 May 2009 9:12] Domas Mituzas
Description:
Prepared statements send metadata at every execute, which is resource waste, considering that they're made entirely to avoid such kind of waste :) 

How to repeat:
PREPARE x FROM "SELECT * FROM table";
EXECUTE x;
EXECUTE x;

inspect packets, observe metadata being sent multiple times

Suggested fix:
cache metadata at client side. in case metadata changes on server-side, signal the client about that at the beginning of PS execute resultset read.