HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/mysql/connector/__pycache__/abstracts.cpython-311.pyc
�

�nc���	��dZddlZddlZddlZddlZddlmZmZddlm	Z	mZm
Z
mZddlm
Z
ddlmZddl
mZdZ	ddlZeed	��r	ejrd
Zn#e$rYnwxYwddlmZmZmZmZmZmZmZmZdd
lm Z ddl!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'm(Z(ej)��Z*dZ+dZ,dZ-dZ.dZ/e
e0e	ee1e2e3e
ef	Z4Gd�de��Z5Gd�de��Z6dS)z+Module gathering all abstract base classes.�N)�ABC�abstractmethod)�date�datetime�time�	timedelta)�Decimal)�	signature)�sleepF�HAS_TLSv1_3T�)�
CONN_ATTRS_DN�DEFAULT_CONFIGURATION�DEPRECATED_TLS_VERSIONS�OPENSSL_CS_NAMES�TLS_CIPHER_SUITES�TLS_VERSIONS�CharacterSet�
ClientFlag)�MySQLConverterBase)�Error�InterfaceError�NotSupportedError�OperationalError�ProgrammingError)�read_option_fileszVThe '{list}' list must not contain repeated values, the value '{value}' is duplicated.zdThe given tls_version: '{}' is not recognized as a valid TLS protocol version (should be one of {}).zHThe given tls_version: '{}' are no longer allowed (should be one of {}).zINo supported TLS protocol version found in the 'tls-versions' list '{}'. aOption "krb_service_principal" {error}, must be a string in the form "primary/instance@realm" e.g "ldap/ldapauth@MYSQL.COM" where "@realm" is optional and if it is not given will be assumed to belong to the default realm, as configured in the krb5.conf file.c�V�eZdZdZd�Zd�Zd�Zd�Zed���Z	ed���Z
ed���Zd	�Zd
�Z
d�Zd�Zed
���Zed���Zed���Zed���Zeed�����Zejd���Zed���Zejd���Zed���Zejd���Zd�Zd�Zed���Zd�Zd�Zeed�����Zd�Z d�Z!ed���Z"e"jd ���Z"ed!���Z#e#jd"���Z#ed#���Z$d\d%�Z%d]d'�Z&ed(���Z'e'jd)���Z'ed*���Z(e(jd+���Z(ed,���Z)e)jd-���Z)ed.���Z*e*jd/���Z*ed0���Z+ed1���Z,d\d2�Z-ed3���Z.ed4���Z/ed5���Z0d6�Z1ed7���Z2e2Z3d8�Z4d^d;�Z5ed<���Z6ed_d>���Z7ed?���Z8e						d`d@���Z9edA���Z:edB���Z;	dadC�Z<d\dD�Z=dE�Z>e	dbdF���Z?dG�Z@dcdH�ZAdI�ZBdJ�ZCdK�ZDdddL�ZEdM�ZFedN���ZGdO�ZHdP�ZIdQ�ZJ								dedT�ZKdU�ZLdfdW�ZMdX�ZNdY�ZOdZ�ZPd[�ZQd$S)g�MySQLConnectionAbstractz7Abstract class for classes connecting to a MySQL serverc��tj��|_d|_d|_d|_d|_d|_d|_i|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_i|_t,d|_d|_d|_d|_d|_d	|_d|_d|_t,d
|_d|_ d|_!d|_"d|_#d|_$t,d|_%t,d|_&d|_'g|_(d|_)d|_*d|_+d|_,d|_-d|_.d|_/d|_0dS)
�
Initialize�-NF�z	127.0.0.1i�r�ssl_disabledT�connect_timeout�allow_local_infile�allow_local_infile_in_path)1r�get_default�
_client_flags�_charset_id�	_sql_mode�
_time_zone�_autocommit�_server_version�
_handshake�_conn_attrs�_user�	_password�
_password1�
_password2�
_password3�	_database�_host�_port�_unix_socket�_client_host�_client_port�_sslr�
_ssl_disabled�_force_ipv6�_oci_config_file�_fido_callback�_krb_service_principal�_use_unicode�
_get_warnings�_raise_on_warnings�_connection_timeout�	_buffered�_unread_result�_have_next_result�_raw�_in_transaction�_allow_local_infile�_allow_local_infile_in_path�_prepared_statements�_query_attrs�_ssl_active�_auth_plugin�_pool_config_version�	converter�_converter_class�_converter_str_fallback�	_compress�_consume_results��selfs �;D:\Python311\Lib\site-packages\mysql/connector/abstracts.py�__init__z MySQLConnectionAbstract.__init__ss���'�3�5�5������������ ���#�����������
���������������� ��
���
� �����������	�2�>�B��� ��� $���"���&*��#� ���"���"'���#8�9J�#K�� ����#���!&�����	�$���#8�9M�#N�� �+@�(�,
��(�%)��!���� ��� ���$(��!���� $���',��$���� %�����c��|S�N�rVs rX�	__enter__z!MySQLConnectionAbstract.__enter__�����rZc�.�|���dSr\��close�rW�exc_type�	exc_value�	tracebacks    rX�__exit__z MySQLConnectionAbstract.__exit__�����
�
�����rZc��|S)z�Return self for weakref.proxy

        This method is used when the original object is needed when using
        weakref.proxy.
        r]rVs rX�get_selfz MySQLConnectionAbstract.get_self�s	���rZc�B�|jp|jduotjdkS)z&Return True if is a secure connection.N�posix)rNr8�os�namerVs rX�	is_securez!MySQLConnectionAbstract.is_secure�s+����
���T�)�@�b�g��.@�	
rZc��|jS)zReturn if have next result.)rGrVs rX�have_next_resultz(MySQLConnectionAbstract.have_next_result�s
���%�%rZc��|jS)zReturn query attributes list.�rMrVs rX�query_attrsz#MySQLConnectionAbstract.query_attrs��
��� � rZc�:�|j�|��dS)z)Add element to the query attributes list.N)rM�append�rW�values  rX�query_attrs_appendz*MySQLConnectionAbstract.query_attrs_append�s���� � ��'�'�'�'�'rZc��|jdd�=dS)zClear query attributes list.NrsrVs rX�query_attrs_clearz)MySQLConnectionAbstract.query_attrs_clear�s����a�a�a� � � rZc�\�g}|jd}t|t��r�|�d��r|�d��std|�d����|dd��d��}|std	���|D]?}|������}|r|�	|���@n<t|ttf��r
d
�|D��}ntd|�d����|j�dd
���td
d
�n|jdd
d
�}|�d���|d}ggg}i}g}	td
tj|��dz�D]B}
|�t"|
��|	�t&|
���C|D]�}d|vrK||	vrG|t&dvr|d�	|���5|d�	|���Q||vr�||}||vr)tt(�d|������|t"dvr"|d�	||����|d�	||����td|�d����|ds|dstd���d�|d��d�|d��g}||jd<d
S)z&Validates the tls_ciphersuites option.�tls_ciphersuites�[�]z)tls_ciphersuites must be a list, found: '�'r
����,z6No valid cipher suite found in 'tls_ciphersuites' listc��g|]}|�|��Sr]r])�.0�tls_css  rX�
<listcomp>zFMySQLConnectionAbstract._validate_tls_ciphersuites.<locals>.<listcomp>�s��F�F�F�6�v�F��F�F�FrZzItls_ciphersuites should be a list with one or more ciphersuites. Found: '�tls_versionsNT)�reverser�-�TLSv1.3��listryzThe value 'z1' in tls_ciphersuites is not a valid cipher suitez:No valid cipher suite found in the 'tls_ciphersuites' list�:)r;�
isinstance�str�
startswith�endswith�AttributeError�split�strip�upperrwr��set�getr�sort�index�updater�extendr�DUPLICATED_IN_LIST_ERROR�format�join)
rWr~r��tls_css�_tls_csr��
newer_tls_ver�translated_names�iani_cipher_suites_names�ossl_cipher_suites_names�tls_verrn�translated_names
             rX�_validate_tls_ciphersuitesz2MySQLConnectionAbstract._validate_tls_ciphersuites�s�������-�.���f�c�"�"�	��%�%�c�*�*�
�v���s�/C�/C�
�$�I��I�I�I�����Q�r�T�l�(�(��-�-�G��
�$�L����#�
5�
5�� �,�,�.�.�.�.�0�0���5�$�+�+�G�4�4�4��
5�
���s��
,�
,�	�F�F�V�F�F�F��� �3�)/�3�3�3���
��y�}�}�^�T�2�2�
.�L����O�O���>�*�1�1�1�-�	�	���$��'�'�'�$�Q��
���8��#%� �#%� �$�$K�l�&8��&G�&G�!�&K�$K�L�	G�	G�G�$�+�+�,=�g�,F�G�G�G�$�+�+�,<�W�,E�F�F�F�F�$�	�	�D��d�{�
�t�'?�?�
��+�I�6�6�5�$�Q�'�.�.�t�4�4�4�4�$�Q�'�.�.�t�4�4�4�4��1�1�
�":�4�"@��"�&6�6��(�0�7�7�!3�?�8������
�,�Y�7�7�O�$�Q�'�.�.�/G��/M�N�N�N�N�$�Q�'�.�.�/G��/M�N�N�N�N�$�#�$�#�#�#���� ��"�	�+;�A�+>�	� �L���
�
�H�H�%�a�(�)�)��H�H�%�a�(�)�)�
��)9��	�$�%�%�%rZc�(�g}|jd}t|t��r�|�d��r|�d��std|�d����|dd��d��}|D]_}|���}|d	kr�||vr)tt�	d|�
�����|�
|���`|dgkr4ts-tt�	|t�����n�t|t��rY|std���|D]D}||vr)tt�	d|�
�����|�
|���En^t|t��r|D]}|�
|���n.td
d�t���d|�d����|std���g}g}g}|D]T}|tvr|�
|��|t"vr|�
|���?|�
|���U|r[|dgkr4ts-t%t�	|t�����|���||jd<dS|r-t%t(�	|t�����|r-tt*�	|t�����dS)z"Validates the tls_versions option.r�rr�z%tls_versions must be a list, found: 'r�r
r�r�r"r�r�zJAt least one TLS protocol version must be specified in 'tls_versions' listz>tls_versions should be a list with one or more of versions in z, z
. found: 'zdAt least one TLS protocol version must be specified in 'tls_versions' list when this option is givenN)r;r�r�r�r�r�r�r�r�r�rw�TLS_V1_3_SUPPORTED�TLS_VER_NO_SUPPORTEDrr�r�r�rrr��TLS_VERSION_DEPRECATED_ERROR�TLS_VERSION_ERROR)rWr��tls_version�tls_versr��use_tls_versions�deprecated_tls_versions�invalid_tls_versionss        rX�_validate_tls_versionsz.MySQLConnectionAbstract._validate_tls_versions%s������i��/���k�3�'�'�*	��*�*�3�/�/�
�K�4H�4H��4M�4M�
�$�J�K�J�J�J����#�1�R�4�(�.�.�s�3�3�H�#�

1�

1��%�m�m�o�o���"�$����,�.��(�0�7�7�!/�{�8������
�#�#�K�0�0�0�0��I�;�&�
�/A�
�$�(�/�/��\�J�J�������T�
*�
*�	��
�$�*����'�
-�
-���l�*��(�0�7�7�!/�w�8������
�#�#�G�,�,�,�,�
-���S�
)�
)�	�&�
-�
-���#�#�G�,�,�,�,�
-�!�I��i�i��-�-�I�I�9E�I�I�I���
�
�	� �C���
�
��"$��!��#�	5�	5�G��,�&�
1� �'�'��0�0�0��1�1�
5�'�.�.�w�7�7�7�7�$�+�+�G�4�4�4�4��	R��I�;�.�
�7I�
�'�(�/�/��\�J�J����
�!�!�#�#�#�(8�D�I�n�%�%�%�
$�	R�#�,�3�3�+�\�����
�
"�	R� �!2�!9�!9�'�<�!P�!P�Q�Q�Q�	R�	RrZc��|jS)z#User used while connecting to MySQL)r0rVs rX�userzMySQLConnectionAbstract.userw����z�rZc��|jS)zMySQL server IP address or name)r6rVs rX�server_hostz#MySQLConnectionAbstract.server_host|r�rZc��|jS)zMySQL server TCP/IP port)r7rVs rX�server_portz#MySQLConnectionAbstract.server_port�r�rZc��|jS)zMySQL Unix socket file location)r8rVs rX�unix_socketz#MySQLConnectionAbstract.unix_socket�rurZc��dS)zGet the current databaseNr]rVs rX�databasez MySQLConnectionAbstract.database�����rZc�6�|�d|����dS)zSet the current databasezUSE N)�	cmd_queryrxs  rXr�z MySQLConnectionAbstract.database�s"��	
���~�e�~�~�&�&�&�&�&rZc��|jS)z"Returns whether to consume results)rUrVs rX�can_consume_resultsz+MySQLConnectionAbstract.can_consume_results�s
���$�$rZc�B�t|t��sJ�||_dS)zSet if can consume results.N)r��boolrUrxs  rXr�z+MySQLConnectionAbstract.can_consume_results�s(���%��&�&�&�&�&� %����rZc��|jS)z%Return the pool configuration version�rPrVs rX�pool_config_versionz+MySQLConnectionAbstract.pool_config_version�s
���(�(rZc��||_dS)z"Set the pool configuration versionNr�rxs  rXr�z+MySQLConnectionAbstract.pool_config_version�s��%*��!�!�!rZc�v�|���}d|vrtd���tdGi|��}	|d|_|d=n#t$rYnwxYw	|d|_|d=n#t$rYnwxYw	t
j��}|�|dp|��|d=n#t$rYnwxYw	|dr'd|_	|�tj
g��n#t$rYnwxYw|�dtd��|_
|�d	td	��|_d
}|jr�tj�|j��}|r>tj�|��rtj�|��rtj�|��rt+d���|j
s|jr!|�tjg��n!|�tjg��	|dsd
|_nd|_n#t$r
d
|_YnwxYw	|d|_|d=n#t$r
d|_YnwxYwd|vsd|vr^	|d}|d=n#t$rd
}YnwxYw	|d}|d=n#t$rd
}YnwxYwt3j||��d|_	|�|d��n-#t$rYn!t:$r}t+d��|�d
}~wwxYwgd�}|D](\}	}
	|
|vr||	||
<||	=�#t$rY�%wxYwd|vsd|vr^	|d}|d=n#t$r
|j}YnwxYw	|d}|d=n#t$r
|j}YnwxYw|� ||��d|vr|dr
|d|_!	tE|d��|_#|d=n-#t$rYn!tH$r}tKd��|�d
}~wwxYwd|vr|�&d��|_'d
}
|�(��D]�\}}	t|n"#t$rt+d|�d���d
�wxYw|�)d��r3d}
|j*�+|�,dd��|i���~|�)d��rd}
|j*�+||i����d |z}	t[|||�.������#t*$rt[|||��Y��wxYw|j/rtj0d!krd|_'|j'r|jd"krtKd#���|
�rVd$|j*vrtd%|j*d$<d&|j*vrtd'|j*d&<d(|j*vs
|j*d(�
d|j*d(<tcd)|j*v��tcd*|j*v��krt+d+���ted,��te|j*��ksd
|j*d)<d
|j*d*<n/|j*d)d
u|j*d*d
ukrt+d-���d.|j*vr!|j*d.�|�3��d/|j*vr!|j*d/�|�4��|j5�	i|_5�n tm|j5tn��stKd0���|j5�(��D]�\}}|tpvr�tm|tr��stKd1|�d2|j5�d����tu|��d3krtKd4|�d5����|�)d ��rtKd6���tm|tr��stKd7|�d8|�d9����tu|��d:krtKd7|�d8|�d;������|j;tj<zr|�=��d<|vr�|d<��|d<|_>tm|j>tr��s(tKt~�@d=�>�����|j>dkr(tKt~�@d?�>�����d@|j>vr(tKt~�@dA�>�����|jA�rtm|jAtr��r�	|jA�BdBdC��\}}n'#tH$rt�dD|jA�d���d
�wxYw	t�jE|��}t�||��|_An*#t*t�f$r}t�|���|�d
}~wwxYwt�|jA��st�dE���tut�|jA��jJ��}|dCkrt�dF|�����d
Sd
S)Hz�Configure the MySQL Connection

        This method allows you to configure the MySQLConnection instance.

        Raises on errors.
        �dsnz!Data source name is not supported�get_warnings�raise_on_warnings�client_flags�compressTr%r&Nz.allow_local_infile_in_path must be a directory�consume_resultsF�auth_pluginr"�charset�	collationr�converter_classzEConverter class should be a subclass of conversion.MySQLConverterBase))�dbr�)�usernamer�)�passwd�password)r$�connection_timeout)�read_default_file�option_filesr�r��host�portz'TCP/IP port number should be an integerr#zUnsupported argument 'r��ssl_�tls_�_rl�mysql_clear_passwordzEClear password authentication is not supported over insecure channels�verify_cert�ssl_verify_cert�verify_identity�ssl_verify_identity�ca�key�certz:ssl_key and ssl_cert need to be both specified, or neither)r�r�z4ssl_key and ssl_cert need to be both set, or neitherr�r~zconn_attrs must be of type dictz+Attribute name should be a string, found: 'z' in '� zAttribute name 'z"' exceeds 32 characters limit sizezNKey names in connection attributes cannot start with '_', found: '{attr_name}'zAttribute 'z
' value: 'z' must be a string typeiz$' exceeds 1024 characters limit size�krb_service_principalzis not a string)�errorzcan not be an empty string�/zis incorrectly formatted�.r
zNo callable named 'z'Expected a callable for 'fido_callback'zN'fido_callback' requires 1 positional argument, but the callback provided has r])K�copyrrr��KeyErrorr�rr'�set_client_flagsrT�COMPRESSr�rrJrKrm�path�abspath�exists�isdir�islinkr��LOCAL_FILESrUrOr�get_charset_infor)�set_converter_class�	TypeErrorr0r1�	set_loginr6�intr7�
ValueErrorr�popr<�itemsr�r;r��replace�setattrr�r8rnr�r�r�r�r/r��dictrr��lenr(�CONNECT_ARGS�_add_default_conn_attrsr@�KRB_SERVICE_PINCIPAL_ERRORr�r?�rsplitr�	importlib�
import_module�getattr�ModuleNotFoundError�callabler
�
parameters)rW�kwargs�config�default�infile_in_pathr�r��err�
compat_map�compat�	translater�r��set_ssl_flagr�ry�	attribute�	attr_name�
attr_value�module�callback�paramss                      rXrzMySQLConnectionAbstract.config�s}
���������F�?�	I�#�$G�H�H�H�#�,�,�V�,�,��	� &�~� 6�D���~�&�&���	�	�	��D�	����	�%+�,?�%@�D�"��*�+�+���	�	�	��D�	����	� �,�.�.�G��!�!�&��"8�"C�G�D�D�D��~�&�&���	�	�	��D�	����	��j�!�
=�!%����%�%�z�':�&;�<�<�<����	�	�	��D�	����$*�:�:� �"7�8L�"M�$
�$
�� �,2�:�:�(�!�">�?�,
�,
��(����+�	W��W�_�_�T�-M�N�N�N��
W��G�N�N�>�2�2�
W���
�
�n�5�5�
W��7�>�>�.�1�1�	
W�%�%U�V�V�V��#�	=�t�'G�	=��!�!�:�#9�":�;�;�;�;��!�!�J�$:�#:�";�<�<�<�	*��+�,�
-�(-��%�%�(,��%����	*�	*�	*�$)�D�!�!�!�	*����	#� &�}� 5�D���}�%�%���	#�	#�	#� "�D����	#�������	T�+��"7�	T�
� ��+���9�%�%���
�
�
�����
����
!�"�;�/�	��;�'�'���
!�
!�
!� �	�	�	�
!����+�<�W�i�P�P�QR�S�D��	��$�$�V�,=�%>�?�?�?�?���	�	�	��D��	�	�	� �0����
�����	����
�
�
�
�",�	�	��F�I�
��F�*�7�(.�v��F�9�%��6�N�N���
�
�
���
�����V��	+�z�V�3�	+�
"��f�~���6�N�N���
"�
"�
"��z����
"����
*�!�*�-���:�&�&���
*�
*�
*��>����
*�����N�N�4��*�*�*��V��	(��v��	(����D�J�	U��V�F�^�,�,�D�J��v�����	�	�	��D��	U�	U�	U� �!J�K�K�QT�T�����	U�����V�#�	<�!'���N�!;�!;�D���� �,�,�.�.�	4�	4�J�C��
P�%�c�*�*�*���
P�
P�
P�$�%D�c�%D�%D�%D�E�E�4�O�
P�����~�~�f�%�%�
4�#���	� � �#�+�+�f�b�"9�"9�5�!A�B�B�B�B�����'�'�
4�#���	� � �#�u��.�.�.�.��#�I�	�4��D�)�U�[�[�]�]�;�;�;�;��%�4�4�4��D�)�U�3�3�3�3�3�4������	&���G�!3�	&�!%�D����	�$�"3�7M�"M�	� �W���
��	2��D�I�-�
T�+@�AR�+S��	�-�(� ��	�1�
�/D�)�0��	�+�,��4�9�$�
%��	�$��
%�"$��	�$���E�T�Y�&�'�'�4��$�)�0C�+D�+D�D�
�$�P������'�'�3�t�y�>�>�9�
�#'��	�%� �$(��	�&�!�!��)�E�"�d�*��	�&�0A�T�0I�J�
�$�J�������*�
.�t�y��/H�
.��+�+�-�-�-�#�d�i�/�
2��I�0�1�
2��/�/�1�1�1���$	�!�D����D�,�d�3�3�"	� �!B�C�C�C�)-�)9�)?�)?�)A�)A�
�
�%�	�:��
�-���!�)�S�1�1��(�A�%�A�A�-1�-=�A�A�A����
�y�>�>�B�&��(�X�9�X�X�X�����'�'��,�,��(�4����
"�*�c�2�2��(�+�i�+�+�:�+�+�+����
�z�?�?�T�)��(�=�i�=�=�:�=�=�=�������
� 7�7�	+��(�(�*�*�*�#�v�-�	��.�/�	�+1�1H�*I�D�'��d�9�3�?�?�
�$�.�5�5�<M�5�N�N�����*�b�0�
�$�.�5�5�:�6������
�$�5�5�
�$�.�5�5�<V�5�W�W������	��$�-�s�3�3�
>� �'+�':�'A�'A�#�q�'I�'I�$�F�H�H��!� � � �*�D�d�.A�D�D�D���� � ����>�&�4�V�<�<�F�*1�&�(�*C�*C�D�'�'��&�(;�<�>�>�>�*�c�8�4�4�#�=�����>�����D�/�0�0�
R�&�'P�Q�Q�Q���4�#6�7�7�B�C�C�F���{�
�&�6�-3�6�6����)	�	�&
�
sC�A�
A�A�A(�(
A5�4A5�93B-�-
B:�9B:�>/C.�.
C;�:C;�6I�I"�!I"�&I7�7J�
J�J#�#J2�1J2�6K�K�K�5L�
L;�	L;�&L6�6L;�
M�
M*�)M*�6N�N�N�N&�&N:�9N:�-P�
P5�	P5� P0�0P5�2
R�R�$#U�U&�%U&�;e�$e>�)f,�,g�=g�gc��dS)z&Add the default connection attributes.Nr]rVs rXrz/MySQLConnectionAbstract._add_default_conn_attrs�r�rZc�r�t|ttf��r|���}t	jd��}|�|��}|std���td�|�	��dd�D����}|dkrtd|�d����|S)	a7Check the MySQL version

        This method will check the MySQL version and raise an InterfaceError
        when it is not supported or invalid. It will return the version
        as a tuple with major, minor and patch.

        Raises InterfaceError if invalid server version.

        Returns tuple
        z$^(\d{1,2})\.(\d{1,2})\.(\d{1,3})(.*)zFailed parsing MySQL versionc3�4K�|]}t|��V��dSr\)r�)r��vs  rX�	<genexpr>z@MySQLConnectionAbstract._check_server_version.<locals>.<genexpr>�s(����<�<�1��A���<�<�<�<�<�<rZr�)�r
zMySQL Version 'z' is not supported)
r��	bytearray�bytes�decode�re�compile�matchr�tuple�groups)�server_version�	regex_verr)�versions    rX�_check_server_versionz-MySQLConnectionAbstract._check_server_version�s����n�y�%�&8�9�9�	5�+�2�2�4�4�N��J�F�G�G�	�����/�/���	A� �!?�@�@�@��<�<������q��s�(;�<�<�<�<�<���V��	W� �!U�>�!U�!U�!U�V�V�V��rZc��|jS)z�Get the MySQL version

        This method returns the MySQL server version as a tuple. If not
        previously connected, it will return None.

        Returns a tuple or None.
        )r-rVs rX�get_server_versionz*MySQLConnectionAbstract.get_server_version�s
���#�#rZc�N�	|jdS#ttf$rYdSwxYw)z�Get the original MySQL version information

        This method returns the original MySQL server as text. If not
        previously connected, it will return None.

        Returns a string or None.
        �server_version_originalN)r.r�r�rVs rX�get_server_infoz'MySQLConnectionAbstract.get_server_info�s<��	��?�#<�=�=���8�$�	�	�	��4�4�	���s��$�$c��dS)z'MySQL session has started a transactionNr]rVs rX�in_transactionz&MySQLConnectionAbstract.in_transactionr�rZc�"�t|t��r|dkr||_nft|ttf��r;|D]7}|dkr|xjt|��zc_�'|xj|zc_�8nt
d���|jS)aSet the client flags

        The flags-argument can be either an int or a list (or tuple) of
        ClientFlag-values. If it is an integer, it will set client_flags
        to flags as is.
        If flags is a list (or tuple), each flag will be set or unset
        when it's negative.

        set_client_flags([ClientFlag.FOUND_ROWS,-ClientFlag.LONG_FLAG])

        Raises ProgrammingError when the flags argument is not a set or
        an integer bigger than 0.

        Returns self.client_flags
        rz+set_client_flags expect integer (>0) or set)r�r�r(r*r��absr)rW�flags�flags   rXr�z(MySQLConnectionAbstract.set_client_flagss��� �e�S�!�!�		R�e�a�i�		R�!&�D���
���t�}�
-�
-�	R��
/�
/���!�8�/��&�&�3�t�9�9�*�4�&�&�&��&�&�$�.�&�&�&�	
/�#�#P�Q�Q�Q��!�!rZc�&�|j|zdkrdSdS)zCheck if a client flag is setrTF)r()rWr:s  rX�isset_client_flagz)MySQLConnectionAbstract.isset_client_flag's!�����%��*�	��4��urZc�8�|�d��dS)zGet the current time zonezSELECT @@session.time_zoner��
info_queryrVs rX�	time_zonez!MySQLConnectionAbstract.time_zone-s�����;�<�<�Q�?�?rZc�F�|�d|�d���||_dS)zSet the time zonezSET @@session.time_zone = 'r�N)r�r+rxs  rXr@z!MySQLConnectionAbstract.time_zone2s-��	
���=�U�=�=�=�>�>�>�����rZc�8�|�d��dS)zGet the SQL modezSELECT @@session.sql_moderr>rVs rX�sql_modez MySQLConnectionAbstract.sql_mode8s�����:�;�;�A�>�>rZc��t|ttf��rd�|��}|�d|�d���||_dS)a�Set the SQL mode

        This method sets the SQL Mode for the current connection. The value
        argument can be either a string with comma separate mode names, or
        a sequence of mode names.

        It is good practice to use the constants class SQLMode:
          from mysql.connector.constants import SQLMode
          cnx.sql_mode = [SQLMode.NO_ZERO_DATE, SQLMode.REAL_AS_FLOAT]
        r�zSET @@session.sql_mode = 'r�N)r�r�r*r�r�r*rxs  rXrCz MySQLConnectionAbstract.sql_mode=sR���e�d�E�]�+�+�	$��H�H�U�O�O�E����<�E�<�<�<�=�=�=�����rZc��dS)z%Send a query which only returns 1 rowNr]�rW�querys  rXr?z"MySQLConnectionAbstract.info_queryNr�rZNc�p�|�|���|_nd|_|�	||_dSd|_dS)z�Set login information for MySQL

        Set the username and/or password for the user connecting to
        the MySQL Server.
        Nr")r�r0r1)rWr�r�s   rXr�z!MySQLConnectionAbstract.set_loginRsD���	�!���)�)�D�J�J��D�J��	 �%�D�N�N�N��D�N�N�NrZTc�Z�||_|jr|j�|��dSdS)zuToggle unicode mode

        Set whether we return string fields as unicode or not.
        Default is True.
        N)rArQ�set_unicoderxs  rXrJz#MySQLConnectionAbstract.set_unicodeas<��"����>�	.��N�&�&�u�-�-�-�-�-�	.�	.rZc�D�|�d��d}|dkS)z#Get whether autocommit is on or offzSELECT @@session.autocommitrr
r>rxs  rX�
autocommitz"MySQLConnectionAbstract.autocommitks%����� =�>�>�q�A����z�rZc�P�|rdnd}|�d|����||_dS)zToggle autocommit�ON�OFFzSET @@session.autocommit = N)r�r,)rWry�switchs   rXrLz"MySQLConnectionAbstract.autocommitqs;���)���E�����=�V�=�=�>�>�>� ����rZc��|jS)z�Get whether this connection retrieves warnings automatically

        This method returns whether this connection retrieves warnings
        automatically.

        Returns True, or False when warnings are not retrieved.
        )rBrVs rXr�z$MySQLConnectionAbstract.get_warningsxs
���!�!rZc�\�t|t��std���||_dS)z�Set whether warnings should be automatically retrieved

        The toggle-argument must be a boolean. When True, cursors for this
        connection will retrieve information about warnings (if any).

        Raises ValueError on error.
        �Expected a boolean typeN)r�r�r�rBrxs  rXr�z$MySQLConnectionAbstract.get_warnings�s3���%��&�&�	8��6�7�7�7�"����rZc��|jS)z�Get whether this connection raises an error on warnings

        This method returns whether this connection will raise errors when
        MySQL reports warnings.

        Returns True or False.
        )rCrVs rXr�z)MySQLConnectionAbstract.raise_on_warnings�s
���&�&rZc�j�t|t��std���||_||_dS)a�Set whether warnings raise an error

        The toggle-argument must be a boolean. When True, cursors for this
        connection will raise an error when MySQL reports warnings.

        Raising on warnings implies retrieving warnings automatically. In
        other words: warnings will be set to True. If set to False, warnings
        will be also set to False.

        Raises ValueError on error.
        rSN)r�r�r�rCrBrxs  rXr�z)MySQLConnectionAbstract.raise_on_warnings�s;���%��&�&�	8��6�7�7�7�"'���"����rZc��|jS)z�Get whether there is an unread result

        This method is used by cursors to check whether another cursor still
        needs to retrieve its result set.

        Returns True, or False when there is no unread result.
        )rFrVs rX�
unread_resultz%MySQLConnectionAbstract.unread_result��
���"�"rZc�\�t|t��std���||_dS)z�Set whether there is an unread result

        This method is used by cursors to let other cursors know there is
        still a result set that needs to be retrieved.

        Raises ValueError on errors.
        rSN)r�r�r�rFrxs  rXrWz%MySQLConnectionAbstract.unread_result�s3���%��&�&�	8��6�7�7�7�#����rZc�@�tj|j��dS)a+Returns the character set for current connection

        This property returns the character set name of the current connection.
        The server is queried when the connection is active. If not connected,
        the configured character set name is returned.

        Returns a string.
        r�r�get_infor)rVs rXr�zMySQLConnectionAbstract.charset�s���$�T�%5�6�6�q�9�9rZc�P�tj|j��d}|dvrdS|S)ayReturns the Python character set for current connection

        This property returns the character set name of the current connection.
        Note that, unlike property charset, this checks if the previously set
        character set is supported by Python and if not, it returns the
        equivalent character set that Python supports.

        Returns a string.
        r)�utf8mb4�utf8mb3�binary�utf8r[)rW�encodings  rX�python_charsetz&MySQLConnectionAbstract.python_charset�s4�� �(��)9�:�:�1�=���7�7�	��6��rZc�R�d}t|ttf��s$|�"t|�d�����t|t��s|�td���|r�t|t��rtj|��\|_}}n�t|t��rtj||��\|_}}not|�d�����|rtj|���\|_}}n,td}tj|d���\|_}}|�	d|�d|�d���	|�
|��n#t$rYnwxYw|jr|j�
|��dSdS)	aVSets the character set and collation for the current connection

        This method sets the character set and collation to be used for
        the current connection. The charset argument can be either the
        name of a character set as a string, or the numerical equivalent
        as defined in constants.CharacterSet.

        When the collation is not given, the default will be looked up and
        used.

        For example, the following will set the collation for the latin1
        character set to latin1_general_ci:

           set_charset('latin1','latin1_general_ci')

        z+{} should be either integer, string or NoneNr�z)collation should be either string or None)r�zSET NAMES 'z' COLLATE 'r�)r�r�r�r�r�rr�r)r�_execute_query�set_character_set_namer�rQ�set_charset)rWr�r��err_msg�charset_name�collation_names      rX�set_charset_collationz-MySQLConnectionAbstract.set_charset_collation�s���"@���'�C��:�.�.�	8�7�	8��W�^�^�I�6�6�7�7�7��)�S�)�)�	J�i�	J��H�I�I�I��	G��'�3�'�'�

<�
!�1�'�:�:�	��$� �"�N��G�S�)�)�
<�
!�1�'�9�E�E�	��$� �"�N�!����	�!:�!:�;�;�;�
�	G�
�-�	�B�B�B�	
�� ����,�I�6�G�
�-�g��F�F�F�	
�� ���	
���T�,�T�T�>�T�T�T�U�U�U�	��'�'��5�5�5�5���	�	�	��D�	�����>�	5��N�&�&�|�4�4�4�4�4�	5�	5s�E4�4
F�Fc�@�tj|j��dS)aReturns the collation for current connection

        This property returns the collation name of the current connection.
        The server is queried when the connection is active. If not connected,
        the configured collation name is returned.

        Returns a string.
        �)rr�r)rVs rXr�z!MySQLConnectionAbstract.collation!s���,�T�-=�>�>�q�A�ArZc��dS)z<Gather information of the MySQL server before authenticationNr]rVs rX�
_do_handshakez%MySQLConnectionAbstract._do_handshake-r�rZc��dS)z'Open the connection to the MySQL serverNr]rVs rX�_open_connectionz(MySQLConnectionAbstract._open_connection1r�rZc��|�|j��|j|_|jr|j|_|jr|j|_dSdS)z�Executes commands after connection has been established

        This method executes commands after the connection has been
        established. Some setting like autocommit, character set, and SQL mode
        are set using this method.
        N)rkr)r,rLr+r@r*rCrVs rX�_post_connectionz(MySQLConnectionAbstract._post_connection5sY��	
�"�"�4�#3�4�4�4��*����?�	-�!�_�D�N��>�	+� �N�D�M�M�M�	+�	+rZc��dS)z Disconnect from the MySQL serverNr]rVs rX�
disconnectz"MySQLConnectionAbstract.disconnectCr�rZc���|r
|jdi|��|���|���|jtjzs|���dSdS)z�Connect to the MySQL server

        This method sets up the connection to the MySQL server. If no
        arguments are given, it will use the already configured or default
        values.
        Nr])rrurqr(r�CAN_HANDLE_EXPIRED_PASSWORDSrs)rWrs  rX�connectzMySQLConnectionAbstract.connectIs}���	"��D�K�!�!�&�!�!�!��������������!�J�$K�K�	$��!�!�#�#�#�#�#�	$�	$rZr
rc�R�d}||kr�|dz}	|���|���|���rdSn<#ttf$r(}||krd|�d|��}t|��|�Yd}~nd}~wwxYw|dkrt
|��||k��dSdS)a�Attempt to reconnect to the MySQL server

        The argument attempts should be the number of times a reconnect
        is tried. The delay argument is the number of seconds to wait between
        each retry.

        You may want to set the number of attempts higher and use delay when
        you expect the MySQL server to be down for maintenance or when you
        expect the network to be temporary unavailable.

        Raises InterfaceError on errors.
        rr
z!Can not reconnect to MySQL after z
 attempt(s): N)rurx�is_connectedr�IOErrorrr)rW�attempts�delay�counterr�msgs      rX�	reconnectz!MySQLConnectionAbstract.reconnectZs������!�	���k�G�
7����!�!�!��������$�$�&�&���E����7�#�
7�
7�
7��h�&�7�-�H�-�-�'*�-�-��)��-�-�3�6�7�7�7�7�7�����
7�����q�y�
��e������!�	�	�	�	�	s�<A�B�B�Bc��dS)z;Reports whether the connection to MySQL Server is availableNr]rVs rXrzz$MySQLConnectionAbstract.is_connectedyr�rZFc��dS)z&Check availability of the MySQL serverNr])rWr�r|r}s    rX�pingzMySQLConnectionAbstract.ping}r�rZc��dS)zCommit current transactionNr]rVs rX�commitzMySQLConnectionAbstract.commit�r�rZc��dS)z!Instantiates and returns a cursorNr])rW�buffered�raw�prepared�cursor_class�
dictionary�named_tuples       rX�cursorzMySQLConnectionAbstract.cursor�r�rZc��dS)zExecute a queryNr]rFs  rXrez&MySQLConnectionAbstract._execute_query�r�rZc��dS)zRollback current transactionNr]rVs rX�rollbackz MySQLConnectionAbstract.rollback�r�rZc���|jrtd���|rm|����dd�����}gd�}||vrtd|�d����|�d|����|�B|jd	krtd
|j�d����|rd}nd
}|�d|����d}|r|dz
}|�|��dS)a�Start a transaction

        This method explicitly starts a transaction sending the
        START TRANSACTION statement to the MySQL server. You can optionally
        set whether there should be a consistent snapshot, which
        isolation level you need or which access mode i.e. READ ONLY or
        READ WRITE.

        For example, to start a transaction with isolation level SERIALIZABLE,
        you would do the following:
            >>> cnx = mysql.connector.connect(..)
            >>> cnx.start_transaction(isolation_level='SERIALIZABLE')

        Raises ProgrammingError when a transaction is already in progress
        and when ValueError when isolation_level specifies an Unknown
        level.
        zTransaction already in progressr�� )zREAD UNCOMMITTEDzREAD COMMITTEDzREPEATABLE READ�SERIALIZABLEzUnknown isolation level "�"z SET TRANSACTION ISOLATION LEVEL N)��r�zMySQL server version z does not support this featurez	READ ONLYz
READ WRITEzSET TRANSACTION zSTART TRANSACTIONz WITH CONSISTENT SNAPSHOT)	r6rr�rr�r�rer-r�)rW�consistent_snapshot�isolation_level�readonly�level�levels�access_moderGs        rX�start_transactionz)MySQLConnectionAbstract.start_transaction�sT��(��	F�"�#D�E�E�E��	L�#�)�)�+�+�3�3�C��=�=�C�C�E�E�E����F��F�"�
Q� �!O�_�!O�!O�!O�P�P�P���� J�5� J� J�K�K�K��	B��#�i�/�
� �+�D�,@�+�+�+����
�
+�)���*����� @�;� @� @�A�A�A�#���	1��0�0�E����u�����rZc�d�|���std���	|���nZ#ttf$rF|jrtd��d�|�|j|j|j	|j
��YnwxYw|s|r�|���}|r5|���D] \}}|�
d|�d|�����!|r5|���D] \}}|�
d|�d|�����!|���dSdS)a�Clears the current active session

        This method resets the session state, if the MySQL server is 5.7.3
        or later active session will be reset without re-authenticating.
        For other server versions session will be reset by re-authenticating.

        It is possible to provide a sequence of variables and their values to
        be set after clearing the session. This is possible for both user
        defined variables and session variables.
        This method takes two arguments user_variables and session_variables
        which are dictionaries.

        Raises OperationalError if not connected, InternalError if there are
        unread results and InterfaceError on errors.
        zMySQL Connection not availablezYReset session is not supported with compression for MySQL server version 5.7.2 or earlierNzSET @`z` = z
SET SESSION `)rzr�cmd_reset_connectionr�NotImplementedErrorrT�cmd_change_userr0r1r5r)r�r��executerb)rW�user_variables�session_variables�curr�rys      rX�
reset_sessionz%MySQLConnectionAbstract.reset_session�s��� � � �"�"�	E�"�#C�D�D�D�
	��%�%�'�'�'�'��!�#6�7�	�	�	��~�
�'�<�����
� � ��
������ �	
�
�
�
�
�
	�����	�.�	��+�+�-�-�C��
;�"0�"6�"6�"8�"8�;�;�J�C���K�K� 9�� 9� 9�%� 9� 9�:�:�:�:� �
B�"3�"9�"9�";�";�B�B�J�C���K�K� @�� @� @�� @� @�A�A�A�A��I�I�K�K�K�K�K�	�	s�:�AB�Bc���|rdt|t��rOtj|j��d}||_|||j��|_|j|j_	dStd���)z�
        Set the converter class to be used. This should be a class overloading
        methods and members of conversion.MySQLConverter.
        rzFConverter class should be a subclass of conversion.MySQLConverterBase.N)�
issubclassrrr\r)rRrArQrS�str_fallbackr�)rW�	convclassris   rXr�z+MySQLConnectionAbstract.set_converter_class�s|��
�	��I�/A�B�B�	�'�0��1A�B�B�1�E�L�$-�D�!�&�Y�|�T�5F�G�G�D�N�*.�*F�D�N�'�'�'��X���
rZc��dS)z)Get all rows returned by the MySQL serverNr])rW�countr`�columnsr��	prep_stmts      rX�get_rowsz MySQLConnectionAbstract.get_rowsr�rZc��t�)zChange the current database�r�)rWr�s  rX�cmd_init_dbz#MySQLConnectionAbstract.cmd_init_db���!�!rZc��t�)z Send a query to the MySQL serverr�)rWrGr�r��
raw_as_strings     rXr�z!MySQLConnectionAbstract.cmd_queryr�rZc��t�)z/Send one or more statements to the MySQL serverr�)rW�
statementss  rX�cmd_query_iterz&MySQLConnectionAbstract.cmd_query_iterr�rZc��t�)z,Send the Refresh command to the MySQL serverr�)rW�optionss  rX�cmd_refreshz#MySQLConnectionAbstract.cmd_refreshr�rZc��t�)z,Close the current connection with the serverr�rVs rX�cmd_quitz MySQLConnectionAbstract.cmd_quit!r�rZc��t�)zShut down the MySQL Serverr�)rW�
shutdown_types  rX�cmd_shutdownz$MySQLConnectionAbstract.cmd_shutdown%r�rZc��t�)z/Send the statistics command to the MySQL Serverr�rVs rX�cmd_statisticsz&MySQLConnectionAbstract.cmd_statistics)r�rZc� �td���)akGet the process list of the MySQL Server

        This method is a placeholder to notify that the PROCESS_INFO command
        is not supported by raising the NotSupportedError. The command
        "SHOW PROCESSLIST" should be send using the cmd_query()-method or
        using the INFORMATION_SCHEMA database.

        Raises NotSupportedError exception
        z;Not implemented. Use SHOW PROCESSLIST or INFORMATION_SCHEMA)rr]rZrX�cmd_process_infoz(MySQLConnectionAbstract.cmd_process_info-s�� �I�
�
�	
rZc��t�)zKill a MySQL processr�)rW�	mysql_pids  rX�cmd_process_killz(MySQLConnectionAbstract.cmd_process_kill<r�rZc��t�)zSend the DEBUG commandr�rVs rX�	cmd_debugz!MySQLConnectionAbstract.cmd_debug@r�rZc��t�)zSend the PING commandr�rVs rX�cmd_pingz MySQLConnectionAbstract.cmd_pingDr�rZr"r!c	��t�)z!Change the current logged in userr�)	rWr�r�r�r��	password1�	password2�	password3�oci_config_files	         rXr�z'MySQLConnectionAbstract.cmd_change_userHs
��"�!rZc��t�)zPrepare a MySQL statementr�)rW�	statements  rX�cmd_stmt_preparez(MySQLConnectionAbstract.cmd_stmt_prepareVr�rZr]c��t�)z"Execute a prepared MySQL statementr�)rW�statement_id�datar
r9s     rX�cmd_stmt_executez(MySQLConnectionAbstract.cmd_stmt_executeZr�rZc��t�)z%Deallocate a prepared MySQL statementr��rWr�s  rX�cmd_stmt_closez&MySQLConnectionAbstract.cmd_stmt_close^r�rZc��t�)zSend data for a columnr�)rWr��param_idr�s    rX�cmd_stmt_send_long_dataz/MySQLConnectionAbstract.cmd_stmt_send_long_databr�rZc��t�)z3Reset data for prepared statement sent as long datar�r�s  rX�cmd_stmt_resetz&MySQLConnectionAbstract.cmd_stmt_resetfr�rZc��t�)z2Resets the session state without re-authenticatingr�rVs rXr�z,MySQLConnectionAbstract.cmd_reset_connectionjr�rZ)NN�T)r
r)Fr
r)NNNNNN)FNN)NFNNN)FFFr\)r"r"r"r!r"r"r"r")r]r]r)R�__name__�
__module__�__qualname__�__doc__rYr^rgrj�propertyrorqrtrzr|r�r�r�r�r�r�rr��setterr�r�rr�staticmethodr/r1r4r6r�r<r@rCr?r�rJrLr�r�rWr�rcrkr�rorqrsrurbrxr�rzr�r�r�rer�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r]rZrXrrps�������A�A�6&�6&�6&�p����������
�
��X�
��&�&��X�&��!�!��X�!�(�(�(�!�!�!�Q9�Q9�Q9�fPR�PR�PR�d����X������X������X���!�!��X�!���'�'��^��X�'��_�'�'��_�'��%�%��X�%���&�&� ��&�
�)�)��X�)���*�*� ��*�f�f�f�P	5�5�5�����\��2$�$�$������6�6��^��X�6�"�"�"�8����@�@��X�@��� � ��� �
�?�?��X�?��_����_�� �4�4��^�4�
 �
 �
 �
 �.�.�.�.�����X��
��!�!���!��"�"��X�"���
#�
#���
#��'�'��X�'���#�#���#�"�#�#��X�#���
$�
$���
$��	:�	:��X�	:��
�
��X�
�>5�>5�>5�>5�@�	B�	B��X�	B��K�K��^�K��6�6��^�6�+�+�+��/�/��^�/�
�E�$�$�$�"����>�J�J��^�J��5�5�5��^�5��)�)��^�)��������	0�	0�	0��^�	0�����^���+�+��^�+�IM�5�5�5�5�n*�*�*�*�X
�
�
��JN�8�8�8��^�8�
"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"��
�
��\�
�"�"�"�"�"�"�"�"�"���������"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"rZrc��eZdZdZd�Zd�Zd�Zedd���Zed���Z	edd	���Z
ed
���Zed���Zed d
���Z
ed���Zd�Zd�Zd!d�Zd"d�Zeed�����Zeed�����Zed���Zed���Zed���Zd�Zd�Zd�Zd�ZdS)#�MySQLCursorAbstractz�Abstract cursor class

    Abstract class defining cursor class with method and members
    required by the Python Database API Specification v2.0.
    c��d|_d|_d|_d|_d|_d|_g|_g|_d|_dS)�InitializationNr�rr
)	�_description�	_rowcount�_last_insert_id�	_warnings�_warning_count�	_executed�_executed_list�_stored_results�	arraysizerVs rXrYzMySQLCursorAbstract.__init__vsJ�� ������#������������ ���!�������rZc��|Sr\r]rVs rXr^zMySQLCursorAbstract.__enter__�r_rZc�.�|���dSr\rarcs    rXrgzMySQLCursorAbstract.__exit__�rhrZr]c��dS)aCalls a stored procedure with the given arguments

        The arguments will be set during this session, meaning
        they will be called like  _<procname>__arg<nr> where
        <nr> is an enumeration (+1) of the arguments.

        Coding Example:
          1) Defining the Stored Routine in MySQL:
          CREATE PROCEDURE multiply(IN pFac1 INT, IN pFac2 INT, OUT pProd INT)
          BEGIN
            SET pProd := pFac1 * pFac2;
          END

          2) Executing in Python:
          args = (5,5,0) # 0 is to hold pprod
          cursor.callproc('multiply', args)
          print(cursor.fetchone())

        Does not return a value, but a result set will be
        available when the CALL-statement execute successfully.
        Raises exceptions when something is wrong.
        Nr])rW�procname�argss   rX�callproczMySQLCursorAbstract.callproc�r�rZc��dS)zClose the cursor.Nr]rVs rXrbzMySQLCursorAbstract.close�r�rZFc��dS)a�Executes the given operation

        Executes the given operation substituting any markers with
        the given parameters.

        For example, getting all rows where id is 5:
          cursor.execute("SELECT * FROM t1 WHERE id = %s", (5,))

        The multi argument should be set to True when executing multiple
        statements in one operation. If not set and multiple results are
        found, an InterfaceError will be raised.

        If warnings where generated, and connection.get_warnings is True, then
        self._warnings will be a list containing these warnings.

        Returns an iterator when multi is True, otherwise None.
        Nr])rW�	operationr�multis    rXr�zMySQLCursorAbstract.execute�r�rZc��dS)a�Execute the given operation multiple times

        The executemany() method will execute the operation iterating
        over the list of parameters in seq_params.

        Example: Inserting 3 new employees and their phone number

        data = [
            ('Jane','555-001'),
            ('Joe', '555-001'),
            ('John', '555-003')
            ]
        stmt = "INSERT INTO employees (name, phone) VALUES ('%s','%s')"
        cursor.executemany(stmt, data)

        INSERT statements are optimized by batching the data, that is
        using the MySQL multiple rows syntax.

        Results are discarded. If they are needed, consider looping over
        data using the execute() method.
        Nr])rWr��
seq_paramss   rX�executemanyzMySQLCursorAbstract.executemany�r�rZc��dS)zQReturns next row of a query result set

        Returns a tuple or None.
        Nr]rVs rX�fetchonezMySQLCursorAbstract.fetchone�r�rZr
c��dS)aReturns the next set of rows of a query result, returning a
        list of tuples. When no more rows are available, it returns an
        empty list.

        The number of rows returned can be specified using the size argument,
        which defaults to one
        Nr])rW�sizes  rX�	fetchmanyzMySQLCursorAbstract.fetchmany�r�rZc��dS)zRReturns all rows of a query result set

        Returns a list of tuples.
        Nr]rVs rX�fetchallzMySQLCursorAbstract.fetchall�r�rZc��dS�zNot Implemented.Nr]rVs rX�nextsetzMySQLCursorAbstract.nextset�r�rZc��dSrr])rW�sizess  rX�
setinputsizesz!MySQLCursorAbstract.setinputsizes�r�rZNc��dSrr])rWr�columns   rX�
setoutputsizez!MySQLCursorAbstract.setoutputsize�r�rZTc��dS)zReset the cursor to defaultNr])rW�frees  rX�resetzMySQLCursorAbstract.reset�r�rZc��|jS)a�Returns description of columns in a result

        This property returns a list of tuples describing the columns in
        in a result set. A tuple is described as follows::

                (column_name,
                 type,
                 None,
                 None,
                 None,
                 None,
                 null_ok,
                 column_flags)  # Addition to PEP-249 specs

        Returns a list of tuples.
        )r�rVs rX�descriptionzMySQLCursorAbstract.description�s
��&� � rZc��|jS)aReturns the number of rows produced or affected

        This property returns the number of rows produced by queries
        such as a SELECT, or affected rows when executing DML statements
        like INSERT or UPDATE.

        Note that for non-buffered cursors it is impossible to know the
        number of rows produced before having fetched them all. For those,
        the number of rows will be -1 right after execution, and
        incremented when fetching rows.

        Returns an integer.
        )r�rVs rX�rowcountzMySQLCursorAbstract.rowcount
s�� �~�rZc��|jS)aReturns the value generated for an AUTO_INCREMENT column

        Returns the value generated for an AUTO_INCREMENT column by
        the previous INSERT or UPDATE statement or None when there is
        no such value available.

        Returns a long value or None.
        )r�rVs rX�	lastrowidzMySQLCursorAbstract.lastrowids
���#�#rZc��|jS)zReturn warnings.�r�rVs rX�warningszMySQLCursorAbstract.warnings(s���~�rZc��|jS)z�Returns the number of warnings

        This property returns the number of warnings generated by the
        previously executed operation.

        Returns an integer value.
        )r�rVs rX�
warning_countz!MySQLCursorAbstract.warning_count-rXrZc��|jS)zReturns Warnings.rrVs rX�
fetchwarningsz!MySQLCursorAbstract.fetchwarnings8s
���~�rZc�v�t|d��r|jjSt|d��r|jjSdS)z&Get the added query attributes so far.�_cnx�_connectionN)�hasattrr$rtr%rVs rX�get_attributesz"MySQLCursorAbstract.get_attributes<sB���4�� � �	)��9�(�(��4��'�'�	0��#�/�/��trZc�Z�t|t��std���|�(t|t��std|�d����t	|d��r|j�||f��dSt	|d��r|j�||f��dSdS)z$Add a query attribute and his value.z&Parameter `name` must be a string typeNzObject z$ cannot be converted to a MySQL typer$r%)r�r�r�MYSQL_PY_TYPESr&r$rzr%)rWrnrys   rX�
add_attributez!MySQLCursorAbstract.add_attributeDs����$��$�$�	M�"�#K�L�L�L��	�Z��~�%F�%F�	�"�E�%�E�E�E���
��4�� � �	?��I�(�(�$���7�7�7�7�7�
�T�=�
)�
)�	?���/�/��u�
�>�>�>�>�>�	?�	?rZc��t|d��r|j���dSt|d��r|j���dSdS)z Remove all the query attributes.r$r%N)r&r$r|r%rVs rX�clear_attributesz$MySQLCursorAbstract.clear_attributesQse���4�� � �	1��I�'�'�)�)�)�)�)�
�T�=�
)�
)�	1���.�.�0�0�0�0�0�	1�	1rZ)r])r]F)r
r\r�)r�r�r�r�rYr^rgrr�rbr�rrrr	rrrrr�rrrrr r"r'r*r,r]rZrXr�r�os4��������
�
�
������������^��0� � ��^� ������^��&����^��.����^�������^������^������������*�*�*�*���!�!��^��X�!�&�����^��X�� �	$�	$��X�	$�����X���#�#��X�#�������?�?�?�1�1�1�1�1rZr�)7r�rrmr'�weakref�abcrrrrrr�decimalr	�inspectr
rr��sslr&r�ImportError�	constantsrrrrrrrr�
conversionr�errorsrrrrr�optionfilesr�WeakValueDictionary�NAMED_TUPLE_CACHEr�r�r�r�rr%�floatr�r�r)rr�r]rZrX�<module>r:s���:2�1�����	�	�	�	�	�	�	�	�����#�#�#�#�#�#�#�#�4�4�4�4�4�4�4�4�4�4�4�4���������������������	��J�J�J��w�s�M�"�"�"�s��"�!�����	�	�	��D�	����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�+�*�*�*�*�*���������������+�*�*�*�*�*�/�G�/�1�1����2��O��
P��
:���	���	����
�
��|"�|"�|"�|"�|"�c�|"�|"�|"�~'g1�g1�g1�g1�g1�#�g1�g1�g1�g1�g1s�A�A�A