JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr ғg@LdZ ddlZdZddlZddlZddlmZddlmZddl m Z m Z m Z dd l mZdd lmZmZdd lmZmZmZdd lmZmZd ZdZGddeZdZGddeZGddeZGddeZ GddeZ!Gdde!Z"Gdde!Z#y#dZYxYw)z4Implementation of communication for MySQL X servers.NTFwraps)MySQL41AuthPlugin)InterfaceErrorOperationalErrorProgrammingErrorSchema)ProtocolMessageReaderWriter)Result RowResult DocResult) SqlStatement AddStatementzDROP DATABASE IF EXISTS `{0}`z#CREATE DATABASE IF NOT EXISTS `{0}`c4eZdZdZdZdZdZdZifdZy) SocketStreamc d|_d|_y)NF)_socket_is_sslselfs h/opt/hc_python/lib64/python3.12/site-packages/../../../lib/python3.12/site-packages/mysqlx/connection.py__init__zSocketStream.__init__2s  ct|trtjntj}tj|tj |_|j j|yN) isinstancetuplesocketAF_INETAF_UNIX SOCK_STREAMrconnect)rparamss_types rr%zSocketStream.connect6sD#-fe#<&..}}VV-?-?@  V$rc|j tdg}|dkDrP|jj|}|dk(r td|j ||t |z}|dkDrPdj |S)NMySQLx Connection not availablerrzUnexpected connection close)rrrecv RuntimeErrorappendlenjoin)rcountbufdatas rreadzSocketStream.read;s~ << "#DE Eai<<$$U+Ds{"#@AA JJt  SY E ai xx}rch|j td|jj|y)Nr))rrsendallrr1s rr4zSocketStream.sendallGs* << "#DE E T"rc`|jsy|jjd|_yr)rclosers rr7zSocketStream.closeLs#||   rcts|jtdtjtj }|j d|vr* |j|dtj|_ d|vr* |j|dtj|_d|vr' |j|d|j!ddnd|vr|jtd |j#|j$|_d |_y#ttjf$r|jtdwxYw#ttjf$r|jtdwxYw#ttjf$r|jtdwxYw) Nz'Python installation has no SSL support.zssl-cazInvalid CA certificate.zssl-crlz Invalid CRL.zssl-certzssl-keyzInvalid Client Certificate/Key.z Client Certificate not provided.T) SSL_AVAILABLEr7r+ssl SSLContextPROTOCOL_SSLv23load_default_certsload_verify_locations CERT_REQUIRED verify_modeIOErrorSSLErrorrVERIFY_CRL_CHECK_CHAIN verify_flagsload_cert_chainget wrap_socketrr)rssl_optscontexts rset_sslzSocketStream.set_sslSs JJLHI I..!4!45""$ x  @--hx.@A&)&7&7#   5--hy.AB'*'A'A$  ! H''(<LLD13 ( " JJL !CD D**4<<8  -S\\* @ $%>?? @S\\* 5 $^44 5S\\* H $%FGG Hs$)D#)E6%F#5E5F5GN) __name__ __module__ __qualname__rr%r2r4r7rJrrrr1s%% #  "!rrc.tfd}|S)Nc |g|i|S#tjtf$r|jt dwxYw)NzCannot connect to host.)r!errorr+ disconnectr)rargskwargsfuncs rwrapperz(catch_network_exception..wrapperxsK <.t.v. . l+ < OO  !:; ;  %%f&6&6&89]]557  ((  0 0 < > ""$rc>|jjd||y)Nsql)resend_execute_statement)rrrSs rsend_sqlzConnection.send_sqls ,,UC>rc|jj|d}t|tr |j}t ||Sr)re send_insertrr_idsr)r statementidss rrzConnection.send_inserts9 !!), i ...CdC  rc||jj||jr t|St |Sr)re send_find _doc_basedrrrrs rfindzConnection.finds/  *"+"6"6yKIdOKrcN|jj|t|Sr)re send_deleterrs rdeletezConnection.delete !!),d|rcN|jj|t|Sr)re send_updaterrs rupdatezConnection.updaterrcR|jj|||t|Sr)rerr)r namespacecmd raise_on_failrSs rexecute_nonqueryzConnection.execute_nonquerys" ,,YTBd|rc|jjd||t|}|j|jdk(r t d|ddS)Nrrz No data found)rerrrhr/r)rrrSresults rexecute_sql_scalarzConnection.execute_sql_scalarsR ,,UC>4 <<1  1 1ay|rcR|jjd||t|S)Nxplugin)rerr)rrrSs rget_row_resultzConnection.get_row_results" ,,YTBrc8|jj|Sr)reread_rowrrs rrzConnection.read_rows}}%%f--rc:|jj|yr)re close_resultrs rrzConnection.close_results ""6*rc8|jj|Sr)reget_column_metadatars rrzConnection.get_column_metadatas}}0088rc2|jjduSr)rcrrs ris_openzConnection.is_opens{{""$..rcZ|jsy|jjyr)rrcr7rs rrRzConnection.disconnects||~  rc|jsy|j|jj|jj |jj |j jyr)rrarhre send_closeread_okrcr7rs rr7zConnection.closes\||~     *    ) ) +   "  rN)T)rKrLrMrriror%rqrrrWrrrrrrrrrrrrrRr7rNrrrYrYs ' %+$%??!!LL..++99/ rrYcReZdZfdZdZfdZfdZdZfdZfdZ xZ S) XConnectioncltt| |g|_|j dg|_d|vrB|dr=|j j |j d|j dddd|_d|_|j|j jddy) Nroutersrkrl)rkrlTc |dS)NpriorityrN)xs rz&XConnection.__init__..s:r)keyreverse) superrrdependent_connectionspop_routersr, _cur_router _can_failover_ensure_prioritiessortrrb __class__s rrzXConnection.__init__s k4)(3%'" Y3 X (6"2 MM  V, VT2"  ! ! 6Ercd}d}|jD]7}|jdd}| |dz }||d<n|dkDr tdd|dz}9d|cxkrt|jkrnytddy) Nrdrrz(The priorities must be between 0 and 100iz\You must either assign no priority to any of the routers or give a priority for every routeri)rrFr r-)rpriority_countrrouterpris rrzXConnection._ensure_prioritiessmmF**Z.C{!#%-z"s&(!! MH$ ~ 2DMM 2 2"$EFJL L 3rc |jsd|_tt|S|jr|j dur$d|_d|_|jD]}d|d< |xj dz c_|j|j d}|j|j d}|j dkDrd|j|j dz d<|j t |jdz k\rd|_||fS) NFrT availablerrkrlr)rrrrrorr-)rrrkrlrs rrozXConnection._connection_params)s}}!&D d>@ @!!T%5%5%;!D !%D --&*{#( A}}T--.v6}}T--.v6   a =BDMM$**1, -k :   s4==1A5 5!&D d}rc"d}|jr tt|St |jdkrtdj|tdd#tj $r }|}Yd}~nd}~wwxYw|jrn)NrCannot connect to host: {0}z(Failed to connect to any of the routers.i) rrrr%r!rQr-rrformat)rrQerrrs rr%zXConnection.connect@s   [$799 t}}  " !>!E!Ee!LM MGNN <<    sA!!B4A;;Bc:|jj|yr)rr,)r connections rbind_connectionzXConnection.bind_connectionMs ""))*5rc|jr5|jjj|jr5tt| yr)rrr7rrrrs rr7zXConnection.closePs?((  & & * * , 2 2 4(( k4&(rc|jr5|jjj|jr5tt| yr)rrrRrrrs rrRzXConnection.disconnectUs?((  & & * * , 7 7 9(( k4+-r) rKrLrMrrror%rr7rR __classcell__rs@rrrs.F L$. O6) ..rrc(eZdZfdZfdZxZS)NodeConnectionc,tt| |yr)rrrrs rrzNodeConnection.__init__\s nd,X6rc tt| y#tj$r}t dj |d}~wwxYw)Nr)rrr%r!rQrr)rrrs rr%zNodeConnection.connect_sC L .$ / 1|| L !>!E!Ec!JK K LsAAA)rKrLrMrr%rrs@rrr[s7LLrrcLeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z y ) BaseSessionaBase functionality for Session classes through the X Protocol. This class encloses the core functionality to be made available on both the XSession and NodeSession classes, such functionality includes: - Accessing available schemas. - Schema management operations. - Enabling/disabling warning generation. - Retrieval of connection information. Args: settings (dict): Connection data used to connect to the database. c||_yr) _settingsrfs rrzBaseSession.__init__ts !rcF|jjjduSr) _connectionrcrrs rrzBaseSession.is_openws&&..d::rct||S)zRetrieves a Schema object from the current session by it's name. Args: name (string): The name of the Schema object to be retrieved. Returns: mysqlx.Schema: The Schema object with the given name. r rrzs r get_schemazBaseSession.get_schemazsdD!!rc|jjjdr#t||jjdSt d)aKRetrieves a Schema object from the current session by the schema name configured in the connection settings. Returns: mysqlx.Schema: The Schema object with the given name at connect time. Raises: ProgrammingError: If default schema not provided. r]zDefault schema not provided)rrbrFr r rs rget_default_schemazBaseSession.get_default_schemasH    $ $ ( ( 2$ 0 0 9 9( CD D<==rcd|jjdtj|dy)zDrops the schema with the specified name. Args: name (string): The name of the Schema object to be retrieved. rTN)rr_DROP_DATABASE_QUERYrrs r drop_schemazBaseSession.drop_schemas+ )) '..t4d dD!!rc>|jjdddy)z4Starts a transaction context on the server. rzSTART TRANSACTIONTNrrrs rstart_transactionzBaseSession.start_transactions ))%1DdKrc>|jjdddy)zXCommits all the operations executed after a call to startTransaction(). rCOMMITTNrrs rcommitzBaseSession.commits ))%4@rc>|jjdddy)zYDiscards all the operations executed after a call to startTransaction(). rROLLBACKTNrrs rrollbackzBaseSession.rollbacks ))%TBrc8|jjyr)rr7rs rr7zBaseSession.closes  rN)rKrLrM__doc__rrrrrrrrrr7rNrrrrfs< "; " >< "L A C !rrc(eZdZdZfdZdZxZS)XSessionaWEnables interaction with a X Protocol enabled MySQL Product. The functionality includes: - Accessing available schemas. - Schema management operations. - Enabling/disabling warning generation. - Retrieval of connection information. Args: settings (dict): Connection data used to connect to the database. ctt| |t|j|_|j j yr)rrrrrrr%rs rrzXSession.__init__s5 h&x0&t~~6   "rc|js tdt|j}|jj |j|S)Nz$XSession is not connected to a farm.)rr NodeSessionrrr)rnsesss rbind_to_default_shardzXSession.bind_to_default_shardsD||~"#IJ JDNN+ (():):; r)rKrLrMrrrrrs@rrrs # rrc(eZdZdZfdZdZxZS)ratEnables interaction with a X Protocol enabled MySQL Server. The functionality includes: - Accessing available schemas. - Schema management operations. - Enabling/disabling warning generation. - Retrieval of connection information. - Includes SQL Execution. Args: settings (dict): Connection data used to connect to the database. ctt| |t|j|_|j j yr)rrrrrrr%rs rrzNodeSession.__init__s5 k4)(3)$..9   "rc.t|j|S)z}Creates a :class:`mysqlx.SqlStatement` object to allow running the SQL statement on the target MySQL Server. )rr)rrs rrzNodeSession.sqlsD,,c22r)rKrLrMrrrrrs@rrrs # 3rr)$rr:r9r|r! functoolsrauthenticationrerrorsrrr crudr rer r rrrrrrrrrobjectrrWrYrrrrrrNrrr s0;M -FF30017>C6CLAAHR.*R.jLZLT!&T!n{63+3w Ms BB#