Leave in nested FOR SELECT ... DO statements will not cause refresh of 
parameters for the left FOR SELECT ... DO
----------------------------------------------------------------------------------------------------------------

                 Key: CORE-4727
                 URL: http://tracker.firebirdsql.org/browse/CORE-4727
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.3
         Environment: Windows server 2008 R2 Standard 64 bit Service Pack 1 
(Chinese version)
            Reporter: Jan-Martin
            Priority: Minor


If there are two nested FOR SELECT ... DO statements and the inner one contains 
a leave the inner FOR SELECT ... DO will not take over the new parameters but 
continues with the original parameters after being called again.

Example:
EXECUTE BLOCK
AS
DECLARE VARIABLE RDB$RELATION_NAME TYPE OF COLUMN RDB$INDICES.RDB$RELATION_NAME;
DECLARE VARIABLE RDB$INDEX_ID TYPE OF COLUMN RDB$INDICES.RDB$INDEX_ID;
DECLARE VARIABLE RDB$INDEX_NAME TYPE OF COLUMN RDB$INDICES.RDB$INDEX_NAME;
BEGIN
  FOR SELECT A.RDB$INDEX_NAME, A.RDB$INDEX_ID
  FROM RDB$INDICES A
  WHERE A.RDB$RELATION_NAME IN 
('RDB$PROCEDURE_PARAMETERS','RDB$RELATION_CONSTRAINTS')
  ORDER BY A.RDB$RELATION_NAME, A.RDB$INDEX_ID
  INTO :RDB$RELATION_NAME, :RDB$INDEX_ID
  DO
  BEGIN
    FOR SELECT A.RDB$INDEX_NAME
    FROM RDB$INDICES A
    WHERE A.RDB$INDEX_ID = :RDB$INDEX_ID AND
        A.RDB$INDEX_NAME STARTING WITH 'RDB$'
    ORDER BY A.RDB$INDEX_NAME
    INTO :RDB$INDEX_NAME
    DO
      LEAVE;
  END 
END

will not take over the new parameter for :RDB$INDEX_ID, instead it will keep on 
running with the first parameter given

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to