✏️ 正在编辑: cursor.cpython-312.pyc
路径:
/var/opt/nydus/ops/mysql/connector/__pycache__/cursor.cpython-312.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
� ��'j�� � � � d Z ddlmZ ddlZddlZddlmZ ddlmZm Z m Z mZmZm Z mZmZmZmZmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZmZmZmZm Z m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- erdd l.m/Z/ dZ0 ejb de0� de0� d�ejd ejf z ejh z � Z5 ejb dejd ejf z ejh z � Z6 ejb de0� de0� d�ejd ejf z ejh z � Z7 ejb dejd ejf z ejh z � Z8 ejb d� Z9 ejb dejt � Z; ejb d� Z< ejb d� Z= ejb d� Z> ejb d� Z?dZ@dZA G d� d� ZBd1d �ZC G d!� d"e� ZD G d#� d$eD� ZE G d%� d&eD� ZF G d'� d(eE� ZG G d)� d*eD� ZH G d+� d,eD� ZI G d-� d.eIeE� ZJ G d/� d0eIeH� ZKy)2zCursor classes.� )�annotationsN)�Decimal)� TYPE_CHECKING�Any�Dict�Iterator�List�NoReturn�Optional�Sequence�Tuple�Union�cast� )� deprecated)�split_multi_statement)�MySQLCursorAbstract)� ServerFlag)�Error�InterfaceError�NotSupportedError�ProgrammingError�ReadTimeoutError�WriteTimeoutError�get_mysql_exception) �DescriptionType� EofPacketType�ParamsDictType�ParamsSequenceOrDictType�ParamsSequenceType� ResultType�RowItemType�RowType� StrOrBytes�WarningType)�MySQLConnectionz\/\*.*?\*\/�(z)|(["'`][^"'`]*?(z)[^"'`]*?["'`])z<\s*ON\s+DUPLICATE\s+KEY(?:[^"'`]*["'`][^"'`]*["'`])*[^"'`]*$z|\s)*INSERT(z[|\s)*(?:IGNORE\s+)?INTO\s+[`'\"]?.+[`'\"]?(?:\.[`'\"]?.+[`'\"]?){0,2}\s+VALUES\s*(\(.+\)).*z.*VALUES\s*(\(.+\)).*s (%s)sV % \((?P<mapping_key>[^)]+)\) (?P<conversion_type>[diouxXeEfFgGcrs%]) s4 ;(?=(?:[^"'`]*(?:"[^"]*"|'[^']*'|`[^`]*`))*[^"'`]*$)s+ %s(?=(?:[^"'`]*["'`][^"'`]*["'`])*[^"'`]*$)z %\(.*?\)sz%\((.*?)\)szNo result set to fetch froml �� c �2 � e Zd ZdZdd�Zdd�Zedd�� Zy) �_ParamSubstitutorz4 Substitutes parameters into SQL statement. c � � || _ d| _ y �Nr )�params�index)�selfr, s �G/opt/nydus/tmp/pip-target-k0fmikie/lib/python/mysql/connector/cursor.py�__init__z_ParamSubstitutor.__init__| s � �'-����� � c � � | j }| xj dz c_ t | j | � S # t $ r t d� d �w xY w)Nr z+Not enough parameters for the SQL statement)r- �bytesr, � IndexErrorr )r. �matchobjr- s r/ �__call__z_ParamSubstitutor.__call__� sS � �� � ��� � �a�� � �����U�+�,�,��� �"�=��� � �s �; �Ac �F � t | j � | j z S )z8Returns number of parameters remaining to be substituted)�lenr, r- �r. s r/ � remainingz_ParamSubstitutor.remaining� s � � �4�;�;��$�*�*�,�,r1 N)r, zSequence[bytes]�return�None�r5 �re.Matchr; r3 )r; �int)�__name__� __module__�__qualname__�__doc__r0 r6 �propertyr: � r1 r/ r) r) w s% � ���� �-� �-r1 r) c �@ �� d�fd�}t j || � }|S )ah >>> _bytestr_format_dict(b'%(a)s', {b'a': b'foobar'}) b'foobar >>> _bytestr_format_dict(b'%%(a)s', {b'a': b'foobar'}) b'%%(a)s' >>> _bytestr_format_dict(b'%%%(a)s', {b'a': b'foobar'}) b'%%foobar' >>> _bytestr_format_dict(b'%(x)s %(y)s', ... {b'x': b'x=%(y)s', b'y': b'y=%(x)s'}) b'x=%(y)s y=%(x)s' c � �� d}| j � }|d dk( rd}|d dk( r |d }�| }|�t d|d � �� �|S )zReplace pattern.N�conversion_type� %� s�mapping_keyzUnsupported conversion_type: )� groupdict� ValueError)r5 �value�groups�key� value_dicts �r/ �replacez%_bytestr_format_dict.<locals>.replace� st �� �!%���#�#�%���#�$��,��E��#�$��,���'�C��s�O�E��=��/��7H�0I�/J�K�� � �r1 r= )�RE_PY_MAPPING_PARAM�sub)�bytestrrQ rR �stmts ` r/ �_bytestr_format_dictrW � s! �� � � �"�"�7�G�4�D��Kr1 c � � � e Zd ZdZ d d � fd� Zd!d�Zd"d#d�Zd$d�Zd%d�Zd&d�Z d$d�Z d'd �Z d(d �Zd)d�Z d%d�Zd*d �Z d+ d,d�Z d-d�Z d.d�Z ed� d/d�� Z d0 d1d�Zd2d�Zd%d�Zd3d�Zd"d4d�Zd5d�Zd6d7d�Zd8d�Zd9d�Zed:d�� Zed$d�� Z d;d�Z!� xZ"S )<�MySQLCursora� Default cursor for interacting with MySQL This cursor will execute statements and handle the result. It will not automatically fetch all rows. MySQLCursor should be inherited whenever other functionallity is required. An example would to change the fetch* member functions to return dictionaries instead of lists of values. Implements the Python Database API Specification v2.0 (PEP-249) c �^ �� t �| � |||� t d| j � | _ y)� Initializer&