/var/opt/nydus/ops/mysql/connector/aio/__pycache__
NameSizeModeActions
abstracts.cpython-312.pyc1155400644editdlrm
authentication.cpython-312.pyc131520644editdlrm
charsets.cpython-312.pyc173430644editdlrm
connection.cpython-312.pyc708760644editdlrm
cursor.cpython-312.pyc601950644editdlrm
logger.cpython-312.pyc3510644editdlrm
network.cpython-312.pyc305960644editdlrm
pooling.cpython-312.pyc302760644editdlrm
protocol.cpython-312.pyc115140644editdlrm
utils.cpython-312.pyc59830644editdlrm
_decorating.cpython-312.pyc43120644editdlrm
__init__.cpython-312.pyc4930644editdlrm
Edit: /var/opt/nydus/ops/mysql/connector/aio/__pycache__/abstracts.cpython-312.pyc (115540B)
N j͒vdZddlmZddlmZgdZddlZddlZddlZddl Z ddl m Z m Z ddl mZmZddlmZdd lmZdd lmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(d d l)m*Z*d d l+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3d dl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;mm?Z?m@Z@d dlAmBZBmCZCmDZDmEZEmFZFd dlGmHZHmIZId dlmJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUd dlVmWZWmXZXddlYmZZZddl[m\Z\m[Z[ddl]m^Z^erddl_m`Z`maZaejdk(ZceGddZdGdde ZeGdde ZfGd d!eWZgy)"z+Module gathering all abstract base classes.) annotations)read_option_files)MySQLConnectionAbstractMySQLCursorAbstract ServerInfoN)ABCabstractmethod) dataclassfield) signature) TracebackType) TYPE_CHECKINGAnyAsyncGenerator AwaitableBinaryIOCallableClassVarDequeDict GeneratorIteratorListMappingNoReturnOptionalSequenceTupleTypeUnioncast) deprecated)DUPLICATED_IN_LIST_ERRORKRB_SERVICE_PRINCIPAL_ERRORMYSQL_PY_TYPESOPENID_TOKEN_FILE_ERRORTLS_V1_3_SUPPORTEDTLS_VER_NO_SUPPORTEDTLS_VERSION_ERRORTLS_VERSION_UNACCEPTABLE_ERROR) CONN_ATTRS_DNDEFAULT_CONFIGURATIONDEPRECATED_METHOD_WARNINGMYSQL_DEFAULT_CHARSET_ID_57MYSQL_DEFAULT_CHARSET_ID_80OPENSSL_CS_NAMESTLS_CIPHER_SUITES TLS_VERSIONS ClientFlag)MySQLConverterMySQLConverterBase)ErrorInterfaceError InternalErrorNotSupportedErrorProgrammingError)UNACCEPTABLE_TLS_CIPHERSUITESUNACCEPTABLE_TLS_VERSIONS) BinaryProtocolTypeDescriptionType EofPacketType HandShakeTypeMySQLScriptPartition OkPacketTypeParamsSequenceType ResultTypeRowTypeStatsPacketType StrOrBytes WarningType)GenericWrapper import_object)MySQLAuthenticator)Charsetcharsets) MySQLProtocol)MySQLTcpSocketMySQLUnixSocketposixceZdZUdZded<ded<edZded <ded <ded <ded <ded <ded<ded<dZded<ddZy)rzStores the server information retrieved on the handshake. Also parses and validates the server version, storing it as a tuple. intprotocolstrversionF)initzTuple[int, ...] version_tuple thread_idcharset status_flags auth_pluginbytes auth_data capabilitiesboolquery_attrs_is_supportedctjd}|j|j}|s t dt d|j ddD}|dkrt d|jd||_y ) zParse 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})(.*)zFailed parsing MySQL versionc32K|]}t|ywN)rU).0vs N/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/aio/abstracts.py z+ServerInfo.__post_init__..s<(;1A(;sr)rLzMySQL Version 'z' is not supportedN)recompilematchrXr8tuplegroupsrZ)self version_rerorXs ri __post_init__zServerInfo.__post_init__s| ZZ GH   . !?@ @< q(;<< V  ?4<<.@R!ST T$NreturnNone) __name__ __module__ __qualname____doc____annotations__r rZrcrtrurirrsT M L%*%6M?6N L%*d*%rurc0 eZdZUdZddddddddddddddddiddddddddddededdded ed ed dd ddddded dddddd/ ddZddZ d ddZddZddZ ddZ ddZ e d ddZ eeddZeddZeddZeddZeddZeddZej,ddZedd Zej,dd!Zedd"Zej,dd#Zdd$Zdd%Zedd&Zej,dd'Zedd(Zej,dd)Zedd*Zedd+Zedd,Zedd-Z edd.Z!edd/Z"e"j,dd0Z"dd1Z#dd2Z$edd3Z%e%j,dd4Z%dd5Z&dd6Z'edd7Z(e(j,dd8Z(dd9Z)dd:Z*edd;Z+e+j,dd<Z+edd=Z,e,j,dd>Z,edd?Z-e-j,dd@Z-eddAZ.eddBZ/eddCZ0eddDZ1e1j,ddEZ1eddFZ2eddGZ3eddHZ4ddIZ5 d ddJZ6ddKZ7ddLZ8ddMZ9e:e;jxdNOddPZ=e:e;jxdQOddRZ>eddSZ?eddTZ@eddUZAeddVZBe d ddWZCe:e;jxdOddXZDeddYZEeEj,ddZZEe:e;jxdOdd[ZFedd\ZGeGj,dd]ZGedd^ZHeHj,dd_ZHdd`ZIddaZJddbZKddcZLdddZMddeZNddfZOddgZPeddhZQdddiZRddjZSeddkZTeTZUdleVdm<e d ddnZWe d ddoZXe d ddpZYeddqZZeddrZ[ d ddsZ\e d ddtZ]edduZ^eddvZ_e d ddwZ` ddxZae d ddyZbe ddzZce d dd{Zde dd|Zeedd}Zfedd~Zg ddZheddZiedddZjeddZkeddZleddZmeddZne d ddZoy)rz'Defines the MySQL connection interface.Nz 127.0.0.1i Fallow_local_infileallow_local_infile_in_pathconnect_timeout read_timeout write_timeoutT ssl_disabled)/userpasswordhostportdatabase password1 password2 password3r\ collationr^ client_flagscompressconsume_results autocommit time_zone conn_attrssql_mode init_command get_warningsraise_on_warningsbufferedrawkerberos_auth_modekrb_service_principalopenid_token_filewebauthn_callbackrrconverter_classconverter_str_fallbackconnection_timeoutrr unix_socket use_unicodessl_cassl_certssl_keyssl_verify_certssl_verify_identityr tls_versionstls_ciphersuitesloopoci_config_fileoci_config_profilerrc/zd|_ ||_||_||_||_||_||_||_||_|#|_ | |_ |!|_ |"|_ ||_ | |_||_||_||_||_||_t)|_d|_| |_ | |_ d|_|*|_|%|_|&|_|'|_|(|_|)|_|+|_ |,|_!| |_"d|_#d|_$d|_%|-xstMjN|_(| xstSjT|_+d|_,t[j\|_/i|_0d|_1g|_2tg|_4|xstj|_6||_7||_8||_9||_:||_;||_<||_=||_>||_?||_@|$|_Ad|_Bd|_Cd|_D|.|_E |/|_F ||_Gd|_Hd|_I d|_J |jy)NF)L!_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_commandrP _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_pool_config_version _handshakeasyncioget_event_loop_loopr4 get_default _client_flags _server_infoweakrefWeakSet_cursors _query_attrs_query_attrs_supported _columns_descrM_authenticatorr5_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)0rrrrrrrrrrr\rr^rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrs0 ri__init__z MySQLConnectionAbstract.__init__s]l-1  &  &(((!,(: ,8-:1;'&5!+)2(0,8(5IM ,3C1:@!&#/&, (0'. 0?4G!2>6F+615)-!37  ,G**, #/"J*2H2H2J26)0): ;=+0#462D2F6E6W-C$2D 5J#1B); :T(#/'8' "-',$)%*/>-2D   48=A$ ((, ( ))+rucbK|js|jd{|S7wrf)is_socket_connectedconnectrrs ri __aenter__z"MySQLConnectionAbstract.__aenter__6s+''),,.   !s $/-/c@K|jd{y7wrfcloserrexc_type exc_value tracebacks ri __aexit__z!MySQLConnectionAbstract.__aexit__; jjl c |jr |jj|_|jrtj g|_|jrtjj|j}|r>tjj|rtjj|rtjj|r td|js |jrtjg|_ntj g|_|j dk(rt#d|j d|j$rtj&dk(rd|_|j(r4|j d k(r t#d |j d k(r t#d t+|j,t.s t#d t1|j2|j4|j6grt9|j6|j4gs td|j6du|j4duk7r td|j:|j=|j>|jAt+|jBtDs t#d|jBjGD]\}}|tHvrt+|tJst#d|d|jBdtM|dkDrt#d|d|jOdr t#dt+|tJst#d|d|dtM|dkDst#d|d|d|jPtjRzr|jU|jVrt+|jVtJs t#d|jVjY}|dk(r&tj&dk7r t#d d!|_-n|d"k(rd#|_-n t#d$|j\rt+|j\tJst#t_j`d%&|j\d'k(rt#t_j`d(&d)|j\vrt#t_j`d*&|jbr|jed+|jbd,|jfrt+|jftJst#tij`d%&|jfd'k(rt#tij`d-&tjj|jfst#d.|jfd/|jj4t+|jjt.r|jjd0kr t#d1|jl5t+|jlt.r|jld0kr t#d2yy#t$r}td|d}~wwxYw)3zValidate connection options.z'user' must be a stringNz.allow_local_infile_in_path must be a directoryauthentication_webauthn_client'z5' cannot be used as the default authentication pluginrSTmysql_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 neitherzconn_attrs must be of type dictz+Attribute name should be a string, found: 'z' in ' zAttribute 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 typeiz$' exceeds 1024 characters limit sizez('kerberos_auth_mode' must be of type strsspintz6'kerberos_auth_mode=SSPI' is only available on WindowsMySQLSSPIKerberosAuthPlugingssapiMySQLKerberosAuthPluginz@Invalid 'kerberos_auth_mode' mode. Please use 'SSPI' or 'GSSAPI'zis not a string)errorrzcan not be an empty string/zis incorrectly formattedwebauth_callbackrLzcannot be an empty stringz The path 'z1' provided via 'openid_token_file' does not existrz.Option read_timeout must be a positive integerz/Option write_timeout must be a positive integer)7rstripAttributeErrorrr4COMPRESSrrospathabspathexistsisdirislinkr LOCAL_FILESrr8rnamer isinstancerrUanyrrrallr_validate_tls_versionsr_validate_tls_ciphersuitesrdictitemsr,rWlen startswithr CONNECT_ARGS_add_default_conn_attrsrlowerrrr%formatr_validate_callablerr'rr)rrerrinfile_in_path attr_name attr_valuers rirz4MySQLConnectionAbstract._validate_connection_optionsCs :: I!ZZ--/  >>!+!4!4 5D   + +WW__T-M-MNNGGNN>2 n577>>.1$%UVV  # #t'G'G!+!7!7 8D ","8"8!8 9D     @ @ D%%&'    G!3!%D      $::$   $JJ$[$**c* !JK K  dnndmm< = t~~67$P %4>>T+AB$J!!-++-%%1//1$00$7 !BC C%)%;%;%A%A%C !IzM)i-$!{&)?)?(@C 9~"$&yk1ST##C($0 j#.$!)JzlC'' :%$!)JzlC999&DB    7 7 7  ( ( *  # #d66<$%OPP!%!9!9!?!?!A !V+77d?(P+H'#x/*C'$V  & &d993?$/66=NO**b0$/66: $555$/66=WX  " "  # #$68O8OQR S  " "d55s;$+229JK&&",$+229TU77>>$"9"9:$ !8!8 9:%%    )d00#6$:L:Lq:P$%UVV    *d11374;N;NQR;R$%VWW?SH IsY Y+ Y&&Y+c |j}gd}|D]\}} ||vr||||<||=td i|}|jdd|_|jdd|_|jdt j|_|jdt|_ |jD]0\}} t|d |z} t|||j2|j!y #t$rYwxYw#t$rtd|dd wxYw#t$rt|||YwxYw) anInternal utility to set or update the connection options. Args: **kwargs: For a complete list of possible arguments, see [1]. Raises: AttributeError: When provided unsupported connection arguments. References: [1]: https://dev.mysql.com/doc/connector-python/en/connector-python-connectargs.html ))dbr)usernamer)passwdr)rr)read_default_file option_filesrFrrrzUnsupported argument 'r Nr r~)copyKeyErrorrpoprrr4rrr5rr'r-rsetattrrr) rrkwargsconfig compat_mapcompat translatekeyvalue attributes ri_set_connection_optionsz/MySQLConnectionAbstract._set_connection_optionss^ ", FI F*(.vF9%6N ",#,V,#JJ~u=!',?!G"JJ~z7M7M7OP%zz*;^L!,,.JC P%c*c I 0i7) ))+3    P$'=cU!%DE4O P " 0i/ 0s/D DD, D  D D),EEcg}|j}t|tr|jdr|j dst d|d|ddj d}|s t d|D]4}|jj}|s$|j|6n8t|ttfr|Dcgc]}|s| }}nt d |d|j td d n|jd d }|jd |d }ggg}i}g} td tj|dzD]2} |j!t"| | j%t&| 4|D]} d| vr9| | vr5| t&dvr|dj| +|d j| @| |vrd|| } | |vr t t)j*d| | t"dvr|dj|| |d j|| t d| d|d s|ds t d|d D]*} | t,dj/vst1d| d|dD]*} | t,dj/vst1d| ddj3|d dj3|dg|_y cc}w)z&Validates the tls_ciphersuites option.[]z)tls_ciphersuites must be a list, found: 'r rL,z6No valid cipher suite found in 'tls_ciphersuites' listzItls_ciphersuites should be a list with one or more ciphersuites. Found: 'NT)reverser-TLSv1.3rlistrCz The value 'z1' in tls_ciphersuites is not a valid cipher suitez:No valid cipher suite found in the 'tls_ciphersuites' listzTLSv1.2zCipher z( when used with TLSv1.2 is unacceptable.z( when used with TLSv1.3 is unacceptable.:)rr!rWr)endswithrsplitrupperappendrOsetrr3sortindexupdater2extendr1r$r-r<valuesr:join)rrrtls_cstls_css_tls_csr newer_tls_vertranslated_namesiani_cipher_suites_namesossl_cipher_suites_namestls_verr translated_namecipher_as_ossls rir%z2MySQLConnectionAbstract._validate_tls_ciphersuitessb'' fc "%%c*vs/C$?xqIQrl((-G$L# ,,...0$++G4# s ,5;FV6vV F ))/3  $119LOt?Q?QRS?T  $'$Q .0H#% .0 $$Kl&8&8&G!&KLG $ + +,=g,F G $ + +, L  /q1N!>y!I!P!P!RR'n--UV2 /q1N!>y!I!P!P!RR'n--UV2 HH%a( ) HH%a( )" G Gs K Kcg}|j}t|tr|jdr|j dst d|d|ddj d}|D]M}|j}|dk(r||vr t tjd | |j|O|d gk(rtst tj|tt|trJ|s t d |D]7}||vr t tjd | |j|9nNt|tr|D]}|j|n%t d dj!td|d|s t dg}g}g}|D]F}|tvr|j||t"vr|j|6|j|H|r7|d gk(r)ts#t%tj|t||_y|r#t%t'j|t|r#t t)jty)z"Validates the tls_versions option.rGrHz%tls_versions must be a list, found: 'r rLrIrJrrrNrMzJAt 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)rr!rWr)rQrrRrr$r-rTr(r)r3rOrUr[r=r:r+r*)rrr tls_versiontls_versrcuse_tls_versionsunacceptable_tls_versionsinvalid_tls_versionss rir$z.MySQLConnectionAbstract._validate_tls_versionsys (( k3 '**3/K4H4H4M$;K=J#1R(..s3H#%mmo "$,.(077!/{ ##K0$I;&/A$(// \J T *$*'l*(077!/w ##G,' S )&##G,'!ii -.jaI   C  $&!!#G,& ''033)009$++G4 $ I;.7I'(// \J"2D  &#.55-|  " !2!9!9'{m1#MN N8,778  !"K= H:6))3 6  " :&#0c9 :s A// B 8 BB cy)zMySQL connection ID.Nr~rs ri connection_idz%MySQLConnectionAbstract.connection_idruc|jS)z$User used while connecting to MySQL.)rrs rirzMySQLConnectionAbstract.userzzruc|jS)z MySQL server IP address or name.)rrs ri server_hostz#MySQLConnectionAbstract.server_hostrxruc|jS)zMySQL server TCP/IP port.)rrs ri server_portz#MySQLConnectionAbstract.server_portrxruc|jS)z MySQL Unix socket file location.)rrs rirz#MySQLConnectionAbstract.unix_socket   ructd)Get the current database.zoThe use of async properties are not supported by Python. Use `await get_database()` to get the database insteadr;rs rirz MySQLConnectionAbstract.databases E  ructd)Set the current database.zsThe use of async properties are not supported by Python. Use `await set_database(name)` to set the database insteadrrrrCs rirz MySQLConnectionAbstract.database I  ruc|jS)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. rrs rirz$MySQLConnectionAbstract.read_timeout!!!rucV| t|tr|dkr td||_y)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 ``` Nr6Option read_timeout must be a positive integer or Noner!rUr8rrrtimeouts rirz$MySQLConnectionAbstract.read_timeout#s42  gs+w{$L%ruc|jS)a 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. rrs rirz%MySQLConnectionAbstract.write_timeoutC"""rucV| t|tr|dkr td||_y)a 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 ``` Nr7Option write_timeout must be a positive integer or Noner!rUr8rrs rirz%MySQLConnectionAbstract.write_timeoutPs42  gs+w{$M&rucJK|jdd{}|dS7 w)rzSELECT DATABASE()Nr info_query)rrresults ri get_databasez$MySQLConnectionAbstract.get_databaseps'':;;ay< #! #cHK|jd|d{y7w)rzUSE N) cmd_queryrs ri set_databasez$MySQLConnectionAbstract.set_databaseusnntE7^,,,s " "c|jS)z"Returns whether to consume results)rrs rican_consume_resultsz+MySQLConnectionAbstract.can_consume_resultsy$$$ruc6t|tsJ||_y)zSet if can consume results.N)r!rbrrs rirz+MySQLConnectionAbstract.can_consume_results~s%&&& %ruc|jS)z'Returns the pool configuration version.rrs ripool_config_versionz+MySQLConnectionAbstract.pool_config_versions(((ruc||_y)z#Sets the pool configuration versionNrrs rirz+MySQLConnectionAbstract.pool_config_versions %*!ruc|jS)z(MySQL session has started a transaction.)rrs riin_transactionz&MySQLConnectionAbstract.in_transactions###ruc|jS)zReturn the event loop.)rrs rirzMySQLConnectionAbstract.looprxrucJ|jxs|jduxrtS)z&Return True if is a secure connection.N)rrIS_POSIXrs ri is_securez!MySQLConnectionAbstract.is_secures%OD$5$5T$A$NhOrucHt|jjS)zReturns query attributes list.)rOrr'rs ri query_attrsz#MySQLConnectionAbstract.query_attrssD%%++-..ruc|jS)zReturn if have next result.)rrs rihave_next_resultz(MySQLConnectionAbstract.have_next_results%%%ructd)$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 insteadrrs rirz"MySQLConnectionAbstract.autocommitrructd)Toggle autocommit.zxThe use of async properties are not supported by Python. Use `await set_autocommit(value)` to set the autocommit insteadrrs rirz"MySQLConnectionAbstract.autocommit N  rucPK|jdd{}|ddk(S7 w)rzSELECT @@session.autocommitNrrLrrs riget_autocommitz&MySQLConnectionAbstract.get_autocommits,oo&CDDQx1}Es &$ &cbK|rdnd}|jd|d{||_y7 w)rONOFFzSET @@session.autocommit = N)rr)rrrCswitchs riset_autocommitz&MySQLConnectionAbstract.set_autocommits7Enn:6(CDDD  Es /- /ctd)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 insteadrrs rirz!MySQLConnectionAbstract.time_zones G  ructd)Sets the time zone.zxThe use of async properties are not supported by Python. Use `await get_autocommit(value)` to get the autocommit insteadrrs rirz!MySQLConnectionAbstract.time_zonerrucJK|jdd{}|dS7 w)rzSELECT @@session.time_zoneNrrrs ri get_time_zonez%MySQLConnectionAbstract.get_time_zones'oo&BCCQxDrcXK|jd|dd{||_y7 w)rzSET @@session.time_zone = 'r N)rrrs ri set_time_zonez%MySQLConnectionAbstract.set_time_zones/nn:5'CDDD Es *( *c Ktdw)Gets the SQL mode.zoThe use of async properties are not supported by Python. Use `await get_sql_mode()` to get the SQL mode insteadrrs rirz MySQLConnectionAbstract.sql_modes E   c Ktdw)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 insteadrrs rirz MySQLConnectionAbstract.sql_modes J  rcK|j!|jdd{d|_|jS7w)rNzSELECT @@session.sql_moder)rrrs ri get_sql_modez$MySQLConnectionAbstract.get_sql_modes: >> !$(OO4O$PPRSTDN~~Qs !><>cKt|ttfrdj|}|j d|dd{||_y7 w)rrJzSET @@session.sql_mode = 'r N)r!rOrpr[rrrs ri set_sql_modez$MySQLConnectionAbstract.set_sql_modesL edE] +HHUOEnn9%BCCC DsAAA Ac|jS)zGet whether this connection retrieves warnings automatically. This method returns whether this connection retrieves warnings automatically. )rrs rirz$MySQLConnectionAbstract.get_warningss !!!rucHt|ts td||_y)aSet 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!rbrmrrs rirz$MySQLConnectionAbstract.get_warningss"%&67 7"ruc|jS)zGet whether this connection raises an error on warnings. This method returns whether this connection will raise errors when MySQL reports warnings. )_raise_on_warningsrs rirz)MySQLConnectionAbstract.raise_on_warnings%s&&&ruc\t|ts td||_|r||_yy)aSet 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. rN)r!rbrmrrrs rirz)MySQLConnectionAbstract.raise_on_warnings.s2%&67 7"' !&D  ruc|jS)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. )rrs ri unread_resultz%MySQLConnectionAbstract.unread_resultC"""rucHt|ts td||_y)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. rN)r!rbrmrrs rirz%MySQLConnectionAbstract.unread_resultLs"%&67 7#ruc.|jjS)a Returns 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. )_charsetrrs rirz!MySQLConnectionAbstract.collationZs}}&&&ruc.|jjS)aReturn 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. rr rs rir\zMySQLConnectionAbstract.charsetfs}}!!!ruc.|jjS)zThe charset ID utilized during the connection phase. If the charset ID hasn't been set, the default charset ID is returned. )r charset_idrs rirz"MySQLConnectionAbstract.charset_idps }}'''ruc|jb|jtjtStj|jj dkrtnt |_|jS)BThe charset object encapsulates charset and collation information.)r)rrrO get_by_idr/rZr0rs rirz MySQLConnectionAbstract._charsetxsj >> !  (  ))*EFF%//((66?04 DN~~ruc||_y)rN)rrs rirz MySQLConnectionAbstract._charsets rucx|j|jjdvry|jjS)a^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. )utf8mb4utf8mb3binaryutf8rrs ripython_charsetz&MySQLConnectionAbstract.python_charsets9 == DMM$6$6; % }}!!!rucy)z&Add the default connection attributes.Nr~rs rir+z/MySQLConnectionAbstract._add_default_conn_attrsrvruc Kyw)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~)rrquerys ri_execute_queryz&MySQLConnectionAbstract._execute_querycK|j|jjd{|j|jd{|j r#|j |j d{|jr#|j|jd{|jr$|j|jd{yy777h7;7w)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_collationrrrrrrrrrrrs ri_post_connectionz(MySQLConnectionAbstract._post_connections((1I1I(JJJ!!$"2"2333 ??$$T__5 5 5 >>##DNN3 3 3   %%d&8&89 9 9  K3 5 3 9sW*C-C#"C-C%.C->C'?.C--C)..C-C+C-%C-'C-)C-+C-cKd}t|ttfs|t|j dt|ts | td|rO|rMt|trt j |jn|}t j|||_ n|rpt|trt j ||_ nt|trt j||_ nZt|j d|rt j||_ n#td}t j||_ |jd|jjd|jjdd{|jr0|jj!|jjyy7Aw)aSet 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!rUrWrmr-rOrr get_by_name_and_collationr get_by_nameget_by_collationr-rrr set_charset)rrr\rerr_msg charset_strs rirz-MySQLConnectionAbstract.set_charset_collations2@'C:.73FW^^I67 7)S)i.CHI I ygs+""7+00  %>>{IVDM '3' ( 2 27 ; GS) ( 4 4W =   !:;; $55i@DM+I6G$009DMnn$--,,-[9P9P8QQR S    >> NN & &t}}'9'9 :   sFGGAGc&|j|zdkDS)z|Checks if a client flag is set. Returns: `True` if the client flag was set, `False` otherwise. rr)rrflags riisset_client_flagz)MySQLConnectionAbstract.isset_client_flags ""T)Q..ruc||_y)zySet the path that user can upload files. Args: path (str): Path that user can upload files. N)r)rrrs riset_allow_local_infile_in_pathz6MySQLConnectionAbstract.set_allow_local_infile_in_paths ,0(ruc|S)zReturn self for weakref.proxy. This method is used when the original object is needed when using weakref.proxy. r~rs riget_selfz MySQLConnectionAbstract.get_self s  ruserver_version property_namec|jS)Gets the MySQL version. Returns: The MySQL server version as a tuple. If not previously connected, it will return `None`. )rrs riget_server_versionz*MySQLConnectionAbstract.get_server_versions"""ru server_infoc|jS)Gets the original MySQL version information. Returns: The original MySQL server as text. If not previously connected, it will return `None`. )rrs riget_server_infoz'MySQLConnectionAbstract.get_server_infosrucH|j|jjSy)rN)rrZrs rirz&MySQLConnectionAbstract.server_version&s%    ($$22 2rucL |jdS#ttf$rYywxYw)rserver_version_originalN)r TypeErrorr:rs rirz#MySQLConnectionAbstract.server_info2s. ??#<= =8$  s ##cy)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~rs rirz+MySQLConnectionAbstract.is_socket_connected?rvruc Kyw)aReports 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~rs ri is_connectedz$MySQLConnectionAbstract.is_connectedGrrc Kyw)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~)rr reconnectattemptsdelays ripingzMySQLConnectionAbstract.pingPrrc(||_|jS)aSet the client flags. The flags-argument can be either an int or a list (or tuple) of ClientFlag values. If it is an integer, it will set client_flags to flags as is. If flags is a list or tuple, each flag will be set or unset when it's negative. 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)rrflagss riset_client_flagsz(MySQLConnectionAbstract.set_client_flagscs"   ruc|jS)z-Gets the client flags of the current session.rrs rirz$MySQLConnectionAbstract.client_flagsts!!!ruct|tr |dkDr||_yt|ttfrB|D]<}|dkr |xjt |zc_(|xj|zc_>yt d)aSets 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. rz.client_flags setter expect integer (>0) or setN)r!rUrrprOabsr;)rrrrs rirz$MySQLConnectionAbstract.client_flagsysq eS !eai!&D  t} -!8&&3t9*4&&&$.&  ##ST Truc||_y)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)rrr convclasss riset_converter_classz+MySQLConnectionAbstract.set_converter_classs  )ruc|jS)z5Gets the converter class set for the current session.)rrs rirz'MySQLConnectionAbstract.converter_classrruc|r_t|trO||_||jj|j |_|j|j _ytd)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) issubclassr6rrr rrr str_fallbackr rs rirz'MySQLConnectionAbstract.converter_classsY I/AB$-D !&t}}'9'94;K;KLDN*.*F*FDNN 'S ruc|jS)z7Gets whether we return string fields as unicode or not.)rrs rirz#MySQLConnectionAbstract.use_unicoder~rucb||_|jr|jj|yy)zSets whether we return string fields as unicode or not. Args: value: A boolean - default is `True`. N)rr set_unicoders rirz#MySQLConnectionAbstract.use_unicodes*" >> NN & &u - rucJ|\}}||jvr||j|<yy)aAdd 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. Nr)rrrCr1r2s riquery_attrs_appendz*MySQLConnectionAbstract.query_attrs_appends1!& : D-- -+5D  i ( .ruc:|jj|dS)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)rr;rrr s riquery_attrs_removez*MySQLConnectionAbstract.query_attrs_removes  $$T400ruci|_y)z5Clears query attributes list on the connector's side.Nr'rs riquery_attrs_clearz)MySQLConnectionAbstract.query_attrs_clears rucK|jr|jd{y|jr tdy7w)zHandle unread result. Consume pending results if is configured for it. Raises: InternalError: When there are pending results and they were not consumed. NzUnread result found)rrrr9rs rihandle_unread_resultz,MySQLConnectionAbstract.handle_unread_resultsB  &&( ( (    56 6  )s AAAcZK|jr|jd{yy7w)zConsume pending results.N)rget_rowsrs rirz'MySQLConnectionAbstract.consume_resultss&   --/ ! !  !s +)+c.K|jdd{4d{}|jtt|d{|j d{cdddd{S7]7V7177 #1d{7swYyxYww)z&Send a query which only returns 1 row.T)rN)cursorexecuter!rWfetchone)rrrr3s rirz"MySQLConnectionAbstract.info_querysld3333v..c5!12 2 2**4333 2*4333sxBA6BA8B#BA: B A<!B$ B0A>1B8B:B<B>BBB BBc:|jj|y)zAdd cursor to the weakref set.N)raddrrr3s ri add_cursorz"MySQLConnectionAbstract.add_cursors &!ruc:|jj|y)z#Remove cursor from the weakref set.N)rremover8s ri remove_cursorz%MySQLConnectionAbstract.remove_cursors V$ruc Kyw)zConnect to the MySQL server.Nr~rs rirzMySQLConnectionAbstract.connectrrcKd}||k7ry|dz} |jd{|jd{|jd{ry |dkDrt j|d{||k7rxyy7`7J74#ttf$r#}||k(rd|d|}t ||Yd}~]d}~wwxYw7Gw)aAttempts 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. rrLNz!Can not reconnect to MySQL after z attempt(s): ) disconnectrrr7IOErrorr8rsleep)rrrrcounterr/msgs rirz!MySQLConnectionAbstract.reconnects"!kG 7oo'''lln$$**,,,-qymmE***!($,7# 7h&;H:F''*e-)-36 ' 7+sr CB BB BB BB C7B?8 CCB B B B<B72C7B<<CcKtw)akShuts 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. )NotImplementedErrorrs rishutdownz MySQLConnectionAbstract.shutdown(s"!s c Kyw)aClose 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~rs rirzMySQLConnectionAbstract.close3rrz@ClassVar[Callable[['MySQLConnectionAbstract'], Awaitable[None]]]r?c Kyw)aInstantiate 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~)rrrrprepared cursor_class dictionaryrrs rir3zMySQLConnectionAbstract.cursorCrrc Kyw)a3Get 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~)rrrcolumnsrr=s riget_rowzMySQLConnectionAbstract.get_row_rrc Kyw)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~)rrcountrrMr prep_stmtr=s rir1z MySQLConnectionAbstract.get_rowsnrrc Kyw)zCommit current transaction.Nr~rs ricommitzMySQLConnectionAbstract.commitrrc Kyw)zRollback current transaction.Nr~rs rirollbackz MySQLConnectionAbstract.rollbackrrcK|jr td|ra|jjddj }gd}||vrt d|d|j d|d{|K|jd krt d |jd |rd }nd }|j d|d{d}|r|dz }|j|d{y7t7)7 w)atStarts a transaction. This method explicitly starts a transaction sending the START TRANSACTION statement to the MySQL server. You can optionally set whether there should be a consistent snapshot, which isolation level you need or which access mode i.e. READ ONLY or READ WRITE. Args: consistent_snapshot: If `True`, Connector/Python sends WITH CONSISTENT SNAPSHOT with the statement. MySQL ignores this for isolation levels for which that option does not apply. isolation_level: Permitted values are 'READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', and 'SERIALIZABLE'. If the value is `None`, no isolation level is sent, so the default level applies. readonly: Can be `True` to start the transaction in READ ONLY mode or `False` to start it in READ WRITE mode. If readonly is omitted, the server's default access mode is used. Raises: ProgrammingError: When a transaction is already in progress and when `ValueError` when `isolation_level` specifies an Unknown level. Examples: For example, to start a transaction with isolation level `SERIALIZABLE`, you would do the following: ``` >>> cnx = mysql.connector.aio.connect(...) >>> await cnx.start_transaction(isolation_level='SERIALIZABLE') ``` zTransaction already in progressrL )zREAD UNCOMMITTEDzREAD COMMITTEDzREPEATABLE READ SERIALIZABLEzUnknown isolation level ""z SET TRANSACTION ISOLATION LEVEL N)rZzMySQL server version z does not support this featurez READ ONLYz READ WRITEzSET TRANSACTION zSTART TRANSACTIONz WITH CONSISTENT SNAPSHOT) rr;rreplacerSrmrrr)rrconsistent_snapshotisolation_levelreadonlylevellevels access_moders ristart_transactionz)MySQLConnectionAbstract.start_transactions%F   "#DE E #))+33C=CCEEFF" #<_>> user_variables = {'var1': '1', 'var2': '10'} >>> session_variables = {'wait_timeout': 100000, 'sql_mode': 'TRADITIONAL'} >>> await cnx.reset_session(user_variables, session_variables) ``` Nr~)rruser_variablessession_variabless ri reset_sessionz%MySQLConnectionAbstract.reset_sessionrrc Kyw)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~rs ricmd_reset_connectionz,MySQLConnectionAbstract.cmd_reset_connectionrrc Kyw)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~)rrrs ri cmd_init_dbz#MySQLConnectionAbstract.cmd_init_dbrrc Kyw)aSend 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~)rrrrr raw_as_stringr=s rirz!MySQLConnectionAbstract.cmd_queryrrc Kyw)acSend 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~)rr statementsr=s ricmd_query_iterz&MySQLConnectionAbstract.cmd_query_iterrrc Kyw)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~)rr statement_idrowsr=s ricmd_stmt_fetchz&MySQLConnectionAbstract.cmd_stmt_fetch&rrc Kyw)zPrepare a MySQL statement. This method will send the PREPARE command to MySQL together with the given statement. Nr~)rr statementr=s ricmd_stmt_preparez(MySQLConnectionAbstract.cmd_stmt_prepare0rrc Kyw)z#Execute a prepared MySQL statement.Nr~)rrrrdatarorr=s ricmd_stmt_executez(MySQLConnectionAbstract.cmd_stmt_execute<rrc Kyw)z}Reset data for prepared statement sent as long data. The result is a dictionary with OK packet information. Nr~rrrrr=s ricmd_stmt_resetz&MySQLConnectionAbstract.cmd_stmt_resetGrrc Kyw)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 ricmd_stmt_closez&MySQLConnectionAbstract.cmd_stmt_closeRrrc Kyw)aSend 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~)rroptionss ri cmd_refreshz#MySQLConnectionAbstract.cmd_refreshZrrc Kyw)aSend 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~)rrrrparam_idryr=s ricmd_stmt_send_long_dataz/MySQLConnectionAbstract.cmd_stmt_send_long_datavrrc Kyw)zClose the current connection with the server. Send the QUIT command to the MySQL server, closing the current connection. Nr~rs ricmd_quitz MySQLConnectionAbstract.cmd_quitrrc Kyw)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~)rr shutdown_types ri cmd_shutdownz$MySQLConnectionAbstract.cmd_shutdownrrc Kyw)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~rs ricmd_statisticsz&MySQLConnectionAbstract.cmd_statisticsrrc Kyw)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~)rr mysql_pids ricmd_process_killz(MySQLConnectionAbstract.cmd_process_killrrc Kyw)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~rs ri cmd_debugz!MySQLConnectionAbstract.cmd_debugrrc Kyw)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~rs ricmd_pingz MySQLConnectionAbstract.cmd_pingrrc  Kyw)aChanges 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~) rrr5rrr\rrrrrrs ricmd_change_userz'MySQLConnectionAbstract.cmd_change_userrr)^r Optional[str]rrWrrWrrUrrrrWrrWrrWr\rWrrWr^rr Optional[int]rrbrrbrrbrrrzDict[str, str]rrrrrrbrrbrrbrrbrrrrrrrz+Optional[Union[str, Callable[[str], None]]]rrbrrrzOptional[MySQLConverter]rrbrrUrrrrrrrOptional[bool]rrrrrrrrrrrrrOptional[List[str]]rrrz#Optional[asyncio.AbstractEventLoop]rrrr)rwrNNNrzOptional[Type[BaseException]]rzOptional[BaseException]rzOptional[TracebackType]rwrxrv)r=rrwrx)r)rprWrqzUnion[str, Callable]rrrUrwrxrwr)rwrWrwrUrwr)rCrWrwrxrrrwrxrwrb)rCrbrwrx)rwr)rCrrwrx)rwzasyncio.AbstractEventLoop)rwz$List[Tuple[str, BinaryProtocolType]])rCzUnion[str, Sequence[int]]rwrx)rwrN)rCrNrwrx)rrWrwrENN)r\zOptional[Union[int, str]]rrrwrx)rrUrwrb)rrWrwrx)rwzOptional[Tuple[int, ...]])FrLr)rrbrrUrrUrwrb)rUnion[int, Sequence[int]]rwrU)rrrwrx)rzOptional[Type[MySQLConverter]]rwrx)rwzType[MySQLConverter])rCzTuple[str, BinaryProtocolType]rwrxr rWrwr>)rrHrwOptional[RowType])r3rrwrx)rLr)rrUrrUrwrx)rwr)NNNNNNN)rrrrrIrrJz#Optional[Type[MySQLCursorAbstract]]rKrrrrrrwr)FNN) rrbrMOptional[List[DescriptionType]]rrr=rrwz1Tuple[Optional[RowType], Optional[EofPacketType]])NFNNN)rPrrrbrMrrrrQrr=rrwz-Tuple[List[RowType], Optional[EofPacketType]])r]rbr^rr_rrwrx)reOptional[Dict[str, Any]]rfrrwrx)rrWrwrC)FFF) rrHrrbrrbrmrbr=rrwrE)rorHr=rrwz!Generator[ResultType, None, None]rL)rrrUrsrUr=rrwrx)rvr_r=rrwz/Mapping[str, Union[int, List[DescriptionType]]])r~r~r) rrzUnion[int, CMySQLPrepStmt]ryzSequence[BinaryProtocolType]rorrrUr=rrwz&Optional[Union[Dict[str, Any], Tuple]])rrrUr=rrwrx)rrUrwrC) rrrUrrUryrr=rrwrU)rwr_rf)rrrwrx)rwrG)rrUrwrC)rwr@)rwrC) rrrNrrrrrr)r5rWrrWrrWr\rrrWrrWrrWrrWrrWrrWrwzOptional[OkPacketType])pryrzr{r|r-rrrrrEr%r$ staticmethodr.propertyr rurrzr|rrsetterrrrrrrrrrrrrrrrrrrrrrrrrr\rrrr+rrrrrrr#r.r-rrrrrrrrrrrrr(r+r-r/rrr9r<rrrFrr?r}r3rNr1rSrUrcrgrirkrrprtrwrzr}rrrrrrrrrrr~rurirrs=1 #"&%)&* % #'%'"&&*""',0/3+/IM#89M#N4I (5 59',"78I"J&;N&K'<_'M%)&* $"&!%*/.3'<^'L,00448)-,0gM,M, M,  M,  M, M,M,M,M,M,M,#M,$M,M, !M,"#M,$!%M,&#'M,( )M,*$+M,,-M,. /M,01M,23M,4*5M,6 -7M,8)9M,:G;M,<!=M,>%2?M,D2EM,F!%GM,H IM,J$KM,L%MM,N#OM,P$QM,RSM,T UM,VWM,X(YM,Z,[M,\%]M,^*_M,`.aM,b2cM,d'eM,f*gM,^37-1-1 /++   aXF4,l[ zORbJK  $8 DG    D##!!  __   " "%%> # #&&> -%%& & ))* *$$PP//&&     !         __  $ $"" # #''''(## $ $ ' '""((&__"" 55  :"UY8;08;DQ8; 8;t/00)00?OPQ#R#0)00}MN O         GH  14 AD   $0)00~NO!P! ""UU00)00?PQR )S )%%$!!.. 61 7" + "%++!+F "    TYJPX$("#'<@%)&*'+    !  :  #  $ %    637"    1      ;     $37"    1        7  **,, %*)-#' D$!D$'D$! D$  D$L486: 0 4     >    #             (    +  (-.  '* :=          9    .0! 202+2 2  2  2 022           6        *            !%!"$!#, , ,  ,  ,  , , , ,  , ,  , , rurceZdZdZ d( d)dZd*dZ d+ d,dZd-dZd.dZe d/dZ e jd0d Z e d/d Z e jd0d Z e d1d Z e d2d Ze d/dZe d3dZeej&dd3dZe d2dZe d4dZe d5dZe d6dZed7dZe d8 d9dZe d8 d9dZe d:dZed;dZeddZ d?dZ!ed@dZ"ed6d Z#eej&d!d/d"Z$dAdBd#Z%dCd$Z&dDd%Z'dEd&Z(dFd'Z)y)Grz#Defines the MySQL cursor interface.NcX||_|j|_d|_d|_d|_d|_d|_g|_g|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_||_||_|jj)|y)NrFrIrrL) _connectionrr _description_last_insert_id _warnings_warning_count _executed_executed_list_stored_results_binaryr _rowcount_nextrow arraysize_stmt_partitions_stmt_partition_stmt_map_resultsrrr9)rr connectionrrs rirzMySQLCursorAbstract.__init__s 5?0: =A.26:#$*.+-*,"   L     @D',,8-: ##D)rucK|Swrfr~rs rirzMySQLCursorAbstract.__aenter__s  c@K|jd{y7wrfrrs rirzMySQLCursorAbstract.__aexit__rrcK|Sw)zIterate over result set. Iteration over the result set which calls self.fetchone() and returns the next row. r~rs ri __aiter__zMySQLCursorAbstract.__aiter__s  rc|K |jd{}|st|S7#t$rtdwxYww)zl Used for iterating over the result set. Calls self.fetchone() to get the next row. N)r5r8StopAsyncIteration)rrrows ri __anext__zMySQLCursorAbstract.__anext__&sD  / 'C$ $ ( /$$ . /s <(&( <(9<c|jS)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. rrs rirz MySQLCursorAbstract.read_timeout3rrucV| t|tr|dkr td||_y)a 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 ``` Nrrrrs rirz MySQLCursorAbstract.read_timeout@s44  gs+w{$L%ruc|jS)a 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. rrs rirz!MySQLCursorAbstract.write_timeoutarrucV| t|tr|dkr td||_y)a  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 ``` Nrrrrs rirz!MySQLCursorAbstract.write_timeoutns44  gs+w{$M&ruc|jS)aReturn 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. )rrs ri descriptionzMySQLCursorAbstract.descriptions$   ruc|jS)aReturn 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. )rrs rirowcountzMySQLCursorAbstract.rowcounts~~ruc|jS)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. rrs ri lastrowidzMySQLCursorAbstract.lastrowids ###ruc|jS)zGets warnings.rrs riwarningszMySQLCursorAbstract.warnings~~rurrc|jS)zReturns Warnings.rrs ri fetchwarningsz!MySQLCursorAbstract.fetchwarningsrruc|jS)zReturn the number of warnings. This property returns the number of warnings generated by the previously executed operation. )rrs ri warning_countz!MySQLCursorAbstract.warning_countrrucf|js tStd|jDS)z[Returns column names. This property returns the columns names as a tuple. c3&K|] }|d yw)rNr~)rgds rirjz3MySQLCursorAbstract.column_names..s4#3aQqT#3s)rrprs ri column_namesz MySQLCursorAbstract.column_namess+ 7N44#3#3444ruc|jy |jjjdS#ttf$r+t t |jjcYSwxYw)aReturns 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. Nzutf-8)rrdecoderUnicodeDecodeErrorr!rWrs rirvzMySQLCursorAbstract.statementsc >> ! 5>>'')009 9 23 5T^^1134 4 5s(87A21A2c,t|jS)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. )rbrrs ri with_rowszMySQLCursorAbstract.with_rowssD%%&&rucy)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~rs ristored_resultsz"MySQLCursorAbstract.stored_resultsrvruc Kyw)aExecutes 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~rr operationparams map_resultss rir4zMySQLCursorAbstract.executerrc Kyw)aExecutes 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~rs ri executemultiz MySQLCursorAbstract.executemultiz rrc Kyw)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~)rrr seq_paramss ri executemanyzMySQLCursorAbstract.executemany rrc Kyw)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~rs rir5zMySQLCursorAbstract.fetchone rrc Kyw)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~rs rifetchallzMySQLCursorAbstract.fetchall rrc Kyw)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~)rrsizes ri fetchmanyzMySQLCursorAbstract.fetchmany rrcKd}|js |j} |jd{}|jr |jn||f|j d{rR |jd{}|jr |jn||f|j d{rQyy7#t$rg}YwxYw7j7S#t$rg}Y^wxYw7/w)aGenerates 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)rrvrr8nextset)rrstatement_cached result_sets ri fetchsetszMySQLCursorAbstract.fetchsets sh %%#~~  #}}.J#44DNN:J  LLN"" #'==?2 #'"8"8>N  LLN"" / J  #2!   #sC*CCC2C*(C)C*.CCC2C*8C(9C*>C*C C C*CC*C C%"C*$C%%C*c Kyw)aKMakes 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~rs rirzMySQLCursorAbstract.nextset rrc Kyw)zClose the cursor.Nr~rs rirzMySQLCursorAbstract.closeC rrrc|jS)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. rrs ri getlastrowidz MySQLCursorAbstract.getlastrowidG s###ruc Kyw)zReset the cursor to default.Nr~)rrfrees riresetzMySQLCursorAbstract.resetP rrcHt|dr|jjSy)zGets a list of query attributes from the connector's side. Returns: List of existing query attributes. rN)hasattrrrrs riget_attributesz"MySQLCursorAbstract.get_attributesS s# 4 '##// /ruct|ts td|t|tstd|d|jj ||fy)aAdd 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 typeNzObject z$ cannot be converted to a MySQL type)r!rWr;r&rr()rrr rCs ri add_attributez!MySQLCursorAbstract.add_attribute] s]$$"#KL L  Z~%F"% DE  ++T5M:rucnt|ts td|jj |S)a'Removes 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!rWr;rr+r*s riremove_attributez$MySQLCursorAbstract.remove_attributes s1$$"#KL L22488ruc8|jjy)zrwrxrrv)*ryrzr{r|rrrrrrrrrrrrrr#r.r-rrrrvrr rr4rrr5rrrrrrrrrrr r~rurirrs"- '+'+ !*+!*$!*% !*F 37-1-1 /++     " "%%@ # #&&@!!&  $$ 0)00zJKL##5555 ''  8:! A A 5A  A  A A F8:! # # 5#  #  # # J    1               F BFP& & P  0)00{KL$M$+;, 9-rurceZdZdZy)CMySQLPrepStmtaPStructure 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. N)ryrzr{r|r~rurir r  srur )hr| __future__rmysql.connector.optionfilesr__all__rrrmrabcrr dataclassesr r inspectr typesr typingrrrrrrrrrrrrrrrrrrr r! _decoratingr# abstractsr$r%r&r'r(r)r*r+ constantsr,r-r.r/r0r1r2r3r4 conversionr5r6errorsr7r8r9r:r; tls_ciphersr<r=r>r?r@rArBrCrDrErFrGrHrIutilsrJrKauthenticationrMrOrNrVrPnetworkrQrRr rrrrr r~rurirs@2"9 J #(.%      <S    2.'#8 77g  %% %DF cF R:W -#W -t^ru