Rechercher dans le manuel MySQL
27.4.5.5 The format_statement() Function
Given a string (normally representing an SQL statement),
reduces it to the length given by the
statement_truncate_len
configuration
option, and returns the result. No truncation occurs if the
string is shorter than
statement_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.
Parameters
statement LONGTEXT
: The statement to format.
format_statement()
operation
can be modified using the following configuration options or
their corresponding user-defined variables (see
Section 27.4.2.1, “The sys_config Table”):
statement_truncate_len
,@sys.statement_truncate_len
The 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:
- +----------------------------------------------------------+
- | sys.format_statement(@stmt) |
- +----------------------------------------------------------+
- +----------------------------------------------------------+
- +-----------------------------------+
- | sys.format_statement(@stmt) |
- +-----------------------------------+
- +-----------------------------------+
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-sys-format-statement.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.