What kind of statements can't be prepared at server side?

Viewed 54

In MySQL, if I use useServerPrepStmts=true, then the driver will try to prepare a statement on the server if it believes it is possible to do that. In case the server is not able to prepare the statement (not all statements can be prepared at server side), a fall back to a 'client prepared statement' occurs.

I have two questions:

  • What kind of statements can't be prepared at server side?
  • Why does the driver sometimes think that the statement can be prepared at server side sending a COM_STMT_PREPARE (see here) to the server, if the server actually is not able to prepare that statement? Does that mean that sometimes the prepareability of a statement does depend on some predicate to be true on the server side and that's why the driver alone fails to make a correct decision?
0 Answers
Related