This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270545

Summary: SQL autocompletion is lost after IF in a PROCEDURE due to custom DELIMITER
Product: db Reporter: Xenos
Component: SQL EditorAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: Dev   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Xenos 2017-05-03 14:29:48 UTC
That seems quiet specific, but it actually isn't. Consider this SQL file, that sets a procedure:


    DROP PROCEDURE IF EXISTS `assert`;
    -- Position 1
    DELIMITER $$
    -- Position 2
    CREATE PROCEDURE `assert`(IN `asserting` TINYINT(1) UNSIGNED, IN `code` INT UNSIGNED)
    	LANGUAGE SQL
    	DETERMINISTIC
    	CONTAINS SQL
    	SQL SECURITY INVOKER
    BEGIN
        -- Position 3
    	IF NOT(`asserting`) THEN
    		CALL throw('UserException', `code`, '{}');
    	END IF;
    	-- Position 4
    END$$
    -- Position 5
    DELIMITER ;
    -- Position 6

There, if you type "SELECT * FROM {Ctrl+Sp}" at each position, you have the following results:
Positon 1 → OK, works (suggests the tables name)
Positon 2 → OK, same
Positon 3 → OK, same
Positon 4 → FAILS, suggests the basic SQL keywords (CREATE, DROP, etc)
Positon 5 → OK, same
Positon 6 → OK, same

So in that very precise place "4", the autocompletion seems to fail.