Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Debugging MySQL procedure

Posted on 2014-01-02
3
Medium Priority
?
618 Views
Last Modified: 2014-01-02
Say,

When I call the procedure - it hangs. Within the procedure are several "calls" to outside procedures, how can I trace which procedures are causing the problem?

Is there a way to have it return certain statistics as it runs? (feedback)
0
Comment
Question by:shaunwingin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:shaunwingin
ID: 39751313
I am using MySQL workbench and I noticed a state: "waiting for cable metadata lock"

Can you please assist to resolve the error.
0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 2000 total points
ID: 39751315
Hi.

MySQL unfortunately does not have a PRINT statement that I am aware of; therefore, one approach is to create a table specifically for logging activity within your procedures.  Subsequently, you could INSERT records into the log as the procedure processes.  For some code, especially on my web services, I will include a debug parameter that I can toggle to true when I want to get log information, avoiding large extraneous table if procedure runs often.

If you trap date/time, it may give you a sense of duration.

Another method is to use debugging tools, such as the Visual Studio debugger:
http://dev.mysql.com/doc/refman/5.5/en/connector-net-visual-studio-debugger.html

SHOW PROFILE also may be useful:
http://dev.mysql.com/doc/refman/5.1/en/show-profile.html

I hope that helps!
0
 
LVL 60

Assisted Solution

by:Kevin Cross
Kevin Cross earned 2000 total points
ID: 39751327
I am using MySQL workbench and I noticed a state: "waiting for cable metadata lock"
- Refer to manual page http://dev.mysql.com/doc/refman/5.0/en/innodb-monitors.html
- query INFORMATION_SCHEMA tables for locks
SELECT *
FROM INFORMATION_SCHEMA.INNODB_LOCKS l
WHERE EXISTS (
    SELECT 1
    FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS w
    WHERE w.BLOCKING_TRX_ID = l.LOCK_TRX_ID
)
;

Open in new window

0

Featured Post

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to count occurrences of each item in an array.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question