o
    ‡ÎÖa¯_  ã                   @   s’   d Z dZdZdZdZdZedkrGddlZdd	lm	Z	 dd
l
mZ dZed Zed Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zeƒ  dS dS )zð
    pygments.lexers._mysql_builtins
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Self-updating data files for the MySQL lexer.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
)ÚfalseÚnullÚtrueÚunknown)<ÚbigintÚbitÚboolÚbooleanÚdecÚdecimalÚdoubleÚfixedÚfloatÚfloat4Úfloat8ÚintÚint1Úint2Úint3Úint4Úint8ÚintegerÚ	mediumintÚ	middleintÚnumericÚ	precisionÚrealÚserialÚsmallintÚtinyintÚdateÚdatetimeÚtimeÚ	timestampÚyearÚbinaryÚblobÚcharÚenumÚlongÚlongblobÚlongtextÚ
mediumblobÚ
mediumtextÚnationalÚncharÚnvarcharÚsetÚtextÚtinyblobÚtinytextÚ	varbinaryÚvarcharÚvarcharacterÚvaryingÚgeometryÚgeometrycollectionÚ
linestringÚmultilinestringÚ
multipointÚmultipolygonÚpointÚpolygonÚjson(u  ÚabsÚacosÚadddateÚaddtimeÚaes_decryptÚaes_encryptÚ	any_valueÚasinÚatanÚatan2Ú	benchmarkÚbinÚbin_to_uuidÚbit_andÚ	bit_countÚ
bit_lengthÚbit_orÚbit_xorÚcan_access_columnÚcan_access_databaseÚcan_access_eventÚcan_access_resource_groupÚcan_access_routineÚcan_access_tableÚcan_access_triggerÚcan_access_viewÚcastÚceilÚceilingÚchar_lengthÚcharacter_lengthÚcoercibilityÚcompressÚconcatÚ	concat_wsÚconnection_idÚconvÚconvert_cpu_id_maskÚ!convert_interval_to_user_intervalÚ
convert_tzÚcosÚcotÚcountÚcrc32ÚcurdateÚcurrent_roleÚcurtimeÚdate_addÚdate_formatÚdate_subÚdatediffÚdaynameÚ
dayofmonthÚ	dayofweekÚ	dayofyearÚdegreesÚeltÚexpÚ
export_setÚextractÚextractvalueÚfieldÚfind_in_setÚfloorÚformat_bytesÚformat_pico_timeÚ
found_rowsÚfrom_base64Ú	from_daysÚfrom_unixtimeÚget_dd_column_privilegesÚget_dd_create_optionsÚget_dd_index_private_dataÚget_dd_index_sub_part_lengthÚget_dd_property_key_valueÚget_dd_tablespace_private_dataÚget_lockÚgreatestÚgroup_concatÚgtid_subsetÚgtid_subtractÚhexÚicu_versionÚifnullÚ
inet6_atonÚ
inet6_ntoaÚ	inet_atonÚ	inet_ntoaÚinstrÚinternal_auto_incrementÚinternal_avg_row_lengthÚinternal_check_timeÚinternal_checksumÚinternal_data_freeÚinternal_data_lengthÚinternal_dd_char_lengthÚinternal_get_comment_or_errorÚinternal_get_dd_column_extraÚinternal_get_enabled_role_jsonÚinternal_get_hostnameÚ!internal_get_mandatory_roles_jsonÚ internal_get_partition_nodegroupÚinternal_get_usernameÚ"internal_get_view_warning_or_errorÚ!internal_index_column_cardinalityÚinternal_index_lengthÚinternal_is_enabled_roleÚinternal_is_mandatory_roleÚinternal_keys_disabledÚinternal_max_data_lengthÚinternal_table_rowsÚ#internal_tablespace_autoextend_sizeÚinternal_tablespace_data_freeÚinternal_tablespace_extent_sizeÚinternal_tablespace_extraÚ internal_tablespace_free_extentsÚinternal_tablespace_idÚ internal_tablespace_initial_sizeÚ&internal_tablespace_logfile_group_nameÚ(internal_tablespace_logfile_group_numberÚ internal_tablespace_maximum_sizeÚinternal_tablespace_row_formatÚinternal_tablespace_statusÚ!internal_tablespace_total_extentsÚinternal_tablespace_typeÚinternal_tablespace_versionÚinternal_update_timeÚis_free_lockÚis_ipv4Úis_ipv4_compatÚis_ipv4_mappedÚis_ipv6Úis_used_lockÚis_uuidÚis_visible_dd_objectÚisnullÚ
json_arrayÚjson_array_appendÚjson_array_insertÚjson_arrayaggÚjson_containsÚjson_contains_pathÚ
json_depthÚjson_extractÚjson_insertÚ	json_keysÚjson_lengthÚ
json_mergeÚjson_merge_patchÚjson_merge_preserveÚjson_objectÚjson_objectaggÚjson_overlapsÚjson_prettyÚ
json_quoteÚjson_removeÚjson_replaceÚjson_schema_validÚjson_schema_validation_reportÚjson_searchÚjson_setÚjson_storage_freeÚjson_storage_sizeÚ	json_typeÚjson_unquoteÚ
json_validÚlast_dayÚlast_insert_idÚlcaseÚleastÚlengthÚlike_range_maxÚlike_range_minÚlnÚ	load_fileÚlocateÚlogÚlog10Úlog2ÚlowerÚlpadÚltrimÚmake_setÚmakedateÚmaketimeÚmaster_pos_waitÚmaxÚmbrcontainsÚmbrcoveredbyÚ	mbrcoversÚmbrdisjointÚ	mbrequalsÚmbrintersectsÚmbroverlapsÚ
mbrtouchesÚ	mbrwithinÚmd5ÚmidÚminÚ	monthnameÚ
name_constÚnowÚnullifÚoctÚoctet_lengthÚordÚ
period_addÚperiod_diffÚpiÚpositionÚpowÚpowerÚps_current_thread_idÚps_thread_idÚquoteÚradiansÚrandÚrandom_bytesÚregexp_instrÚregexp_likeÚregexp_replaceÚregexp_substrÚrelease_all_locksÚrelease_lockÚremove_dd_property_keyÚreverseÚroles_graphmlÚroundÚrpadÚrtrimÚsec_to_timeÚsession_userÚshaÚsha1Úsha2ÚsignÚsinÚsleepÚsoundexÚspaceÚsqrtÚst_areaÚst_asbinaryÚst_asgeojsonÚ	st_astextÚst_aswkbÚst_aswktÚ	st_bufferÚst_buffer_strategyÚst_centroidÚst_containsÚst_convexhullÚ
st_crossesÚst_differenceÚst_dimensionÚst_disjointÚst_distanceÚst_distance_sphereÚst_endpointÚst_envelopeÚ	st_equalsÚst_exteriorringÚ
st_geohashÚst_geomcollfromtextÚst_geomcollfromtxtÚst_geomcollfromwkbÚst_geometrycollectionfromtextÚst_geometrycollectionfromwkbÚst_geometryfromtextÚst_geometryfromwkbÚst_geometrynÚst_geometrytypeÚst_geomfromgeojsonÚst_geomfromtextÚst_geomfromwkbÚst_interiorringnÚst_intersectionÚst_intersectsÚst_isclosedÚ
st_isemptyÚst_issimpleÚ
st_isvalidÚst_latfromgeohashÚst_latitudeÚ	st_lengthÚst_linefromtextÚst_linefromwkbÚst_linestringfromtextÚst_linestringfromwkbÚst_longfromgeohashÚst_longitudeÚst_makeenvelopeÚst_mlinefromtextÚst_mlinefromwkbÚst_mpointfromtextÚst_mpointfromwkbÚst_mpolyfromtextÚst_mpolyfromwkbÚst_multilinestringfromtextÚst_multilinestringfromwkbÚst_multipointfromtextÚst_multipointfromwkbÚst_multipolygonfromtextÚst_multipolygonfromwkbÚst_numgeometriesÚst_numinteriorringÚst_numinteriorringsÚst_numpointsÚst_overlapsÚst_pointfromgeohashÚst_pointfromtextÚst_pointfromwkbÚ	st_pointnÚst_polyfromtextÚst_polyfromwkbÚst_polygonfromtextÚst_polygonfromwkbÚst_simplifyÚst_sridÚst_startpointÚ	st_swapxyÚst_symdifferenceÚ
st_touchesÚst_transformÚst_unionÚst_validateÚ	st_withinÚst_xÚst_yÚstatement_digestÚstatement_digest_textÚstdÚstddevÚ
stddev_popÚstddev_sampÚstr_to_dateÚstrcmpÚsubdateÚsubstrÚ	substringÚsubstring_indexÚsubtimeÚsumÚsysdateÚsystem_userÚtanÚtime_formatÚtime_to_secÚtimediffÚ	to_base64Úto_daysÚ
to_secondsÚtrimÚucaseÚ
uncompressÚuncompressed_lengthÚunhexÚunix_timestampÚ	updatexmlÚupperÚuuidÚ
uuid_shortÚuuid_to_binÚvalidate_password_strengthÚvar_popÚvar_sampÚvarianceÚversionÚwait_for_executed_gtid_setÚ!wait_until_sql_thread_after_gtidsÚweekdayÚ
weekofyearÚyearweek)(ÚbkaÚbnlÚdupsweedoutÚ
firstmatchÚgroup_indexÚ	hash_joinÚindexÚindex_mergeÚ
intoexistsÚjoin_fixed_orderÚ
join_indexÚ
join_orderÚjoin_prefixÚjoin_suffixÚ	loosescanÚmaterializationÚmax_execution_timeÚmergeÚmrrÚno_bkaÚno_bnlÚno_group_indexÚno_hash_joinÚno_icpÚno_indexÚno_index_mergeÚno_join_indexÚno_mergeÚno_mrrÚno_order_indexÚno_range_optimizationÚno_semijoinÚno_skip_scanÚorder_indexÚqb_nameÚresource_groupÚsemijoinÚset_varÚ	skip_scanÚsubquery(†  Ú
accessibleÚaccountÚactionÚactiveÚaddÚadminÚafterÚagainstÚ	aggregateÚ	algorithmÚallÚalterÚalwaysÚanalyzeÚandÚanyÚarrayÚasÚascÚasciiÚ
asensitiveÚatÚ	attributeÚauto_incrementÚautoextend_sizeÚavgÚavg_row_lengthÚbackupÚbeforeÚbeginÚbetweenÚbinlogÚblockÚbothÚbtreeÚbucketsÚbyÚbyteÚcacheÚcallÚcascadeÚcascadedÚcaseÚcatalog_nameÚchainÚchangeÚchangedÚchannelÚ	characterÚcharsetÚcheckÚchecksumÚcipherÚclass_originÚclientÚcloneÚcloseÚcoalesceÚcodeÚcollateÚ	collationÚcolumnÚcolumn_formatÚcolumn_nameÚcolumnsÚcommentÚcommitÚ	committedÚcompactÚ
completionÚ	componentÚ
compressedÚcompressionÚ
concurrentÚ	conditionÚ
connectionÚ
consistentÚ
constraintÚconstraint_catalogÚconstraint_nameÚconstraint_schemaÚcontainsÚcontextÚcontinueÚconvertÚcpuÚcreateÚcrossÚcubeÚ	cume_distÚcurrentÚcurrent_dateÚcurrent_timeÚcurrent_timestampÚcurrent_userÚcursorÚcursor_nameÚdataÚdatabaseÚ	databasesÚdatafileÚdayÚday_hourÚday_microsecondÚ
day_minuteÚ
day_secondÚ
deallocateÚdeclareÚdefaultÚdefault_authÚdefinerÚ
definitionÚdelay_key_writeÚdelayedÚdeleteÚ
dense_rankÚdescÚdescribeÚdescriptionÚdeterministicÚdiagnosticsÚ	directoryÚdisableÚdiscardÚdiskÚdistinctÚdistinctrowÚdivÚdoÚdropÚdualÚdumpfileÚ	duplicateÚdynamicÚeachÚelseÚelseifÚemptyÚenableÚenclosedÚ
encryptionÚendÚendsÚenforcedÚengineÚengine_attributeÚenginesÚerrorÚerrorsÚescapeÚescapedÚeventÚeventsÚeveryÚexceptÚexchangeÚexcludeÚexecuteÚexistsÚexitÚ	expansionÚexpireÚexplainÚexportÚextendedÚextent_sizeÚfailed_login_attemptsr   ÚfastÚfaultsÚfetchÚfieldsÚfileÚfile_block_sizeÚfilterÚfirstÚfirst_valueÚflushÚ	followingÚfollowsÚforÚforceÚforeignÚformatÚfoundÚfromÚfullÚfulltextÚfunctionÚgeneralÚ	generatedÚgeomcollectionÚgetÚ
get_formatÚget_master_public_keyÚglobalÚgrantÚgrantsÚgroupÚgroup_replicationÚgroupingÚgroupsÚhandlerÚhashÚhavingÚhelpÚhigh_priorityÚ	histogramÚhistoryÚhostÚhostsÚhourÚhour_microsecondÚhour_minuteÚhour_secondÚ
identifiedÚifÚignoreÚignore_server_idsÚimportÚinÚinactiver¼  ÚindexesÚinfileÚinitial_sizeÚinnerÚinoutÚinsensitiveÚinsertÚinsert_methodÚinstallÚinstanceÚintervalÚintoÚ	invisibleÚinvokerÚioÚio_after_gtidsÚio_before_gtidsÚ	io_threadÚipcÚisÚ	isolationÚissuerÚiterateÚjoinÚ
json_tableÚ
json_valueÚkeyÚkey_block_sizeÚkeysÚkillÚlagÚlanguageÚlastÚ
last_valueÚlateralÚleadÚleadingÚleaveÚleavesÚleftÚlessÚlevelÚlikeÚlimitÚlinearÚlinesÚlistÚloadÚlocalÚ	localtimeÚlocaltimestampÚlockÚlockedÚlocksÚlogfileÚlogsÚloopÚlow_priorityÚmasterÚmaster_auto_positionÚmaster_bindÚmaster_compression_algorithmsÚmaster_connect_retryÚmaster_delayÚmaster_heartbeat_periodÚmaster_hostÚmaster_log_fileÚmaster_log_posÚmaster_passwordÚmaster_portÚmaster_public_key_pathÚmaster_retry_countÚmaster_server_idÚ
master_sslÚmaster_ssl_caÚmaster_ssl_capathÚmaster_ssl_certÚmaster_ssl_cipherÚmaster_ssl_crlÚmaster_ssl_crlpathÚmaster_ssl_keyÚmaster_ssl_verify_server_certÚmaster_tls_ciphersuitesÚmaster_tls_versionÚmaster_userÚmaster_zstd_compression_levelÚmatchÚmax_connections_per_hourÚmax_queries_per_hourÚmax_rowsÚmax_sizeÚmax_updates_per_hourÚmax_user_connectionsÚmaxvalueÚmediumÚmemberÚmemoryrÇ  Úmessage_textÚmicrosecondÚmigrateÚmin_rowsÚminuteÚminute_microsecondÚminute_secondÚmodÚmodeÚmodifiesÚmodifyÚmonthÚmutexÚmysql_errnoÚnameÚnamesÚnaturalÚndbÚ
ndbclusterÚnestedÚnetwork_namespaceÚneverÚnewÚnextÚnoÚno_waitÚno_write_to_binlogÚ	nodegroupÚnoneÚnotÚnowaitÚ	nth_valueÚntiler   ÚnullsÚnumberÚofÚoffÚoffsetÚojÚoldÚonÚoneÚonlyÚopenÚoptimizeÚoptimizer_costsÚoptionÚoptionalÚ
optionallyÚoptionsÚorÚorderÚ
ordinalityÚorganizationÚothersÚoutÚouterÚoutfileÚoverÚownerÚ	pack_keysÚpageÚparserÚpartialÚ	partitionÚpartitioningÚ
partitionsÚpasswordÚpassword_lock_timeÚpathÚpercent_rankÚpersistÚpersist_onlyÚphaseÚpluginÚ
plugin_dirÚpluginsÚportÚprecedesÚ	precedingÚprepareÚpreserveÚprevÚprimaryÚprivilege_checks_userÚ
privilegesÚ	procedureÚprocessÚprocesslistÚprofileÚprofilesÚproxyÚpurgeÚquarterÚqueryÚquickÚrandomÚrangeÚrankÚreadÚ	read_onlyÚ
read_writeÚreadsÚrebuildÚrecoverÚ	recursiveÚredo_buffer_sizeÚ	redundantÚ	referenceÚ
referencesÚregexpÚrelayÚrelay_log_fileÚrelay_log_posÚrelay_threadÚrelaylogÚreleaseÚreloadÚremoveÚrenameÚ
reorganizeÚrepairÚrepeatÚ
repeatableÚreplaceÚreplicate_do_dbÚreplicate_do_tableÚreplicate_ignore_dbÚreplicate_ignore_tableÚreplicate_rewrite_dbÚreplicate_wild_do_tableÚreplicate_wild_ignore_tableÚreplicationÚrequireÚrequire_row_formatÚrequire_table_primary_key_checkÚresetÚresignalÚresourceÚrespectÚrestartÚrestoreÚrestrictÚresumeÚretainÚreturnÚreturned_sqlstateÚ	returningÚreturnsÚreuser"  ÚrevokeÚrightÚrlikeÚroleÚrollbackÚrollupÚrotateÚroutineÚrowÚ	row_countÚ
row_formatÚ
row_numberÚrowsÚrtreeÚ	savepointÚscheduleÚschemaÚschema_nameÚschemasÚsecondÚsecond_microsecondÚ	secondaryÚsecondary_engineÚsecondary_engine_attributeÚsecondary_loadÚsecondary_unloadÚsecurityÚselectÚ	sensitiveÚ	separatorÚserializableÚserverÚsessionÚshareÚshowÚshutdownÚsignalÚsignedÚsimpleÚskipÚslaveÚslowÚsnapshotÚsocketÚsomeÚsonameÚsoundsÚsourceÚspatialÚspecificÚsqlÚsql_after_gtidsÚsql_after_mts_gapsÚsql_before_gtidsÚsql_big_resultÚsql_buffer_resultÚsql_calc_found_rowsÚsql_no_cacheÚsql_small_resultÚ
sql_threadÚsql_tsi_dayÚsql_tsi_hourÚsql_tsi_minuteÚsql_tsi_monthÚsql_tsi_quarterÚsql_tsi_secondÚsql_tsi_weekÚsql_tsi_yearÚsqlexceptionÚsqlstateÚ
sqlwarningÚsridÚsslÚstackedÚstartÚstartingÚstartsÚstats_auto_recalcÚstats_persistentÚstats_sample_pagesÚstatusÚstopÚstorageÚstoredÚstraight_joinÚstreamÚstringÚsubclass_originÚsubjectÚsubpartitionÚsubpartitionsÚsuperÚsuspendÚswapsÚswitchesÚsystemÚtableÚtable_checksumÚ
table_nameÚtablesÚ
tablespaceÚ	temporaryÚ	temptableÚ
terminatedÚthanÚthenÚthread_priorityÚtiesÚtimestampaddÚtimestampdiffÚtlsÚtoÚtrailingÚtransactionÚtriggerÚtriggersr   ÚtruncateÚtypeÚtypesÚ	unboundedÚuncommittedÚ	undefinedÚundoÚundo_buffer_sizeÚundofileÚunicodeÚ	uninstallÚunionÚuniquer   ÚunlockÚunsignedÚuntilÚupdateÚupgradeÚusageÚuseÚuse_frmÚuserÚuser_resourcesÚusingÚutc_dateÚutc_timeÚutc_timestampÚ
validationÚvalueÚvaluesÚ	variablesÚvcpuÚviewÚvirtualÚvisibleÚwaitÚwarningsÚweekÚweight_stringÚwhenÚwhereÚwhileÚwindowÚwithÚwithoutÚworkÚwrapperÚwriteÚx509ÚxaÚxidÚxmlÚxorÚ
year_monthÚzerofillÚ__main__é    N)Úurlopen)Úformat_linesz-https://github.com/mysql/mysql-server/raw/8.0z
/sql/lex.hz/sql/item_create.ccc                  C   s˜   t tƒ ¡ jddd�} t| ƒ}t| ƒ}t| ƒ}t tƒ ¡ jddd�}| t	|ƒ¡ |t
tƒ8 }tdtt|ƒƒƒ tdtt|ƒƒƒ tdtt|ƒƒƒ d S )NÚutf8r¶  )rr  ÚMYSQL_FUNCTIONSÚMYSQL_KEYWORDSÚMYSQL_OPTIMIZER_HINTS)r_  ÚLEX_URLr  ÚdecodeÚparse_lex_keywordsÚparse_lex_functionsÚparse_lex_optimizer_hintsÚITEM_CREATE_URLr6  Úparse_item_create_functionsr0   ÚMYSQL_DATATYPESÚupdate_contentÚtupleÚsorted)Úlex_fileÚkeywordsÚ	functionsÚoptimizer_hintsÚitem_create_file© ru  úA/usr/lib/python3/dist-packages/pygments/lexers/_mysql_builtins.pyÚupdate_myself¨  s   rw  c                 C   óB   t ƒ }tjd| tjd�D ]}| | d¡ ¡ ¡ q|stdƒ‚|S )zParse keywords in lex.h.z({SYM(?:_HK)?\("(?P<keyword>[a-z0-9_]+)",©ÚflagsÚkeywordzNo keywords found©r0   ÚreÚfinditerÚIrâ  r£  rô   Ú
ValueError©ÚfÚresultsÚmru  ru  rv  rg  »  ó   rg  c                 C   rx  )zParse optimizer hints in lex.h.z"{SYM_H\("(?P<keyword>[a-z0-9_]+)",ry  r{  zNo optimizer hints foundr|  r�  ru  ru  rv  ri  È  r…  ri  c                 C   rx  )z&Parse MySQL function names from lex.h.z%{SYM_FN?\("(?P<function>[a-z0-9_]+)",ry  r™  zNo lex functions foundr|  r�  ru  ru  rv  rh  Õ  r…  rh  c                 C   rx  )z/Parse MySQL function names from item_create.cc.z({"(?P<function>[^"]+?)",\s*SQL_F[^(]+?\(ry  r™  zNo item_create functions foundr|  r�  ru  ru  rv  rk  â  r…  rk  c                 C   sÎ   t tƒ�}| ¡ }W d  ƒ n1 sw   Y  t d|  tjtjB ¡}| |¡}|s1td|  ƒ‚t	| |ƒ}|d| 
¡ … | || ¡ d…  }t tddd��}| |¡ W d  ƒ dS 1 s`w   Y  dS )zAOverwrite this file with content parsed from MySQL's source code.Nz^%s\s*=\s*\($.*?^\s*\)$z,Could not find an existing definition for %sÚwÚ
)Únewline)rG  Ú__file__r  r}  ÚcompileÚMÚSÚsearchr€  r`  rü  rk  rU  )Ú
field_nameÚcontentr‚  r?  Úre_matchr„  Ú	new_blockru  ru  rv  rm  ï  s   

ÿ

$"ÿrm  )Ú__doc__ÚMYSQL_CONSTANTSrl  rb  rd  rc  Ú__name__r}  Úurllib.requestr_  Úpygments.utilr`  Ú
SOURCE_URLre  rj  rw  rg  ri  rh  rk  rm  ru  ru  ru  rv  Ú<module>   s8    L  {,     
›