Skip to content

Incorrect check of the limit on the number of local temporary tables #8968

@AlexBekhtin

Description

@AlexBekhtin

From documentation

Max number of LTTs: The maximum number of active Local Temporary Tables per
connection is 1024.

EXECUTE BLOCK
AS
DECLARE IDX INTEGER;
BEGIN
  IN AUTONOMOUS TRANSACTION DO BEGIN
     FOR IDX = 1 TO 10000 DO   
       EXECUTE STATEMENT 'RECREATE LOCAL TEMPORARY TABLE A_'||:IDX||' (ID INT) ON COMMIT PRESERVE ROWS';
  END
END;

SELECT COUNT(*) FROM MON$LOCAL_TEMPORARY_TABLES;
/*
                COUNT
=====================
                10000
*/

RECREATE LOCAL TEMPORARY TABLE A_1 (ID INT) ON COMMIT PRESERVE ROWS
/*
Statement failed, SQLSTATE = 54000
unsuccessful metadata update
-RECREATE TABLE "PUBLIC"."A_1" failed
-Implementation limit exceeded
-Too many local temporary tables exist already
*/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions