Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-07-2007, 01:11 PM
Daniel
 
Posts: n/a
Default How to trace statements executed in a procedure called by a client?

Hi,

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-07-2007, 03:14 PM
Daniel
 
Posts: n/a
Default Re: How to trace statements executed in a procedure called by a client?

Daniel vi t:
> [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


My MySQL configuration file also contains the following lines:

log = /var/log/mysql/mysql.log
log-long-format
log-slow-queries = /var/log/mysql/mysql-slow.log


However the mysql.log file just contains the stored procedure call:

12 Query CALL foo()

I though that the SQL engine was also logging every query that it
executes.


--
Daniel

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:41 PM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.