if (mysql_stmt_prepare(S->stmt, sql, sql_len)) {
/* TODO: might need to pull statement specific info here? */
+ /* if the query isn't supported by the protocol, fallback to emulation */
+ if (mysql_errno(H->server) == 1295) {
+ if (nsql) {
+ efree(nsql);
+ }
+ goto fallback;
+ }
pdo_mysql_error(dbh);
if (nsql) {
efree(nsql);
return 1;
-#else
- stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
+fallback:
#endif
+ stmt->supports_placeholders = PDO_PLACEHOLDER_NONE;
return 1;
}