PDF (A4) - 40.3Mb
Man Pages (TGZ) - 262.0Kb
Man Pages (Zip) - 367.6Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb
Given a string (normally representing an SQL statement), reduces it to the length given by thestatement_truncate_len configuration option, and returns the result. No truncation occurs if the string is shorter thanstatement_truncate_len. Otherwise, the middle part of the string is replaced by an ellipsis (...).
This function is useful for formatting possibly lengthy statements retrieved from Performance Schema tables to a known fixed maximum length.
format_statement() operation can be modified using the following configuration options or their corresponding user-defined variables (seeSection 30.4.2.1, “The sys_config Table”):
statement_truncate_len,@sys.statement_truncate_lenThe maximum length of statements returned by the
format_statement()function. Longer statements are truncated to this length. The default is 64.
By default,format_statement() truncates statements to be no more than 64 characters. Setting@sys.statement_truncate_len changes the truncation length for the current session:
mysql> SET @stmt = 'SELECT variable, value, set_time, set_by FROM sys_config';mysql> SELECT sys.format_statement(@stmt);+----------------------------------------------------------+| sys.format_statement(@stmt) |+----------------------------------------------------------+| SELECT variable, value, set_time, set_by FROM sys_config |+----------------------------------------------------------+mysql> SET @sys.statement_truncate_len = 32;mysql> SELECT sys.format_statement(@stmt);+-----------------------------------+| sys.format_statement(@stmt) |+-----------------------------------+| SELECT variabl ... ROM sys_config |+-----------------------------------+PDF (A4) - 40.3Mb
Man Pages (TGZ) - 262.0Kb
Man Pages (Zip) - 367.6Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb