§
    >Ä³g€_  ã                   ó8  — U d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% erddl&m'Z' dd	l(m)Z) dd
l*m+Z+m,Z, ddl-m.Z. dZ/e0e1d<   e2e3ee)fZ4e#e$e2         e$e3         e$e         e$e)         f         e1d<   de%e2e5f         de2fd„Z6de2de5fd„Z7de2de5fd„Z8de2de5fd„Z9de2de5fd„Z:de2de5fd„Z;de2de5fd„Z<de2de5fd„Z=de5de2de#e5e5f         fd„Z>de5de#e5e"e5         f         fd„Z?de5de"e#e"e5         df                  fd„Z@	 	 dCde5de"e5         de"e2         de#e5e5f         fd „ZAde5de2de#e5e2f         fd!„ZBde5de#e5e"e2         f         fd"„ZCde.deDfd#„ZE	 dDd%e.d&e"eD         d'e2ddfd(„ZFde eDeDf         fd)„ZGde eDeDf         fd*„ZHde"e eDeDf                  fd+„ZIde#eDeDeDf         fd,„ZJd-eDdeDfd.„ZKd-eDde eDeeDge0f         f         fd/„ZLd0eDde"e#eDeDf                  fd1„ZMd2eDdeDfd3„ZN	 dEd6e%e2e.f         d7eDdeOfd8„ZP e¦   «         de eDe%eDe#eDeDf         f         f         fd9„¦   «         ZQd:eDdefd;„ZRd<eDd=eDddfd>„ZSd=eDddfd?„ZTdefd@„ZU G dA„ dB¦  «        ZVdS )Fz
Utilities.é    N)ÚDecimal)Ú	lru_cache)Úin_table_a1Úin_table_b1Úin_table_c3Úin_table_c4Úin_table_c5Úin_table_c6Úin_table_c7Úin_table_c8Úin_table_c9Úin_table_c11Úin_table_c12Úin_table_c21_c22Úin_table_d1Úin_table_d2)	ÚTYPE_CHECKINGÚAnyÚCallableÚDictÚListÚOptionalÚTupleÚTypeÚUnion)ÚMySQLConnectionAbstracté   )Ú
HexLiteral)ÚDEPRECATED_TLS_CIPHERSUITESÚDEPRECATED_TLS_VERSIONS)Ú
StrOrBytesFÚ__MYSQL_DEBUG__ÚNUMERIC_TYPESÚbufÚreturnc                 ój  — t          | t          ¦  «        r| S t          | ¦  «        t          ¦   «         }}|dk    r| d         S |dk    r6|| dd|z
  z  z   z  }t          t	          j        d|¦  «        d         ¦  «        S || dd|z
  z  z   z  }t          t	          j        d|¦  «        d         ¦  «        S )z&Unpacks the given buffer to an integerr   r   é   ó    ú<Ié   ú<Q)Ú
isinstanceÚintÚlenÚ	bytearrayÚstructÚunpack)r$   ÚlengthÚtmps      úS/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/mysql/connector/utils.pyÚintreadr5   X   sµ   € å�#•sÑÔð Øˆ
Ý�c‘(”(�I™KœKˆC€FØ�‚{€{Ø�1ŒvˆØ�‚{€{Øˆs�W  F¡
Ñ+Ñ+Ñ+ˆÝ•6”=  sÑ+Ô+¨AÔ.Ñ/Ô/Ð/Øˆ3�˜A ™JÑ'Ñ'Ñ'€CÝ�vŒ}˜T 3Ñ'Ô'¨Ô*Ñ+Ô+Ð+ó    Úic                 ób   — | dk     s| dk    rt          d¦  «        ‚t          j        d| ¦  «        S )z^
    Takes an unsigned byte (1 byte) and packs it as a bytes-object.

    Returns string.
    r   éÿ   z int1store requires 0 <= i <= 255ú<B©Ú
ValueErrorr0   Úpack©r7   s    r4   Ú	int1storer?   f   s6   € ð 	ˆ1‚u€u��C’�ÝÐ;Ñ<Ô<Ð<ÝŒ;�t˜QÑÔÐr6   c                 ób   — | dk     s| dk    rt          d¦  «        ‚t          j        d| ¦  «        S )z`
    Takes an unsigned short (2 bytes) and packs it as a bytes-object.

    Returns string.
    r   éÿÿ  z"int2store requires 0 <= i <= 65535ú<Hr;   r>   s    r4   Ú	int2storerC   q   s6   € ð 	ˆ1‚u€u��E’	�	ÝÐ=Ñ>Ô>Ð>ÝŒ;�t˜QÑÔÐr6   c                 ór   — | dk     s| dk    rt          d¦  «        ‚t          j        d| ¦  «        dd…         S )zb
    Takes an unsigned integer (3 bytes) and packs it as a bytes-object.

    Returns string.
    r   éÿÿÿ z%int3store requires 0 <= i <= 16777215r)   é   r;   r>   s    r4   Ú	int3storerG   |   s?   € ð 	ˆ1‚u€u��H’�ÝÐ@ÑAÔAÐAÝŒ;�t˜QÑÔ  ! Ô$Ð$r6   c                 ób   — | dk     s| dk    rt          d¦  «        ‚t          j        d| ¦  «        S )zb
    Takes an unsigned integer (4 bytes) and packs it as a bytes-object.

    Returns string.
    r   ì   ÿÿ z'int4store requires 0 <= i <= 4294967295r)   r;   r>   s    r4   Ú	int4storerJ   ‡   s6   € ð 	ˆ1‚u€u��J’�ÝÐBÑCÔCÐCÝŒ;�t˜QÑÔÐr6   c                 ób   — | dk     s| dk    rt          d¦  «        ‚t          j        d| ¦  «        S )zZ
    Takes an unsigned integer (8 bytes) and packs it as string.

    Returns string.
    r   ì            z!int8store requires 0 <= i <= 2^64r+   r;   r>   s    r4   Ú	int8storerM   ’   s9   € ð 	ˆ1‚u€u�Ð(Ò(Ð(ÝÐ<Ñ=Ô=Ð=ÝŒ;�t˜QÑÔÐr6   c                 óÌ   — | dk     s| dk    rt          d¦  «        ‚| dk    rt          }n1| dk    rt          }n#| dk    rt          }n| dk    rt          }nt
          } || ¦  «        S )zÍ
    Takes an unsigned integers and packs it as a bytes-object.

    This function uses int1store, int2store, int3store,
    int4store or int8store depending on the integer value.

    returns string.
    r   rL   z!intstore requires 0 <= i <=  2^64r9   rA   rE   rI   )r<   r?   rC   rG   rJ   rM   )r7   Úformed_strings     r4   ÚintstorerP   �   s|   € ð 	ˆ1‚u€u�Ð(Ò(Ð(ÝÐ<Ñ=Ô=Ð=àˆC‚x€xÝ!ˆˆØ	
ˆeŠˆÝ!ˆˆØ	
ˆhŠˆÝ!ˆˆØ	
ˆjŠˆÝ!ˆˆå!ˆàˆ=˜ÑÔÐr6   c                 ó&  — | dk     s| dk    rt          d¦  «        ‚| dk     rt          j        d| ¦  «        S | dk    rdt          j        d| ¦  «        z   S | d	k    r d
t          j        d| ¦  «        dd…         z   S dt          j        d| ¦  «        z   S )z|
    Takes an unsigned integer and packs it as bytes,
    with the information of how much bytes the encoded int takes.
    r   rL   zRequires 0 <= i <= 2^64éû   r:   rA   ó   ürB   rE   ó   ýr)   rF   ó   þr+   r;   r>   s    r4   Úlc_intrV   ·   s¢   € ð
 	ˆ1‚u€u�Ð(Ò(Ð(ÝÐ2Ñ3Ô3Ð3àˆ3‚w€wÝŒ{˜4 Ñ#Ô#Ð#ØˆE‚z€zØ�œ T¨1Ñ-Ô-Ñ-Ð-ØˆH‚}€}Ø�œ T¨1Ñ-Ô-¨a°¨cÔ2Ñ2Ð2à•V”[  qÑ)Ô)Ñ)Ð)r6   Úsizec                 ó.   — | d|…         }| |d…         |fS )zi
    Reads bytes from a buffer.

    Returns a tuple with buffer less the read bytes, and the bytes.
    r   N© ©r$   rW   Úress      r4   Ú
read_bytesr\   É   s$   € ð ˆa�ˆfŒ+€CØ���ŒJ˜ÐÐr6   c                 ó<  — | d         dk    r| dd…         dfS dx}}| d         }|dk    r|}| d|z   d…         | d|dz   …         fS |dk    rd}n|dk    rd	}n|d
k    rd}t          | d|dz   …         ¦  «        }| ||z   dz   d…         | |dz   ||z   dz   …         fS )u›  
    Takes a buffer and reads a length coded string from the start.

    This is how Length coded strings work

    If the string is 250 bytes long or smaller, then it looks like this:

      <-- 1b  -->
      +----------+-------------------------
      |  length  | a string goes here
      +----------+-------------------------

    If the string is bigger than 250, then it looks like this:

      <- 1b -><- 2/3/8 ->
      +------+-----------+-------------------------
      | type |  length   | a string goes here
      +------+-----------+-------------------------

      if type == Ã¼:
          length is code in next 2 bytes
      elif type == Ã½:
          length is code in next 3 bytes
      elif type == Ã¾:
          length is code in next 8 bytes

    NULL has a special value. If the buffer starts with Ã» then
    it's a NULL and we return None as value.

    Returns a tuple (trucated buffer, bytes).
    r   rR   r   Néú   éü   é   éý   rF   éþ   r*   ©r5   )r$   r2   ÚlsizeÚfsts       r4   Úread_lc_stringrf   Ó   sè   € ð@ ˆ1„v�‚}€}à�A�B�B”˜ˆÐàÐ€FˆUØ
ˆaŒ&€Cà
ˆc‚z€zØˆØ�A˜‘J�L�LÔ! 3 q¨6°A©: ~Ô#6Ð7Ð7Ø
ˆc‚z€zØˆˆØ	�ŠˆØˆˆØ	�ŠˆØˆå�S˜˜U Q™Y˜Ô'Ñ(Ô(€FØ�˜‘ Ñ"Ð$Ð$Ô% s¨5°1©9°vÀ±~ÈÑ7IÐ+IÔ'JÐKÐKr6   .c                 ó"  — g }ddddœ}t          | ¦  «        }d}||k     râ| |         }|dk    rdS |dk    r|                     d¦  «         |d	z  }n«|d
k    r1|}|                     | |d	z   ||d	z   z   …         ¦  «         |d	|z   z  }ntd}	 ||         }n# t          $ r Y dS w xY wt          | |d	z   ||d	z   z   …         ¦  «        }|                     | |d	z   |z   ||z   |d	z   z   …         ¦  «         |d	|z   |z   z  }||k     °ât	          |¦  «        S )zXReads all length encoded strings from the given buffer

    Returns a list of bytes
    r`   rF   r*   )r_   ra   rb   r   r9   NrR   r   r^   )r.   ÚappendÚKeyErrorr5   Útuple)r$   ÚbyteslstÚsizesÚbuf_lenÚposÚfirstr2   rd   s           r4   Úread_lc_string_listrp     so  € ð
 ')€Hà˜! !Ð$Ð$€Eå�#‰hŒh€GØ
€Cà
�Š-ˆ-Ø�C”ˆØ�CŠ<ˆ<ð �4Ø�CŠ<ˆ<à�OŠO˜DÑ!Ô!Ð!Ø�1‰HˆCˆCà˜Š|ˆ|Ø�Ø—’  S¨1¡W°¸#À¹'Ñ0BÐ$BÔ CÑDÔDÐDØ�q˜6‘zÑ!��à�ð Ø! %œL�E�EøÝð  ð  ð  Ø˜4˜4ð øøøå   c¨A¡g°¸#À¹'Ñ1BÐ%BÔ!CÑDÔD�Ø—’  C¨!¡G¨e¡O°f¸u±nÈÈaÉÑ6PÐ$PÔ QÑRÔRÐRØ�q˜5‘y 6Ñ)Ñ)�ð/ �Š-ˆ-õ2 �‰?Œ?Ðs   ÂB Â
B"Â!B"Úendc                 ó  — |€|€t          d¦  «        ‚|�P	 |                      |¦  «        }n"# t           $ r}t          d¦  «        |‚d}~ww xY w| |dz   d…         | d|…         fS |�t          | |¦  «        S t          d¦  «        ‚)zr
    Reads a string up until a character or for a given size.

    Returns a tuple (trucated buffer, string).
    Nz&read_string() needs either end or sizezend byte not present in bufferr   r   z.read_string() needs either end or size (weird))r<   Úindexr\   )r$   rq   rW   ÚidxÚerrs        r4   Úread_stringrv   0  s°   € ð €{�t�|ÝÐAÑBÔBÐBà
€ð	HØ—)’)˜C‘.”.ˆCˆCøÝð 	Hð 	Hð 	HÝÐ=Ñ>Ô>ÀCÐGøøøøð	Høøøà�C˜!‘G�I�I”  A c E¤
Ð+Ð+ØÐÝ˜#˜tÑ$Ô$Ð$å
ÐEÑ
FÔ
FÐFs   —- ­
A·AÁAc                 óH   — t          | d|…         ¦  «        }| |d…         |fS )zMRead an integer from buffer

    Returns a tuple (truncated buffer, int)
    r   Nrc   rZ   s      r4   Úread_intrx   I  s,   € õ
 �#�a˜�f”+Ñ
Ô
€CØ���ŒJ˜ÐÐr6   c                 óì  — | st          d¦  «        ‚| d         }|dk    r| dd…         dfS |dk     r| dd…         t          |¦  «        fS |dk    r-| dd…         t          j        d| dd…         ¦  «        d         fS |d	k    r0| d
d…         t          j        d| dd
…         dz   ¦  «        d         fS |dk    r-| dd…         t          j        d| dd…         ¦  «        d         fS t          d¦  «        ‚)z�
    Takes a buffer and reads an length code string from the start.

    Returns a tuple with buffer less the integer and the integer read.
    zEmpty buffer.r   rR   r   Nr_   rF   z<xHra   r'   r)   r(   rb   é	   z<xQz%Failed reading length encoded integer)r<   r-   r0   r1   )r$   Úlcbytes     r4   Úread_lc_intr|   R  s  € ð ð *Ý˜Ñ)Ô)Ð)à�ŒV€FØ�‚}€}Ø�A�B�B”˜ˆÐØ�‚|€|Ø�A�B�B”�˜V™œÐ%Ð%Ø�‚}€}Ø�A�B�B”�œ u¨c°!°A°#¬hÑ7Ô7¸Ô:Ð;Ð;Ø�‚}€}Ø�A�B�B”�œ t¨S°°1°¬X¸Ñ-?Ñ@Ô@ÀÔCÐDÐDØ�‚}€}Ø�A�B�B”�œ u¨c°!°A°#¬hÑ7Ô7¸Ô:Ð;Ð;Ý
Ð<Ñ
=Ô
=Ð=r6   c                 ó¨   — t          | t          ¦  «        sd                     d„ | D ¦   «         ¦  «        S d                     d„ | D ¦   «         ¦  «        S )z"Debug function for showing buffersÚ c                 ó   — g | ]}d |d›�‘Œ	S ©z\xÚ02xrY   ©Ú.0Úcs     r4   ú
<listcomp>z"_digest_buffer.<locals>.<listcomp>o  s    € Ð3Ð3Ð3¨!˜˜a˜˜˜Ð3Ð3Ð3r6   c                 ó4   — g | ]}d t          |¦  «        d›�‘ŒS r€   )Úordr‚   s     r4   r…   z"_digest_buffer.<locals>.<listcomp>p  s*   € Ð4Ð4Ð4¨1Ð&�#˜a™&œ&Ð&Ð&Ð&Ð4Ð4Ð4r6   )r,   ÚstrÚjoin)r$   s    r4   Ú_digest_bufferrŠ   l  sV   € å�c�3ÑÔð 5Ø�wŠwÐ3Ð3¨sÐ3Ñ3Ô3Ñ4Ô4Ð4Ø�7Š7Ð4Ð4°Ð4Ñ4Ô4Ñ5Ô5Ð5r6   é   ÚabufferÚprefixÚlimitc                 óÎ   — |rF|r|dk    rt          | d|…         ¦  «        }nt          | ¦  «        }t          |dz   |z   ¦  «         dS t          t          | ¦  «        ¦  «         dS )z2Debug function printing output of _digest_buffer()r   z: N)rŠ   Úprint)rŒ   r�   rŽ   Údigests       r4   Úprint_bufferr’   s  sz   € ð ð 'Øð 	-�U˜Q’Y�YÝ# G¨A¨e¨GÔ$4Ñ5Ô5ˆFˆFå# GÑ,Ô,ˆFÝˆf�t‰m˜fÑ$Ñ%Ô%Ð%Ð%Ð%å�n˜WÑ%Ô%Ñ&Ô&Ð&Ð&Ð&r6   c                  óÖ  — i } t           j                             dd¦  «        }t           j                             |¦  «        s| S t	          |d¬¦  «        5 }|D ]x}|                     d¦  «        }t          |¦  «        dk    rŒ+|d                              ¦   «         }|d                              d	¦  «         	                    d
¦  «        }|| |<   Œy	 ddd¦  «         n# 1 swxY w Y   | S )zsParse the contents of /etc/os-release file.

    Returns:
        A dictionary containing release information.
    ú/etcz
os-releaseúutf-8©Úencodingú=r`   r   r   ú
ú"N©
ÚosÚpathr‰   ÚexistsÚopenÚsplitr.   ÚlowerÚrstripÚstrip)ÚdistroÚos_release_fileÚfile_objÚlineÚ	key_valueÚkeyÚvalues          r4   Ú_parse_os_releaser«   �  s!  € ð  €FÝ”g—l’l 6¨<Ñ8Ô8€OÝŒ7�>Š>˜/Ñ*Ô*ð ØˆÝ	ˆo¨Ð	0Ñ	0Ô	0ð  °HØð 	 ð 	 ˆDØŸ
š
 3™œˆIÝ�9‰~Œ~ Ò"Ð"ØØ˜A”,×$Ò$Ñ&Ô&ˆCØ˜a”L×'Ò'¨Ñ-Ô-×3Ò3°CÑ8Ô8ˆEØˆF�3‰KˆKð	 ð ð  ð  ñ  ô  ð  ð  ð  ð  ð  ð  øøøð  ð  ð  ð  ð €Ms   ÁA<CÃC"Ã%C"c                  óÒ  — i } t           j                             dd¦  «        }t           j                             |¦  «        r¥t	          |d¬¦  «        5 }|D ]x}|                     d¦  «        }t          |¦  «        dk    rŒ+|d                              ¦   «         }|d                              d	¦  «         	                    d
¦  «        }|| |<   Œy	 ddd¦  «         n# 1 swxY w Y   | S )ztParse the contents of /etc/lsb-release file.

    Returns:
        A dictionary containing release information.
    r”   zlsb-releaser•   r–   r˜   r`   r   r   r™   rš   Nr›   )r¤   Úlsb_release_filer¦   r§   r¨   r©   rª   s          r4   Ú_parse_lsb_releaser®   –  s  € ð €FÝ”w—|’| F¨MÑ:Ô:ÐÝ	„w‡~‚~Ð&Ñ'Ô'ð $ÝÐ"¨WÐ5Ñ5Ô5ð 	$¸Ø ð $ð $�Ø ŸJšJ s™OœO�	Ý�y‘>”> QÒ&Ð&ØØ ”l×(Ò(Ñ*Ô*�Ø! !œ×+Ò+¨DÑ1Ô1×7Ò7¸Ñ<Ô<�Ø#��s‘�ð$ð	$ð 	$ð 	$ñ 	$ô 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$øøøð 	$ð 	$ð 	$ð 	$ð €Ms   ÁA<CÃC Ã#C c                  óD  — i } t          t          j        dd¬¦  «        5 }	 t          j        d|¬¦  «        }n# t
          $ r Y ddd¦  «         dS w xY w|                     t          j        ¦   «         ¦  «         	                    ¦   «         }|D ]y}| 
                    d¦  «        }t          |¦  «        dk    rŒ+|d	                              d
d¦  «                             ¦   «         }|d                              d¦  «        }|| |<   Œz	 ddd¦  «         n# 1 swxY w Y   | S )ztParse the output of the lsb_release command.

    Returns:
        A dictionary containing release information.
    Úwr•   r–   )Úlsb_releasez-a)ÚstderrNú:r`   r   ú Ú_r   ú	)rŸ   rœ   ÚdevnullÚ
subprocessÚcheck_outputÚOSErrorÚdecodeÚsysÚgetfilesystemencodingÚ
splitlinesr    r.   Úreplacer¡   r£   )r¤   r·   ÚstdoutÚlinesr§   r¨   r©   rª   s           r4   Ú_parse_lsb_release_commandrÂ   ª  s€  € ð €FÝ	�bŒj˜#¨Ð	0Ñ	0Ô	0ð  °Gð	ÝÔ,Ð-BÈ7ÐSÑSÔSˆFˆFøÝð 	ð 	ð 	Øð	 ð  ð  ñ  ô  ð  ð  ð  ð	øøøà—’�cÔ7Ñ9Ô9Ñ:Ô:×EÒEÑGÔGˆØð 	 ð 	 ˆDØŸ
š
 3™œˆIÝ�9‰~Œ~ Ò"Ð"ØØ˜A”,×&Ò& s¨CÑ0Ô0×6Ò6Ñ8Ô8ˆCØ˜a”L×&Ò& tÑ,Ô,ˆEØˆF�3‰KˆKð	 ð ð  ð  ñ  ô  ð  ð  ð  ð  ð  ð  øøøð  ð  ð  ð  ð €Ms2   ŸD¡8·D¸
AÁDÁAÁB7DÄDÄDc                  óì  — t          ¦   «         } | rA|                      dd¦  «        |                      dd¦  «        |                      dd¦  «        fS t          ¦   «         } | rA|                      dd¦  «        |                      dd¦  «        |                      dd¦  «        fS t          ¦   «         } | rA|                      dd¦  «        |                      d	d¦  «        |                      d
d¦  «        fS dS )aN  Tries to determine the name of the Linux OS distribution name.

    First tries to get information from ``/etc/os-release`` file.
    If fails, tries to get the information of ``/etc/lsb-release`` file.
    And finally the information of ``lsb-release`` command.

    Returns:
        A tuple with (`name`, `version`, `codename`)
    Ú
distrib_idr~   Údistrib_releaseÚdistrib_codenameÚdistributor_idÚreleaseÚcodenameÚnameÚ
version_idÚversion_codename)r~   r~   r~   )r®   ÚgetrÂ   r«   )r¤   s    r4   Úlinux_distributionrÎ   Á  s  € õ (:Ñ';Ô';€FØð 
à�JŠJ�| RÑ(Ô(Ø�JŠJÐ(¨"Ñ-Ô-Ø�JŠJÐ)¨2Ñ.Ô.ð
ð 	
õ (Ñ)Ô)€FØð 
à�JŠJÐ'¨Ñ,Ô,Ø�JŠJ�y "Ñ%Ô%Ø�JŠJ�z 2Ñ&Ô&ð
ð 	
õ Ñ Ô €FØð 
à�JŠJ�v˜rÑ"Ô"Ø�JŠJ�| RÑ(Ô(Ø�JŠJÐ)¨2Ñ.Ô.ð
ð 	
ð ˆ<r6   Úunicode_strc                 óF   — | rt          j        | d         ¦  «        dv rdS dS )zÈGet the readiness direction of the unicode string.

    We assume that the direction is "L-to-R" if the first character does not
    indicate the direction is "R-to-L" or an "AL" (Arabic Letter).
    r   )ÚRÚALúR-to-LzL-to-R)ÚunicodedataÚbidirectional)rÏ   s    r4   Ú_get_unicode_read_directionrÖ   æ  s9   € ð ð •{Ô0°¸Q´Ñ@Ô@ð Eð ð ð ˆxØˆ8r6   c                 óÂ   — t          | ¦  «        }|dk    rBt          | d         ¦  «        rt          | d         ¦  «        st          d¦  «        ‚dt          iS dt          iS )at  
    1) The characters in section 5.8 MUST be prohibited.

    2) If a string contains any RandALCat character, the string MUST NOT
       contain any LCat character.

    3) If a string contains any RandALCat character, a RandALCat
       character MUST be the first character of the string, and a
       RandALCat character MUST be the last character of the string.
    rÓ   r   éÿÿÿÿzvInvalid unicode Bidirectional sequence, if the first character is RandALCat, the final charactermust be RandALCat too.z7Bidirectional Characters requirement 2 [StringPrep, d2])rÖ   r   r<   r   )rÏ   Úread_dirs     r4   Ú_get_unicode_direction_rulerÚ   ô  sx   € õ +¨;Ñ7Ô7€Hð �8ÒÐÝ˜K¨œNÑ+Ô+ð 	µ¸KÈ¼OÑ0LÔ0Lð 	Ýð)ñô ð ð JÍ;ÐWÐWð FÅ{ÐSÐSr6   Únormalized_strc                 ó¤  — t           t          t          t          t          t          t
          t          t          t          t          t          dœ}	 |                     t          | ¦  «        ¦  «         n(# t          $ r}| t          |¦  «        fcY d}~S d}~ww xY w| D ]5}|                     ¦   «         D ]\  }} ||¦  «        r|dk    r||fc c S ŒŒ6dS )aª  Check for Prohibited Output according to rfc4013 profile.

    This profile specifies the following characters as prohibited input:

       - Non-ASCII space characters [StringPrep, C.1.2]
       - ASCII control characters [StringPrep, C.2.1]
       - Non-ASCII control characters [StringPrep, C.2.2]
       - Private Use characters [StringPrep, C.3]
       - Non-character code points [StringPrep, C.4]
       - Surrogate code points [StringPrep, C.5]
       - Inappropriate for plain text characters [StringPrep, C.6]
       - Inappropriate for canonical representation characters [StringPrep, C.7]
       - Change display properties or deprecated characters [StringPrep, C.8]
       - Tagging characters [StringPrep, C.9]

    In addition of checking of Bidirectional Characters [StringPrep, Section 6]
    and the Unassigned Code Points [StringPrep, A.1].

    Returns:
        A tuple with ("probited character", "breaked_rule")
    )z4Space characters that contains the ASCII code pointsz&Space characters non-ASCII code pointsz(Unassigned Code Points [StringPrep, A.1]z.Non-ASCII space characters [StringPrep, C.1.2]z,ASCII control characters [StringPrep, C.2.1]z(Private Use characters [StringPrep, C.3]z+Non-character code points [StringPrep, C.4]z'Surrogate code points [StringPrep, C.5]z9Inappropriate for plain text characters [StringPrep, C.6]zGInappropriate for canonical representation characters [StringPrep, C.7]zDChange display properties or deprecated characters [StringPrep, C.8]z$Tagging characters [StringPrep, C.9]Nr´   )r   r   r   r   r   r   r	   r
   r   r   r   ÚupdaterÚ   r<   rˆ   Úitems)rÛ   Úrulesru   ÚcharÚruleÚfuncs         r4   Ú"validate_normalized_unicode_stringrã     sÿ   € õ2 AMÝ2>Ý4?Ý:FÝ8HÝ4?Ý7BÝ3>ÝEPÝS^ÝP[Ý0;ðð €Eð(Ø�ŠÕ0°Ñ@Ô@ÑAÔAÐAÐAøÝð (ð (ð (Ø�s 3™xœxÐ'Ð'Ð'Ð'Ð'Ð'Ð'øøøøð(øøøð ð "ð "ˆØŸ+š+™-œ-ð 	"ð 	"‰JˆD�$Øˆt�D‰zŒzð "˜d cšk˜kØ˜T�zÐ!Ð!Ð!Ð!Ð!øð	"ð ˆ4s   Á"A0 Á0
BÁ:BÂ
BÂBÚa_stringc                 óz   — d„ | D ¦   «         }d                      |¦  «        }t          j        d|¦  «        }|sdS |S )a(  normalizes a unicode string according to rfc4013

    Normalization of a unicode string according to rfc4013: The SASLprep profile
    of the "stringprep" algorithm.

    Normalization Unicode equivalence is the specification by the Unicode
    character encoding standard that some sequences of code points represent
    essentially the same character.

    This method normalizes using the Normalization Form Compatibility
    Composition (NFKC), as described in rfc4013 2.2.

    Returns:
        Normalized unicode string according to rfc4013.
    c                 óV   — g | ]&}t          |¦  «        rd nt          |¦  «        rdn|‘Œ'S )r´   r~   )r   r   )rƒ   rà   s     r4   r…   z,normalize_unicode_string.<locals>.<listcomp>W  sJ   € ð ð ð àõ ˜DÑ!Ô!ÐHˆˆ­[¸Ñ->Ô->Ð'H r rÀDðð ð r6   r~   ÚNFKC)r‰   rÔ   Ú	normalize)rä   Ú	nstr_listÚnstrs      r4   Únormalize_unicode_stringrë   D  sY   € ð&ð àðñ ô €Ið
 �7Š7�9ÑÔ€Dõ
 Ô  ¨Ñ.Ô.€DØð àˆrà€Kr6   r6   r•   Úpayloadr—   c                 óL  — t          | t          ¦  «        r| S t          | t          ¦  «        rt          | ¦  «        S t          | t          ¦  «        sF	 t          |                      |¬¦  «        ¦  «        S # t
          $ r}t          d¦  «        |‚d}~ww xY wt          | ¦  «        S )z(Initialize a bytearray from the payload.r–   zpayload must be a str or bytesN)r,   r/   r-   ÚbytesÚencodeÚAttributeErrorr<   )rì   r—   ru   s      r4   Úinit_bytearrayrñ   i  s´   € õ �'�9Ñ%Ô%ð ØˆÝ�'�3ÑÔð "Ý˜Ñ!Ô!Ð!Ý�g�uÑ%Ô%ð Hð	HÝ˜WŸ^š^°X˜^Ñ>Ô>Ñ?Ô?Ð?øÝð 	Hð 	Hð 	HÝÐ=Ñ>Ô>ÀCÐGøøøøð	Høøøõ �WÑÔÐs   Á"A5 Á5
BÁ?BÂBc                  ó  — dddœ} t           j        dk    rxdt          j        ¦   «         d         v rd| d<   n7dt          j        ¦   «         d         v rd	| d<   nt          j        ¦   «         | d<   d
t          j        ¦   «         d         › �| d<   nyt          j        ¦   «         | d<   t          j        ¦   «         dk    r dt          j        ¦   «         d         › �| d<   n,d                     t          ¦   «         dd…         ¦  «        | d<   | S )z4Return a dict with the platform arch and OS version.r~   )ÚarchÚversionÚntÚ64r   Úx86_64ró   Ú32Úi386zWindows-r   rô   ÚDarwinzmacOS-ú-r`   )
rœ   rÊ   ÚplatformÚarchitectureÚ	win32_verÚmachineÚsystemÚmac_verr‰   rÎ   )Úplats    r4   Úget_platformr  z  s  € ð =?È2Ð3NÐ3N€DÝ	„w�$‚€Ø•8Ô(Ñ*Ô*¨1Ô-Ð-Ð-Ø#ˆD�‰LˆLØ•XÔ*Ñ,Ô,¨QÔ/Ð/Ð/Ø!ˆD�‰LˆLå#Ô0Ñ2Ô2ˆD�‰LØ>¥XÔ%7Ñ%9Ô%9¸!Ô%<Ð>Ð>ˆˆY‰ˆåÔ'Ñ)Ô)ˆˆV‰ÝŒ?ÑÔ Ò(Ð(Ø>¥xÔ'7Ñ'9Ô'9¸!Ô'<Ð>Ð>ˆD�‰OˆOà!ŸhšhÕ'9Ñ';Ô';¸A¸a¸CÔ'@ÑAÔAˆD�‰Oà€Kr6   Úfullpathc                 óZ  — t          | t          ¦  «        st          d¦  «        ‚	 |                      dd¦  «        \  }}t	          j        |¦  «        }t          ||¦  «        }nG# t          $ r t          d| › d�¦  «        d‚t          t          f$ r}t          |› ¦  «        |‚d}~ww xY w|S )a(  Import an object from a fully qualified module path.

    Args:
        obj (str): A string representing the fully qualified name of the object.

    Returns:
        Object: The imported object.

    Raises:
        ValueError: If the object can't be imported.

    .. versionadded:: 8.0.33
    z]'fullpath' should be a str representing the fully qualified name of the object to be importedú.r   zNo callable named 'ú'N)	r,   rˆ   r<   ÚrsplitÚ	importlibÚimport_moduleÚgetattrrð   ÚModuleNotFoundError)r  Ú
module_strÚcallable_strÚmoduleÚobjru   s         r4   Úimport_objectr  �  sÚ   € õ �h¥Ñ$Ô$ð 
Ýð$ñ
ô 
ð 	
ð,Ø#+§?¢?°3¸Ñ#:Ô#:Ñ ˆ
�LÝÔ(¨Ñ4Ô4ˆÝ�f˜lÑ+Ô+ˆˆøÝð Fð Fð FÝÐ:¨xÐ:Ð:Ð:Ñ;Ô;ÀÐEÝÕ/Ð0ð ,ð ,ð ,Ý˜C˜Ñ"Ô"¨Ð+øøøøð,øøøð €Js   ¦=A$ Á$.B(ÂB#Â#B(Úcipher_as_osslÚtls_versionc                 óœ   — | t          j        |i ¦  «                             ¦   «         v r"d| › d�}t          j        |t
          ¦  «         dS dS )aI  Emits a warning if a deprecated cipher is being utilized.

    Args:
        cipher: Must be ingested as OpenSSL name.
        tls_versions: TLS version to check the cipher against.

    Raises:
        DeprecationWarning: If the cipher is flagged as deprecated
                            according to the OSSA cipher list.
    z$This connection is using TLS cipher ú[ which is now deprecated and will be removed in a future release of MySQL Connector/Python.N)r   rÍ   ÚvaluesÚwarningsÚwarnÚDeprecationWarning)r  r  Úwarn_msgs      r4   Úwarn_ciphersuites_deprecatedr  ¯  sh   € ð Õ4Ô8¸ÀbÑIÔI×PÒPÑRÔRÐRÐRð&°>ð &ð &ð &ð 	õ
 	Œ�hÕ 2Ñ3Ô3Ð3Ð3Ð3ð SÐRr6   c                 ó\   — | t           v r"d| › d�}t          j        |t          ¦  «         dS dS )a  Emits a warning if a deprecated TLS version is being utilized.

    Args:
        tls_versions: TLS version to check.

    Raises:
        DeprecationWarning: If the TLS version is flagged as deprecated
                            according to the OSSA cipher list.
    z%This connection is using TLS version r  N)r    r  r  r  )r  r  s     r4   Úwarn_tls_version_deprecatedr  Ã  sN   € ð Õ-Ð-Ð-ð&°Kð &ð &ð &ð 	õ
 	Œ�hÕ 2Ñ3Ô3Ð3Ð3Ð3ð .Ð-r6   c                  ó*   — dt           dt           fd„} | S )z‹
    Decorator to close the current connection if a read or a write timeout
    is raised by the method passed via the func parameter.
    Ú
cnx_methodr%   c           	      óv   ‡ — t          j        ‰ ¦  «        dddt          dt          dt          fˆ fd„¦   «         }|S )NÚcnxr   ÚargsÚkwargsr%   c                 ó˜   •— 	  ‰| g|¢R i |¤ŽS # t           $ r0}t          |t          ¦  «        r|                      ¦   «          |‚d }~ww xY w)N)Ú	Exceptionr,   ÚTimeoutErrorÚclose)r!  r"  r#  ru   r  s       €r4   Úhandle_cnx_methodzGhandle_read_write_timeout.<locals>.decorator.<locals>.handle_cnx_methodÝ  sk   ø€ ðØ!�z #Ð7¨Ð7Ð7Ð7°Ð7Ð7Ð7øÝð ð ð Ý˜c¥<Ñ0Ô0ð  Ø—I’I‘K”K�KØ�	øøøøðøøøs   ƒ �
A	™+AÁA	)Ú	functoolsÚwrapsr   )r  r(  s   ` r4   Ú	decoratorz,handle_read_write_timeout.<locals>.decoratorÜ  s^   ø€ Ý	Œ˜Ñ	$Ô	$ð	Ø*ð	Ý36ð	ÝBEð	åð	ð 	ð 	ð 	ð 	ñ 
%Ô	$ð	ð !Ð r6   )r   )r+  s    r4   Úhandle_read_write_timeoutr,  Ö  s,   € ð!�hð !­8ð !ð !ð !ð !ð Ðr6   c                   ó\   ‡ — e Zd ZdZdeddfd„Zdedefd„Zded	eddfˆ fd
„Zdefd„Z	ˆ xZ
S )ÚGenericWrapperz<Base class that provides basic object wrapper functionality.Úwrappedr%   Nc                 ó   — || _         dS )zConstructor.N)Ú_wrapped)Úselfr/  s     r4   Ú__init__zGenericWrapper.__init__ð  s   € à$ˆŒˆˆr6   Úattrc                 ó^   — || j         v rt          | |¦  «        S t          | j        |¦  «        S )zçGets an attribute.

        Attributes defined in the wrapper object have higher precedence
        than those wrapped object equivalent. Attributes not found in
        the wrapper are then searched in the wrapped object.
        )Ú__dict__r  r1  )r2  r4  s     r4   Ú__getattr__zGenericWrapper.__getattr__ô  s3   € ð �4”=Ð Ð å˜4 Ñ&Ô&Ð&å�t”} dÑ+Ô+Ð+r6   rÊ   rª   c                 óÂ   •— d| j         vr|| j         d<   dS || j         v r$t          ¦   «                              ||¦  «         dS | j                             ||¦  «         dS )zSets an attribute.r1  N)r6  ÚsuperÚ__setattr__r1  )r2  rÊ   rª   Ú	__class__s      €r4   r:  zGenericWrapper.__setattr__  sk   ø€ à˜Tœ]Ð*Ð*Ø(-ˆDŒM˜*Ñ%ØˆFà�4”=Ð Ð å‰GŒG×Ò  eÑ,Ô,Ð,ØˆFàŒ×!Ò! $¨Ñ.Ô.Ð.Ð.Ð.r6   c                 ó$   — | j         j        j        S )zGets the wrapped class name.)r1  r;  Ú__name__)r2  s    r4   Úget_wrapped_classz GenericWrapper.get_wrapped_class  s   € àŒ}Ô&Ô/Ð/r6   )r=  Ú
__module__Ú__qualname__Ú__doc__r   r3  rˆ   r7  r:  r>  Ú__classcell__)r;  s   @r4   r.  r.  í  s·   ø€ € € € € ØFÐFð% ð %¨ð %ð %ð %ð %ð, ð ,¨ð ,ð ,ð ,ð ,ð/ ð /¨Cð /°Dð /ð /ð /ð /ð /ð /ð0 3ð 0ð 0ð 0ð 0ð 0ð 0ð 0ð 0r6   r.  )NN)Nr‹   )r6   r•   )WrA  r)  r	  rœ   rü   r0   r¸   r¼   rÔ   r  Údecimalr   r   Ú
stringprepr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   Útypingr   r   r   r   r   r   r   r   r   Úmysql.connector.abstractsr   Úcustom_typesr   Útls_ciphersr   r    Útypesr!   r"   ÚboolÚ__annotations__r-   Úfloatr#   rî   r5   r?   rC   rG   rJ   rM   rP   rV   r\   rf   rp   rv   rx   r|   rˆ   rŠ   r’   r«   r®   rÂ   rÎ   rÖ   rÚ   rã   rë   r/   rñ   r  r  r  r  r,  r.  rY   r6   r4   ú<module>rM     s¹  ðð: Ð Ð à Ð Ð Ð Ø Ð Ð Ð Ø 	€	€	€	Ø €€€Ø €€€Ø Ð Ð Ð Ø 
€
€
€
Ø Ð Ð Ð Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð ð BØAÐAÐAÐAÐAÐAà $Ð $Ð $Ð $Ð $Ð $Ø MÐ MÐ MÐ MÐ MÐ MÐ MÐ MØ Ð Ð Ð Ð Ð à€�Ð Ð Ñ ð Ø	ØØð	Q€ˆu�T˜#”Y  U¤¨T°'¬]¸DÀÔ<LÐLÔMð ð ñ ð,��s˜E�zÔ"ð , sð ,ð ,ð ,ð ,ð �ð  ˜ð  ð  ð  ð  ð �ð  ˜ð  ð  ð  ð  ð%�ð %˜ð %ð %ð %ð %ð �ð  ˜ð  ð  ð  ð  ð �ð  ˜ð  ð  ð  ð  ð�ð ˜ð ð ð ð ð4*ˆcð *�eð *ð *ð *ð *ð$�Eð  ð ¨¨u°e¨|Ô)<ð ð ð ð ð2L˜ð 2L %¨¨x¸¬Ð(>Ô"?ð 2Lð 2Lð 2Lð 2Lðj%˜Uð % x°°h¸u´oÀsÐ6JÔ0KÔ'Lð %ð %ð %ð %ðT  ØðGð GØ	ðGà	�%ŒðGð �3Œ-ðGð ˆ5�%ˆ<Ôð	Gð Gð Gð Gð2�%ð ˜sð  u¨U°C¨ZÔ'8ð ð ð ð ð>�Uð >˜u U¨H°S¬MÐ%9Ô:ð >ð >ð >ð >ð46˜
ð 6 sð 6ð 6ð 6ð 6ð EGð'ð 'Øð'Ø!)¨#¤ð'Ø>Að'à	ð'ð 'ð 'ð 'ð˜4  S œ>ð ð ð ð ð*˜D  c œNð ð ð ð ð( H¨T°#°s°(¬^Ô$<ð ð ð ð ð."˜E # s¨C -Ô0ð "ð "ð "ð "ðJ¨Sð °Sð ð ð ð ðT¨Sð T°T¸#¸xÈÈÈtÈÔ?TÐ:TÔ5Uð Tð Tð Tð Tð81Øð1àˆe�C˜�HŒoÔð1ð 1ð 1ð 1ðh" sð "¨sð "ð "ð "ð "ðL <Cðð Ø�3˜
�?Ô#ðØ58ðàðð ð ð ð" €�„ð�d˜3  c¨5°°c°¬?Ð&:Ô ;Ð;Ô<ð ð ð ñ „ðð*˜Cð  Cð ð ð ð ð>4°ð 4À3ð 4È4ð 4ð 4ð 4ð 4ð(4¨Sð 4°Tð 4ð 4ð 4ð 4ð& 8ð ð ð ð ð.#0ð #0ð #0ð #0ð #0ñ #0ô #0ð #0ð #0ð #0r6   