Fixed #27323 -- Optimized Oracle introspection by using USER_SEQUENCES instead of USER_CATALOG.
This commit is contained in:
parent
458e2fbfcc
commit
794f866cec
|
@ -54,8 +54,8 @@ END;
|
||||||
DECLARE
|
DECLARE
|
||||||
i INTEGER;
|
i INTEGER;
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT COUNT(*) INTO i FROM USER_CATALOG
|
SELECT COUNT(1) INTO i FROM USER_SEQUENCES
|
||||||
WHERE TABLE_NAME = '%(sq_name)s' AND TABLE_TYPE = 'SEQUENCE';
|
WHERE SEQUENCE_NAME = '%(sq_name)s';
|
||||||
IF i = 0 THEN
|
IF i = 0 THEN
|
||||||
EXECUTE IMMEDIATE 'CREATE SEQUENCE "%(sq_name)s"';
|
EXECUTE IMMEDIATE 'CREATE SEQUENCE "%(sq_name)s"';
|
||||||
END IF;
|
END IF;
|
||||||
|
|
|
@ -40,8 +40,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||||
DECLARE
|
DECLARE
|
||||||
i INTEGER;
|
i INTEGER;
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT COUNT(*) INTO i FROM USER_CATALOG
|
SELECT COUNT(1) INTO i FROM USER_SEQUENCES
|
||||||
WHERE TABLE_NAME = '%(sq_name)s' AND TABLE_TYPE = 'SEQUENCE';
|
WHERE SEQUENCE_NAME = '%(sq_name)s';
|
||||||
IF i = 1 THEN
|
IF i = 1 THEN
|
||||||
EXECUTE IMMEDIATE 'DROP SEQUENCE "%(sq_name)s"';
|
EXECUTE IMMEDIATE 'DROP SEQUENCE "%(sq_name)s"';
|
||||||
END IF;
|
END IF;
|
||||||
|
|
Loading…
Reference in New Issue