o
    ÕèFh  ã                   @   sH   d dl mZmZ d dlmZ d dlmZ d dlmZ G dd„ deƒZ	dS )é    )ÚDatabaseErrorÚInterfaceError)ÚBaseDatabaseFeatures)Úis_oracledb)Úcached_propertyc                       s8  e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZeZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d	Z7d
dhZ8dZ9e:dd„ ƒZ;e:‡ fdd„ƒZ<e:dd„ ƒZ=e:dd„ ƒZ>e:dd„ ƒZ?e:dd„ ƒZ@‡  ZAS )ÚDatabaseFeatures)é   FTz
 FROM DUALz|
        CREATE PROCEDURE "TEST_PROCEDURE" AS
            V_I INTEGER;
        BEGIN
            V_I := 1;
        END;
    zŒ
        CREATE PROCEDURE "TEST_PROCEDURE" (P_I INTEGER) AS
            V_I INTEGER;
        BEGIN
            V_I := P_I;
        END;
    z¿
        CREATE TABLE test_table_composite_pk (
            column_1 NUMBER(11) NOT NULL,
            column_2 NUMBER(11) NOT NULL,
            PRIMARY KEY (column_1, column_2)
        )
    iÿÿ  z$CURRENT_TIMESTAMP AT TIME ZONE 'UTC'zFannotations.tests.NonAggregateAnnotationTestCase.test_custom_functionsz^annotations.tests.NonAggregateAnnotationTestCase.test_custom_functions_can_ref_other_functionsz1INSERT INTO {} VALUES (DEFAULT, DEFAULT, DEFAULT)c              
   C   sV   ddhddhddhh d£dhd	hd
hdhdhdœ	}t r)| jjdkr)| ddhi¡ |S )Nz4db_functions.text.test_sha224.SHA224Tests.test_basicz8db_functions.text.test_sha224.SHA224Tests.test_transformzVdb_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_week_before_1000zbdb_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_week_before_1000zadb_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_second_func_no_fractionalzmdb_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_extract_second_func_no_fractional>   úCexpressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xorúHexpressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_nullúNexpressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_right_nullzHexpressions_window.tests.WindowFunctionTests.test_row_number_no_orderingz?model_fields.test_jsonfield.TestQuerying.test_usage_in_subqueryzMmigrations.test_operations.OperationTests.test_alter_field_pk_fk_db_collationzIgeneric_relations_regress.tests.GenericRelationTests.test_textlink_filterz?lookup.tests.LookupQueryingTests.test_aggregate_combined_lookup)	zOracle doesn't support SHA224.zwOracle doesn't correctly calculate ISO 8601 week numbering before 1583 (the Gregorian calendar was introduced in 1582).z>Oracle extracts seconds including fractional seconds (#33517).z#Oracle doesn't support bitwise XOR.z9Oracle requires ORDER BY in row_number, ANSI:SQL doesn't.z&Raises ORA-00600: internal error code.zGOracle doesn't support changing collations on indexed columns (#33671).z1Oracle doesn't support comparing NCLOB to NUMBER.z1Oracle doesn't support casting filters to NUMBER.)é   é   r   zhpython-oracledb 2.1.2+ no longer hides 'ORA-1403: no data found' exceptions raised in database triggers.zLbackends.oracle.tests.TransactionalTests.test_hidden_no_data_found_exception)r   Ú
connectionÚoracledb_versionÚupdate)ÚselfÚskips© r   ú[/var/www/html/loop/nvenv/lib/python3.10/site-packages/django/db/backends/oracle/features.pyÚdjango_test_skips^   s:   þýýÿÿÿÿÿØ,ÿþÿ	z"DatabaseFeatures.django_test_skipsc                    s   i t ƒ j¥dddddddœ¥S )NÚ	CharFieldÚBigIntegerFieldÚIntegerFieldÚDateTimeField)ÚGenericIPAddressFieldÚPositiveBigIntegerFieldÚPositiveIntegerFieldÚPositiveSmallIntegerFieldÚSmallIntegerFieldÚ	TimeField)ÚsuperÚintrospected_field_types©r   ©Ú	__class__r   r   r!   ˜   s   ÿùz)DatabaseFeatures.introspected_field_typesc                 C   s   dddd| j rddœS d dœS )NÚ	BINARY_CIÚBINARYÚ
SWEDISH_CI)ÚciÚcsÚnon_defaultÚ
swedish_ciÚvirtual)Úsupports_collation_on_charfieldr"   r   r   r   Útest_collations¤   s   ûûz DatabaseFeatures.test_collationsc                 C   s†   | j  ¡ �4}z| d¡ W n" ty/ } z|jd jdkr*W Y d }~W d   ƒ dS ‚ d }~ww 	 W d   ƒ dS 1 s<w   Y  d S )Nz,SELECT CAST('a' AS VARCHAR2(4001)) FROM dualr   iŽ  FT)r   ÚcursorÚexecuter   ÚargsÚcode)r   r/   Úer   r   r   r-   ®   s   
û€ý$ùz0DatabaseFeatures.supports_collation_on_charfieldc                 C   ó   | j jdkS )N)é   ©r   Úoracle_versionr"   r   r   r   Ú!supports_primitives_in_json_field¹   ó   z2DatabaseFeatures.supports_primitives_in_json_fieldc                 C   r4   )N)é   r6   r"   r   r   r   Ú&supports_boolean_expr_in_select_clause½   r9   z7DatabaseFeatures.supports_boolean_expr_in_select_clause)BÚ__name__Ú
__module__Ú__qualname__Úminimum_database_versionÚallows_group_by_lobÚallows_group_by_select_indexÚ!interprets_empty_strings_as_nullsÚhas_select_for_updateÚhas_select_for_update_nowaitÚ!has_select_for_update_skip_lockedÚhas_select_for_update_ofÚselect_for_update_of_columnÚcan_return_columns_from_insertÚsupports_subqueries_in_group_byÚ*ignores_unnecessary_order_by_in_subqueriesÚsupports_transactionsÚsupports_timezonesÚhas_native_duration_fieldÚcan_defer_constraint_checksÚ.supports_partially_nullable_unique_constraintsÚ&supports_deferrable_unique_constraintsÚtruncates_namesÚsupports_commentsÚsupports_tablespacesÚsupports_sequence_resetÚ!can_introspect_materialized_viewsÚatomic_transactionsÚnulls_order_largestÚrequires_literal_defaultsÚ'supports_default_keyword_in_bulk_insertr   Úclosed_cursor_error_classÚbare_select_suffixÚ%supports_select_for_update_with_limitÚsupports_temporal_subtractionÚignores_table_name_caseÚsupports_index_on_text_fieldÚ(create_test_procedure_without_params_sqlÚ(create_test_procedure_with_int_param_sqlÚ,create_test_table_with_composite_primary_keyÚsupports_callproc_kwargsÚsupports_over_clauseÚ#supports_frame_range_fixed_distanceÚsupports_ignore_conflictsÚmax_query_paramsÚsupports_partial_indexesÚ!supports_stored_generated_columnsÚ"supports_virtual_generated_columnsÚcan_rename_indexÚ%supports_slicing_ordering_in_compoundÚ#requires_compound_order_by_subqueryÚ*allows_multiple_constraints_on_same_fieldsÚsupports_comparing_boolean_exprÚsupports_json_field_containsÚsupports_collation_on_textfieldÚtest_now_utc_templateÚdjango_test_expected_failuresÚinsert_test_table_with_defaultsr   r   r!   r.   r-   r8   r;   Ú__classcell__r   r   r#   r   r      sŒ    ýÿ
9
	


r   N)
Ú	django.dbr   r   Ú django.db.backends.base.featuresr   Ú&django.db.backends.oracle.oracledb_anyr   Údjango.utils.functionalr   r   r   r   r   r   Ú<module>   s
    