I have some stored procedures where once I use the store with debug information the following Error occurs:
"You have an error in your SQL syntax; check ....near' CALL cr_debug.TRACE(0, 27, 0, 3, cr_stack_depth);efix);
CALL cr_debug.TRAC' at line 10"
the strange thing is that it worked fine for some time, but then suddenly this error occurs.
I removed the whole body from the procedure and left only the declaration portion, then tried again to compile with debug info.
The result is a message window telling me
"Failed restoring 'dev_share.__TR_prefixv6_1':
PROCEDURE __TR_prefix_v6_1 already exists
The next thing that happens, the SQL file opens and again an Error is listed in the Error list.
This time:
...near 'DECLARE cr_stack_depth INTEGER DEFAULT
cr_debug.ENTER_MODULE('__TR_prefix_v6_1',' at line 1
SQL Syntax Problem while storing with debug info
BUG in combination with REPEAT function.
I think I found the problem. My stored procedure uses the function REPEAT(str,count).
Example:
This procedure can be "compiled" and executed on MySQL. If I want to compile it using debug information I get the following error:
"You have an error ...... near' CALL cr_debug.TRACE(0, 10, 0, 3, cr_stack_depth);,
cr__stack_depth);SET a - SUBST' at line 8"
If I remove the line
or replace the line with
I can compile the procudere using debug information.
Example:
Code: Select all
PROCEDURE dev_share.test(INOUT pValue VARCHAR(100))
BEGIN
DECLARE a VARCHAR(100) DEFAULT "";
DECLARE b VARCHAR(100) DEFAULT "";
DECLARE vNullStr VARCHAR(160) DEFAULT REPEAT("00000000",8);
IF TRUE THEN
SET a = SUBSTRING_INDEX(pValue,":",1);
SET b = SUBSTRING_INDEX(pValue,":",-1);
END IF;
END
"You have an error ...... near' CALL cr_debug.TRACE(0, 10, 0, 3, cr_stack_depth);,
cr__stack_depth);SET a - SUBST' at line 8"
If I remove the line
Code: Select all
DECLARE vNullStr VARCHAR(160) DEFAULT REPEAT("00000000",8);
Code: Select all
DECLARE vNullStr VARCHAR(160) DEFAULT "0000000000000000000000000000000000000000000000000000000000000000";