Not the answer you need?
Register and ask your own question!

Logging of prepared statements

cblumecblume EntrantInactive User Role Beginner
Hi,

Product: percona-xtradb-cluster-server-5.6 5.6.26-25.12-1.jessie

While debugging i found the following in the logfile while executing a prepared statement:
mysql> SET @s = 'SELECT SLEEP(5);';
Query OK, 0 rows affected (0.00 sec)

mysql> PREPARE stmt3 FROM @s;
Query OK, 0 rows affected (0.00 sec)
Statement prepared

mysql> EXECUTE stmt3;
+----------+
| SLEEP(5) |
+----------+
|        0 |
+----------+
1 row in set (5.00 sec)

mysql> 


This gets printed in the logfile:
151204 10:58:45        2 Query    SET @s = 'SELECT SLEEP(5);'
151204 10:58:47        2 Query    PREPARE stmt3 FROM @s
                       2 Prepare    SELECT SLEEP(5)
151204 10:58:53        2 Query    EXECUTE stmt3
                       2 Execute    SELECT SLEEP(5)
151204 10:58:58        2 Execute    SELECT SLEEP(5)

-> "Execute SELECT SLEEP(5)" is printed twice


Here is the output from the logfile of a mysql-server without galera:
151204 14:02:02 187871 Query    SET @s = 'SELECT SLEEP(5);'
151204 14:02:07 187871 Query    PREPARE stmt3 FROM @s
                187871 Prepare  SELECT SLEEP(5)
151204 14:02:10 187871 Query    EXECUTE stmt3
151204 14:02:15 187871 Execute  SELECT SLEEP(5)

-> "Execute SELECT SLEEP(5)" is printed only once

Is this a "feature" from the logging engine or is it really executed twice?

Greetings
Carsten
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.