FUNCTION cr_debug.ENTER_MODULE2 does not exist

目录

1.原因

2.解决方案(推荐第二种)

创建 一个cr_debug 数据库,运行这个库的结构建表语句sql

2.下载dbforge这个工具 右键要清除的存储过程->debug->Compile...


1.原因

后台执行报错

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION cr_debug.ENTER_MODULE2 does not exist

我是本地的数据库,和公司数据库版本都是5.7 小版本是有差别的,之前以为是版本问题后来也不是版本问题,函数过程都是通过Navicat这整个传输过来的,项目启动发现使用公司库没问题,自己本地就会报错,把这个出问题的sql放到工具上运行也是会报错,然后定位到这个sql中哪个方法引起报错,使用工具手动传参,运行方法发现就是这个方法引起的了

搜索一些问题发现说是 使用 dbForge Studio for MySQL 数据库连接工具debug产生的打印

然后我就下载了一个连接本地数据库去执行这个方法,发现他去掉了本身函数定义的很多内容就有下面是比较红框的都去掉了,我就把去掉的内容复制出来把本地给覆盖掉,执行了一下发现好了,不报错了

但是也不能解决问题就他么下载个软件吧,问题就是因为公司前辈使用dbforge 这个工具 跟踪方法debug ,多了很多CALL cr_debug.UPDATE_WATCH语句

下面是在论坛上粘贴的解决方案

调试完毕的存储过程,在其它工具中添加了很多调试用的语句信息,所以在调试完成后再次右击存储过程,然后Debug,并选择Compile或直接按Ctrl+F7
这时候可以看到数据库多了一个cr_debug库
给对应需要调试的数据库的用户授予cr_debug库的所有权限和mysql库的select权限,当这种处理完毕后就可以正常使用dbforge studio for mysql的调试功能了

果然公司数据库有一个这个库,反正安装上面的解决方案自己本地也是多了这么一个库,再运行是没错了,这特么发现这个报错

cr_debug.ENTER_MODULE2 就他么清晰了,这他么就是数据库名和方法名,也是傻 了感觉

2.解决方案(推荐第二种)

  1. 创建 一个cr_debug 数据库,运行这个库的结构建表语句sql



SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for breakpoints
-- ----------------------------
DROP TABLE IF EXISTS `breakpoints`;
CREATE TABLE `breakpoints`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `debug_id` int(11) NULL DEFAULT NULL,
  `module_name` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `module_owner` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `module_type` int(11) NOT NULL,
  `line` int(11) NULL DEFAULT NULL,
  `pos` int(11) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for callstack
-- ----------------------------
DROP TABLE IF EXISTS `callstack`;
CREATE TABLE `callstack`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `debug_id` int(11) NOT NULL,
  `unit_name` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `module_name` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `module_owner` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `module_type` int(11) NOT NULL,
  `start_line` int(11) NULL DEFAULT NULL,
  `end_line` int(11) NULL DEFAULT NULL,
  `start_pos` int(11) NULL DEFAULT NULL,
  `end_pos` int(11) NULL DEFAULT NULL,
  `stack_depth` int(11) NOT NULL,
  `compiler_version` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for debuggings
-- ----------------------------
DROP TABLE IF EXISTS `debuggings`;
CREATE TABLE `debuggings`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `proc_id` int(11) NOT NULL,
  `step_kind` int(11) NULL DEFAULT NULL,
  `estimated_depth` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for info
-- ----------------------------
DROP TABLE IF EXISTS `info`;
CREATE TABLE `info`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `debug_id` int(11) NOT NULL,
  `break_reason` int(11) NULL DEFAULT NULL,
  `stack_depth` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for watches
-- ----------------------------
DROP TABLE IF EXISTS `watches`;
CREATE TABLE `watches`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `debug_id` int(11) NOT NULL,
  `stack_depth` int(11) NOT NULL,
  `watch_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `watch_value` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `watch_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Procedure structure for attach
-- ----------------------------
DROP PROCEDURE IF EXISTS `attach`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `attach`(IN in_debug_id INTEGER)
    SQL SECURITY INVOKER
BEGIN
  SET @debug_id = in_debug_id, @timeout = 5;
  DO GET_LOCK(CAST(@debug_id AS char), 5);
END
;;
delimiter ;

-- ----------------------------
-- Function structure for check_breakpoint
-- ----------------------------
DROP FUNCTION IF EXISTS `check_breakpoint`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `check_breakpoint`() RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  DECLARE result INTEGER DEFAULT 0;

  IF (@debug_id > 0) THEN
    SELECT
      COUNT(*)
    FROM callstack c,
         breakpoints b
    WHERE c.debug_id = @debug_id
      AND b.debug_id = @debug_id
      AND c.stack_depth = @stack_depth
      AND c.module_name = b.module_name
      AND c.module_owner = b.module_owner
      AND c.module_type = b.module_type
      AND c.start_line = b.line
    INTO result;
  END IF;
  RETURN result;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for check_version_compatibility
-- ----------------------------
DROP FUNCTION IF EXISTS `check_version_compatibility`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `check_version_compatibility`(in_stack_depth INTEGER) RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  DECLARE c_version INTEGER DEFAULT NULL;
  SELECT
    compiler_version
  FROM callstack
  WHERE debug_id = @debug_id
    AND stack_depth = in_stack_depth
  INTO c_version;
  RETURN COALESCE(c_version, 0) - get_version();
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for continue
-- ----------------------------
DROP PROCEDURE IF EXISTS `continue`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `continue`(IN in_step_kind INTEGER)
    SQL SECURITY INVOKER
BEGIN
  DECLARE stack_depth INTEGER;

  SELECT
    MAX(c.stack_depth)
  FROM callstack c
  WHERE c.debug_id = @debug_id
  INTO stack_depth;

  UPDATE debuggings
    SET step_kind = in_step_kind
    WHERE id = @debug_id;

  IF (in_step_kind = 3) THEN
    UPDATE debuggings
      SET estimated_depth = stack_depth - 1
      WHERE id = @debug_id;
  ELSEIF (in_step_kind = 2) THEN
    UPDATE debuggings
      SET estimated_depth = stack_depth
      WHERE id = @debug_id;
  ELSE
    UPDATE debuggings
      SET estimated_depth = -1
      WHERE id = @debug_id;
  END IF;

  CALL switch_locks(0);
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for debug_off
-- ----------------------------
DROP PROCEDURE IF EXISTS `debug_off`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `debug_off`()
    SQL SECURITY INVOKER
BEGIN
  DELETE
    FROM callstack
    WHERE debug_id = @debug_id;
  DELETE
    FROM breakpoints
    WHERE debug_id = @debug_id;
  DELETE
    FROM watches
    WHERE debug_id = @debug_id;
  DELETE
    FROM debuggings
    WHERE id = @debug_id;
  DELETE
    FROM info
    WHERE debug_id = @debug_id;
  DO RELEASE_LOCK(@debug_id);
  DO RELEASE_LOCK(CONCAT(@debug_id, 'second'));
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for debug_on
-- ----------------------------
DROP PROCEDURE IF EXISTS `debug_on`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `debug_on`(OUT out_debug_id INTEGER)
    SQL SECURITY INVOKER
BEGIN
  CALL update_system_calls(-1);

  DELETE d.*, c.*, i.*, w.*, b.*
    FROM debuggings d
      LEFT JOIN callstack c
        ON c.debug_id = d.id
      LEFT JOIN breakpoints b
        ON b.debug_id = d.id
      LEFT JOIN info i
        ON i.debug_id = d.id
      LEFT JOIN watches w
        ON w.debug_id = d.id
    WHERE proc_id = CONNECTION_ID();

  INSERT INTO debuggings (proc_id, step_kind)
    VALUES (CONNECTION_ID(), 1);
  SELECT
    LAST_INSERT_ID()
  INTO @debug_id;

  SET @stack_depth := 0;

  INSERT INTO info (debug_id, break_reason, stack_depth)
    VALUES (@debug_id, -1, @stack_depth);

  SET out_debug_id := @debug_id;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for detach
-- ----------------------------
DROP PROCEDURE IF EXISTS `detach`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `detach`()
    SQL SECURITY INVOKER
BEGIN
  DO RELEASE_LOCK(@debug_id);
  DO RELEASE_LOCK(CONCAT(@debug_id, 'second'));
  SET @debug_id = -1;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for enter_handler
-- ----------------------------
DROP FUNCTION IF EXISTS `enter_handler`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `enter_handler`(in_unit_name        VARCHAR(300),
                              in_module_name      VARCHAR(300),
                              in_module_owner     VARCHAR(300),
                              in_module_type      INTEGER,
                              in_compiler_version INTEGER) RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  RETURN cr_debug.enter_module3(in_unit_name, in_module_name, in_module_owner, in_module_type, in_compiler_version);
END
;;
delimiter ;

-- ----------------------------
-- Function structure for enter_module
-- ----------------------------
DROP FUNCTION IF EXISTS `enter_module`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `enter_module`(in_module_name VARCHAR(300), in_module_owner VARCHAR(300), in_module_type INTEGER) RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  RETURN cr_debug.enter_module2(in_module_name, in_module_owner, in_module_type, NULL);
END
;;
delimiter ;

-- ----------------------------
-- Function structure for enter_module2
-- ----------------------------
DROP FUNCTION IF EXISTS `enter_module2`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `enter_module2`(in_module_name VARCHAR(300), in_module_owner VARCHAR(300), in_module_type INTEGER, in_compiler_version INTEGER) RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  RETURN cr_debug.enter_module3(NULL, in_module_name, in_module_owner, in_module_type, in_compiler_version);
END
;;
delimiter ;

-- ----------------------------
-- Function structure for enter_module3
-- ----------------------------
DROP FUNCTION IF EXISTS `enter_module3`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `enter_module3`(in_unit_name VARCHAR(300), in_module_name VARCHAR(300), in_module_owner VARCHAR(300), in_module_type INTEGER, in_compiler_version INTEGER) RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  IF (@debug_id > 0) THEN
    SET @stack_depth := @stack_depth + 1;
    UPDATE info
      SET stack_depth = @stack_depth
      WHERE debug_id = @debug_id;
    INSERT INTO cr_debug.callstack (debug_id, unit_name, module_name, module_owner, module_type, stack_depth, compiler_version)
      VALUES (@debug_id, in_unit_name, in_module_name, in_module_owner, in_module_type, @stack_depth, in_compiler_version);
  END IF;

  RETURN @stack_depth;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for get_found_rows
-- ----------------------------
DROP FUNCTION IF EXISTS `get_found_rows`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `get_found_rows`() RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  RETURN @debug_found_rows;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for get_last_insert_id
-- ----------------------------
DROP FUNCTION IF EXISTS `get_last_insert_id`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `get_last_insert_id`() RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  RETURN @debug_last_insert_id;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for get_row_count
-- ----------------------------
DROP FUNCTION IF EXISTS `get_row_count`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `get_row_count`() RETURNS int(11)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
  RETURN @debug_row_count;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for get_step_kind
-- ----------------------------
DROP FUNCTION IF EXISTS `get_step_kind`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `get_step_kind`() RETURNS int(11)
    READS SQL DATA
BEGIN
  DECLARE result INTEGER DEFAULT -1;

  SELECT
    step_kind
  FROM debuggings
  WHERE id = @debug_id
  INTO result;
  RETURN result;
END
;;
delimiter ;

-- ----------------------------
-- Function structure for get_version
-- ----------------------------
DROP FUNCTION IF EXISTS `get_version`;
delimiter ;;
CREATE DEFINER=`root`@`%` FUNCTION `get_version`() RETURNS int(11)
    READS SQL DATA
    DETERMINISTIC
    SQL SECURITY INVOKER
BEGIN
  RETURN 100636;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for leave_module
-- ----------------------------
DROP PROCEDURE IF EXISTS `leave_module`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `leave_module`(IN in_stack_depth INTEGER)
    SQL SECURITY INVOKER
BEGIN
  IF (@debug_id > 0) THEN
    DELETE
      FROM callstack
      WHERE debug_id = @debug_id
        AND stack_depth > in_stack_depth;

    SET @stack_depth = in_stack_depth;
    UPDATE info
      SET stack_depth = in_stack_depth
      WHERE debug_id = @debug_id;

    IF (@stack_depth <= 0) THEN
      UPDATE info
        SET break_reason = 25
        WHERE debug_id = @debug_id;
    END IF;
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for remove_breakpoint
-- ----------------------------
DROP PROCEDURE IF EXISTS `remove_breakpoint`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `remove_breakpoint`(breakpoint_no INTEGER)
    SQL SECURITY INVOKER
BEGIN
  DELETE
    FROM breakpoints
    WHERE id = breakpoint_no;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for set_breakpoint
-- ----------------------------
DROP PROCEDURE IF EXISTS `set_breakpoint`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `set_breakpoint`(IN in_module_name VARCHAR(300), IN in_module_owner VARCHAR(300), IN in_module_type INTEGER, IN in_line INTEGER, IN in_pos INTEGER, OUT out_br_no INTEGER)
    SQL SECURITY INVOKER
BEGIN
  DECLARE module_exists INTEGER DEFAULT -1;

  IF (in_module_type = 7 OR in_module_type = 8) THEN
    SELECT
      COUNT(routine_name)
    INTO module_exists
    FROM information_schema.routines
    WHERE routine_name = in_module_name
      AND routine_schema = in_module_owner;
  ELSEIF (in_module_type = 12) THEN
    SELECT
      COUNT(trigger_name)
    INTO module_exists
    FROM information_schema.triggers
    WHERE trigger_name = in_module_name
      AND trigger_schema = in_module_owner;
  END IF;

  SET out_br_no := -1;
  IF (module_exists <> 0) THEN
    DELETE
      FROM breakpoints
      WHERE module_name = in_module_name
        AND module_owner = in_module_owner
        AND module_type = in_module_type
        AND line = in_line
        AND pos = in_pos
        AND debug_id = @debug_id;
    INSERT INTO breakpoints (module_name, module_owner, module_type, line, pos, debug_id)
      VALUES (in_module_name, in_module_owner, in_module_type, in_line, in_pos, @debug_id);
    SELECT
      LAST_INSERT_ID()
    INTO out_br_no;
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for switch_locks
-- ----------------------------
DROP PROCEDURE IF EXISTS `switch_locks`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `switch_locks`(IN is_target TINYINT)
BEGIN
  DECLARE lock1 VARCHAR(200) DEFAULT @debug_id;
  DECLARE lock2 VARCHAR(200) DEFAULT CONCAT(@debug_id, 'second');
  DECLARE timeout INT;
  DECLARE to_lock,
          to_release VARCHAR(200);

  IF (is_target > 0) THEN
    SET timeout = 3600;
  ELSE
    SET timeout = 10;
  END IF;

  IF (IS_USED_LOCK(lock1) = CONNECTION_ID()) THEN
    SET to_lock = lock2;
    SET to_release = lock1;
  ELSE
    SET to_lock = lock1;
    SET to_release = lock2;
  END IF;

  IF (is_target > 0) THEN
    DO RELEASE_LOCK(to_release);
  END IF;

  DO GET_LOCK(to_lock, timeout);

  IF (is_target = 0) THEN
    DO RELEASE_LOCK(to_release);
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for synchronize
-- ----------------------------
DROP PROCEDURE IF EXISTS `synchronize`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `synchronize`(OUT out_unit_name VARCHAR(300), OUT out_module_name VARCHAR(300), OUT out_module_owner VARCHAR(300), OUT out_module_type INTEGER, OUT out_stack_depth INTEGER, OUT out_start_line INTEGER, OUT out_end_line INTEGER, OUT out_start_pos INTEGER, OUT out_end_pos INTEGER, OUT out_break_reason INTEGER)
    SQL SECURITY INVOKER
BEGIN
  DECLARE second_lock VARCHAR(200);
  DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET out_break_reason = 0;

  IF (IS_USED_LOCK(CAST(@debug_id AS CHAR)) = CONNECTION_ID()) THEN
    SET second_lock = CONCAT(@debug_id, 'second');
  ELSE
    SET second_lock = @debug_id;
  END IF;

  IF (IS_FREE_LOCK(second_lock) > 0) THEN
    SELECT
      unit_name,
      module_name,
      module_owner,
      module_type,
      c.stack_depth,
      start_line,
      end_line,
      start_pos,
      end_pos,
      break_reason
    FROM callstack c,
         debuggings d,
         info i
    WHERE c.debug_id = @debug_id
      AND d.id = @debug_id
      AND i.debug_id = @debug_id
      AND c.stack_depth = i.stack_depth
    INTO out_unit_name, out_module_name, out_module_owner, out_module_type, out_stack_depth, out_start_line, out_end_line, out_start_pos,
    out_end_pos, out_break_reason;
  ELSE
    SELECT
      break_reason
    FROM info
    WHERE debug_id = @debug_id
    INTO out_break_reason;
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for trace
-- ----------------------------
DROP PROCEDURE IF EXISTS `trace`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `trace`(IN in_start_line INTEGER, IN in_end_line INTEGER, IN in_start_pos INTEGER, IN in_end_pos INTEGER, IN in_stack_depth INTEGER)
    SQL SECURITY INVOKER
Trace:
BEGIN
  DECLARE step_kind,
          estimated_depth INTEGER DEFAULT -1;
  DECLARE cnt INT DEFAULT 0;

  IF (@debug_id > 0) THEN
    IF (in_stack_depth < @stack_depth) THEN
      CALL leave_module(in_stack_depth);
    END IF;

    UPDATE callstack
      SET start_line = in_start_line,
          end_line = in_end_line,
          start_pos = in_start_pos,
          end_pos = in_end_pos
      WHERE debug_id = @debug_id
        AND stack_depth = @stack_depth;

    SET step_kind := get_step_kind();

    IF (step_kind = 1100) THEN
      UPDATE info
        SET break_reason = 25
        WHERE debug_id = @debug_id;
      UPDATE debuggings
        SET cr_debug_terminated = 1
        WHERE id = @debug_id;
    END IF;

    IF (check_version_compatibility(@stack_depth) != 0) THEN
      LEAVE Trace;
    END IF;

    IF (step_kind = 2 OR step_kind = 3) THEN
      SELECT
        d.estimated_depth
      FROM debuggings d
      WHERE id = @debug_id
      INTO estimated_depth;

      IF (@stack_depth > estimated_depth AND check_breakpoint() = 0) THEN
        LEAVE Trace;
      END IF;

    ELSEIF (step_kind = 4 AND check_breakpoint() = 0) THEN
      LEAVE Trace;
    END IF;

    IF check_breakpoint() != 0 THEN
      UPDATE info
        SET break_reason = 22
        WHERE debug_id = @debug_id;
    ELSEIF step_kind IN (1, 2, 3) THEN
      UPDATE info
        SET break_reason = 21
        WHERE debug_id = @debug_id;
    ELSEIF step_kind = 4 THEN
      UPDATE info
        SET break_reason = 25
        WHERE debug_id = @debug_id;
    END IF;

    CALL switch_locks(1);
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for update_system_calls
-- ----------------------------
DROP PROCEDURE IF EXISTS `update_system_calls`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `update_system_calls`(IN in_query_type INTEGER)
BEGIN
  IF (in_query_type = 101) THEN
    SET @debug_found_rows := FOUND_ROWS();
  ELSEIF (in_query_type = 102) THEN
    SET @debug_row_count := ROW_COUNT();
    SET @debug_last_insert_id := LAST_INSERT_ID();
  ELSEIF (in_query_type = 103 OR in_query_type = 104) THEN
    SET @debug_row_count := ROW_COUNT();
  ELSE
    SET @debug_row_count := ROW_COUNT();
    SET @debug_found_rows := FOUND_ROWS();
    SET @debug_last_insert_id := LAST_INSERT_ID();
  END IF;
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for update_watch2
-- ----------------------------
DROP PROCEDURE IF EXISTS `update_watch2`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `update_watch2`(IN in_watch_name VARCHAR(200), IN in_watch_value VARCHAR(65535), IN in_stack_depth INTEGER)
    SQL SECURITY INVOKER
BEGIN
  CALL update_watch3(in_watch_name, in_watch_value, '', in_stack_depth);
END
;;
delimiter ;

-- ----------------------------
-- Procedure structure for update_watch3
-- ----------------------------
DROP PROCEDURE IF EXISTS `update_watch3`;
delimiter ;;
CREATE DEFINER=`root`@`%` PROCEDURE `update_watch3`(IN in_watch_name VARCHAR(200), IN bin_watch_value varbinary(65535), IN in_watch_type VARCHAR(200), IN in_stack_depth INTEGER)
    SQL SECURITY INVOKER
BEGIN
  DECLARE in_watch_value TEXT;
  DECLARE watch_id INT DEFAULT -1;

  DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
    SET in_watch_value = CONCAT('0x', HEX(bin_watch_value));

  SET in_watch_value = CAST(bin_watch_value AS CHAR);

  IF (@debug_id > 0) THEN

    SELECT
      id
    INTO watch_id
    FROM watches
    WHERE watch_name = in_watch_name
      AND stack_depth = in_stack_depth
      AND debug_id = @debug_id;

    IF (watch_id < 0) THEN
      INSERT INTO watches (watch_name, watch_value, watch_type, stack_depth, debug_id)
        VALUES (in_watch_name, in_watch_value, in_watch_type, in_stack_depth, @debug_id);
    ELSE
      UPDATE watches
        SET watch_name = in_watch_name,
            watch_value = in_watch_value,
            debug_id = @debug_id
        WHERE id = watch_id;
    END IF;
  END IF;
END
;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;

2.下载dbforge这个工具 右键要清除的存储过程->debug->Compile...


执行即可

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值