MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Daniel Caune Date:June 7 2007 1:34am
Subject:How to trace statements executed in a procedure called by a client?
View as plain text  
Hi,

First of all, I would like to apologize if I didn't send my message to
the right mailing list.

My question is related to MySQL administration, where I don't have any
particular experience.

I would to trace every SQL statement executed inside a procedure that is
called by a client:

CREATE PROCEDURE foo()
  NOT DETERMINISTIC
  MODIFIES SQL DATA
  COMMENT 'Generate the required number of random battles'
BEGIN
  <statement 1>

  <statement 2>

  <statement 3>
END;

The problem is that the mysql-slow.log file only contains a trace of the
call to the procedure; it does not provide any trace of every subsequent
statement executed by the procedure itself:

# Time: 070607  1:23:04
# User@Host: dbo[dbo] @ localhost []
# Query_time: 0  Lock_time: 0  Rows_sent: 0  Rows_examined: 2
SET last_insert_id=27274;
CALL foo();

Is there any way to configure mysqld to trace every statement executed
by MySQL?  For information, my current configuration is the following:

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/english
long_query_time = 1
log-queries-not-using-indexes
skip-external-locking
verbose
log_bin_trust_function_creators = 1

Thanks a lot!

--
Daniel
Thread
How to trace statements executed in a procedure called by a client?Daniel Caune7 Jun