If this option is ON , the diagnostics()  procedure is permitted to perform table scans on the INFORMATION_SCHEMA.TABLES  table. This can be expensive if there are many tables. The default is OFF . 

• diagnostics.include_raw , @sys.diagnostics.include_raw 

If this option is ON , the diagnostics()  procedure output includes the raw output from querying the metrics  view. The default is OFF . 

• 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. 

## Example 

Create a diagnostics report that starts an iteration every 30 seconds and runs for at most 120 seconds using the current Performance Schema settings: 

mysql> CALL sys.diagnostics(120, 30, ’current’); 

To capture the output from the diagnostics()  procedure in a file as it runs, use the mysql  client tee filename  and notee  commands (see Section 4.5.1.2, “mysql Client Commands” ): 

## 28.4.4.3 The execute_prepared_stmt() Procedure 

mysql> tee diag.out; mysql> CALL sys.diagnostics(120, 30, ’current’); mysql> notee; 

Given an SQL statement as a string, executes it as a prepared statement. The prepared statement is deallocated after execution, so it is not subject to reuse. Thus, this procedure is useful primarily for executing dynamic statements on a one-time basis. 

This procedure uses sys_execute_prepared_stmt  as the prepared statement name. If that statement name exists when the procedure is called, its previous content is destroyed. 

## Parameters 

• in_query LONGTEXT CHARACTER SET utf8 : The statement string to execute. 

## Configuration Options 

execute_prepared_stmt()  operation can be modified using the following configuration options or their corresponding user-defined variables (see Section 28.4.2.1, “The sys_config Table” ): 

## Example 

• debug , @sys.debug 

If this option is ON , produce debugging output. The default is OFF . 

mysql> CALL sys.execute_prepared_stmt(’SELECT COUNT(*) FROM mysql.user’); +----------+ | COUNT(*) | +----------+ | 15 | +----------+ 

