SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 7.1.228 Pro] - Funny glitch with braces

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 7.1.228 Pro] - Funny glitch with braces
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post [SA 7.1.228 Pro] - Funny glitch with braces Reply with quote
I ran into a funny glitch with braces today. I have a snippet that I wanted to edit and dropped its content into SQL Editor to sort out the required number of braces.
Code:

DECLARE EXIT HANDLER FOR SQLEXCEPTION
   BEGIN
       ROLLBACK;
        INSERT INTO ertekesites.error_log(error_msg)
       VALUES (CONCAT(TRIM(TRAILING ', ' FROM CONCAT('/*Failed statement:*/ CALL $OBJECT(ins_qualname, proc)$(', "COALESCE("$ARGS$", 'NULL'),', '")),');'));
        SELECT @id_error_log := LAST_INSERT_ID();
    END;


The Jump to Matching Brace function does not work very well with this one. It's not supposed to happen very often but this time it was deeply misleading :) I'm not sure this one should (or could easily) be fixed, though.
Fri Nov 28, 2014 5:31 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I don't think this is a bug. The code here is very snippet-syntax specific, that piece "COALESCE("$ARGS$", 'NULL'),', '" of code is not a valid SQL code, it converts to a valid code only after the snippet code execution. The SQL parser chokes on that and it fails to match brackets correctly in the present format.


Last edited by SysOp on Mon Dec 01, 2014 9:23 am; edited 1 time in total
Sat Nov 29, 2014 12:00 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post Reply with quote
SysOp wrote:
I don't think this is a bug. The code here is very snippet-syntax specific, that piece "COALESCE("$ARGS$", 'NULL'),', '" of code is not a valid SQL code, it converts to a valid code only after the snippet code execution. The SQL parser chokes on that and it fails to match brackets correctly in the present format.


Neither do I. That's why I said it was just a glitch and that I wasn't sure it should be fixed. It's just a funny anomaly.
Mon Dec 01, 2014 4:30 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.