Yeah, that is the one. Basically, inside the server there isn't an API for running a SQL statement and returning the results internally. The results of the select are automatically packed and sent over the wire. Because of this, there are no real good solutions for running SQL in the server. I'd like to be able to use mysql_internal_connect() (a new function that works like mysql_connect) and then mysql_query() to basically get a authentication-less (auth is already done) handle to the current connection and execute sql on it. For example, it would be great if a rewrite plugin could run some SQL to populate a table, then rewrite the query as select * from tmp_table. While I could write a rewrite plugin the uses the C client API to run queries as long as I use a username/password to connect, I can't run them in the context of the original THD, so it can't access temporary tables created by the C API connection through the THD, so it isn't very useful.
--Justin