Hi, It seems that the problem was the following:
In mysql_stmt_execute() sp_cache_flush_obsolete() is called to flush the statement cache (or something similar). But the proper sp_cache_routines_and_add_tables() functions won't be called from open_tables(), because thd->lex->query_tables_own_last is other than NULL. Inserting the line thd->lex->mark_as_requiring_prelocking(NULL); into Prepared_statement::execute(), after the call to thd->set_n_backup_statement() seems to fix the problem. Now I'd like to know how to submit this patch, and if somebody with more than a few hours of experience with the MySQL codebase can see some possible pitfalls in this fix. Thx ImRe > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 23 November 2006 12:14 > To: 'mysql@lists.mysql.com' > Subject: Weird error with stored function > > Hi, > > I am trying to use stored functions through the prepared > statement C API. I have one application that issues > relatively long running queries, while the other is doing > some inserts, updates, and short queries. If the second > application somehow calls a stored function (either directly > through a prepared statement, or indirectly through a > trigger) while first is in the middle of a query, then I > receiving an error like this one: > FUNCTION gi.get_country does not exist > > Anybody have seen something like this before? > How can I circumvent it? > > I'm on windows, running MySQL 5.0.27-community-log. I am > using InnoDB for my database, and the server SQL mode is > sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SU > BSTITUTION,ANSI,ONLY_FULL_GROUP_BY" > > Thanks in advance > > ImRe -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]