this_query

NAME

this_query(): Returns the current query executed by this thread.

TYPE

Function

DESCRIPTION

This function returns the text of query which is now executing under the current process.

Essentially, it is the very same query which invoked this function. That it, the call to this_query() is expected to be found within the result's text.

The function is provided as ground for future query/text analysis routines which would be able to modify query behavior according to query's text.

SYNOPSIS

this_query()
  RETURNS LONGTEXT CHARSET utf8

EXAMPLES

The most simplistic form:

mysql> SELECT this_query();
+---------------------+
| this_query()        |
+---------------------+
| SELECT this_query() |
+---------------------+

ENVIRONMENT

MySQL 5.1 or newer

SEE ALSO

Execution & flow control

AUTHOR

Shlomi Noach
 
common_schema documentation