FUNCTION cr_debug.ENTER_MODULE2 does not exist

debug.cr:Crystal的调试宏 立即下载

目录

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...


执行即可

 

CRDebug-开源 CRDebug是一个调试器应用程序,主要面向游戏等高性能应用程序的开发人员。 它允许使用CRDebug提供的各种可视化插件在运行时捕获数据并在以后进行分析。 立即下载

相关推荐

GD32F4系列定时器正交译码器实战:用TIMER1读取旋转编码器信号(附完整代码)

本文详细介绍了GD32F4系列定时器正交译码器的实战应用,重点讲解如何使用TIMER1模块高效读取旋转编码器信号。内容涵盖硬件连接、定时器配置、方向判断与速度计算等关键环节,并提供了完整的代码实现和优化建议,帮助开发者快速掌握GD32微控制器在工业控制和消费电子领域的编码器接口设计。

weixin_29169505的博客 200

mysql cr debug_mysql 存储过程使用dbforge 跟踪debug ,多了很多CALL cr_debug.UPDATE_WATCH3,如果去掉...

CREATEDEFINER=`rootdba`@`%`PROCEDURE`case_30day_ser4`(OUTout_flagINT,out_tableVARCHAR(200))BEGINDECLAREcr_stack_depthINTEGERDEFAULTcr_debug.ENTER_MODULE2('case_30day_ser4...CREATE DEFINER=`rootdba`@`%...

weixin_30704909的博客 749

Acer宏碁暗影骑士擎AN515-58原厂系统恢复指南:从ISO镜像到完整出厂设置

本文详细介绍了为Acer宏碁暗影骑士擎AN515-58游戏本恢复原厂系统的完整指南。从准备工作、数据备份到下载官方镜像、制作恢复U盘,再到BIOS设置与恢复流程,一步步教你如何将系统完整还原至出厂状态,确保所有硬件驱动、NITROSENSE控制中心等专属优化功能恢复正常,解决系统卡顿、功能异常等问题。

weixin_29271263的博客 1092

MySQL存储过程调试工具

下载专业版  :https://www.devart.com/dbforge/mysql/studio/download.html 安装:一路下一步即可 连接数据库选择对应编码   下面转自:http://blog.chinaunix.net/uid-26364035-id-3179231.html 对于某些存储过程很多且复杂的SQL的应用

zhanghongzheng3213的专栏 1万+

weblogic 集群搭建,双机部署,相关问题记录

4.5.集群搭建1 参考网址https://wenku.baidu.com/view/76365129cd1755270722192e453610661ed95aa4.html IP地址 端口 角色 192.168.1.160 9001 AdminServer ...

zl386119974的专栏 1669

PX4实战指南:通过遥控器通道映射实现多舵机PWM精准控制

本文详细介绍了通过PX4飞控的AUX PWM接口实现遥控器通道映射控制多舵机的实战指南。内容包括硬件选型与连接、软件参数配置、通道映射方法以及常见问题排查,帮助开发者精准实现无人机舵机PWM控制,适用于云台、机械臂等扩展功能开发。

ee345的博客 304

关于Mysql存储过程debug遇到问题总结

研发同事申请对存储过程编译权限,之后给了alter routine,create routine,execute权限,反馈还是不行,提示没权限,后直接给了all privileges在该库上,还是不行,这时候有点郁闷,之后给了all privileges on *.*后就可以了,debug完成后,all privileges on *.*权限回收,研发反馈程序有报错信息,如下图示: 一看这么...

云计算、数据库、大数据、容器、微服务、深度学习、NLP、Python 398

Android SurfaceFlinger——概述(一)

对于系统渲染流程的理解是指导 SurfaceFlinger 设计的核心思想,从 Android 4.1 一直到 Android 9.0 都没有太大的变化。只要抓住这五个核心思想,我们阅读 SurfaceFlinger 的难度就会下降不少。下面看一下 SurfaceFlinger 的体系和 Skia 以及 View的绘制流程的关系。framework 面向开发者所有的 View 是便于开发的控件,里面仅仅只是提供了当前 View 各种属性以及功能。

小旭的专栏 2583

使用工具dbforge调试MySQL存储过程debug时遇到的问题

问题1: execute command denied to user 'whpe_test'@'%' for routine 办法: 存储过程定义由'definer' 改为 'invoker ' grant ALL PRIVILEGES ON cr_debug.* to 'root'@'%' ; 问题2: 占击'setup into'时,提示 whpe_test.p_meituan2_clean does not contain debug information. 办法: 右键点击存储过程,执.

u010719917的专栏 1061

UCIE Specification详解(八)

Logical Physical Layer(逻辑物理层)

Crazzy_M的博客 1605

25、量子计算:中性原子与约瑟夫森结量子比特

本文详细探讨了中性原子和约瑟夫森结两种量子比特在量子计算中的应用。中性原子量子比特利用光晶格实现量子态的操控,具有长相干时间的优势,但面临可扩展性和多量子比特操作的挑战;而约瑟夫森结量子比特基于超导技术,结合半导体制造工艺,具有低耗散和潜在的高可扩展性,但在参数控制和环境干扰方面存在难题。文章还比较了这两种方案的性能、应用场景及未来发展趋势,展望了它们在量子计算发展中的潜力与突破方向。

ol789012的博客 211

mysql 存储过程编写(2)

下面是本人的第一个关于mysql的第一个存储过程案例 创建过程 BEGIN DECLARE cr_stack_depth INTEGER DEFAULT cr_debug.ENTER_MODULE('report_QCY', 'mosa_erp', 7); /*    进销存统计表 inDate VARCHAR(10),branchID INT(11),wareh

ITpengcheng的专栏 9587

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

linux权限数字‘755’,‘700’等代表的含义

444 r–r--r– 600 rw------- 644 rw-r–r-- 666 rw-rw-rw- 700 rwx------ 744 rwxr–r-- 755 rwxr-xr-x 777 rwxrwxrwx 从左至右, 1-3位数字代表文件所有者的权限, 4-6位数字代表同组用户的权限, 7-9数字代表其他用户的权限。 读取权限:等于4 用 r 表示 写入权限:等于2 用 w 表示 执行权限:等于1 用 x 表示 例如: 755 7: 4+2+1 rwx 所有者具有读取、写入、执行.

WILDCHAP_的博客 7943

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

mysql cr debug 权限_mysql用户权限配置

mysql用户权限配置有什么不对的地方请各位大神多多指教!!!1,查看用户表$ mysql$ select User,Password,host from mysql.user;User: 用户名Password:密码(加密)host:连接ip2,开放远程连接$ vim /etc/mysql/mariadb.conf.d/50-server.cnf然后注释:# bind-address ...

weixin_32286661的博客 378

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

启动dbforge studio for mysql的调试功能

1、安装dbforge studio for mysql 2、使用dbforge studio for mysql,并以root身份连接数据库后编写一个存储过程 3、右击存储过程选择Debug,然后选择Step Into 4、打断点就可以调试了 5、调试完毕的存储过程,在其它工具中添加了很多调试用的语句信息,所以在调试完成后再次右击存储过程,然后Debug,并选择Compile或直接按Ctrl+...

冷月宫主的专栏 3080

mysql 函数 debug_Mysql的Debug模式实现

前一段领导开发了一个内核的模块,测试的过程中,发现导致MYSQL客户端无法连接服务器。经过查询文档,追根溯源,终于找到了MYSQL实现链接客户端的代码,在源文件sql-common/client.c里的 CLI_MYSQL_REAL_CONNECT 函数。但是代码很长,一时半会儿肯定看不明白。这个时候发现,发现代码当中有很多这样的代码:DBUG_ENTER("mysql_real_connect"...

weixin_39631953的博客 951

mysql 存储过程函数_mysql存储过程、函数

一组预编译好的sql语句集合,理解成批处理语句。优点:提高代码的重用性简化操作减少编译次数并且和数据库服务器连接的次数,提高效率创建存储过程create procedure 存储过程名([参数模式] 参数名 参数类型)begin存储过程体end参数模式:in:该参数可以作为输入,也就是该参数需要调用方传入值out:该参数可以作为输出,也就是说该参数可以作为返回值inout:该参数既可以作为输入也可...

weixin_29664063的博客 191

FUNCTION XXX does not exist

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION queryCountByGradeWithProcesure does not exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) a...

Clover的博客 1万+

Mysql主从复制报错Last_Errno: 1305

Mysql主从复制某些库表时总出现各种问题,之前根据业务配置的只张同步的表如下(作用同replicate_do_table): replicate_wild_do_table=me.parana_brands replicate_wild_do_table=me.parana_items replicate_wild_do_table=me.parana_orders replicate_wil

阿丽 7075

Npgsql 42883 function does not exist

第二次遇到这个问题了,花了很长时间才搞定,记不住.好记性不如烂笔头,特此记录. 42883: function test(ioid => bigint,idescribe => text) does not exist 发生这个错误的原因是创建函数后,PostgreSQL将函数名和参数名自动转换为小写.当Npgsql调用这个函数时,函数名不区分大小写,但是参数名区分大小写. --函数...

kmblack1的专栏 3509

使用JdbcTemplate 操作PostgreSQL,当where条件中有timestamp类型时,报错operator does not exist: timestamp w/out timezo...

今天遇到一个问题,找了还半天,Google一下,官网显示是一个bug。 思考一番肯定是类型出了问题。 Controller: Service:转化时间戳 Dao: 一波转换搞定! 转载于:https://www.cnblogs.com/zacky31/p/8711553.html...

weixin_33753003的博客 1480
上一篇: RabbitMQ高级特性
下一篇: java-proxy 内网穿透搭建使用
别浪呀
博客等级 码龄8年 1万+粉丝 260原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值