且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何调试MySQL存储过程?

更新时间:2022-02-25 22:16:20

我做的事情和你很相似。

I do something very similar to you.

我通常会包含一个默认为false的DEBUG参数,我可以在运行时设置为true。然后将调试语句包装到If DEBUG块中。

I'll usually include a DEBUG param that defaults to false and I can set to true at run time. Then wrap the debug statements into an "If DEBUG" block.

我还使用一个记录表与我的许多工作,以便我可以审查过程和时间。我的调试代码也得到输出。我包括调用的参数名称,简要描述,受影响的行计数(如果适用),注释字段和时间戳。

I also use a logging table with many of my jobs so that I can review processes and timing. My Debug code gets output there as well. I include the calling param name, a brief description, row counts affected (if appropriate), a comments field and a time stamp.

好的调试工具是悲伤所有SQL平台的失败。

Good debugging tools is one of the sad failings of all SQL platforms.