Either debugger bug or basic help needed
Posted: Fri 26 Apr 2019 18:28
I just purchased dbForge and ran into a problem in one of my first stored procedures. After I have run through a cursor in the debugger, I have no access to any variables. A simple example follows. The code works fine when not in the debugger, and the select statements return the correct values in the debugger, but hovering over variables doesn't work. Is this a bug or is there a way around the issue? Thanks.
PROCEDURE info.procedure1()
BEGIN
DECLARE myint int;
DECLARE myvar varchar(20);
DECLARE done boolean DEFAULT FALSE;
DECLARE mycursor CURSOR FOR SELECT datum FROM mytable;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=TRUE;
DROP TABLE IF EXISTS mytable;
CREATE TEMPORARY TABLE mytable (datum int);
INSERT INTO mytable VALUES (1);
OPEN mycursor;
myloop: LOOP
FETCH mycursor INTO myint;
IF done THEN
LEAVE myloop;
END IF;
END LOOP;
CLOSE mycursor;
SET myvar = 'Hello World!';
SET @myvar2 = 'Goodbye World!';
# If you hover over myvar and myvar2 at this point they show NULL and undefined in the debugger.
SELECT myvar;
SELECT @myvar2;
# But these selects work correctly and can access the data.
END
PROCEDURE info.procedure1()
BEGIN
DECLARE myint int;
DECLARE myvar varchar(20);
DECLARE done boolean DEFAULT FALSE;
DECLARE mycursor CURSOR FOR SELECT datum FROM mytable;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=TRUE;
DROP TABLE IF EXISTS mytable;
CREATE TEMPORARY TABLE mytable (datum int);
INSERT INTO mytable VALUES (1);
OPEN mycursor;
myloop: LOOP
FETCH mycursor INTO myint;
IF done THEN
LEAVE myloop;
END IF;
END LOOP;
CLOSE mycursor;
SET myvar = 'Hello World!';
SET @myvar2 = 'Goodbye World!';
# If you hover over myvar and myvar2 at this point they show NULL and undefined in the debugger.
SELECT myvar;
SELECT @myvar2;
# But these selects work correctly and can access the data.
END