hyb
2026-01-09 4cb426cb3ae31e772a09d4ade5b2f0242aaeefa0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Ë
Wñúhe=ãó@—UdZddlZddlZddlmZddlmZmZmZddl    m
Z
ddl m Z dZ     d    d
d d d ddddddddddœZ    ejdej ej"z¬«Zej&ed<    Gd„d«Z    d#dededee ddffd „Zd!edeefd"„Zy)$z8Classes and methods utilized to work with MySQL Scripts.éN)Údeque)ÚDequeÚ    GeneratorÚOptionalé)ÚInterfaceError)ÚMySQLScriptPartitionó;s\$s\^s\?s\(s\)s\[s\]s\{s\}s\.s\|s\+s\-s\*)ú$ú^ú?ú(ú)ú[ú]ú{ú}ú.ú|ú+ú-Ú*sA(delimiter\s+)(?=(?:[^"'`]*(?:"[^"]*"|'[^']*'|`[^`]*`))*[^"'`]*$))ÚflagsÚDELIMITER_PATTERNcóê—eZdZdZdZdeddfd„Zdededeefd    „Ze    d
e
de fd „«Z e    d
e
de fd „«Z e    d edeefd„«Ze    dede fd„«Ze    dedefd„«Zdde deefd„Zdefd„Zy)ÚMySQLScriptSplitterz¹Breaks a MySQL script into single statements.
 
    It strips custom delimiters and comments along the way, except for comments
    representing a MySQL extension or optimizer hint.
    s3(?=(?:[^"'`]*(?:"[^"]*"|'[^']*'|`[^`]*`))*[^"'`]*$)Ú
sql_scriptÚreturnNcó<—||_d|_d|_i|_y)z Constructor.N)Ú_codeÚ _single_stmtsÚ_mappable_stmtsÚ_re_sql_split_stmts)Úselfrs  úMH:\Change_password\venv_build\Lib\site-packages\mysql/connector/_scripting.pyÚ__init__zMySQLScriptSplitter.__init__Ns!€àˆŒ
Ø48ˆÔØ6:ˆÔØ<>ˆÕ óÚcodeÚ    delimitercóÖ—g}||jvrŒd|vr td«‚|j«Dcgc]&}tj    ||j ««‘Œ(}}t jdj|«|jz«|j|<|j|j|«D]&}|j«}|sŒ|j|«Œ(|Scc}w)z Split code context by delimiter.ó\z5The backslash (\) character is not a valid delimiter.r') r#rÚdecodeÚDELIMITER_RESERVED_SYMBOLSÚgetÚencodeÚreÚcompileÚjoinÚ_regex_sql_split_stmtsÚsplitÚstripÚappend)r$r(r)ÚsnippetsÚcharÚdelimiter_patternÚsnippetÚ snippet_strips        r%Ú_split_statementz$MySQLScriptSplitter._split_statementUsé€àˆà ˜D×4Ñ4Ñ 4ؘ    Ñ!Ü$ØLóðð
&×,Ñ,Ó.ö!àô+×.Ñ.¨t°T·[±[³]ÕCð!Ð ð!ô35·*±*Ø—‘Ð*Ó+¨d×.IÑ.IÑIó3ˆD× $Ñ $ YÑ /ð×/Ñ/°    Ñ:×@Ñ@ÀÓFò    /ˆGØ#ŸM™M›OˆMÚØ—‘  Õ.ð    /ð
ˆùò!s²+C&r8cóH—tjt|««ddvS)z;Validates whether `char` is a white-space character or not.r>ÚZ©Ú unicodedataÚcategoryÚchr©r8s r%Úis_white_space_charz'MySQLScriptSplitter.is_white_space_charmó#€ô×#Ñ#¤C¨£IÓ.¨qÑ1°UÐ:Ð:r'cóH—tjt|««ddvS)z7Validates whether `char` is a control character or not.r>ÚCr?rCs r%Úis_control_charz#MySQLScriptSplitter.is_control_charrrEr'Ústringcó.—tjd|«S)z6Split `string` by any control character or whitespace.s[\s\x00-\x1f\x7f-\x9f])r0r4)rIs r%Ú$split_by_control_char_or_white_spacez8MySQLScriptSplitter.split_by_control_char_or_white_spacews€ôx‰xÐ2°FÓ;Ð;r'có:—tjt|«duS)zBValidates whether `code` has the delimiter command pattern or not.N)r0Úsearchr©r(s r%Ú has_delimiterz!MySQLScriptSplitter.has_delimiter|s€ôy‰yÔ*¨DÓ1¸Ð=Ð=r'cóF—dtdtdtfd„}dtdtfd„}dtdtdtfd„}td«}d\}}t    d    «t    d
«t    d «}    }}|t |«kr›|€Qd }
||d d ||«rd}
n||dd «rd}
n||d d ||«rd}
|
|
dvr3|t |«krh|||k7r`|dz }|t |«krM|||k7rŒnC|dzt |«kr-|||dzdk7r"|dz }|dzt |«kr |||dzdk7rŒ"|dz }t t |
««D]} |j«Œ|rttj|d«stj|d«rD|j«|r2tj|d«rŒ+tj|d«rŒDŒc|€||||    fvr||}n | ||||hvrd }|j||«|dz }|t |«krŒ›t|«S)aèRemove MySQL comments which include `--`-style, `#`-style
        and `C`-style comments.
 
        A `--`-style comment spans from `--` to the end of the line.
        It requires the second dash to be
        followed by at least one whitespace or control character
        (such as a space, tab, newline, and so on).
 
        A `#`-style comment spans from `#` to the end of the line.
 
        A C-style comment spans from a `/*` sequence to the following `*/`
        sequence, as in the C programming language. This syntax enables a
        comment to extend over multiple lines because the beginning and
        closing sequences need not be on the same line.
 
        **NOTE: Only C-style comments representing MySQL extensions or
        optimizer hints are preserved**. E.g.,
 
        ```
        /*! MySQL-specific code */
 
        /*+ MySQL-specific code */
        ```
 
        *For Reference Manual- MySQL Comments*, see
        https://dev.mysql.com/doc/refman/en/comments.html.
        Úb_strÚb_charrcóh—|dk(xr,tj|«xstj|«S)Ns--)rrHrD©rQrRs  r%Ú is_dash_stylez:MySQLScriptSplitter.remove_comments.<locals>.is_dash_styleŸs5€Ø˜E‘>òÜ#×3Ñ3°FÓ;òCÜ&×:Ñ:¸6ÓBð r'có —|dk(S)Nó#©)rQs r%Ú is_hash_stylez:MySQLScriptSplitter.remove_comments.<locals>.is_hash_style¥s €Ø˜D‘=Ð  r'có@—|dk(xr|td«td«hvS)Ns/*ú!r)ÚordrTs  r%Ú
is_c_stylez7MySQLScriptSplitter.remove_comments.<locals>.is_c_style¨s#€Ø˜E‘>ÒH f´S¸³X¼sÀ3»xÐ4HÐ&HÐ Hr'r')rNú
ú'ú"Néþÿÿÿú--éÿÿÿÿú#z/*)rbrdrés*/) ÚbytesÚintÚboolÚ    bytearrayr\ÚlenÚrangeÚpoprrHrDr6) r(rUrYr]ÚbufÚiÚ literal_ctxÚ
line_breakÚ single_quoteÚ double_quoteÚstyleÚ_s             r%Úremove_commentsz#MySQLScriptSplitter.remove_commentssa€ð<    ¤ð    ´ð    ¼ó    ð     !¤ð    !¬4ó    !ð    Iœeð    I¬Sð    I´Tó    Iô˜‹nˆØ ‰ˆˆ;Ü14°T³¼CÀ»HÄcÈ#Ãh ,Lˆ
Ø”#d“)‹mØÑ"ؐ٠  R S ¨4°©7Ô3Ø ‘EÙ" 3 r s 8Ô,Ø‘EÙ  B C ¨$¨q©'Ô2Ø EØÑ$Ø  Ñ+ؤ# d£)šm°°Q±¸:Ò0EØ ™F˜Að ¤# d£)šm°°Q±¸:Ô0Eð  !™e¤c¨$£iÒ/°D¸¸QÀ¹U°OÀuÒ4LØ ™F˜Að  !™e¤c¨$£iÒ/°D¸¸QÀ¹U°OÀuÓ4Là˜Q™˜ä"¤3 u£:Ó.ò"˜ØŸ™    ð"ñÜ+×;Ñ;¸CÀ¹GÔDÜ.×BÑBÀ3ÀrÁ7ÔKàŸ™œ    ñ    Ü+×;Ñ;¸CÀ¹GÕDÜ.×BÑBÀ3ÀrÁ7ÕKñàÐ" t¨A¡w°<ÀÐ2NÑ'NØ" 1™g‘ ØÐ(¨T°!©W¸ÀjÐ8QÑ-QØ" à J‰Jt˜A‘wÔ Ø ‰FˆAðG”#d“)ŒmôJS‹zÐr'rucóÀ—|j |jSg|_t}g}d}|r!tj|j¬«}n |j}t j t|¬«D] }t jt|«rq|j|«d}|j«|jj|jdj|«|¬««||t|«dg}}n|j|«|}Œ¢|r;|jj|jdj|«|¬««|jS)aSplits the given script text into a sequence of individual statements.
 
        The word DELIMITER and any of its lower and upper case combinations
        such as delimiter, DeLiMiter, etc., are considered reserved words by
        the connector. Users must quote these when included in multi statements
        for other purposes different from declaring an actual statement delimiter;
        e.g., as names for tables, columns, variables, in comments, etc.
 
        ```
        CREATE TABLE `delimiter` (begin INT, end INT); -- I am a `DELimiTer` comment
        ```
 
        If they are not quoted, the statement-mapping will not produce the expected
        experience.
 
        See https://dev.mysql.com/doc/refman/8.0/en/keywords.html to know more
        about quoting a reserved word.
 
        *Note that comments are always ignored as they are not considered to be
        part of statements, with one exeception; **C-style comments representing
        MySQL extensions or optimizer hints are preserved***.
        Nr'rN)ÚpatternrIró )r(r))r!ÚDEFAULT_DELIMITERrrur r0r4rrMrKrlÚextendr<r2rjr6)r$rur)rmÚprevr(ÚcurrÚnext_delimiters        r%Ú split_scriptz MySQLScriptSplitter.split_scriptÕsN€ð0 × Ñ Ð )Ø×%Ñ%Ð %ð ˆÔÜ%ˆ    ØˆØˆñ Ü&×6Ñ6¸D¿J¹JÐ6ÓG‰Dà—:‘:ˆDô—H‘HÔ%6¸tÔDò    ˆDôy‰yÔ*¨DÔ1ð"&×!JÑ!JÈ4Ó!PÐQRÑ!Sð—‘”    ð×"Ñ"×)Ñ)Ø×)Ñ)¨t¯y©y¸«~ÈÐ)ÓSôð "0°$´s¸>Ó7JÐ7LÐ2MÐ1N˜3‘    ð—
‘
˜4Ô ð‰Dð1    ñ6 Ø × Ñ × %Ñ %Ø×%Ñ%¨4¯9©9°S«>ÀYÐ%ÓOô ð×!Ñ!Ð!r'có8—|jjd«S)Núutf-8)r r,)r$s r%Ú__repr__zMySQLScriptSplitter.__repr__ s€Øz‰z× Ñ  Ó)Ð)r')T)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r3rfr&Úlistr<Ú staticmethodrgrhrDrHrKrOrur~ÚstrrrXr'r%rrEs„ñð XÐð? 5ð?¨Tó?ð Uð°uðÀÀeÁóð0ð; #ð;¨$ò;óð;ðð;˜cð; dò;óð;ðð<°Uð<¸tÀE¹{ò<óð<ðð>˜Eð> dò>óð>ððQ˜eðQ¨òQóðQñfI"¨DðI"¸DÀ¹KóI"ðV*˜#ô*r'rÚsql_codeÚ map_resultsrc
#ó®K—tj|«s|sttg«|¬«–—yt|¬«}|j    «}|sttdg«d¬«–—y|s(tt|«dj |«¬«–—yd}d„t |«D«}|D]X}||kDr-tdj |||«t|||«¬«–—t||t||g«¬«–—|d    z}ŒZ|t|«kr@tdj ||t|««t||t|««¬«–—yy­w)
a·Breaks a MySQL script into sub-scripts.
 
    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.
 
    Args:
        sql_code: MySQL script.
        map_results: If True, each sub-script is `statement-result` mappable.
 
    Returns:
        A generator of typed dictionaries with keys `single_stmts` and `mappable_stmts`.
 
        If mapping disabled and no delimiters detected, it returns a 1-item generator,
        the field `single_stmts` is an empty list and the `mappable_stmt` field
        corresponds to the unmodified script, that may be mappable.
 
        If mapping disabled and delimiters detected, it returns a 1-item generator,
        the field `single_stmts` is a list including all the single statements
        found in the script and the `mappable_stmt` field corresponds to the processed
        script (delimiters are stripped) that may be mappable.
 
        If maping enabled, the script is broken into mappable partitions. It returns
        an N-item generator (as many items as computed partitions), the field
        `single_stmts` is a list including all the single statements of the partition
        and the `mappable_stmt` field corresponds to the sub-script (partition) that
        is guaranteed to be mappable.
 
    Raises:
        `InterfaceError` if an invalid delimiter string is found.
    )Ú single_stmtsÚ mappable_stmtN)rr's;
rc3óTK—|] \}}|ddj«dk(sŒ|–—Œ"y­w)NésCALL )Úupper)Ú.0ÚjÚstmts   r%ú    <genexpr>z(split_multi_statement.<locals>.<genexpr>js(èø€ÒW™7˜1˜d¸$¸rÀ¸(¿.¹.Ó:JÈhÓ:V”QÑWùs‚(¡()rrŒr)rrOr    rr~r2Ú    enumeraterj)r‰rŠÚtokÚstmtsrnÚ partition_idsr’s       r%Úsplit_multi_statementr™$s_èø€ôL × ,Ñ ,¨XÔ 6¹{ô #´°b³    ÈÔRÒRØä
¨Ô
2€Cð × Ñ Ó €Eñ ô#´°s°e³ ÈCÔPÒPØá ô#ܘu›°V·[±[ÀÓ5Gô
ò    
ð    ð    
€AÙW¤i°Ó&6ÔW€MØ ò ˆØ ˆqŠ5ä$Ø"(§+¡+¨e°A°a¨jÓ"9Ü!& u¨Q¨q zÓ!2ôò ô #Ø ™(´¸¸a¹°zÓ1Bô
ò    
𠐉E‰ð ð    Œ3ˆu‹:‚~ä  Ø$Ÿk™k¨%°´C¸³JÐ*?Ó@Ü" 5¨¬S°«ZÐ#8Ó9ô ó    
ðùs‚EEÚscriptcó—tjdtj|«tj¬«}|rt |d«dk7r t g«St |Dcgc]}|djd«‘Œc}«Scc}w)alScans the MySQL script looking for `filenames` (one for each
    `LOCAL INFILE` statement found).
 
    Arguments:
        script: a MySQL script that may include one or more `LOCAL INFILE` statements.
 
    Returns:
        filenames: a list of filenames (one for each `LOCAL INFILE` statement found).
        An empty list is returned if no matches are found.
    s2LOCAL\s+INFILE\s+(["'])((?:\\\1|(?:(?!\1)).)*)(\1))rwrIrrérr€)r0ÚfindallrruÚ
IGNORECASErjrr,)ršÚmatchesÚmatchs   r%Úget_local_infile_filenamesr¡sp€ôj‰jØJÜ"×2Ñ2°6Ó:܏m‰mô€Gñ
”c˜' !™*“o¨Ò*ܐR‹yÐô ¸Ö@¨u%˜‘(—/‘/ 'Õ*Ò@Ó AÐAùÒ@sÁ!B)F)r…r0r@Ú collectionsrÚtypingrrrÚerrorsrÚtypesr    ryr-r1ržÚ    MULTILINErÚPatternÚ__annotations__rrfrhr™rˆr¡rXr'r%ú<module>r©söðò:?ã    Ûåß-Ñ-å"Ý'àÐð,ð
Ø    Ø    Ø    Ø    Ø    Ø    Ø    Ø    Ø    Ø    Ø    Ø    Ø    ñÐð Eà * §
¡
ØMØ
-‰-˜"Ÿ,™,Ñ
&ô!А2—:‘:óðD÷\*ñ\*ðBñZ
ØðZ
àðZ
ðÐ# T¨4Ð/Ñ0óZ
ðzB uðB°°s±ôBr'