SQL Syntax Problem while storing with debug info

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
obomysql
Posts: 8
Joined: Wed 01 Aug 2007 20:21

SQL Syntax Problem while storing with debug info

Post by obomysql » Thu 23 Aug 2007 15:02

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

obomysql
Posts: 8
Joined: Wed 01 Aug 2007 20:21

BUG in combination with REPEAT function.

Post by obomysql » Thu 23 Aug 2007 20:00

I think I found the problem. My stored procedure uses the function REPEAT(str,count).

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

Code: Select all

DECLARE vNullStr VARCHAR(160) DEFAULT REPEAT("00000000",8);
or replace the line with

Code: Select all

DECLARE vNullStr VARCHAR(160) DEFAULT "0000000000000000000000000000000000000000000000000000000000000000";
I can compile the procudere using debug information.

Duke
Devart Team
Posts: 476
Joined: Fri 29 Oct 2004 09:25

Post by Duke » Mon 27 Aug 2007 07:28

We'll fix the problem with default variable value in the next build.

Post Reply