
    *how                   t   S r SSKJr  / SQrSSKrSSKrSSKrSSKrSSKJ	r	J
r
  SSKJrJr  SSKJr  SSKJr  SS	KJrJrJrJrJrJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&  S
SK'J(r(  S
SK)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1  S
SK2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;  S
SK<J=r=J>r>  S
SK?J@r@JArAJBrBJCrCJDrD  S
SKEJFrFJGrG  S
SKJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQJRrRJSrS  S
SKTJUrUJVrV  SSKWJXrX  SSKYJZrZJYrY  SSK[J\r\  \(       a  SSK]J^r^J_r_  \R                  S:H  ra\ " S S5      5       rb " S S\	5      rc " S S\	5      rd " S S \U5      reg)!z+Module gathering all abstract base classes.    )annotations)MySQLConnectionAbstractMySQLCursorAbstract
ServerInfoN)ABCabstractmethod)	dataclassfield)	signature)TracebackType)TYPE_CHECKINGAnyAsyncGenerator	AwaitableBinaryIOCallableClassVarDequeDict	GeneratorIteratorListMappingNoReturnOptionalSequenceTupleTypeUnioncast   )
deprecated)DUPLICATED_IN_LIST_ERRORKRB_SERVICE_PRINCIPAL_ERRORMYSQL_PY_TYPESOPENID_TOKEN_FILE_ERRORTLS_V1_3_SUPPORTEDTLS_VER_NO_SUPPORTEDTLS_VERSION_ERRORTLS_VERSION_UNACCEPTABLE_ERROR)	CONN_ATTRS_DNDEFAULT_CONFIGURATIONDEPRECATED_METHOD_WARNINGMYSQL_DEFAULT_CHARSET_ID_57MYSQL_DEFAULT_CHARSET_ID_80OPENSSL_CS_NAMESTLS_CIPHER_SUITESTLS_VERSIONS
ClientFlag)MySQLConverterMySQLConverterBase)ErrorInterfaceErrorInternalErrorNotSupportedErrorProgrammingError)UNACCEPTABLE_TLS_CIPHERSUITESUNACCEPTABLE_TLS_VERSIONS)BinaryProtocolTypeDescriptionTypeEofPacketTypeHandShakeTypeMySQLScriptPartitionOkPacketTypeParamsSequenceType
ResultTypeRowTypeStatsPacketType
StrOrBytesWarningType)GenericWrapperimport_object   )MySQLAuthenticator)Charsetcharsets)MySQLProtocol)MySQLTcpSocketMySQLUnixSocketposixc                      \ rS rSr% SrS\S'   S\S'   \" SS9rS	\S
'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   SrS\S'   SS jr	Sr
g)r      zStores the server information retrieved on the handshake.

Also parses and validates the server version, storing it as a tuple.
intprotocolstrversionF)initzTuple[int, ...]version_tuple	thread_idcharsetstatus_flagsauth_pluginbytes	auth_datacapabilitiesboolquery_attrs_is_supportedc                   [         R                  " S5      nUR                  U R                  5      nU(       d  [	        S5      e[        S UR                  5       SS  5       5      nUS:  a  [	        SU R                   S35      eX0l        g	)
ztParse and validate server version.

Raises:
    InterfaceError: If parsing fails or MySQL version is not supported.
z$^(\d{1,2})\.(\d{1,2})\.(\d{1,3})(.*)zFailed parsing MySQL versionc              3  8   #    U  H  n[        U5      v   M     g 7fN)rU   ).0vs     U/var/www/auris/envauris/lib/python3.13/site-packages/mysql/connector/aio/abstracts.py	<genexpr>+ServerInfo.__post_init__.<locals>.<genexpr>   s     <(;1A(;s   r      )   rK   zMySQL Version 'z' is not supportedN)recompilematchrX   r7   tuplegroupsrZ   )self
version_rerp   rX   s       ri   __post_init__ServerInfo.__post_init__   sz     ZZ GH
  . !?@@<q(;<<V ?4<<.@R!STT$    )rZ   NreturnNone)__name__
__module____qualname____firstlineno____doc____annotations__r
   rZ   rc   ru   __static_attributes__ rw   ri   r   r      sT    
 ML%*%6M?6NL%*d*%rw   r   c            .         \ rS rSr% SrSSSSSSSSSSSSSSSS0 SSSSSSSSSS\S   \S	   SS\S
   \S   \S   SSSSSSS\S   SSSS.-                                                                                         SS jjrSS jr   S       SS jjrSS jr	SS jr
SS jr\ S       SS jj5       r\\SS j5       5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       r\R,                  SS j5       r\SS  j5       r\R,                  SS! j5       r\SS" j5       r\R,                  SS# j5       rSS$ jrSS% jr\SS& j5       r\R,                  SS' j5       r\SS( j5       r\SS) j5       r\SS* j5       r\SS+ j5       r\SS, j5       r \SS- j5       r!\!R,                  SS. j5       r!SS/ jr"SS0 jr#\SS1 j5       r$\$R,                  SS2 j5       r$SS3 jr%SS4 jr&\SS5 j5       r'\'R,                  SS6 j5       r'SS7 jr(SS8 jr)\SS9 j5       r*\*R,                  SS: j5       r*\SS; j5       r+\+R,                  SS< j5       r+\SS= j5       r,\,R,                  SS> j5       r,\SS? j5       r-\SS@ j5       r.\SSA j5       r/\SSB j5       r0\0R,                  SSC j5       r0\SSD j5       r1\SSE j5       r2\SSF j5       r3SSG jr4 S     SSH jjr5SSI jr6SSJ jr7SSK jr8\9" \:Rv                  " SLSM95      SSN j5       r<\9" \:Rv                  " SOSM95      SSP j5       r=\SSQ j5       r>\SSR j5       r?\SSS j5       r@\SST j5       rA\ S       SSU jj5       rB\9" \:Rv                  " SSM95      SSV j5       rC\SSW j5       rD\DR,                  SSX j5       rD\9" \:Rv                  " SSM95      SSY j5       rE\SSZ j5       rF\FR,                  SS[ j5       rF\SS\ j5       rG\GR,                  SS] j5       rGSS^ jrHSS_ jrISS` jrJSSa jrKSSb jrLSSc jrMSSd jrNSSe jrO\SSf j5       rPSSSg jjrQSSh jrR\SSi j5       rS\SrTSj\USk'   \       S               SSl jj5       rV\   S         SSm jj5       rW\     S             SSn jj5       rX\SSo j5       rY\SSp j5       rZ\SSq j5       r[\SSr j5       r\\   S           SSs jj5       r]      SSt jr^\ S       SSu jj5       r_\      SSv j5       r`\   S           SSw jj5       ra\      SSx j5       rb\SSy j5       rc\SSz j5       rd          SS{ jre\SS| j5       rf\SSS} jj5       rg\SS~ j5       rh\SS j5       ri\SS j5       rj\SS j5       rk\          S                     SS jj5       rlSrmg)r      z'Defines the MySQL connection interface.N z	127.0.0.1i  Fallow_local_infileallow_local_infile_in_pathconnect_timeoutread_timeoutwrite_timeoutTssl_disabled)-userpasswordhostportdatabase	password1	password2	password3r\   	collationr^   client_flagscompressconsume_results
autocommit	time_zone
conn_attrssql_modeinit_commandget_warningsraise_on_warningsbufferedrawkerberos_auth_modekrb_service_principalopenid_token_filewebauthn_callbackr   r   converter_classconverter_str_fallbackconnection_timeoutr   r   unix_socketuse_unicodessl_cassl_certssl_keyssl_verify_certssl_verify_identityr   tls_versionstls_ciphersuitesloopr   r   c       -        p   S U l          Xl        X l        X0l        X@l        XPl        X`l        Xpl        Xl        U#U l	        U U l
        U!U l        U"U l        UU l        Xl        Xl        Xl        UU l        UU l        UU l        [)        5       U l        S U l        Xl         Xl         SU l        U*U l        U%U l        U&U l        U'U l        U(U l        U)U l        U+U l         U,U l!        Xl"        S U l#        S U l$        U-=(       d    [J        RL                  " 5       U l'        U=(       d    [P        RR                  " 5       U l*        S U l+        [X        RZ                  " 5       U l.        0 U l/        SU l0        / U l1        [e        5       U l3        U=(       d    [h        U l5        UU l6        UU l7        UU l8        UU l9        UU l:        UU l;        UU l<        UU l=        UU l>        UU l?        U$U l@        SU lA        SU lB        SU lC        S U lD        S U lE        UU lF        S U lG        S U lH         S U lI         U R                  5         g )NF)K!_MySQLConnectionAbstract__charset_user	_password_host_port	_database
_password1
_password2
_password3_unix_socket_connection_timeout_read_timeout_write_timeout_connection_attrs	_compress_consume_results_autocommit
_time_zone	_sql_mode_init_commandrO   	_protocol_socket_charset_name_charset_collation_ssl_active_ssl_disabled_ssl_ca	_ssl_cert_ssl_key_ssl_verify_cert_ssl_verify_identity_tls_versions_tls_ciphersuites_auth_plugin_auth_plugin_class
_handshakeasyncioget_event_loop_loopr3   get_default_client_flags_server_infoweakrefWeakSet_cursors_query_attrs_query_attrs_supported_columns_descrL   _authenticatorr4   _converter_class_converter_str_fallback_kerberos_auth_mode_krb_service_principal_openid_token_file_allow_local_infile_allow_local_infile_in_path_get_warningsr   	_buffered_raw_use_unicode_have_next_result_unread_result_in_transaction_oci_config_file_oci_config_profile_webauthn_callback	converter_local_infile_filenames_query_validate_connection_options).rs   r   r   r   r   r   r   r   r   r\   r   r^   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s.                                                 ri   __init__ MySQLConnectionAbstract.__init__   s3   h -1	 
&

&(((!,(: ,8-:1;'&5!+)2(0,8(5IM,3C1:@!&#/&,(0'.0?4G!2>6F+61537,G**, 	
 #/"J*2H2H2J26)0):;=+0#462D2F6E6W-C$2D 5J#1B); :T(#/'8'	"-',$)%*/326  	 48=A$	( (,())+rw   c                l   #    U R                  5       (       d  U R                  5       I S h  vN   U $  N7frf   )is_socket_connectedconnectrs   s    ri   
__aenter__"MySQLConnectionAbstract.__aenter__/  s-     '')),,.   !s   )424c                @   #    U R                  5       I S h  vN   g  N7frf   closers   exc_type	exc_value	tracebacks       ri   	__aexit__!MySQLConnectionAbstract.__aexit__4        jjl   c                   U R                   (       a    U R                   R                  5       U l         U R                  (       a  [        R
                  /U l        U R                  (       a  [        R                  R                  U R                  5      nU(       aH  [        R                  R                  U5      (       a$  [        R                  R                  U5      (       a$  [        R                  R                  U5      (       a  [        S5      eU R                  (       d  U R                  (       a  [        R                  /U l        O[        R                  * /U l        U R                   S:X  a  [#        SU R                    S35      eU R$                  (       a  [        R&                  S:X  a  SU l        U R(                  (       a6  U R                   S	:X  a  [#        S
5      eU R                   S:X  a  [#        S5      e[+        U R,                  [.        5      (       d  [#        S5      e[1        U R2                  U R4                  U R6                  /5      (       a  [9        U R6                  U R4                  /5      (       d  [        S5      eU R6                  SL U R4                  SL :w  a  [        S5      eU R:                  b  U R=                  5         U R>                  b  U RA                  5         [+        U RB                  [D        5      (       d  [#        S5      eU RB                  RG                  5        H  u  p4U[H        ;   a  M  [+        U[J        5      (       d  [#        SU SU RB                   S35      e[M        U5      S:  a  [#        SU S35      eURO                  S5      (       a  [#        S5      e[+        U[J        5      (       d  [#        SU SU S35      e[M        U5      S:  d  M  [#        SU SU S35      e   U RP                  [        RR                  -  (       a  U RU                  5         U RV                  (       a  [+        U RV                  [J        5      (       d  [#        S5      eU RV                  RY                  5       nUS:X  a'  [        R&                  S:w  a  [#        S 5      eS!U l-        OUS":X  a  S#U l-        O[#        S$5      eU R\                  (       a  [+        U R\                  [J        5      (       d  [#        [^        R`                  " S%S&95      eU R\                  S':X  a  [#        [^        R`                  " S(S&95      eS)U R\                  ;  a  [#        [^        R`                  " S*S&95      eU Rb                  (       a  U Re                  S+U Rb                  S,5        U Rf                  (       a  [+        U Rf                  [J        5      (       d  [#        [h        R`                  " S%S&95      eU Rf                  S':X  a  [#        [h        R`                  " S-S&95      e[        R                  R                  U Rf                  5      (       d  [#        S.U Rf                   S/35      eU Rj                  b:  [+        U Rj                  [.        5      (       a  U Rj                  S0:  a  [#        S15      eU Rl                  b;  [+        U Rl                  [.        5      (       a  U Rl                  S0:  a  [#        S25      egg! [         a  n[        S5      UeSnAff = f)3zValidate connection options.z'user' must be a stringNz.allow_local_infile_in_path must be a directoryauthentication_webauthn_client'z5' cannot be used as the default authentication pluginrR   Tmysql_clear_passwordzFClear password authentication is not supported over insecure  channels$authentication_openid_connect_clientzEOpenID Connect authentication is not supported over insecure channelsz'TCP/IP port number should be an integerz:ssl_key and ssl_cert need to be both specified, or neitherz4ssl_key and ssl_cert need to be both set, or neitherzconn_attrs must be of type dictz+Attribute name should be a string, found: 'z' in '    zAttribute name 'z"' exceeds 32 characters limit size_zNKey names in connection attributes cannot start with '_', found: '{attr_name}'zAttribute 'z
' value: 'z' must be a string typei   z$' exceeds 1024 characters limit sizez('kerberos_auth_mode' must be of type strsspintz6'kerberos_auth_mode=SSPI' is only available on WindowsMySQLSSPIKerberosAuthPlugingssapiMySQLKerberosAuthPluginz@Invalid 'kerberos_auth_mode' mode. Please use 'SSPI' or 'GSSAPI'zis not a string)errorr   zcan not be an empty string/zis incorrectly formattedwebauth_callbackrK   zcannot be an empty stringz
The path 'z1' provided via 'openid_token_file' does not existr   z.Option read_timeout must be a positive integerz/Option write_timeout must be a positive integer)7r   stripAttributeErrorr   r3   COMPRESSr   r   ospathabspathexistsisdirislinkr   LOCAL_FILESr   r7   r   namer   
isinstancer   rU   anyr   r   r   allr   _validate_tls_versionsr   _validate_tls_ciphersuitesr   dictitemsr+   rW   len
startswithr   CONNECT_ARGS_add_default_conn_attrsr   lowerr   r   r$   formatr   _validate_callabler   r&   r   r   )rs   errinfile_in_path	attr_name
attr_valuer   s         ri   r   4MySQLConnectionAbstract._validate_connection_options<  s   ::I!ZZ--/
 >>!+!4!4 5D++WW__T-M-MNNGGNN>22n5577>>.11$%UVV##t'G'G!+!7!7 8D","8"8!8 9D  @@ D%%& '   G!3!%D  $::$     $JJ$[  $**c** !JKKdnndmm<==t~~677$P  %4>>T+AB$J  !!-++-%%1//1$00$77 !BCC%)%;%;%A%A%C!IM)i--$!{&)?)?(@C 
 9~"$&yk1ST  ##C(($0 
 j#..$!)Jzl C' ' 
 :%$!)Jzl C9 9 9 &DB 
 7 77((*##d66<<$%OPP!%!9!9!?!?!A!V+77d?(P  +H'#x/*C'$V  &&d993??$/66=NO  **b0$/66: 
 $555$/66=WX  ""##$68O8OQRS""d55s;;$+229JK  &&",$+229TU  77>>$"9"9::$ !8!8 9 :% %  )d00#66$:L:Lq:P$%UVV*d113774;N;NQR;R$%VWW <S +u " I$%>?SHIs   [0 0
\:\\c                J   / nU R                   n[        U[        5      (       a  UR                  S5      (       a  UR	                  S5      (       d  [        SU S35      eUSS R                  S5      nU(       d  [        S5      eU H;  nUR                  5       R                  5       nU(       d  M*  UR                  U5        M=     OE[        U[        [        45      (       a  U Vs/ s H  o"(       d  M  UPM     nnO[        S	U S35      eU R                  c	  [        S
S
 OU R                  S
S
 nUR                  SS9  US   n/ / /n0 n/ n	[        S
[        R                  " U5      S-     H3  n
UR!                  ["        U
   5        U	R%                  [&        U
   5        M5     U H  nSU;   a>  X;   a9  U[&        S   ;   a  US   R                  U5        M1  US   R                  U5        MG  X;   ad  X   nX;   a  [        [(        R*                  " SUS95      eU["        S   ;   a  US   R                  X   5        M  US   R                  X   5        M  [        SU S35      e   US   (       d  US   (       d  [        S5      eUS    H-  nU[,        S   R/                  5       ;   d  M   [1        SU S35      e   US    H-  nU[,        S   R/                  5       ;   d  M   [1        SU S35      e   SR3                  US   5      SR3                  US   5      /U l         g
s  snf )z&Validates the tls_ciphersuites option.[]z)tls_ciphersuites must be a list, found: 'r  rK   ,z6No valid cipher suite found in 'tls_ciphersuites' listzItls_ciphersuites should be a list with one or more ciphersuites. Found: 'NT)reverser   -TLSv1.3r   listvaluezThe value 'z1' in tls_ciphersuites is not a valid cipher suitez:No valid cipher suite found in the 'tls_ciphersuites' listzTLSv1.2zCipher z( when used with TLSv1.2 is unacceptable.z( when used with TLSv1.3 is unacceptable.:)r   r&  rW   r.  endswithr  splitr  upperappendrB  setr   r2   sortindexupdater1   extendr0   r#   r2  r;   valuesr9   join)rs   r   tls_cstls_css_tls_csr   newer_tls_vertranslated_namesiani_cipher_suites_namesossl_cipher_suites_namestls_verr%  translated_namecipher_as_ossls                 ri   r*  2MySQLConnectionAbstract._validate_tls_ciphersuites  sd   ''fc""%%c**vs/C/C$?xqI  Qrl((-G$L  # ,,...07$++G4 #
 s,,5;FV6vVF ))/3   $119LOt?Q?QRS?T 	 	$'$Q .0H#% .0  $$Kl&8&8&G!&KLG$++,=g,FG$++,<W,EF M %Dd{t?+I66$Q'..t4$Q'..t41":"@"6(077!3? 
 ,Y77$Q'../G/MN$Q'../G/MN$!$ (# # ' %.  "+;A+> L 
 /q1N!>y!I!P!P!RR'n--UV  2
 /q1N!>y!I!P!P!RR'n--UV  2 HH%a()HH%a()"
G  Gs   &
L 4L c                |   / nU R                   n[        U[        5      (       a  UR                  S5      (       a  UR	                  S5      (       d  [        SU S35      eUSS R                  S5      nU HO  nUR                  5       nUS:X  a  M  X!;   a  [        [        R                  " S	US
95      eUR                  U5        MQ     US/:X  a/  [        (       d$  [        [        R                  " U[        5      5      eO[        U[        5      (       aP  U(       d  [        S5      eU H7  nXA;   a  [        [        R                  " S	US
95      eUR                  U5        M9     OU[        U[        5      (       a  U H  nUR                  U5        M     O%[        SSR!                  [        5       SU S35      eU(       d  [        S5      e/ n/ n/ nU HL  nU[        ;   a  UR                  U5        U["        ;   a  UR                  U5        M;  UR                  U5        MN     U(       a=  US/:X  a/  [        (       d$  [%        [        R                  " U[        5      5      eXPl         gU(       a$  [%        [&        R                  " U[        5      5      eU(       a$  [        [(        R                  " W[        5      5      eg)z"Validates the tls_versions option.r:  r;  z%tls_versions must be a list, found: 'r  rK   r<  r=  r   r   rA  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&  rW   r.  rE  r  rF  r  r#   r2  rH  r'   r(   r2   rB  rI  rO  r<   r9   r*   r)   )rs   r   tls_versiontls_versrW  use_tls_versionsunacceptable_tls_versionsinvalid_tls_versionss           ri   r)  .MySQLConnectionAbstract._validate_tls_versions<  s   ((k3''**3//K4H4H4M4M$;K=J  #1R(..s3H#%mmo"$.(077!/{ 
 ##K0 $ I;&/A/A$(//\J  T**$*  '*(077!/w 
 ##G, ' S))&##G, ' !ii-.jaI 
  C 
 $&!!#G,& ''033)009$++G4 $ I;.7I7I'(//\J  "2&#.55-| 
 " !2!9!9'<!PQQ "rw   c                0   [        U[        5      (       a   [        U5      n[        U5      (       d  [	        SU  S35      e[        [        U5      R                  5      nXB:w  a  [	        SU  SU SU 35      eg! [         a  n[	        U 5      UeSnAff = f)a  Validates if it's a Python callable.

 Args:
     option_name (str): Connection option name.
     callback (str or callable): The fully qualified path to the callable or
                                 a callable.
     num_args (int): Number of positional arguments allowed.

Raises:
     ProgrammingError: If `callback` is not valid or wrong number of positional
                       arguments.

.. versionadded:: 8.2.0
NzExpected a callable for 'r  z' requires z4 positional argument, but the callback provided has )	r&  rW   rJ   
ValueErrorr:   callabler-  r   
parameters)option_namecallbacknum_argsr4  
num_paramss        ri   r3  *MySQLConnectionAbstract._validate_callable  s    $ h$$:(2 !!"%>{m1#MNN 8,778
!"K=H: 6))36  "  :&#0c9:s   A9 9
BBBc                    g)zMySQL connection ID.Nr   r   s    ri   connection_id%MySQLConnectionAbstract.connection_id      rw   c                    U R                   $ )z$User used while connecting to MySQL.)r   r   s    ri   r   MySQLConnectionAbstract.user       zzrw   c                    U R                   $ )z MySQL server IP address or name.)r   r   s    ri   server_host#MySQLConnectionAbstract.server_host  rq  rw   c                    U R                   $ )zMySQL server TCP/IP port.)r   r   s    ri   server_port#MySQLConnectionAbstract.server_port  rq  rw   c                    U R                   $ )z MySQL Unix socket file location.)r   r   s    ri   r   #MySQLConnectionAbstract.unix_socket          rw   c                    [        S5      e)Get the current database.zoThe use of async properties are not supported by Python. Use `await get_database()` to get the database insteadr:   r   s    ri   r    MySQLConnectionAbstract.database  s     E
 	
rw   c                    [        S5      e)Set the current database.zsThe use of async properties are not supported by Python. Use `await set_database(name)` to set the database insteadr}  rs   rC  s     ri   r   r~         I
 	
rw   c                    U R                   $ )a  
Gets the connection context's timeout in seconds for each attempt
to read any data from the server.

`read_timeout` is number of seconds upto which the connector should wait
for the server to reply back before raising an ReadTimeoutError. We can set
this option to None, which would signal the connector to wait indefinitely
till the read operation is completed or stopped abruptly.
r   r   s    ri   r   $MySQLConnectionAbstract.read_timeout       !!!rw   c                b    Ub&  [        U[        5      (       a  US:  a  [        S5      eXl        g)a?  
Sets or updates the connection context's timeout in seconds for each attempt
to read any data from the server.

`read_timeout` is number of seconds upto which the connector should wait
for the server to reply back before raising an ReadTimeoutError. We can set
this option to None, which would signal the connector to wait indefinitely
till the read operation is completed or stopped abruptly.

Args:
    timeout: Accepts a non-negative integer which is the timeout to be set
             in seconds or None.
Raises:
    InterfaceError: If a positive integer or None is not passed via the
                    timeout parameter.
Examples:
    The following will set the read_timeout of the current session to
    5 seconds:
    ```
    >>> cnx = await mysql.connector.aio.connect(user='scott')
    >>> cnx.read_timeout = 5
    ```
Nr   6Option read_timeout must be a positive integer or Noner&  rU   r7   r   rs   timeouts     ri   r   r    s5    2 gs++w{$L  %rw   c                    U R                   $ )ax  
Gets the connection context's timeout in seconds for each attempt
to send data to the server.

`write_timeout` is number of seconds upto which the connector should spend to
write to the server before raising an WriteTimeoutError. We can set this option
to None, which would signal the connector to wait indefinitely till the write
operation is completed or stopped abruptly.
r   r   s    ri   r   %MySQLConnectionAbstract.write_timeout       """rw   c                b    Ub&  [        U[        5      (       a  US:  a  [        S5      eXl        g)a5  
Sets or updates the connection context's timeout in seconds for each attempt
to send data to the server.

`write_timeout` is number of seconds upto which the connector should spend to
write to the server before raising an WriteTimeoutError. We can set this option
to None, which would signal the connector to wait indefinitely till the write
operation is completed or stopped abruptly.

Args:
    timeout: Accepts a non-negative integer which is the timeout to be set in
             seconds or None.
Raises:
    InterfaceError: If a positive integer or None is not passed via the
                    timeout parameter.
Examples:
    The following will set the write_timeout of the current
    session to 5 seconds:
    ```
    >>> cnx = await mysql.connector.connect(user='scott')
    >>> cnx.write_timeout = 5
    ```
Nr   7Option write_timeout must be a positive integer or Noner&  rU   r7   r   r  s     ri   r   r    s5    2 gs++w{$M  &rw   c                J   #    U R                  S5      I Sh  vN nUS   $  N	7f)r|  zSELECT DATABASE()Nr   
info_query)rs   results     ri   get_database$MySQLConnectionAbstract.get_database3  s&     ':;;ay <   #!
#c                H   #    U R                  SU 35      I Sh  vN   g N7f)r  zUSE N)	cmd_queryr  s     ri   set_database$MySQLConnectionAbstract.set_database8  s     nntE7^,,,s   " "c                    U R                   $ )z"Returns whether to consume results)r   r   s    ri   can_consume_results+MySQLConnectionAbstract.can_consume_results<       $$$rw   c                >    [        U[        5      (       d   eXl        g)zSet if can consume results.N)r&  rb   r   r  s     ri   r  r  A  s     %&&&& %rw   c                    U R                   $ )z(MySQL session has started a transaction.)r   r   s    ri   in_transaction&MySQLConnectionAbstract.in_transactionG  s     ###rw   c                    U R                   $ )zReturn the event loop.)r   r   s    ri   r   MySQLConnectionAbstract.loopL  rq  rw   c                ^    U R                   =(       d    U R                  SL=(       a    [        $ )z&Return True if is a secure connection.N)r   r   IS_POSIXr   s    ri   	is_secure!MySQLConnectionAbstract.is_secureQ  s%     OD$5$5T$A$NhOrw   c                H    [        U R                  R                  5       5      $ )zReturns query attributes list.)rB  r   r,  r   s    ri   query_attrs#MySQLConnectionAbstract.query_attrsV  s     D%%++-..rw   c                    U R                   $ )zReturn if have next result.)r   r   s    ri   have_next_result(MySQLConnectionAbstract.have_next_result[  s     %%%rw   c                    [        S5      e)$Get whether autocommit is on or off.zsThe use of async properties are not supported by Python. Use `await get_autocommit()` to get the autocommit insteadr}  r   s    ri   r   "MySQLConnectionAbstract.autocommit`  r  rw   c                    [        S5      e)Toggle autocommit.zxThe use of async properties are not supported by Python. Use `await set_autocommit(value)` to set the autocommit insteadr}  r  s     ri   r   r  h       N
 	
rw   c                P   #    U R                  S5      I Sh  vN nUS   S:H  $  N7f)r  zSELECT @@session.autocommitNr   rK   r  r  s     ri   get_autocommit&MySQLConnectionAbstract.get_autocommitp  s+     oo&CDDQx1} Es   &$&c                j   #    U(       a  SOSnU R                  SU 35      I Sh  vN   Xl        g N7f)r  ONOFFzSET @@session.autocommit = N)r  r   )rs   rC  switchs      ri   set_autocommit&MySQLConnectionAbstract.set_autocommitu  s4     Enn:6(CDDD  	Es   #313c                    [        S5      e)Gets the current time zone.zqThe use of async properties are not supported by Python. Use `await get_time_zone()` to get the time zone insteadr}  r   s    ri   r   !MySQLConnectionAbstract.time_zone{  s     G
 	
rw   c                    [        S5      e)Sets the time zone.zxThe use of async properties are not supported by Python. Use `await get_autocommit(value)` to get the autocommit insteadr}  r  s     ri   r   r    r  rw   c                J   #    U R                  S5      I Sh  vN nUS   $  N	7f)r  zSELECT @@session.time_zoneNr   r  r  s     ri   get_time_zone%MySQLConnectionAbstract.get_time_zone  s&     oo&BCCQx Dr  c                V   #    U R                  SU S35      I Sh  vN   Xl        g N7f)r  zSET @@session.time_zone = 'r  N)r  r   r  s     ri   set_time_zone%MySQLConnectionAbstract.set_time_zone  s,     nn:5'CDDD 	Es   )')c                    #    [        S5      e7f)Gets the SQL mode.zoThe use of async properties are not supported by Python. Use `await get_sql_mode()` to get the SQL mode insteadr}  r   s    ri   r    MySQLConnectionAbstract.sql_mode  s      E
 	
   c                    #    [        S5      e7f)k  Sets 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]
```
ztThe use of async properties are not supported by Python. Use `await set_sql_mode(value)` to set the SQL mode insteadr}  r  s     ri   r   r    s      J
 	
r  c                   #    U R                   c!  U R                  S5      I Sh  vN S   U l         U R                   $  N7f)r  NzSELECT @@session.sql_moder   )r   r  r   s    ri   get_sql_mode$MySQLConnectionAbstract.get_sql_mode  s9     >>!$(OO4O$PPRSTDN~~ Qs   "?=?c                   #    [        U[        [        45      (       a  SR                  U5      nU R	                  SU S35      I Sh  vN   Xl        g N7f)r  r=  zSET @@session.sql_mode = 'r  N)r&  rB  rq   rO  r  r   r  s     ri   set_sql_mode$MySQLConnectionAbstract.set_sql_mode  sL      edE]++HHUOEnn9%BCCC 	Ds   AAAAc                    U R                   $ )zGet whether this connection retrieves warnings automatically.

This method returns whether this connection retrieves warnings automatically.
)r   r   s    ri   r   $MySQLConnectionAbstract.get_warnings  s     !!!rw   c                P    [        U[        5      (       d  [        S5      eXl        g)zSet 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: When the value is not a bool type.
Expected a boolean typeN)r&  rb   rc  r   r  s     ri   r   r    s#     %&&677"rw   c                    U R                   $ )zGet whether this connection raises an error on warnings.

This method returns whether this connection will raise errors when MySQL
reports warnings.
)_raise_on_warningsr   s    ri   r   )MySQLConnectionAbstract.raise_on_warnings  s     &&&rw   c                l    [        U[        5      (       d  [        S5      eXl        U(       a  Xl        gg)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: When the value is not a bool type.
r  N)r&  rb   rc  r  r   r  s     ri   r   r    s1     %&&677"'!& rw   c                    U R                   $ )zGet whether there is an unread result.

This method is used by cursors to check whether another cursor still needs to
retrieve its result set.
)r   r   s    ri   unread_result%MySQLConnectionAbstract.unread_result       """rw   c                P    [        U[        5      (       d  [        S5      eXl        g)zSet 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: When the value is not a bool type.
r  N)r&  rb   rc  r   r  s     ri   r  r    s#     %&&677#rw   c                .    U R                   R                  $ )zReturns 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.
)_charsetr   r   s    ri   r   !MySQLConnectionAbstract.collation  s     }}&&&rw   c                .    U R                   R                  $ )zReturn 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.
r  r%  r   s    ri   r\   MySQLConnectionAbstract.charset  s     }}!!!rw   c                .    U R                   R                  $ )z}The charset ID utilized during the connection phase.

If the charset ID hasn't been set, the default charset ID is returned.
)r  
charset_idr   s    ri   r  "MySQLConnectionAbstract.charset_id)  s     }}'''rw   c                    U R                   cf  U R                  c  [        R                  " [        5      $ [        R                  " U R                  R
                  S:  a  [        O[        5      U l         U R                   $ )BThe charset object encapsulates charset and collation information.)   r   )r   r   rN   	get_by_idr.   rZ   r/   r   s    ri   r   MySQLConnectionAbstract._charset1  sj     >>!  (
  ))*EFF%// ((66? 04	DN ~~rw   c                    Xl         g)r  N)r   r  s     ri   r  r  E  s	     rw   c                ~    U R                   b  U R                   R                  S;   a  gU R                   R                  $ )a6  Return 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.
)utf8mb4utf8mb3binaryutf8r  r   s    ri   python_charset&MySQLConnectionAbstract.python_charsetJ  s9     == DMM$6$6 ;
 %

 }}!!!rw   c                    g)z&Add the default connection attributes.Nr   r   s    ri   r0  /MySQLConnectionAbstract._add_default_conn_attrs[  rn  rw   c                   #    g7f)zExecute a query.

This method simply calls cmd_query() after checking for unread result. If there
are still unread result, an InterfaceError is raised. Otherwise whatever
cmd_query() returns is returned.
Nr   )rs   querys     ri   _execute_query&MySQLConnectionAbstract._execute_query_          c                  #    U R                  U R                  R                  S9I Sh  vN   U R                  U R                  5      I Sh  vN   U R
                  (       a#  U R                  U R
                  5      I Sh  vN   U R                  (       a#  U R                  U R                  5      I Sh  vN   U R                  (       a$  U R                  U R                  5      I Sh  vN   gg N N Nr N@ N7f)zExecutes 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.
)r\   N)set_charset_collationr  r  r  r   r   r  r   r  r   r  r   s    ri   _post_connection(MySQLConnectionAbstract._post_connectionh  s      ((1I1I(JJJ!!$"2"2333??$$T__555>>##DNN333%%d&8&8999  	K3539sW   'C9C/"C9C13C9 C33C94C553C9(C7)C91C93C95C97C9c                2  #    Sn[        U[        [        45      (       d  Ub  [        UR	                  S5      5      e[        U[        5      (       d  Ub  [        S5      eU(       aZ  U(       aS  [        U[        5      (       a   [
        R                  " U5      R                  OUn[
        R                  " XB5      U l	        OU(       a|  [        U[        5      (       a  [
        R                  " U5      U l	        O[        U[        5      (       a  [
        R                  " U5      U l	        Oa[        UR	                  S5      5      eU(       a  [
        R                  " U5      U l	        O$[        S   n[
        R                  " U5      U l	        U R                  SU R                  R                   SU R                  R                   S35      I Sh  vN   U R                  (       a0  U R                  R!                  U R                  R                  5        gg NF7f)a`  Set 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.

Args:
    charset: Can be either the name of a character set, or the numerical
             equivalent as defined in `constants.CharacterSet`.
    collation: When collation is `None`, the default collation for the
               character set is used.

Examples:
    The following will set the collation for the latin1 character set to
    `latin1_general_ci`:
    ```
    >>> cnx = mysql.connector.connect(user='scott')
    >>> cnx.set_charset_collation('latin1', 'latin1_general_ci')
    ```
z+{} should be either integer, string or NoneNr\   z)collation should be either string or NonezSET NAMES 'z' COLLATE 'r  )r&  rU   rW   rc  r2  rN   r  r%  get_by_name_and_collationr  get_by_nameget_by_collationr,   r  r   r   set_charset)rs   r\   r   err_msgcharset_strs        ri   r  -MySQLConnectionAbstract.set_charset_collationx  s    2 @'C:..73FW^^I677)S))i.CHIIy gs++ ""7+00 
 %>>{VDM'3'' ( 2 27 ;GS)) ( 4 4W = 	!:;;$55i@DM+I6G$009DMnn$--,,-[9P9P8QQRS
 	
 	
 >>NN&&t}}'9'9: 		
s   GHHAHc                &    U R                   U-  S:  $ )zdChecks if a client flag is set.

Returns:
    `True` if the client flag was set, `False` otherwise.
r   r   )rs   flags     ri   isset_client_flag)MySQLConnectionAbstract.isset_client_flag  s     ""T)Q..rw   c                    Xl         g)zaSet the path that user can upload files.

Args:
    path (str): Path that user can upload files.
N)r   )rs   r  s     ri   set_allow_local_infile_in_path6MySQLConnectionAbstract.set_allow_local_infile_in_path  s
     ,0(rw   c                    U $ )zqReturn self for weakref.proxy.

This method is used when the original object is needed when using
weakref.proxy.
r   r   s    ri   get_self MySQLConnectionAbstract.get_self  s	     rw   server_versionproperty_namec                    U R                   $ )Gets the MySQL version.

Returns:
    The MySQL server version as a tuple. If not previously connected, it will
    return `None`.
)r  r   s    ri   get_server_version*MySQLConnectionAbstract.get_server_version  s     """rw   server_infoc                    U R                   $ )Gets the original MySQL version information.

Returns:
    The original MySQL server as text. If not previously connected, it will
    return `None`.
)r!  r   s    ri   get_server_info'MySQLConnectionAbstract.get_server_info  s     rw   c                J    U R                   b  U R                   R                  $ g)r  N)r   rZ   r   s    ri   r  &MySQLConnectionAbstract.server_version  s%     ($$222rw   c                N     U R                   S   $ ! [        [        4 a     gf = f)r#  server_version_originalN)r   	TypeErrorKeyErrorr   s    ri   r!  #MySQLConnectionAbstract.server_info  s.    	??#<==8$ 		s    $$c                    g)zReports whether the socket is connected.

Instead of ping the server like ``is_connected()``, it only checks if the
socket connection flag is set.
Nr   r   s    ri   r   +MySQLConnectionAbstract.is_socket_connected  rn  rw   c                   #    g7f)zReports whether the connection to MySQL Server is available.

This method checks whether the connection to MySQL is available.
It is similar to ``ping()``, but unlike the ``ping()`` method, either `True`
or `False` is returned and no exception is raised.
Nr   r   s    ri   is_connected$MySQLConnectionAbstract.is_connected   r  r  c                   #    g7f)a  Check availability of the MySQL server.

When reconnect is set to `True`, one or more attempts are made to try to
reconnect to the MySQL server using the ``reconnect()`` method.

``delay`` is the number of seconds to wait between each retry.

When the connection is not available, an InterfaceError is raised. Use the
``is_connected()`` method if you just want to check the connection without
raising an error.

Raises:
    InterfaceError: On errors.
Nr   )rs   	reconnectattemptsdelays       ri   pingMySQLConnectionAbstract.ping	  r  r  c                &    Xl         U R                   $ )a  Set 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.

client_flags = [ClientFlag.FOUND_ROWS,-ClientFlag.LONG_FLAG]

Raises:
    ProgrammingError: When the flags argument is not a set or an integer bigger
                      than 0.
)r   )rs   flagss     ri   set_client_flags(MySQLConnectionAbstract.set_client_flags  s     "   rw   c                    U R                   $ )z-Gets the client flags of the current session.r  r   s    ri   r   $MySQLConnectionAbstract.client_flags-  s     !!!rw   c                   [        U[        5      (       a  US:  a  Xl        g[        U[        [        45      (       aF  U H?  nUS:  a!  U =R                  [        U5      ) -  sl        M*  U =R                  U-  sl        MA     g[        S5      e)a  Sets 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.

client_flags = [ClientFlag.FOUND_ROWS,-ClientFlag.LONG_FLAG]

Raises:
    ProgrammingError: When the flags argument is not a set or an integer bigger
                      than 0.
r   z.client_flags setter expect integer (>0) or setN)r&  rU   r   rq   rB  absr:   )rs   r9  r  s      ri   r   r=  2  su     eS!!eai!&t}--!8&&3t9*4&&&$.&	  ##STTrw   c                    Xl         g)zSet the converter class to be used.

This should be a class overloading methods and members of
conversion.MySQLConverter.

Raises:
    TypeError: When the class is not a subclass of `conversion.MySQLConverter`.
N)r   rs   	convclasss     ri   set_converter_class+MySQLConnectionAbstract.set_converter_classK  s
      )rw   c                    U R                   $ )z5Gets the converter class set for the current session.)r   r   s    ri   r   'MySQLConnectionAbstract.converter_classW  r  rw   c                    U(       ac  [        U[        5      (       aN  Xl        U" U R                  R                  U R
                  5      U l        U R                  U R                  l        g[        S5      e)zSets the converter class to be used.

This should be a class overloading methods and members of
conversion.MySQLConverter.

Raises:
    TypeError: When the class is not a subclass of `conversion.MySQLConverter`.
zAConverter class should be a subclass of conversion.MySQLConverterN)

issubclassr5   r   r  r%  r   r   r   str_fallbackr*  rA  s     ri   r   rF  \  sZ     I/ABB$-!&t}}'9'94;K;KLDN*.*F*FDNN'S rw   c                    U R                   $ )z7Gets whether we return string fields as unicode or not.)r   r   s    ri   r   #MySQLConnectionAbstract.use_unicodeo  rz  rw   c                j    Xl         U R                  (       a  U R                  R                  U5        gg)ziSets whether we return string fields as unicode or not.

Args:
    value: A boolean - default is `True`.
N)r   r   set_unicoder  s     ri   r   rK  t  s(     ">>NN&&u- rw   c                H    Uu  p#X R                   ;  a  X0R                   U'   gg)zAdd element to the query attributes list on the connector's side.

If an element in the query attributes list already matches
the attribute name provided, the new element will NOT be added.

Args:
    value: key-value as a 2-tuple.
Nr   )rs   rC  r6  r7  s       ri   query_attrs_append*MySQLConnectionAbstract.query_attrs_append  s+     !&	---+5i( .rw   c                :    U R                   R                  US5      $ )zRemove element by name from the query attributes list.

If no match, `None` is returned, else the corresponding value is returned.

Args:
    name: key name.
N)r   poprs   r%  s     ri   query_attrs_remove*MySQLConnectionAbstract.query_attrs_remove  s       $$T400rw   c                    0 U l         g)z5Clears query attributes list on the connector's side.NrO  r   s    ri   query_attrs_clear)MySQLConnectionAbstract.query_attrs_clear  s
    rw   c                   #    U R                   (       a  U R                  5       I Sh  vN   gU R                  (       a  [        S5      eg N"7f)zHandle unread result.

Consume pending results if is configured for it.

Raises:
    InternalError: When there are pending results and they were not consumed.
NzUnread result found)r   r   r  r8   r   s    ri   handle_unread_result,MySQLConnectionAbstract.handle_unread_result  sA        &&((( 566   )s   %AA
#Ac                d   #    U R                   (       a  U R                  5       I Sh  vN   gg N7f)zConsume pending results.N)r  get_rowsr   s    ri   r   'MySQLConnectionAbstract.consume_results  s%     --/!! !s   %0.0c                2  #    U R                  SS9I Sh  vN  ISh  vN nUR                  [        [        U5      5      I Sh  vN   UR	                  5       I Sh  vN sSSS5      ISh  vN   $  N] NV N1 N N! , ISh  vN  (       d  f       g= f7f)z&Send a query which only returns 1 row.T)r   N)cursorexecuter    rW   fetchone)rs   r  ra  s      ri   r  "MySQLConnectionAbstract.info_query  sc     d3333v..c5!1222** 4332* 4333sx   BA3BA5B#A=A7A=A9A=!B-A;.B5B7A=9A=;B=BBBBc                :    U R                   R                  U5        g)zAdd cursor to the weakref set.N)r   addrs   ra  s     ri   
add_cursor"MySQLConnectionAbstract.add_cursor  s    &!rw   c                :    U R                   R                  U5        g)z#Remove cursor from the weakref set.N)r   removerg  s     ri   remove_cursor%MySQLConnectionAbstract.remove_cursor  s    V$rw   c                   #    g7f)zConnect to the MySQL server.Nr   r   s    ri   r   MySQLConnectionAbstract.connect  r  r  c                  #    SnX1:w  a  US-   n U R                  5       I Sh  vN   U R                  5       I Sh  vN   U R                  5       I Sh  vN (       a  g US:  a  [        R                  " U5      I Sh  vN   X1:w  a  M  gg Nh NR N<! [        [        4 a#  nX1:X  a  SU SU 3n[        U5      Ue SnANaSnAff = f NI7f)aC  Attempts 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.

Args:
    attempts: Number of attempts to make when reconnecting.
    delay: Use it (defined in seconds) if you want to wait between each retry.

Raises:
    InterfaceError: When reconnection fails.
r   rK   Nz!Can not reconnect to MySQL after z attempt(s): )
disconnectr   r0  r6   IOErrorr7   r   sleep)rs   r4  r5  counterr4  msgs         ri   r3  !MySQLConnectionAbstract.reconnect  s     " !kG7oo'''lln$$**,,, - qymmE*** ! ($,7# 7&;H: F''*e-  )-36 '7 +sr   C
B BB BB B	B !C
>C?	C

C
B B B C"C ;C
 CC
c                   #    [         e7f)aC  Shuts down connection to MySQL Server.

This method closes the socket. It raises no exceptions.

Unlike `disconnect()`, `shutdown()` closes the client connection without
attempting to send a `QUIT` command to the server first. Thus, it will not
block if the connection is disrupted for some reason such as network failure.
)NotImplementedErrorr   s    ri   shutdown MySQLConnectionAbstract.shutdown  s      "!s   	c                   #    g7f)aK  Close the connection.

It closes any opened cursor associated to this connection, and closes the
underling socket connection.

`MySQLConnection.close()` is a synonymous for `MySQLConnection.disconnect()`
method name and more commonly used.

This method tries to send a `QUIT` command and close the socket. It raises
no exceptions.
Nr   r   s    ri   r  MySQLConnectionAbstract.close  r  r  z@ClassVar[Callable[['MySQLConnectionAbstract'], Awaitable[None]]]rq  c                   #    g7f)a=  Instantiate and return a cursor.

By default, MySQLCursor is returned. Depending on the options while
connecting, a buffered and/or raw cursor is instantiated instead.
Also depending upon the cursor options, rows can be returned as a dictionary
or a tuple.

It is possible to also give a custom cursor through the cursor_class
parameter, but it needs to be a subclass of
mysql.connector.aio.abstracts.MySQLCursorAbstract.

Raises:
    ProgrammingError: When cursor_class is not a subclass of
                      MySQLCursor.
    ValueError: When cursor is not available.
Nr   )rs   r   r   preparedcursor_class
dictionaryr   r   s           ri   ra  MySQLConnectionAbstract.cursor  r  r  c                   #    g7f)a  Get the next rows returned by the MySQL server.

This method gets one row from the result set after sending, for example, the
query command. The result is a tuple consisting of the row and the EOF packet.
If no row was available in the result set, the row data will be None.
Nr   )rs   r  columnsr   kwargss        ri   get_rowMySQLConnectionAbstract.get_row  r  r  c                   #    g7f)zGet all rows returned by the MySQL server.

This method gets all rows returned by the MySQL server after sending, for
example, the query command. The result is a tuple consisting of a list of rows
and the EOF packet.
Nr   )rs   countr  r  r   	prep_stmtr  s          ri   r^   MySQLConnectionAbstract.get_rows'  r  r  c                   #    g7f)zCommit current transaction.Nr   r   s    ri   commitMySQLConnectionAbstract.commit8  r  r  c                   #    g7f)zRollback current transaction.Nr   r   s    ri   rollback MySQLConnectionAbstract.rollback<  r  r  c                   #    g7f)zResets the session state without re-authenticating.

Reset command only works on MySQL server 5.7.3 or later.
The result is True for a successful reset otherwise False.
Nr   r   s    ri   cmd_reset_connection,MySQLConnectionAbstract.cmd_reset_connection@  r  r  c                   #    g7f)zChange the current database.

This method changes the current (default) database by sending the INIT_DB
command. The result is a dictionary containing the OK packet infawaitormation.
Nr   )rs   r   s     ri   cmd_init_db#MySQLConnectionAbstract.cmd_init_dbH  r  r  c                   #    g7f)a  Send a query to the MySQL server.

This method send the query to the MySQL server and returns the result.

If there was a text result, a tuple will be returned consisting of the number
of columns and a list containing information about these columns.

When the query doesn't return a text result, the OK or EOF packet information
as dictionary will be returned. In case the result was an error, exception
Error will be raised.
Nr   )rs   r  r   r   raw_as_stringr  s         ri   r  !MySQLConnectionAbstract.cmd_queryP  r  r  c                   #    g7f)a  Send one or more statements to the MySQL server.

Similar to the cmd_query method, but instead returns a generator
object to iterate through results. It sends the statements to the
MySQL server and through the iterator you can get the results.

statement = 'SELECT 1; INSERT INTO t1 VALUES (); SELECT 2'
for result in await cnx.cmd_query(statement, iterate=True):
    if 'columns' in result:
        columns = result['columns']
        rows = await cnx.get_rows()
    else:
        # do something useful with INSERT result
Nr   )rs   
statementsr  s      ri   cmd_query_iter&MySQLConnectionAbstract.cmd_query_itere  r  r  c                   #    g7f)zFetch a MySQL statement Result Set.

This method will send the FETCH command to MySQL together with the given
statement id and the number of rows to fetch.
Nr   )rs   statement_idrowsr  s       ri   cmd_stmt_fetch&MySQLConnectionAbstract.cmd_stmt_fetchy  r  r  c                   #    g7f)zrPrepare a MySQL statement.

This method will send the PREPARE command to MySQL together with the given
statement.
Nr   )rs   	statementr  s      ri   cmd_stmt_prepare(MySQLConnectionAbstract.cmd_stmt_prepare  r  r  c                   #    g7f)z#Execute a prepared MySQL statement.Nr   )rs   r  datare  r9  r  s         ri   cmd_stmt_execute(MySQLConnectionAbstract.cmd_stmt_execute  r  r  c                   #    g7f)zmReset data for prepared statement sent as long data.

The result is a dictionary with OK packet information.
Nr   rs   r  r  s      ri   cmd_stmt_reset&MySQLConnectionAbstract.cmd_stmt_reset  r  r  c                   #    g7f)zDeallocate a prepared MySQL statement.

This method deallocates the prepared statement using the statement_id.
Note that the MySQL server does not return anything.
Nr   r  s      ri   cmd_stmt_close&MySQLConnectionAbstract.cmd_stmt_close  r  r  c                   #    g7f)a	  Send the Refresh command to the MySQL server.

This method sends the Refresh command to the MySQL server. The options
argument should be a bitwise value using constants.RefreshOption.

Typical usage example:
    ```
   RefreshOption = mysql.connector.RefreshOption
   refresh = RefreshOption.LOG | RefreshOption.INFO
   await cnx.cmd_refresh(refresh)
   ```

Args:
    options: Bitmask value constructed using constants from
             the `constants.RefreshOption` class.

Returns:
    A dictionary representing the OK packet got as response when executing
    the command.

Raises:
    ValueError: If an invalid command `refresh options` is provided.
    DeprecationWarning: If one of the options is deprecated for the server you
                        are connecting to.
Nr   )rs   optionss     ri   cmd_refresh#MySQLConnectionAbstract.cmd_refresh  r  r  c                   #    g7f)a  Send data for a column.

This methods send data for a column (for example BLOB) for statement identified
by statement_id. The param_id indicate which parameter the data belongs too.
The data argument should be a file-like object.

Since MySQL does not send anything back, no error is raised. When the MySQL
server is not reachable, an OperationalError is raised.

cmd_stmt_send_long_data should be called before cmd_stmt_execute.

The total bytes send is returned.
Nr   )rs   r  param_idr  r  s        ri   cmd_stmt_send_long_data/MySQLConnectionAbstract.cmd_stmt_send_long_data  r  r  c                   #    g7f)zzClose the current connection with the server.

Send the QUIT command to the MySQL server, closing the current connection.
Nr   r   s    ri   cmd_quit MySQLConnectionAbstract.cmd_quit  r  r  c                   #    g7f)zShut down the MySQL Server.

This method sends the SHUTDOWN command to the MySQL server.
The `shutdown_type` is not used, and it's kept for backward compatibility.
Nr   )rs   shutdown_types     ri   cmd_shutdown$MySQLConnectionAbstract.cmd_shutdown  r  r  c                   #    g7f)zSend the statistics command to the MySQL Server.

This method sends the STATISTICS command to the MySQL server. The result is a
dictionary with various statistical information.
Nr   r   s    ri   cmd_statistics&MySQLConnectionAbstract.cmd_statistics  r  r  c                   #    g7f)zKill a MySQL process.

This method send the PROCESS_KILL command to the server along with the
process ID. The result is a dictionary with the OK packet information.
Nr   )rs   	mysql_pids     ri   cmd_process_kill(MySQLConnectionAbstract.cmd_process_kill  r  r  c                   #    g7f)a  Send the DEBUG command.

This method sends the DEBUG command to the MySQL server, which requires the
MySQL user to have SUPER privilege. The output will go to the MySQL server
error log and the result of this method is a dictionary with EOF packet
information.
Nr   r   s    ri   	cmd_debug!MySQLConnectionAbstract.cmd_debug  r  r  c                   #    g7f)zSend the PING command.

This method sends the PING command to the MySQL server. It is used to check
if the the connection is still valid. The result of this method is dictionary
with OK packet information.
Nr   r   s    ri   cmd_ping MySQLConnectionAbstract.cmd_ping  r  r  c                   #    g7f)a  Changes the current logged in user.

It also causes the specified database to become the default (current)
database. It is also possible to change the character set using the
charset argument. The character set passed during initial connection
is reused if no value of charset is passed via this method.

Args:
    username: New account's username.
    password: New account's password.
    database: Database to become the default (current) database.
    charset: Client charset (see [1]), only the lower 8-bits.
    password1: New account's password factor 1 - it's used instead
               of `password` if set (higher precedence).
    password2: New account's password factor 2.
    password3: New account's password factor 3.
    oci_config_file: OCI configuration file location (path-like string).
    oci_config_profile: OCI configuration profile location (path-like string).
    openid_token_file: OpenID Connect token file location (path-like string).

Returns:
    ok_packet: Dictionary containing the OK packet information.

Examples:
    ```
    >>> cnx.cmd_change_user(username='', password='', database='', charset=33)
    ```

References:
    [1]: https://dev.mysql.com/doc/dev/mysql-server/latest/                page_protocol_basic_character_set.html#a_protocol_character_set
Nr   )rs   usernamer   r   r\   r   r   r   oci_config_fileoci_config_profiler   s              ri   cmd_change_user'MySQLConnectionAbstract.cmd_change_user  r  r  )E	__charsetr   r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )Zr   Optional[str]r   rW   r   rW   r   rU   r   r  r   rW   r   rW   r   rW   r\   rW   r   rW   r^   r  r   Optional[int]r   rb   r   rb   r   rb   r   r  r   zDict[str, str]r   r  r   r  r   rb   r   rb   r   rb   r   rb   r   r  r   r  r   r  r   z+Optional[Union[str, Callable[[str], None]]]r   rb   r   r  r   zOptional[MySQLConverter]r   rb   r   rU   r   r  r   r  r   r  r   Optional[bool]r   r  r   r  r   r  r   r  r   r  r   r  r   Optional[List[str]]r   r  r   z#Optional[asyncio.AbstractEventLoop])ry   r   NNNr  zOptional[Type[BaseException]]r  zOptional[BaseException]r  zOptional[TracebackType]ry   rz   rx   )r   )rf  rW   rg  zUnion[str, Callable]rh  rU   ry   rz   ry   r  )ry   rW   ry   rU   ry   r  )rC  rW   ry   rz   r  r  ry   rz   ry   rb   )rC  rb   ry   rz   )ry   zasyncio.AbstractEventLoop)ry   z$List[Tuple[str, BinaryProtocolType]])rC  zUnion[str, Sequence[int]]ry   rz   )ry   rM   )rC  rM   ry   rz   )r  rW   ry   rD   NN)r\   zOptional[Union[int, str]]r   r  ry   rz   )r  rU   ry   rb   )r  rW   ry   rz   )ry   zOptional[Tuple[int, ...]])FrK   r   )r3  rb   r4  rU   r5  rU   ry   rb   )r9  Union[int, Sequence[int]]ry   rU   )r9  r  ry   rz   )rB  zOptional[Type[MySQLConverter]]ry   rz   )ry   zType[MySQLConverter])rC  zTuple[str, BinaryProtocolType]ry   rz   r%  rW   ry   r=   )r  rG   ry   Optional[RowType])ra  r   ry   rz   )rK   r   )r4  rU   r5  rU   ry   rz   )ry   r   )NNNNNNN)r   r  r   r  r~  r  r  z#Optional[Type[MySQLCursorAbstract]]r  r  r   r  r   r  ry   r   )FNN)
r  rb   r  Optional[List[DescriptionType]]r   r  r  r   ry   z1Tuple[Optional[RowType], Optional[EofPacketType]])NFNNN)r  r  r  rb   r  r  r   r  r  r   r  r   ry   z-Tuple[List[RowType], Optional[EofPacketType]])r   rW   ry   rB   )FFF)r  rG   r   rb   r   rb   r  rb   r  r   ry   rD   )r  rG   r  r   ry   z!Generator[ResultType, None, None]rK   )r  rU   r  rU   r  r   ry   rz   )r  r_   r  r   ry   z/Mapping[str, Union[int, List[DescriptionType]]])r   r   r   )r  zUnion[int, CMySQLPrepStmt]r  zSequence[BinaryProtocolType]re  r   r9  rU   r  r   ry   z&Optional[Union[Dict[str, Any], Tuple]])r  rU   r  r   ry   rz   )r  rU   ry   rB   )
r  rU   r  rU   r  r   r  r   ry   rU   )ry   r_   rf   )r  r  ry   rz   )ry   rF   )r  rU   ry   rB   )ry   r?   )ry   rB   )
r   r   r   Nr   r   r   r   r   r   )r  rW   r   rW   r   rW   r\   r  r   rW   r   rW   r   rW   r  rW   r  rW   r   rW   ry   zOptional[OkPacketType])nr{   r|   r}   r~   r   r,   r   r   r  r   r*  r)  staticmethodr3  propertyr   rl  r   rs  rv  r   r   setterr   r   r  r  r  r  r   r  r  r  r   r  r  r   r  r  r   r  r  r   r   r  r   r\   r  r  r  r0  r  r  r  r  r  r  r"   r-   r2  r  r$  r  r!  r   r0  r6  r:  r   rC  r   r   rP  rU  rX  r[  r   r  rh  rl  r   r3  ry  r  rq  r   ra  r  r^  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   rw   ri   r   r      si   1
 #"&%)&* % #'%'"&&*""',0/3+/IM#89M#N4I(5
 59',"78I"J&;N&K'<_'M%)&* $"&!%*/.3'<^'L,00448cH, H, 	H,
 H, H,  H, H, H, H, H, H, #H, $H, H,  !H," #H,$ !%H,& #'H,(  )H,* $+H,, -H,.  /H,0 1H,2 3H,4 *5H,6  -7H,8 )9H,: G;H,< !=H,> %2?H,D 2EH,F !%GH,H  IH,J $KH,L %MH,N #OH,P $QH,R SH,T  UH,V WH,X (YH,Z ,[H,\ %]H,^ *_H,` .aH,b 2cH,T 37-1-1	/ + +	
 
aXF[
zORb JK  $8 DG 	   D #  #       ! ! 
 
 __
 
 
" 
" % %> 
# 
# & &>
- % % &  &
 $ $   P P / / & & 
 
 
 

! 
 
 
 

 
 
 
 __
 
$$ " " # # ' ' ' '( # # $ $ 	' 	' " " ( (  & __  " "  5 5  :" UY8;08;DQ8;	8;t/0 )00?OPQ# R# )00}MN  O  	 	 
 
     GH14AD	 $ )00~NO! P!  " " U U0 )00?PQR	) S	) % %  $ ! ! . .617"
+"% + +!+F	"   TYJPX $("#'<@%)&*'+   !	
 : # $ % 
 6  37"	 1 	
  
;    $37"  1	
    
7   * * , ,      #  	
   
 (  
+	( -.'*:=	  		 	 
9		 	  .0!202 +2 	2
 2 2 
02 2   
	     6  	
  
*              !%!"$!#,, , 	,
 , , , , ,  , , 
 , ,rw   r   c                  8   \ rS rSrSr  S*     S+S jjrS,S jr   S-       S.S jjrS/S jrS0S jr	\
S1S	 j5       r\R                  S2S
 j5       r\
S1S j5       r\R                  S2S j5       r\
S3S j5       r\
S4S j5       r\
S1S j5       r\
S5S j5       r\" \R(                  " SS95      S5S j5       r\
S4S j5       r\
S6S j5       r\
S7S j5       r\
S8S j5       r\S9S j5       r\  S:       S;S jj5       r\  S:       S;S jj5       r\      S<S j5       r\S=S j5       r\S>S j5       r \S?S@S jj5       r!  SAS jr"\SBS  j5       r#\S8S! j5       r$\" \R(                  " S"S95      S1S# j5       r%SCSDS$ jjr&SES% jr'SFS& jr(SGS' jr)SHS( jr*S)r+g)Ir   i@  z#Defines the MySQL cursor interface.Nc                R   Xl         UR                  U l        S U l        S U l        S U l        SU l        S U l        / U l        / U l	        SU l
        SU l        SU l        SU l        SU l        S U l        S U l        SU l        X l        X0l        U R                   R)                  U 5        g )Nr   Fr<  r  rK   )_connectionr   r   _description_last_insert_id	_warnings_warning_count	_executed_executed_list_stored_results_binaryr   	_rowcount_nextrow	arraysize_stmt_partitions_stmt_partition_stmt_map_resultsr   r   rh  )rs   
connectionr   r   s       ri   r   MySQLCursorAbstract.__init__C  s     5?0:
=A.26:#$*.+-*,"	 L
    	 @D',,8-:##D)rw   c                   #    U $ 7frf   r   r   s    ri   r   MySQLCursorAbstract.__aenter__f  s
        c                @   #    U R                  5       I S h  vN   g  N7frf   r  r  s       ri   r  MySQLCursorAbstract.__aexit__i  r
  r  c                   #    U $ 7f)znIterate over result set.

Iteration over the result set which calls self.fetchone()
and returns the next row.
r   r   s    ri   	__aiter__MySQLCursorAbstract.__aiter__q  s      r  c                   #     U R                  5       I Sh  vN nU(       d  [        eU$  N! [         a    [        Sef = f7f)zU
Used for iterating over the result set. Calles self.fetchone()
to get the next row.
N)rc  r7   StopAsyncIteration)rs   rows     ri   __next__MySQLCursorAbstract.__next__y  sC     
	/'C $$
 ( 	/$$.	/s#   A- +- A- ?Ac                    U R                   $ )a|  
Gets the cursor context's timeout in seconds for each attempt
to read any data from the server.

`read_timeout` is number of seconds upto which the connector should wait
for the server to reply back before raising an ReadTimeoutError. We can set
this option to None, which would signal the connector to wait indefinitely
till the read operation is completed or stopped abruptly.
r  r   s    ri   r    MySQLCursorAbstract.read_timeout  r  rw   c                b    Ub&  [        U[        5      (       a  US:  a  [        S5      eXl        g)ai  
Sets or updates the cursor context's timeout in seconds for each attempt
to read any data from the server.

`read_timeout` is number of seconds upto which the connector should wait
for the server to reply back before raising an ReadTimeoutError. We can set
this option to None, which would signal the connector to wait indefinitely
till the read operation is completed or stopped abruptly.

Args:
    timeout: Accepts a non-negative integer which is the timeout to be set
             in seconds or None.
Raises:
    InterfaceError: If a positive integer or None is not passed via the
                    timeout parameter.
Examples:
    The following will set the read_timeout of the current session's cursor
    context to 5 seconds:
    ```
    >>> cnx = await mysql.connector.connect(user='scott')
    >>> cur = await cnx.cursor()
    >>> cur.read_timeout = 5
    ```
Nr   r  r  r  s     ri   r   r
    s5    4 gs++w{$L  %rw   c                    U R                   $ )at  
Gets the cursor context's timeout in seconds for each attempt
to send data to the server.

`write_timeout` is number of seconds upto which the connector should spend to
write to the server before raising an WriteTimeoutError. We can set this option
to None, which would signal the connector to wait indefinitely till the write
operation is completed or stopped abruptly.
r  r   s    ri   r   !MySQLCursorAbstract.write_timeout  r  rw   c                b    Ub&  [        U[        5      (       a  US:  a  [        S5      eXl        g)ac  
Sets or updates the cursor context's timeout in seconds for each attempt
to send data to the server.

`write_timeout` is number of seconds upto which the connector should spend to
write to the server before raising an WriteTimeoutError. We can set this option
to None, which would signal the connector to wait indefinitely till the write
operation is completed or stopped abruptly.

Args:
    timeout: Accepts a non-negative integer which is the timeout to be set in
             seconds or None.
Raises:
    InterfaceError: If a positive integer or None is not passed via the
                    timeout parameter.
Examples:
    The following will set the write_timeout of the current session's cursor
    context to 5 seconds:
    ```
    >>> cnx = await mysql.connector.connect(user='scott')
    >>> cur = await cnx.cursor()
    >>> cur.write_timeout = 5
    ```
Nr   r  r  r  s     ri   r   r    s5    4 gs++w{$M  &rw   c                    U R                   $ )ab  Return 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  r   s    ri   descriptionMySQLCursorAbstract.description  s    $    rw   c                    U R                   $ )a  Return 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.
)r  r   s    ri   rowcountMySQLCursorAbstract.rowcount  s     ~~rw   c                    U R                   $ )zGets the value generated for an AUTO_INCREMENT column by the previous
INSERT or UPDATE statement or None when there is no such value available.
r  r   s    ri   	lastrowidMySQLCursorAbstract.lastrowid  s    
 ###rw   c                    U R                   $ )zGets warnings.r  r   s    ri   warningsMySQLCursorAbstract.warnings
       ~~rw   r  r  c                    U R                   $ )zReturns Warnings.r  r   s    ri   fetchwarnings!MySQLCursorAbstract.fetchwarnings  r  rw   c                    U R                   $ )z}Return the number of warnings.

This property returns the number of warnings generated by the previously
executed operation.
)r  r   s    ri   warning_count!MySQLCursorAbstract.warning_count  r  rw   c                p    U R                   (       d
  [        5       $ [        S U R                    5       5      $ )zKReturns column names.

This property returns the columns names as a tuple.
c              3  *   #    U  H	  oS    v   M     g7f)r   Nr   )rg   ds     ri   rj   3MySQLCursorAbstract.column_names.<locals>.<genexpr>%  s     4#3aqT#3s   )r  rq   r   s    ri   column_names MySQLCursorAbstract.column_names  s+     7N44#3#3444rw   c                    U R                   c  g U R                   R                  5       R                  S5      $ ! [        [        4 a+    [        [        U R                   R                  5       5      s $ f = f)ao  Returns the latest executed statement.

When a multiple statement is executed, the value of `statement`
corresponds to the one that caused the current result set, provided
the statement-result mapping was enabled. Otherwise, the value of
`statement` matches the statement just as provided when calling
`execute()` and it does not change as result sets are traversed.
Nzutf-8)r  r  decoder  UnicodeDecodeErrorr    rW   r   s    ri   r  MySQLCursorAbstract.statement'  sc     >>!	5>>'')0099 23 	5T^^11344	5s   (9 8A43A4c                ,    [        U R                  5      $ )zReturns whether the cursor could have rows returned.

This property returns True when column descriptions are available and possibly
also rows, which will need to be fetched.
)rb   r  r   s    ri   	with_rowsMySQLCursorAbstract.with_rows8  s     D%%&&rw   c                    g)zReturns an iterator for stored results.

This method returns an iterator over results which are stored when callproc()
is called. The iterator will provide MySQLCursorBuffered instances.
Nr   r   s    ri   stored_results"MySQLCursorAbstract.stored_resultsA  rn  rw   c                   #    g7f)aZ  Executes the given operation (a MySQL script) 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,))
```

If you want each single statement in the script to be related
to its corresponding result set, you should enable the `map_results`
switch - see workflow example below.

If the given script uses `DELIMITER` statements (which are not recognized
by MySQL Server), the connector will parse such statements to remove them
from the script and substitute delimiters as needed. This pre-processing
may cause a performance hit when using long scripts. Note that when enabling
`map_results`, the script is expected to use `DELIMITER` statements in order
to split the script into multiple query strings.

The following characters are currently not supported by the connector in
`DELIMITER` statements: `"`, `'`, #`, `/*` and `*/`.

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

Args:
    operation: Operation to be executed - it can be a single or a
               multi statement.
    params: The parameters found in the tuple or dictionary params are bound
            to the variables in the operation. Specify variables using `%s` or
            `%(name)s` parameter style (that is, using format or pyformat style).
    map_results: It is `False` by default. If `True`, it allows you to know what
                statement caused what result set - see workflow example below.
                Only relevant when working with multi statements.

Returns:
    `None`.

Example (basic usage):
    The following example runs many single statements in a
    single go and loads the corresponding result sets
    sequentially:

    ```
    sql_operation = '''
    SET @a=1, @b='2024-02-01';
    SELECT @a, LENGTH('hello'), @b;
    SELECT @@version;
    '''
    async with await cnx.cursor() as cur:
        await cur.execute(sql_operation)

        result_set = await cur.fetchall()
        # do something with result set
        ...

        while (await cur.nextset()):
            result_set = await cur.fetchall()
            # do something with result set
            ...
    ```

    In case the operation is a single statement, you may skip the
    looping section as no more result sets are to be expected.

Example (statement-result mapping):
    The following example runs many single statements in a
    single go and loads the corresponding result sets
    sequentially. Additionally, each result set gets related
    to the statement that caused it:

    ```
    sql_operation = '''
    SET @a=1, @b='2024-02-01';
    SELECT @a, LENGTH('hello'), @b;
    SELECT @@version;
    '''
    async with await cnx.cursor() as cur:
        await cur.execute(sql_operation, map_results=True)

        # statement 1 is `SET @a=1, @b='2024-02-01'`,
        # result set from statement 1 is `[]` - aka, an empty set.
        result_set, statement = await cur.fetchall(), cur.statement
        # do something with result set
        ...

        # 1st call to `nextset()` will laod the result set from statement 2,
        # statement 2 is `SELECT @a, LENGTH('hello'), @b`,
        # result set from statement 2 is `[(1, 5, '2024-02-01')]`.
        #
        # 2nd call to `nextset()` will laod the result set from statement 3,
        # statement 3 is `SELECT @@version`,
        # result set from statement 3 is `[('9.0.0-labs-mrs-8',)]`.
        #
        # 3rd call to `nextset()` will return `None` as there are no more sets,
        # leading to the end of the consumption process of result sets.
        while (await cur.nextset()):
            result_set, statement = await cur.fetchall(), cur.statement
            # do something with result set
            ...
    ```

    In case the mapping is disabled (`map_results=False`), all result
    sets get related to the same statement, which is the one provided
    when calling `execute()`. In other words, the property `statement`
    will not change as result sets are consumed, which contrasts with
    the case in which the mapping is enabled. Note that we offer a
    new fetch-related API command which can be leveraged as a shortcut
    for consuming result sets - it is equivalent to the previous
    workflow.

    ```
    sql_operation = '''
    SET @a=1, @b='2024-02-01';
    SELECT @a, LENGTH('hello'), @b;
    SELECT @@version;
    '''
    async with await cnx.cursor() as cur:
        await cur.execute(sql_operation, map_results=True)
        async for statement, result_set in cur.fetchsets():
            # do something with result set
    ```
Nr   rs   	operationparamsmap_resultss       ri   rb  MySQLCursorAbstract.executeI  r  r  c                   #    g7f)a  Executes the given operation (it can be a multi statement
or a MySQL script) substituting any markers with the given parameters.

**NOTE: `executemulti()` is deprecated and will be removed in a
future release. Use `execute()` instead.**

If you want each single statement in the script to be related
to its corresponding result set, you should enable the `map_results`
switch - see workflow example below. This capability reduces performance.

**Unexpected behavior might happen if your script includes the following
symbols as delimiters `"`, `'`, `#`, `/*` and `*/`. The use of these should
be avoided for now**.

Refer to the documentation of `execute()` to see the multi statement execution
workflow.

Args:
    operation: Operation to be executed - it can be a single or a
               multi statement.
    params: The parameters found in the tuple or dictionary params are bound
            to the variables in the operation. Specify variables using `%s` or
            `%(name)s` parameter style (that is, using format or pyformat style).
    map_results: It is `False` by default. If `True`, it allows you to know what
                statement caused what result set - see workflow example below.
                Only relevant when working with multi statements.

Returns:
    `None`.
Nr   r5  s       ri   executemulti MySQLCursorAbstract.executemulti  r  r  c                   #    g7f)a  Prepare and execute a MySQL Prepared Statement many times.

This method will prepare the given operation and execute with each tuple found
the list seq_params.

If the cursor instance already had a prepared statement, it is first closed.

executemany() simply calls execute().
Nr   )rs   r6  
seq_paramss      ri   executemanyMySQLCursorAbstract.executemany  r  r  c                   #    g7f)zReturn next row of a query result set.

Raises:
    InterfaceError: If there is no result to fetch.

Returns:
    tuple or None: A row from query result set.
Nr   r   s    ri   rc  MySQLCursorAbstract.fetchone	  r  r  c                   #    g7f)zReturn all rows of a query result set.

Raises:
    InterfaceError: If there is no result to fetch.

Returns:
    list: A list of tuples with all rows of a query result set.
Nr   r   s    ri   fetchallMySQLCursorAbstract.fetchall	  r  r  c                   #    g7f)a  Return the next set of rows of a query result set.

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.

Returns:
    list: The next set of rows of a query result set.
Nr   )rs   sizes     ri   	fetchmanyMySQLCursorAbstract.fetchmany	  r  r  c                 #    SnU R                   (       d  U R                  n U R                  5       I Sh  vN nU R                   (       a  U R                  OUU47v   U R	                  5       I Sh  vN (       a]   U R                  5       I Sh  vN nU R                   (       a  U R                  OUU47v   U R	                  5       I Sh  vN (       a  M\  gg N! [         a    / n Nf = f N{ N_! [         a    / n Nkf = f N77f)a  Generates the result sets stream caused by the last `execute*()`.

Returns:
    A 2-tuple; the first element is the statement that caused the
    result set, and the second is the result set itself.

Example:
    Consider the following example where multiple statements are executed in one
    go:

    ```
        sql_operation = '''
        SET @a=1, @b='2024-02-01';
        SELECT @a, LENGTH('hello'), @b;
        SELECT @@version;
        '''
        async with await cnx.cursor() as cur:
            await cur.execute(sql_operation, map_results=True)

            result_set, statement = await cur.fetchall(), cur.statement
            # do something with result set
            ...

            while (await cur.nextset()):
                result_set, statement = await cur.fetchall(), cur.statement
                # do something with result set
                ...
    ```

    In this case, as an alternative to loading the result sets with `nextset()`
    in combination with a `while` loop, you can use `fetchsets()` which is
    equivalent to the previous approach:

    ```
        sql_operation = '''
        SET @a=1, @b='2024-02-01';
        SELECT @a, LENGTH('hello'), @b;
        SELECT @@version;
        '''
        async with await cnx.cursor() as cur:
            await cur.execute(sql_operation, map_results=True)
            async for statement, result_set in cur.fetchsets():
                # do something with result set
    ```
N)r  r  rD  r7   nextset)rs   statement_cached
result_sets      ri   	fetchsetsMySQLCursorAbstract.fetchsets%	  s     h  %%#~~	#}}.J #44DNN:J 	 LLN"" #'==?2
 #'"8"8>N  LLN""" / 	J	
 #2!  
  #s    DC CC 7D2C.3	D=C2 C0C2 7DD	DDC C+(D*C++D0C2 2D>D DDc                   #    g7f)a[  Makes the cursor skip to the next available set, discarding
any remaining rows from the current set.

This method should be used as part of the multi statement
execution workflow - see example below.

Returns:
    It returns `None` if there are no more sets. Otherwise, it returns
    `True` and subsequent calls to the `fetch*()` methods will return
    rows from the next result set.

Example:
    The following example runs many single statements in a
    single go and loads the corresponding result sets
    sequentially:

    ```
    sql_operation = '''
    SET @a=1, @b='2024-02-01';
    SELECT @a, LENGTH('hello'), @b;
    SELECT @@version;
    '''
    async with await cnx.cursor() as cur:
        await cur.execute(sql_operation)

        result_set = await cur.fetchall()
        # do something with result set
        ...

        while (await cur.nextset()):
            result_set = await cur.fetchall()
            # do something with result set
            ...
    ```

    In case the operation is a single statement, you may skip the
    looping section as no more result sets are to be expected.
Nr   r   s    ri   rK  MySQLCursorAbstract.nextsetm	  r  r  c                   #    g7f)zClose the cursor.Nr   r   s    ri   r  MySQLCursorAbstract.close	  r  r  r  c                    U R                   $ )zReturn the value generated for an AUTO_INCREMENT column.

Returns the value generated for an AUTO_INCREMENT column by the previous
INSERT or UPDATE statement.
r  r   s    ri   getlastrowid MySQLCursorAbstract.getlastrowid	  s     ###rw   c                   #    g7f)zReset the cursor to default.Nr   )rs   frees     ri   resetMySQLCursorAbstract.reset	  r  r  c                R    [        U S5      (       a  U R                  R                  $ g)zlGets a list of query attributes from the connector's side.

Returns:
    List of existing query attributes.
r  N)hasattrr  r  r   s    ri   get_attributes"MySQLCursorAbstract.get_attributes	  s&     4''##///rw   c                    [        U[        5      (       d  [        S5      eUb$  [        U[        5      (       d  [        SU S35      eU R                  R                  X45        g)a  Add a query attribute and its value into the connector's query attributes.

Query attributes must be enabled on the server - they are disabled by default. A
warning is logged when setting query attributes for a server connection
that does not support them.

Args:
    name: Key name used to identify the attribute.
    value: A value converted to the MySQL Binary Protocol.

Raises:
    ProgrammingError: If the value's conversion fails.
&Parameter `name` must be a string typeNzObject z$ cannot be converted to a MySQL type)r&  rW   r:   r%   r  rP  )rs   r%  rC  s      ri   add_attribute!MySQLCursorAbstract.add_attribute	  sa     $$$"#KLLZ~%F%F"% DE  	++TM:rw   c                x    [        U[        5      (       d  [        S5      eU R                  R	                  U5      $ )zRemoves a query attribute by name from the connector's query attributes.

If no match, `None` is returned, else the corresponding value is returned.

Args:
    name: Key name used to identify the attribute.

Returns:
    value: Attribute's value.
r`  )r&  rW   r:   r  rU  rT  s     ri   remove_attribute$MySQLCursorAbstract.remove_attribute	  s4     $$$"#KLL22488rw   c                8    U R                   R                  5         g)z<Clears the list of query attributes on the connector's side.N)r  rX  r   s    ri   clear_attributes$MySQLCursorAbstract.clear_attributes	  s    **,rw   )r  r  r  r  r  r  r   r  r   r   r  r  r  r  r  r  r  r   r  r  )r  r   r   r  r   r  )ry   r   r  r  )ry   zIterator[RowType])ry   rE   r  r  )ry   r  r  )ry   zOptional[List[WarningType]])ry   zTuple[str, ...]r  r  )ry   zIterator[MySQLCursorAbstract])r   F)r6  rW   r7  z$Union[Sequence[Any], Dict[str, Any]]r8  rb   ry   rz   )r6  rW   r>  zSequence[ParamsSequenceType]ry   rz   )ry   r  )ry   zList[RowType]r  )rG  rU   ry   zList[Sequence[Any]])ry   z9AsyncGenerator[tuple[Optional[str], list[RowType]], None])ry   r  )T)rX  rb   ry   r   )ry   z.Optional[List[Tuple[str, BinaryProtocolType]]])r%  rW   rC  r=   ry   rz   r  rx   ),r{   r|   r}   r~   r   r   r   r  r  r  r  r   r  r   r  r  r  r  r"   r-   r2  r  r"  r(  r  r/  r   r2  rb  r;  r?  rc  rD  rH  rN  rK  r  rU  rY  r]  ra  rd  rg  r   r   rw   ri   r   r   @  s   -
 '+'+	!*+!* $!* %	!*F
 37-1-1	/ + +	
 
 
" 
" % %@ 
# 
# & &@ ! !& 
 
 $ $   )00zJK L # # 5 5 5 5  ' '    8:!	AA 5A 	A
 
A AF  8:!	## 5# 	#
 
# #J  1 
	      	 	F	BFP & &P     )00{KL$ M$+;,9-rw   r   c                      \ rS rSrSrSrg)CMySQLPrepStmti	  a<  Structure to represent a result from `CMySQLConnection.cmd_stmt_prepare`.
It can be used consistently as a type hint.

`_mysql_connector.MySQLPrepStmt` isn't available when the C-ext isn't built.

In this regard, `CmdStmtPrepareResult` acts as a proxy/wrapper entity for a
`_mysql_connector.MySQLPrepStmt` instance.
r   N)r{   r|   r}   r~   r   r   r   rw   ri   rj  rj  	  s    rw   rj  )fr   
__future__r   __all__r   r  rn   r   abcr   r   dataclassesr	   r
   inspectr   typesr   typingr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    _decoratingr"   	abstractsr#   r$   r%   r&   r'   r(   r)   r*   	constantsr+   r,   r-   r.   r/   r0   r1   r2   r3   
conversionr4   r5   errorsr6   r7   r8   r9   r:   tls_ciphersr;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   utilsrI   rJ   authenticationrL   rN   rM   rV   rO   networkrP   rQ   r%  r  r   r   r   rj  r   rw   ri   <module>r{     s   @ 2 "
J  	 	  # (       . %	 	 	
 
 
 <  S    2 . ' #8 77g % % %D[c [|4W
-# W
-t^ rw   