From: Zardosht Kasheff Date: January 18 2013 4:47am Subject: detecting select SQL statements that are functions List-Archive: http://lists.mysql.com/internals/38686 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Hello all, In our storage engine's handler, we would like to be able to detect when a statement is just a simple select statement, that is, "read-only". In MySQL 5.6, InnoDB seems to do this with the function thd_trx_is_auto_commit. We have tried to do something similar in MySQL 5.5. The problem we run into is when the select statement is a function, and the function performs a write. With the thd, is there a way to detect that the statement is not a simple select, but rather calling a function? Thanks -Zardosht