관리-도구
편집 파일: features.cpython-38.pyc
U )�e� � @ s� d dl Z e jdkr d dlmZ nd dlmZ d dlmZ d dlmZ zd dl Z dZ W n ek rl dZ Y nX G dd � d e�ZdS ) � N�� � )�BaseDatabaseFeatures)�cached_property)�sixTFc s� e Zd ZdZg ZdZdZdZdZdZ dZ dZdZdZ dZdZdZdZdZdZdZdZdZdZdZejdk rxdZejZdZ� fdd�Z e!dd� �Z"e!d d � �Z#e!dd� �Z$e!d d� �Z%e!dd� �Z&dd� Z'� Z(S )�DatabaseFeaturesz�Features specific to MySQL Microsecond precision is supported since MySQL 5.6.3 and turned on by default if this MySQL version is used. FTr c s t t| ��|� d S )N)�superr �__init__)�self� connection�� __class__� �t/opt/hc_python/lib64/python3.8/site-packages/../../../lib/python3.8/site-packages/mysql/connector/django/features.pyr 5 s zDatabaseFeatures.__init__c C s | j jdkrdS dS )N)� � � TF)r � mysql_version�r r r r �supports_microsecond_precision8 s z/DatabaseFeatures.supports_microsecond_precisionc C s� d}dj |d�}| j�� �|}|�|� |�dj |d�� | jjdkrj|�d| jjd |f� |�� d }n|�d j |d�� |�� d }|�|� W 5 Q R X || _|S )z�Get default storage engine of MySQL This method creates a table without ENGINE table option and inspects which engine was used. Used by Django tests. ZINTROSPECT_TESTzDROP TABLE IF EXISTS {table})�tablezCREATE TABLE {table} (X INT))r r r zXSELECT ENGINE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s�NAMEr z&SHOW TABLE STATUS WHERE Name='{table}'r )�formatr �cursor�executer Z settings_dictZfetchoneZ_cached_storage_engine)r ZtblnameZ droptabler Zenginer r r �mysql_storage_engine>