Stored functions and prepared statements
Hello all,
after a lot of frustration and testing, I have concluded that it's apparently impossible to call a stored function from a prepared statement, no matter how simple the function (e.g. a simple test function that returns its single integer parameter). The statement is prepared, calling mysql_stmt_execute() on it seems to work fine, but according to the server log it is never executed, and no result is returned.
By the way, I'm using MySQL 5.1.50. I read that "Before MySQL 5.1.4, CALL statements cannot be prepared, meaning that stored procedures cannot be called from dynamic SQL. This is true both for server-side prepared statements and for SQL prepared statements", but a) there's no mention of stored functions, b) 5.1.50 > 5.1.4, right?
So I'm thinking that this *should* work, however I'm stuck with it not working. Can anyone offer any advice? Oh yes, main reason I'm using prepared statements is that I'm inserting random binary data.