관리-도구
편집 파일: connection.cpython-38.pyc
U )�e�@ � @ s& d Z zddlZdZW n dZY nX ddlZddlZddlmZ ddlmZ ddl m Z mZmZ dd l mZ dd lmZmZ ddlmZmZmZ ddlmZmZ d ZdZG dd� de�Zdd� ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de!�Z"G dd� de!�Z#dS )z4Implementation of communication for MySQL X servers.� NTF��wraps� )�MySQL41AuthPlugin)�InterfaceError�OperationalError�ProgrammingError��Schema)�Protocol�MessageReaderWriter)�Result� RowResult� DocResult)�SqlStatement�AddStatementzDROP DATABASE IF EXISTS `{0}`z#CREATE DATABASE IF NOT EXISTS `{0}`c @ s@ e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zi fdd�Zd S )�SocketStreamc C s d | _ d| _d S )NF)�_socket�_is_ssl��self� r �f/opt/hc_python/lib64/python3.8/site-packages/../../../lib/python3.8/site-packages/mysqlx/connection.py�__init__2 s zSocketStream.__init__c C s6 t |t�rtjntj}t�|tj�| _| j�|� d S �N)� isinstance�tuple�socket�AF_INET�AF_UNIX�SOCK_STREAMr �connect)r �paramsZs_typer r r r! 6 s zSocketStream.connectc C s\ | j d krtd��g }|dkrR| j �|�}|dkr:td��|�|� |t|�8 }qd�|�S )N�MySQLx Connection not availabler � zUnexpected connection close)r r �recv�RuntimeError�append�len�join)r �count�buf�datar r r �read; s zSocketStream.readc C s"