Files
LupiNex-Connect/node_modules/mariadb/dist/promise.cjs
T
2026-08-30 15:23:57 +02:00

38 lines
314 KiB
JavaScript

"use strict";var sn=Object.create;var Mt=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var _n=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty;var ei=(E,e)=>{for(var s in e)Mt(E,s,{get:e[s],enumerable:!0})},ti=(E,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _n(e))!on.call(E,n)&&n!==s&&Mt(E,n,{get:()=>e[n],enumerable:!(t=rn(e,n))||t.enumerable});return E};var m=(E,e,s)=>(s=E!=null?sn(nn(E)):{},ti(e||!E||!E.__esModule?Mt(s,"default",{value:E,enumerable:!0}):s,E)),En=E=>ti(Mt({},"__esModule",{value:!0}),E);var Jo={};ei(Jo,{SqlError:()=>L,createConnection:()=>J_,createPool:()=>z_,createPoolCluster:()=>en,default:()=>Zo,defaultOptions:()=>Z_,importFile:()=>tn,version:()=>$_});module.exports=En(Jo);var Me={name:"mariadb",version:"3.5.3",description:"fast mariadb or mysql connector.",type:"module",exports:{".":{import:{types:"./types/index.d.ts",default:"./promise.js"},require:{types:"./types/index.d.cts",default:"./dist/promise.cjs"}},"./callback":{import:{types:"./types/callback.d.ts",default:"./callback.js"},require:{types:"./types/callback.d.cts",default:"./dist/callback.cjs"}}},types:"types/index.d.ts",directories:{lib:"lib",test:"test"},private:!1,scripts:{build:"npm run build:cjs","build:cjs":"esbuild promise.js --bundle --minify --platform=node --format=cjs --target=node20 --external:denque --external:iconv-lite --external:lru-cache --outfile=dist/promise.cjs && esbuild callback.js --bundle --minify --platform=node --format=cjs --target=node20 --external:denque --external:iconv-lite --external:lru-cache --outfile=dist/callback.cjs",test:"npm run test:types-prettier && npm run test:prettier && npm run test:tsc && npm run test:types && npm run test:lint && npm run test:imports && npm run test:base","test:base":"vitest --no-file-parallelism --isolate --reporter=verbose run","test:imports":"npm run build && node test/import/cjs.cjs && node test/import/esm.mjs && npm run test:imports:tsc","test:imports:tsc":"tsc --noEmit -p test/import/tsc/cjs-node16.tsconfig.json && tsc --noEmit -p test/import/tsc/esm-nodenext.tsconfig.json && tsc --noEmit -p test/import/tsc/bundler.tsconfig.json","test:lint":'eslint "*.js" "{tools,lib,test,benchmarks}/**/*.js"',"test:tsc":"tsc --noEmit -p types/tsconfig.json","test:types":'eslint "types/*.ts"',"test:types-prettier":'prettier --write "types/*.ts"',"test:prettier":'prettier --write "*.js" "{tools,lib,test,benchmarks}/**/*.js"',prepublishOnly:"npm run build",coverage:"npm run coverage:test && npm run coverage:create && npm run coverage:send","coverage:test":"nyc vitest --no-file-parallelism --isolate --reporter=verbose run","coverage:report":"npm run coverage:create && npm run coverage:send","coverage:create":"nyc report --reporter=text-lcov > coverage.lcov","coverage:send":"./codecov --disable=gcov",benchmark:"node benchmarks/benchmarks-all.js","benchmark:setup":"npm install --no-save promise-mysql mysql2",generate:"node tools/generate-mariadb.js"},repository:{type:"git",url:"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},keywords:["mariadb","mysql","client","driver","connector"],files:["lib","types/index.d.ts","types/callback.d.ts","types/share.d.ts","types/index.d.cts","types/callback.d.cts","types/share.d.cts","promise.js","check-node.js","callback.js","dist/"],engines:{node:">= 20.0.0"},author:"Diego Dupin <diego.dupin@mariadb.com>",license:"LGPL-2.1-or-later",dependencies:{"@types/geojson":"^7946.0.16","@types/node":">=20",denque:"^2.1.0","iconv-lite":"^0.7.2","lru-cache":"^11.5.0"},devDependencies:{"@typescript-eslint/eslint-plugin":"^8.59.0","@typescript-eslint/parser":"^8.59.0",chalk:"^5.6.0","error-stack-parser":"^2.1.4",esbuild:"^0.28.0",eslint:"^10.4.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5",nyc:"^18.0.0",prettier:"^3.8.0",tinybench:"^6.0.2",typescript:"^5.9.3",vitest:"^4.1.0",winston:"^3.19.0"},bugs:{url:"https://jira.mariadb.org/projects/CONJS/"},homepage:"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme"};function An(E,e){let s=E.split("."),t=e.split("."),n=Number(s[0]),o=Number(t[0]);if(n>o)return!0;if(n<o)return!1;if(t.length===1)return!0;let a=Number(s[1]),A=Number(t[1]);return a>=A}var un=Me.engines.node,si=un.replace(">=","").trim(),hn=process.version.replace("v","");An(hn,si)||(console.error(`please upgrade node: mariadb requires at least version ${si}`),process.exit(1));var Fr=m(require("node:events"),1),mt=m(require("denque"),1),as=m(require("node:net"),1);var L={};ei(L,{client:()=>N,createError:()=>f,createFatalError:()=>w,default:()=>Ke,getClientErrorKey:()=>ii});var r={};r[120]="HA_ERR_KEY_NOT_FOUND";r[121]="HA_ERR_FOUND_DUPP_KEY";r[122]="HA_ERR_INTERNAL_ERROR";r[123]="HA_ERR_RECORD_CHANGED";r[124]="HA_ERR_WRONG_INDEX";r[126]="HA_ERR_CRASHED";r[127]="HA_ERR_WRONG_IN_RECORD";r[128]="HA_ERR_OUT_OF_MEM";r[129]="HA_ERR_RETRY_INIT";r[130]="HA_ERR_NOT_A_TABLE";r[131]="HA_ERR_WRONG_COMMAND";r[132]="HA_ERR_OLD_FILE";r[133]="HA_ERR_NO_ACTIVE_RECORD";r[134]="HA_ERR_RECORD_DELETED";r[135]="HA_ERR_RECORD_FILE_FULL";r[136]="HA_ERR_INDEX_FILE_FULL";r[137]="HA_ERR_END_OF_FILE";r[138]="HA_ERR_UNSUPPORTED";r[139]="HA_ERR_TO_BIG_ROW";r[140]="HA_WRONG_CREATE_OPTION";r[141]="HA_ERR_FOUND_DUPP_UNIQUE";r[142]="HA_ERR_UNKNOWN_CHARSET";r[143]="HA_ERR_WRONG_MRG_TABLE_DEF";r[144]="HA_ERR_CRASHED_ON_REPAIR";r[145]="HA_ERR_CRASHED_ON_USAGE";r[146]="HA_ERR_LOCK_WAIT_TIMEOUT";r[147]="HA_ERR_LOCK_TABLE_FULL";r[148]="HA_ERR_READ_ONLY_TRANSACTION";r[149]="HA_ERR_LOCK_DEADLOCK";r[150]="HA_ERR_CANNOT_ADD_FOREIGN";r[151]="HA_ERR_NO_REFERENCED_ROW";r[152]="HA_ERR_ROW_IS_REFERENCED";r[153]="HA_ERR_NO_SAVEPOINT";r[154]="HA_ERR_NON_UNIQUE_BLOCK_SIZE";r[155]="HA_ERR_NO_SUCH_TABLE";r[156]="HA_ERR_TABLE_EXIST";r[157]="HA_ERR_NO_CONNECTION";r[158]="HA_ERR_NULL_IN_SPATIAL";r[159]="HA_ERR_TABLE_DEF_CHANGED";r[160]="HA_ERR_NO_PARTITION_FOUND";r[161]="HA_ERR_RBR_LOGGING_FAILED";r[162]="HA_ERR_DROP_INDEX_FK";r[163]="HA_ERR_FOREIGN_DUPLICATE_KEY";r[164]="HA_ERR_TABLE_NEEDS_UPGRADE";r[165]="HA_ERR_TABLE_READONLY";r[166]="HA_ERR_AUTOINC_READ_FAILED";r[167]="HA_ERR_AUTOINC_ERANGE";r[168]="HA_ERR_GENERIC";r[169]="HA_ERR_RECORD_IS_THE_SAME";r[170]="HA_ERR_LOGGING_IMPOSSIBLE";r[171]="HA_ERR_CORRUPT_EVENT";r[172]="HA_ERR_NEW_FILE";r[173]="HA_ERR_ROWS_EVENT_APPLY";r[174]="HA_ERR_INITIALIZATION";r[175]="HA_ERR_FILE_TOO_SHORT";r[176]="HA_ERR_WRONG_CRC";r[177]="HA_ERR_TOO_MANY_CONCURRENT_TRXS";r[178]="HA_ERR_NOT_IN_LOCK_PARTITIONS";r[179]="HA_ERR_INDEX_COL_TOO_LONG";r[180]="HA_ERR_INDEX_CORRUPT";r[181]="HA_ERR_UNDO_REC_TOO_BIG";r[182]="HA_FTS_INVALID_DOCID";r[184]="HA_ERR_TABLESPACE_EXISTS";r[185]="HA_ERR_TOO_MANY_FIELDS";r[186]="HA_ERR_ROW_IN_WRONG_PARTITION";r[187]="HA_ERR_ROW_NOT_VISIBLE";r[188]="HA_ERR_ABORTED_BY_USER";r[189]="HA_ERR_DISK_FULL";r[190]="HA_ERR_INCOMPATIBLE_DEFINITION";r[191]="HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE";r[192]="HA_ERR_DECRYPTION_FAILED";r[193]="HA_ERR_FK_DEPTH_EXCEEDED";r[194]="HA_ERR_TABLESPACE_MISSING";r[195]="HA_ERR_SEQUENCE_INVALID_DATA";r[196]="HA_ERR_SEQUENCE_RUN_OUT";r[197]="HA_ERR_COMMIT_ERROR";r[198]="HA_ERR_PARTITION_LIST";r[199]="HA_ERR_NO_ENCRYPTION";r[200]="HA_ERR_ROLLBACK";r[201]="HA_ERR_LOCAL_TMP_SPACE_FULL";r[202]="HA_ERR_GLOBAL_TMP_SPACE_FULL";r[1e3]="ER_HASHCHK";r[1001]="ER_NISAMCHK";r[1002]="ER_NO";r[1003]="ER_YES";r[1004]="ER_CANT_CREATE_FILE";r[1005]="ER_CANT_CREATE_TABLE";r[1006]="ER_CANT_CREATE_DB";r[1007]="ER_DB_CREATE_EXISTS";r[1008]="ER_DB_DROP_EXISTS";r[1009]="ER_DB_DROP_DELETE";r[1010]="ER_DB_DROP_RMDIR";r[1011]="ER_CANT_DELETE_FILE";r[1012]="ER_CANT_FIND_SYSTEM_REC";r[1013]="ER_CANT_GET_STAT";r[1014]="ER_CANT_GET_WD";r[1015]="ER_CANT_LOCK";r[1016]="ER_CANT_OPEN_FILE";r[1017]="ER_FILE_NOT_FOUND";r[1018]="ER_CANT_READ_DIR";r[1019]="ER_CANT_SET_WD";r[1020]="ER_CHECKREAD";r[1021]="ER_DISK_FULL";r[1022]="ER_DUP_KEY";r[1023]="ER_ERROR_ON_CLOSE";r[1024]="ER_ERROR_ON_READ";r[1025]="ER_ERROR_ON_RENAME";r[1026]="ER_ERROR_ON_WRITE";r[1027]="ER_FILE_USED";r[1028]="ER_FILSORT_ABORT";r[1029]="ER_FORM_NOT_FOUND";r[1030]="ER_GET_ERRNO";r[1031]="ER_ILLEGAL_HA";r[1032]="ER_KEY_NOT_FOUND";r[1033]="ER_NOT_FORM_FILE";r[1034]="ER_NOT_KEYFILE";r[1035]="ER_OLD_KEYFILE";r[1036]="ER_OPEN_AS_READONLY";r[1037]="ER_OUTOFMEMORY";r[1038]="ER_OUT_OF_SORTMEMORY";r[1039]="ER_UNEXPECTED_EOF";r[1040]="ER_CON_COUNT_ERROR";r[1041]="ER_OUT_OF_RESOURCES";r[1042]="ER_BAD_HOST_ERROR";r[1043]="ER_HANDSHAKE_ERROR";r[1044]="ER_DBACCESS_DENIED_ERROR";r[1045]="ER_ACCESS_DENIED_ERROR";r[1046]="ER_NO_DB_ERROR";r[1047]="ER_UNKNOWN_COM_ERROR";r[1048]="ER_BAD_NULL_ERROR";r[1049]="ER_BAD_DB_ERROR";r[1050]="ER_TABLE_EXISTS_ERROR";r[1051]="ER_BAD_TABLE_ERROR";r[1052]="ER_NON_UNIQ_ERROR";r[1053]="ER_SERVER_SHUTDOWN";r[1054]="ER_BAD_FIELD_ERROR";r[1055]="ER_WRONG_FIELD_WITH_GROUP";r[1056]="ER_WRONG_GROUP_FIELD";r[1057]="ER_WRONG_SUM_SELECT";r[1058]="ER_WRONG_VALUE_COUNT";r[1059]="ER_TOO_LONG_IDENT";r[1060]="ER_DUP_FIELDNAME";r[1061]="ER_DUP_KEYNAME";r[1062]="ER_DUP_ENTRY";r[1063]="ER_WRONG_FIELD_SPEC";r[1064]="ER_PARSE_ERROR";r[1065]="ER_EMPTY_QUERY";r[1066]="ER_NONUNIQ_TABLE";r[1067]="ER_INVALID_DEFAULT";r[1068]="ER_MULTIPLE_PRI_KEY";r[1069]="ER_TOO_MANY_KEYS";r[1070]="ER_TOO_MANY_KEY_PARTS";r[1071]="ER_TOO_LONG_KEY";r[1072]="ER_KEY_COLUMN_DOES_NOT_EXIST";r[1073]="ER_BLOB_USED_AS_KEY";r[1074]="ER_TOO_BIG_FIELDLENGTH";r[1075]="ER_WRONG_AUTO_KEY";r[1076]="ER_BINLOG_CANT_DELETE_GTID_DOMAIN";r[1077]="ER_NORMAL_SHUTDOWN";r[1078]="ER_GOT_SIGNAL";r[1079]="ER_SHUTDOWN_COMPLETE";r[1080]="ER_FORCING_CLOSE";r[1081]="ER_IPSOCK_ERROR";r[1082]="ER_NO_SUCH_INDEX";r[1083]="ER_WRONG_FIELD_TERMINATORS";r[1084]="ER_BLOBS_AND_NO_TERMINATED";r[1085]="ER_TEXTFILE_NOT_READABLE";r[1086]="ER_FILE_EXISTS_ERROR";r[1087]="ER_LOAD_INFO";r[1088]="ER_ALTER_INFO";r[1089]="ER_WRONG_SUB_KEY";r[1090]="ER_CANT_REMOVE_ALL_FIELDS";r[1091]="ER_CANT_DROP_FIELD_OR_KEY";r[1092]="ER_INSERT_INFO";r[1093]="ER_UPDATE_TABLE_USED";r[1094]="ER_NO_SUCH_THREAD";r[1095]="ER_KILL_DENIED_ERROR";r[1096]="ER_NO_TABLES_USED";r[1097]="ER_TOO_BIG_SET";r[1098]="ER_NO_UNIQUE_LOGFILE";r[1099]="ER_TABLE_NOT_LOCKED_FOR_WRITE";r[1100]="ER_TABLE_NOT_LOCKED";r[1101]="ER_UNUSED_17";r[1102]="ER_WRONG_DB_NAME";r[1103]="ER_WRONG_TABLE_NAME";r[1104]="ER_TOO_BIG_SELECT";r[1105]="ER_UNKNOWN_ERROR";r[1106]="ER_UNKNOWN_PROCEDURE";r[1107]="ER_WRONG_PARAMCOUNT_TO_PROCEDURE";r[1108]="ER_WRONG_PARAMETERS_TO_PROCEDURE";r[1109]="ER_UNKNOWN_TABLE";r[1110]="ER_FIELD_SPECIFIED_TWICE";r[1111]="ER_INVALID_GROUP_FUNC_USE";r[1112]="ER_UNSUPPORTED_EXTENSION";r[1113]="ER_TABLE_MUST_HAVE_COLUMNS";r[1114]="ER_RECORD_FILE_FULL";r[1115]="ER_UNKNOWN_CHARACTER_SET";r[1116]="ER_TOO_MANY_TABLES";r[1117]="ER_TOO_MANY_FIELDS";r[1118]="ER_TOO_BIG_ROWSIZE";r[1119]="ER_STACK_OVERRUN";r[1120]="ER_WRONG_OUTER_JOIN";r[1121]="ER_NULL_COLUMN_IN_INDEX";r[1122]="ER_CANT_FIND_UDF";r[1123]="ER_CANT_INITIALIZE_UDF";r[1124]="ER_UDF_NO_PATHS";r[1125]="ER_UDF_EXISTS";r[1126]="ER_CANT_OPEN_LIBRARY";r[1127]="ER_CANT_FIND_DL_ENTRY";r[1128]="ER_FUNCTION_NOT_DEFINED";r[1129]="ER_HOST_IS_BLOCKED";r[1130]="ER_HOST_NOT_PRIVILEGED";r[1131]="ER_PASSWORD_ANONYMOUS_USER";r[1132]="ER_PASSWORD_NOT_ALLOWED";r[1133]="ER_PASSWORD_NO_MATCH";r[1134]="ER_UPDATE_INFO";r[1135]="ER_CANT_CREATE_THREAD";r[1136]="ER_WRONG_VALUE_COUNT_ON_ROW";r[1137]="ER_CANT_REOPEN_TABLE";r[1138]="ER_INVALID_USE_OF_NULL";r[1139]="ER_REGEXP_ERROR";r[1140]="ER_MIX_OF_GROUP_FUNC_AND_FIELDS";r[1141]="ER_NONEXISTING_GRANT";r[1142]="ER_TABLEACCESS_DENIED_ERROR";r[1143]="ER_COLUMNACCESS_DENIED_ERROR";r[1144]="ER_ILLEGAL_GRANT_FOR_TABLE";r[1145]="ER_GRANT_WRONG_HOST_OR_USER";r[1146]="ER_NO_SUCH_TABLE";r[1147]="ER_NONEXISTING_TABLE_GRANT";r[1148]="ER_NOT_ALLOWED_COMMAND";r[1149]="ER_SYNTAX_ERROR";r[1150]="ER_DELAYED_CANT_CHANGE_LOCK";r[1151]="ER_TOO_MANY_DELAYED_THREADS";r[1152]="ER_ABORTING_CONNECTION";r[1153]="ER_NET_PACKET_TOO_LARGE";r[1154]="ER_NET_READ_ERROR_FROM_PIPE";r[1155]="ER_NET_FCNTL_ERROR";r[1156]="ER_NET_PACKETS_OUT_OF_ORDER";r[1157]="ER_NET_UNCOMPRESS_ERROR";r[1158]="ER_NET_READ_ERROR";r[1159]="ER_NET_READ_INTERRUPTED";r[1160]="ER_NET_ERROR_ON_WRITE";r[1161]="ER_NET_WRITE_INTERRUPTED";r[1162]="ER_TOO_LONG_STRING";r[1163]="ER_TABLE_CANT_HANDLE_BLOB";r[1164]="ER_TABLE_CANT_HANDLE_AUTO_INCREMENT";r[1165]="ER_DELAYED_INSERT_TABLE_LOCKED";r[1166]="ER_WRONG_COLUMN_NAME";r[1167]="ER_WRONG_KEY_COLUMN";r[1168]="ER_WRONG_MRG_TABLE";r[1169]="ER_DUP_UNIQUE";r[1170]="ER_BLOB_KEY_WITHOUT_LENGTH";r[1171]="ER_PRIMARY_CANT_HAVE_NULL";r[1172]="ER_TOO_MANY_ROWS";r[1173]="ER_REQUIRES_PRIMARY_KEY";r[1174]="ER_NO_RAID_COMPILED";r[1175]="ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE";r[1176]="ER_KEY_DOES_NOT_EXISTS";r[1177]="ER_CHECK_NO_SUCH_TABLE";r[1178]="ER_CHECK_NOT_IMPLEMENTED";r[1179]="ER_CANT_DO_THIS_DURING_AN_TRANSACTION";r[1180]="ER_ERROR_DURING_COMMIT";r[1181]="ER_ERROR_DURING_ROLLBACK";r[1182]="ER_ERROR_DURING_FLUSH_LOGS";r[1183]="ER_ERROR_DURING_CHECKPOINT";r[1184]="ER_NEW_ABORTING_CONNECTION";r[1185]="ER_UNUSED_10";r[1186]="ER_FLUSH_MASTER_BINLOG_CLOSED";r[1187]="ER_INDEX_REBUILD";r[1188]="ER_MASTER";r[1189]="ER_MASTER_NET_READ";r[1190]="ER_MASTER_NET_WRITE";r[1191]="ER_FT_MATCHING_KEY_NOT_FOUND";r[1192]="ER_LOCK_OR_ACTIVE_TRANSACTION";r[1193]="ER_UNKNOWN_SYSTEM_VARIABLE";r[1194]="ER_CRASHED_ON_USAGE";r[1195]="ER_CRASHED_ON_REPAIR";r[1196]="ER_WARNING_NOT_COMPLETE_ROLLBACK";r[1197]="ER_TRANS_CACHE_FULL";r[1198]="ER_SLAVE_MUST_STOP";r[1199]="ER_SLAVE_NOT_RUNNING";r[1200]="ER_BAD_SLAVE";r[1201]="ER_MASTER_INFO";r[1202]="ER_SLAVE_THREAD";r[1203]="ER_TOO_MANY_USER_CONNECTIONS";r[1204]="ER_SET_CONSTANTS_ONLY";r[1205]="ER_LOCK_WAIT_TIMEOUT";r[1206]="ER_LOCK_TABLE_FULL";r[1207]="ER_READ_ONLY_TRANSACTION";r[1208]="ER_DROP_DB_WITH_READ_LOCK";r[1209]="ER_CREATE_DB_WITH_READ_LOCK";r[1210]="ER_WRONG_ARGUMENTS";r[1211]="ER_NO_PERMISSION_TO_CREATE_USER";r[1212]="ER_UNION_TABLES_IN_DIFFERENT_DIR";r[1213]="ER_LOCK_DEADLOCK";r[1214]="ER_TABLE_CANT_HANDLE_FT";r[1215]="ER_CANNOT_ADD_FOREIGN";r[1216]="ER_NO_REFERENCED_ROW";r[1217]="ER_ROW_IS_REFERENCED";r[1218]="ER_CONNECT_TO_MASTER";r[1219]="ER_QUERY_ON_MASTER";r[1220]="ER_ERROR_WHEN_EXECUTING_COMMAND";r[1221]="ER_WRONG_USAGE";r[1222]="ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT";r[1223]="ER_CANT_UPDATE_WITH_READLOCK";r[1224]="ER_MIXING_NOT_ALLOWED";r[1225]="ER_DUP_ARGUMENT";r[1226]="ER_USER_LIMIT_REACHED";r[1227]="ER_SPECIFIC_ACCESS_DENIED_ERROR";r[1228]="ER_LOCAL_VARIABLE";r[1229]="ER_GLOBAL_VARIABLE";r[1230]="ER_NO_DEFAULT";r[1231]="ER_WRONG_VALUE_FOR_VAR";r[1232]="ER_WRONG_TYPE_FOR_VAR";r[1233]="ER_VAR_CANT_BE_READ";r[1234]="ER_CANT_USE_OPTION_HERE";r[1235]="ER_NOT_SUPPORTED_YET";r[1236]="ER_MASTER_FATAL_ERROR_READING_BINLOG";r[1237]="ER_SLAVE_IGNORED_TABLE";r[1238]="ER_INCORRECT_GLOBAL_LOCAL_VAR";r[1239]="ER_WRONG_FK_DEF";r[1240]="ER_KEY_REF_DO_NOT_MATCH_TABLE_REF";r[1241]="ER_OPERAND_COLUMNS";r[1242]="ER_SUBQUERY_NO_1_ROW";r[1243]="ER_UNKNOWN_STMT_HANDLER";r[1244]="ER_CORRUPT_HELP_DB";r[1245]="ER_CYCLIC_REFERENCE";r[1246]="ER_AUTO_CONVERT";r[1247]="ER_ILLEGAL_REFERENCE";r[1248]="ER_DERIVED_MUST_HAVE_ALIAS";r[1249]="ER_SELECT_REDUCED";r[1250]="ER_TABLENAME_NOT_ALLOWED_HERE";r[1251]="ER_NOT_SUPPORTED_AUTH_MODE";r[1252]="ER_INDEX_CANNOT_HAVE_NULL";r[1253]="ER_COLLATION_CHARSET_MISMATCH";r[1254]="ER_SLAVE_WAS_RUNNING";r[1255]="ER_SLAVE_WAS_NOT_RUNNING";r[1256]="ER_TOO_BIG_FOR_UNCOMPRESS";r[1257]="ER_ZLIB_Z_MEM_ERROR";r[1258]="ER_ZLIB_Z_BUF_ERROR";r[1259]="ER_ZLIB_Z_DATA_ERROR";r[1260]="ER_CUT_VALUE_GROUP_CONCAT";r[1261]="ER_WARN_TOO_FEW_RECORDS";r[1262]="ER_WARN_TOO_MANY_RECORDS";r[1263]="ER_WARN_NULL_TO_NOTNULL";r[1264]="ER_WARN_DATA_OUT_OF_RANGE";r[1265]="WARN_DATA_TRUNCATED";r[1266]="ER_WARN_USING_OTHER_HANDLER";r[1267]="ER_CANT_AGGREGATE_2COLLATIONS";r[1268]="ER_DROP_USER";r[1269]="ER_REVOKE_GRANTS";r[1270]="ER_CANT_AGGREGATE_3COLLATIONS";r[1271]="ER_CANT_AGGREGATE_NCOLLATIONS";r[1272]="ER_VARIABLE_IS_NOT_STRUCT";r[1273]="ER_UNKNOWN_COLLATION";r[1274]="ER_SLAVE_IGNORED_SSL_PARAMS";r[1275]="ER_SERVER_IS_IN_SECURE_AUTH_MODE";r[1276]="ER_WARN_FIELD_RESOLVED";r[1277]="ER_BAD_SLAVE_UNTIL_COND";r[1278]="ER_MISSING_SKIP_SLAVE";r[1279]="ER_UNTIL_COND_IGNORED";r[1280]="ER_WRONG_NAME_FOR_INDEX";r[1281]="ER_WRONG_NAME_FOR_CATALOG";r[1282]="ER_WARN_QC_RESIZE";r[1283]="ER_BAD_FT_COLUMN";r[1284]="ER_UNKNOWN_KEY_CACHE";r[1285]="ER_WARN_HOSTNAME_WONT_WORK";r[1286]="ER_UNKNOWN_STORAGE_ENGINE";r[1287]="ER_WARN_DEPRECATED_SYNTAX";r[1288]="ER_NON_UPDATABLE_TABLE";r[1289]="ER_FEATURE_DISABLED";r[1290]="ER_OPTION_PREVENTS_STATEMENT";r[1291]="ER_DUPLICATED_VALUE_IN_TYPE";r[1292]="ER_TRUNCATED_WRONG_VALUE";r[1293]="ER_TOO_MUCH_AUTO_TIMESTAMP_COLS";r[1294]="ER_INVALID_ON_UPDATE";r[1295]="ER_UNSUPPORTED_PS";r[1296]="ER_GET_ERRMSG";r[1297]="ER_GET_TEMPORARY_ERRMSG";r[1298]="ER_UNKNOWN_TIME_ZONE";r[1299]="ER_WARN_INVALID_TIMESTAMP";r[1300]="ER_INVALID_CHARACTER_STRING";r[1301]="ER_WARN_ALLOWED_PACKET_OVERFLOWED";r[1302]="ER_CONFLICTING_DECLARATIONS";r[1303]="ER_SP_NO_RECURSIVE_CREATE";r[1304]="ER_SP_ALREADY_EXISTS";r[1305]="ER_SP_DOES_NOT_EXIST";r[1306]="ER_SP_DROP_FAILED";r[1307]="ER_SP_STORE_FAILED";r[1308]="ER_SP_LILABEL_MISMATCH";r[1309]="ER_SP_LABEL_REDEFINE";r[1310]="ER_SP_LABEL_MISMATCH";r[1311]="ER_SP_UNINIT_VAR";r[1312]="ER_SP_BADSELECT";r[1313]="ER_SP_BADRETURN";r[1314]="ER_SP_BADSTATEMENT";r[1315]="ER_UPDATE_LOG_DEPRECATED_IGNORED";r[1316]="ER_UPDATE_LOG_DEPRECATED_TRANSLATED";r[1317]="ER_QUERY_INTERRUPTED";r[1318]="ER_SP_WRONG_NO_OF_ARGS";r[1319]="ER_SP_COND_MISMATCH";r[1320]="ER_SP_NORETURN";r[1321]="ER_SP_NORETURNEND";r[1322]="ER_SP_BAD_CURSOR_QUERY";r[1323]="ER_SP_BAD_CURSOR_SELECT";r[1324]="ER_SP_CURSOR_MISMATCH";r[1325]="ER_SP_CURSOR_ALREADY_OPEN";r[1326]="ER_SP_CURSOR_NOT_OPEN";r[1327]="ER_SP_UNDECLARED_VAR";r[1328]="ER_SP_WRONG_NO_OF_FETCH_ARGS";r[1329]="ER_SP_FETCH_NO_DATA";r[1330]="ER_SP_DUP_PARAM";r[1331]="ER_SP_DUP_VAR";r[1332]="ER_SP_DUP_COND";r[1333]="ER_SP_DUP_CURS";r[1334]="ER_SP_CANT_ALTER";r[1335]="ER_SP_SUBSELECT_NYI";r[1336]="ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG";r[1337]="ER_SP_VARCOND_AFTER_CURSHNDLR";r[1338]="ER_SP_CURSOR_AFTER_HANDLER";r[1339]="ER_SP_CASE_NOT_FOUND";r[1340]="ER_FPARSER_TOO_BIG_FILE";r[1341]="ER_FPARSER_BAD_HEADER";r[1342]="ER_FPARSER_EOF_IN_COMMENT";r[1343]="ER_FPARSER_ERROR_IN_PARAMETER";r[1344]="ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER";r[1345]="ER_VIEW_NO_EXPLAIN";r[1346]="ER_FRM_UNKNOWN_TYPE";r[1347]="ER_WRONG_OBJECT";r[1348]="ER_NONUPDATEABLE_COLUMN";r[1349]="ER_VIEW_SELECT_DERIVED";r[1350]="ER_VIEW_SELECT_CLAUSE";r[1351]="ER_VIEW_SELECT_VARIABLE";r[1352]="ER_VIEW_SELECT_TMPTABLE";r[1353]="ER_VIEW_WRONG_LIST";r[1354]="ER_WARN_VIEW_MERGE";r[1355]="ER_WARN_VIEW_WITHOUT_KEY";r[1356]="ER_VIEW_INVALID";r[1357]="ER_SP_NO_DROP_SP";r[1358]="ER_SP_GOTO_IN_HNDLR";r[1359]="ER_TRG_ALREADY_EXISTS";r[1360]="ER_TRG_DOES_NOT_EXIST";r[1361]="ER_TRG_ON_VIEW_OR_TEMP_TABLE";r[1362]="ER_TRG_CANT_CHANGE_ROW";r[1363]="ER_TRG_NO_SUCH_ROW_IN_TRG";r[1364]="ER_NO_DEFAULT_FOR_FIELD";r[1365]="ER_DIVISION_BY_ZERO";r[1366]="ER_TRUNCATED_WRONG_VALUE_FOR_FIELD";r[1367]="ER_ILLEGAL_VALUE_FOR_TYPE";r[1368]="ER_VIEW_NONUPD_CHECK";r[1369]="ER_VIEW_CHECK_FAILED";r[1370]="ER_PROCACCESS_DENIED_ERROR";r[1371]="ER_RELAY_LOG_FAIL";r[1372]="ER_PASSWD_LENGTH";r[1373]="ER_UNKNOWN_TARGET_BINLOG";r[1374]="ER_IO_ERR_LOG_INDEX_READ";r[1375]="ER_BINLOG_PURGE_PROHIBITED";r[1376]="ER_FSEEK_FAIL";r[1377]="ER_BINLOG_PURGE_FATAL_ERR";r[1378]="ER_LOG_IN_USE";r[1379]="ER_LOG_PURGE_UNKNOWN_ERR";r[1380]="ER_RELAY_LOG_INIT";r[1381]="ER_NO_BINARY_LOGGING";r[1382]="ER_RESERVED_SYNTAX";r[1383]="ER_WSAS_FAILED";r[1384]="ER_DIFF_GROUPS_PROC";r[1385]="ER_NO_GROUP_FOR_PROC";r[1386]="ER_ORDER_WITH_PROC";r[1387]="ER_LOGGING_PROHIBIT_CHANGING_OF";r[1388]="ER_NO_FILE_MAPPING";r[1389]="ER_WRONG_MAGIC";r[1390]="ER_PS_MANY_PARAM";r[1391]="ER_KEY_PART_0";r[1392]="ER_VIEW_CHECKSUM";r[1393]="ER_VIEW_MULTIUPDATE";r[1394]="ER_VIEW_NO_INSERT_FIELD_LIST";r[1395]="ER_VIEW_DELETE_MERGE_VIEW";r[1396]="ER_CANNOT_USER";r[1397]="ER_XAER_NOTA";r[1398]="ER_XAER_INVAL";r[1399]="ER_XAER_RMFAIL";r[1400]="ER_XAER_OUTSIDE";r[1401]="ER_XAER_RMERR";r[1402]="ER_XA_RBROLLBACK";r[1403]="ER_NONEXISTING_PROC_GRANT";r[1404]="ER_PROC_AUTO_GRANT_FAIL";r[1405]="ER_PROC_AUTO_REVOKE_FAIL";r[1406]="ER_DATA_TOO_LONG";r[1407]="ER_SP_BAD_SQLSTATE";r[1408]="ER_STARTUP";r[1409]="ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR";r[1410]="ER_CANT_CREATE_USER_WITH_GRANT";r[1411]="ER_WRONG_VALUE_FOR_TYPE";r[1412]="ER_TABLE_DEF_CHANGED";r[1413]="ER_SP_DUP_HANDLER";r[1414]="ER_SP_NOT_VAR_ARG";r[1415]="ER_SP_NO_RETSET";r[1416]="ER_CANT_CREATE_GEOMETRY_OBJECT";r[1417]="ER_FAILED_ROUTINE_BREAK_BINLOG";r[1418]="ER_BINLOG_UNSAFE_ROUTINE";r[1419]="ER_BINLOG_CREATE_ROUTINE_NEED_SUPER";r[1420]="ER_EXEC_STMT_WITH_OPEN_CURSOR";r[1421]="ER_STMT_HAS_NO_OPEN_CURSOR";r[1422]="ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG";r[1423]="ER_NO_DEFAULT_FOR_VIEW_FIELD";r[1424]="ER_SP_NO_RECURSION";r[1425]="ER_TOO_BIG_SCALE";r[1426]="ER_TOO_BIG_PRECISION";r[1427]="ER_M_BIGGER_THAN_D";r[1428]="ER_WRONG_LOCK_OF_SYSTEM_TABLE";r[1429]="ER_CONNECT_TO_FOREIGN_DATA_SOURCE";r[1430]="ER_QUERY_ON_FOREIGN_DATA_SOURCE";r[1431]="ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST";r[1432]="ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE";r[1433]="ER_FOREIGN_DATA_STRING_INVALID";r[1434]="ER_CANT_CREATE_FEDERATED_TABLE";r[1435]="ER_TRG_IN_WRONG_SCHEMA";r[1436]="ER_STACK_OVERRUN_NEED_MORE";r[1437]="ER_TOO_LONG_BODY";r[1438]="ER_WARN_CANT_DROP_DEFAULT_KEYCACHE";r[1439]="ER_TOO_BIG_DISPLAYWIDTH";r[1440]="ER_XAER_DUPID";r[1441]="ER_DATETIME_FUNCTION_OVERFLOW";r[1442]="ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG";r[1443]="ER_VIEW_PREVENT_UPDATE";r[1444]="ER_PS_NO_RECURSION";r[1445]="ER_SP_CANT_SET_AUTOCOMMIT";r[1446]="ER_MALFORMED_DEFINER";r[1447]="ER_VIEW_FRM_NO_USER";r[1448]="ER_UNUSED_30";r[1449]="ER_NO_SUCH_USER";r[1450]="ER_FORBID_SCHEMA_CHANGE";r[1451]="ER_ROW_IS_REFERENCED_2";r[1452]="ER_NO_REFERENCED_ROW_2";r[1453]="ER_SP_BAD_VAR_SHADOW";r[1454]="ER_TRG_NO_DEFINER";r[1455]="ER_OLD_FILE_FORMAT";r[1456]="ER_SP_RECURSION_LIMIT";r[1457]="ER_SP_PROC_TABLE_CORRUPT";r[1458]="ER_SP_WRONG_NAME";r[1459]="ER_TABLE_NEEDS_UPGRADE";r[1460]="ER_SP_NO_AGGREGATE";r[1461]="ER_MAX_PREPARED_STMT_COUNT_REACHED";r[1462]="ER_VIEW_RECURSIVE";r[1463]="ER_NON_GROUPING_FIELD_USED";r[1464]="ER_TABLE_CANT_HANDLE_SPKEYS";r[1465]="ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA";r[1466]="ER_REMOVED_SPACES";r[1467]="ER_AUTOINC_READ_FAILED";r[1468]="ER_USERNAME";r[1469]="ER_HOSTNAME";r[1470]="ER_WRONG_STRING_LENGTH";r[1471]="ER_NON_INSERTABLE_TABLE";r[1472]="ER_ADMIN_WRONG_MRG_TABLE";r[1473]="ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT";r[1474]="ER_NAME_BECOMES_EMPTY";r[1475]="ER_AMBIGUOUS_FIELD_TERM";r[1476]="ER_FOREIGN_SERVER_EXISTS";r[1477]="ER_FOREIGN_SERVER_DOESNT_EXIST";r[1478]="ER_ILLEGAL_HA_CREATE_OPTION";r[1479]="ER_PARTITION_REQUIRES_VALUES_ERROR";r[1480]="ER_PARTITION_WRONG_VALUES_ERROR";r[1481]="ER_PARTITION_MAXVALUE_ERROR";r[1482]="ER_PARTITION_SUBPARTITION_ERROR";r[1483]="ER_PARTITION_SUBPART_MIX_ERROR";r[1484]="ER_PARTITION_WRONG_NO_PART_ERROR";r[1485]="ER_PARTITION_WRONG_NO_SUBPART_ERROR";r[1486]="ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR";r[1487]="ER_NOT_CONSTANT_EXPRESSION";r[1488]="ER_FIELD_NOT_FOUND_PART_ERROR";r[1489]="ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR";r[1490]="ER_INCONSISTENT_PARTITION_INFO_ERROR";r[1491]="ER_PARTITION_FUNC_NOT_ALLOWED_ERROR";r[1492]="ER_PARTITIONS_MUST_BE_DEFINED_ERROR";r[1493]="ER_RANGE_NOT_INCREASING_ERROR";r[1494]="ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR";r[1495]="ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR";r[1496]="ER_PARTITION_ENTRY_ERROR";r[1497]="ER_MIX_HANDLER_ERROR";r[1498]="ER_PARTITION_NOT_DEFINED_ERROR";r[1499]="ER_TOO_MANY_PARTITIONS_ERROR";r[1500]="ER_SUBPARTITION_ERROR";r[1501]="ER_CANT_CREATE_HANDLER_FILE";r[1502]="ER_BLOB_FIELD_IN_PART_FUNC_ERROR";r[1503]="ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF";r[1504]="ER_NO_PARTS_ERROR";r[1505]="ER_PARTITION_MGMT_ON_NONPARTITIONED";r[1506]="ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING";r[1507]="ER_PARTITION_DOES_NOT_EXIST";r[1508]="ER_DROP_LAST_PARTITION";r[1509]="ER_COALESCE_ONLY_ON_HASH_PARTITION";r[1510]="ER_REORG_HASH_ONLY_ON_SAME_NO";r[1511]="ER_REORG_NO_PARAM_ERROR";r[1512]="ER_ONLY_ON_RANGE_LIST_PARTITION";r[1513]="ER_ADD_PARTITION_SUBPART_ERROR";r[1514]="ER_ADD_PARTITION_NO_NEW_PARTITION";r[1515]="ER_COALESCE_PARTITION_NO_PARTITION";r[1516]="ER_REORG_PARTITION_NOT_EXIST";r[1517]="ER_SAME_NAME_PARTITION";r[1518]="ER_NO_BINLOG_ERROR";r[1519]="ER_CONSECUTIVE_REORG_PARTITIONS";r[1520]="ER_REORG_OUTSIDE_RANGE";r[1521]="ER_PARTITION_FUNCTION_FAILURE";r[1522]="ER_PART_STATE_ERROR";r[1523]="ER_LIMITED_PART_RANGE";r[1524]="ER_PLUGIN_IS_NOT_LOADED";r[1525]="ER_WRONG_VALUE";r[1526]="ER_NO_PARTITION_FOR_GIVEN_VALUE";r[1527]="ER_FILEGROUP_OPTION_ONLY_ONCE";r[1528]="ER_CREATE_FILEGROUP_FAILED";r[1529]="ER_DROP_FILEGROUP_FAILED";r[1530]="ER_TABLESPACE_AUTO_EXTEND_ERROR";r[1531]="ER_WRONG_SIZE_NUMBER";r[1532]="ER_SIZE_OVERFLOW_ERROR";r[1533]="ER_ALTER_FILEGROUP_FAILED";r[1534]="ER_BINLOG_ROW_LOGGING_FAILED";r[1535]="ER_BINLOG_ROW_WRONG_TABLE_DEF";r[1536]="ER_BINLOG_ROW_RBR_TO_SBR";r[1537]="ER_EVENT_ALREADY_EXISTS";r[1538]="ER_EVENT_STORE_FAILED";r[1539]="ER_EVENT_DOES_NOT_EXIST";r[1540]="ER_EVENT_CANT_ALTER";r[1541]="ER_EVENT_DROP_FAILED";r[1542]="ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG";r[1543]="ER_EVENT_ENDS_BEFORE_STARTS";r[1544]="ER_EVENT_EXEC_TIME_IN_THE_PAST";r[1545]="ER_EVENT_OPEN_TABLE_FAILED";r[1546]="ER_EVENT_NEITHER_M_EXPR_NOR_M_AT";r[1547]="ER_UNUSED_2";r[1548]="ER_UNUSED_3";r[1549]="ER_EVENT_CANNOT_DELETE";r[1550]="ER_EVENT_COMPILE_ERROR";r[1551]="ER_EVENT_SAME_NAME";r[1552]="ER_EVENT_DATA_TOO_LONG";r[1553]="ER_DROP_INDEX_FK";r[1554]="ER_WARN_DEPRECATED_SYNTAX_WITH_VER";r[1555]="ER_CANT_WRITE_LOCK_LOG_TABLE";r[1556]="ER_CANT_LOCK_LOG_TABLE";r[1557]="ER_UNUSED_4";r[1558]="ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE";r[1559]="ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR";r[1560]="ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT";r[1561]="ER_UNUSED_13";r[1562]="ER_PARTITION_NO_TEMPORARY";r[1563]="ER_PARTITION_CONST_DOMAIN_ERROR";r[1564]="ER_PARTITION_FUNCTION_IS_NOT_ALLOWED";r[1565]="ER_DDL_LOG_ERROR";r[1566]="ER_NULL_IN_VALUES_LESS_THAN";r[1567]="ER_WRONG_PARTITION_NAME";r[1568]="ER_CANT_SET_IN_TRANSACTION";r[1569]="ER_DUP_ENTRY_AUTOINCREMENT_CASE";r[1570]="ER_EVENT_MODIFY_QUEUE_ERROR";r[1571]="ER_EVENT_SET_VAR_ERROR";r[1572]="ER_PARTITION_MERGE_ERROR";r[1573]="ER_CANT_ACTIVATE_LOG";r[1574]="ER_RBR_NOT_AVAILABLE";r[1575]="ER_BASE64_DECODE_ERROR";r[1576]="ER_EVENT_RECURSION_FORBIDDEN";r[1577]="ER_EVENTS_DB_ERROR";r[1578]="ER_ONLY_INTEGERS_ALLOWED";r[1579]="ER_UNSUPORTED_LOG_ENGINE";r[1580]="ER_BAD_LOG_STATEMENT";r[1581]="ER_CANT_RENAME_LOG_TABLE";r[1582]="ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT";r[1583]="ER_WRONG_PARAMETERS_TO_NATIVE_FCT";r[1584]="ER_WRONG_PARAMETERS_TO_STORED_FCT";r[1585]="ER_NATIVE_FCT_NAME_COLLISION";r[1586]="ER_DUP_ENTRY_WITH_KEY_NAME";r[1587]="ER_BINLOG_PURGE_EMFILE";r[1588]="ER_EVENT_CANNOT_CREATE_IN_THE_PAST";r[1589]="ER_EVENT_CANNOT_ALTER_IN_THE_PAST";r[1590]="ER_SLAVE_INCIDENT";r[1591]="ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT";r[1592]="ER_BINLOG_UNSAFE_STATEMENT";r[1593]="ER_SLAVE_FATAL_ERROR";r[1594]="ER_SLAVE_RELAY_LOG_READ_FAILURE";r[1595]="ER_SLAVE_RELAY_LOG_WRITE_FAILURE";r[1596]="ER_SLAVE_CREATE_EVENT_FAILURE";r[1597]="ER_SLAVE_MASTER_COM_FAILURE";r[1598]="ER_BINLOG_LOGGING_IMPOSSIBLE";r[1599]="ER_VIEW_NO_CREATION_CTX";r[1600]="ER_VIEW_INVALID_CREATION_CTX";r[1601]="ER_SR_INVALID_CREATION_CTX";r[1602]="ER_TRG_CORRUPTED_FILE";r[1603]="ER_TRG_NO_CREATION_CTX";r[1604]="ER_TRG_INVALID_CREATION_CTX";r[1605]="ER_EVENT_INVALID_CREATION_CTX";r[1606]="ER_TRG_CANT_OPEN_TABLE";r[1607]="ER_CANT_CREATE_SROUTINE";r[1608]="ER_UNUSED_11";r[1609]="ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT";r[1610]="ER_SLAVE_CORRUPT_EVENT";r[1611]="ER_LOAD_DATA_INVALID_COLUMN";r[1612]="ER_LOG_PURGE_NO_FILE";r[1613]="ER_XA_RBTIMEOUT";r[1614]="ER_XA_RBDEADLOCK";r[1615]="ER_NEED_REPREPARE";r[1616]="ER_DELAYED_NOT_SUPPORTED";r[1617]="WARN_NO_MASTER_INFO";r[1618]="WARN_OPTION_IGNORED";r[1619]="ER_PLUGIN_DELETE_BUILTIN";r[1620]="WARN_PLUGIN_BUSY";r[1621]="ER_VARIABLE_IS_READONLY";r[1622]="ER_WARN_ENGINE_TRANSACTION_ROLLBACK";r[1623]="ER_SLAVE_HEARTBEAT_FAILURE";r[1624]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE";r[1625]="ER_UNUSED_14";r[1626]="ER_CONFLICT_FN_PARSE_ERROR";r[1627]="ER_EXCEPTIONS_WRITE_ERROR";r[1628]="ER_TOO_LONG_TABLE_COMMENT";r[1629]="ER_TOO_LONG_FIELD_COMMENT";r[1630]="ER_FUNC_INEXISTENT_NAME_COLLISION";r[1631]="ER_DATABASE_NAME";r[1632]="ER_TABLE_NAME";r[1633]="ER_PARTITION_NAME";r[1634]="ER_SUBPARTITION_NAME";r[1635]="ER_TEMPORARY_NAME";r[1636]="ER_RENAMED_NAME";r[1637]="ER_TOO_MANY_CONCURRENT_TRXS";r[1638]="WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED";r[1639]="ER_DEBUG_SYNC_TIMEOUT";r[1640]="ER_DEBUG_SYNC_HIT_LIMIT";r[1641]="ER_DUP_SIGNAL_SET";r[1642]="ER_SIGNAL_WARN";r[1643]="ER_SIGNAL_NOT_FOUND";r[1644]="ER_SIGNAL_EXCEPTION";r[1645]="ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER";r[1646]="ER_SIGNAL_BAD_CONDITION_TYPE";r[1647]="WARN_COND_ITEM_TRUNCATED";r[1648]="ER_COND_ITEM_TOO_LONG";r[1649]="ER_UNKNOWN_LOCALE";r[1650]="ER_SLAVE_IGNORE_SERVER_IDS";r[1651]="ER_QUERY_CACHE_DISABLED";r[1652]="ER_SAME_NAME_PARTITION_FIELD";r[1653]="ER_PARTITION_COLUMN_LIST_ERROR";r[1654]="ER_WRONG_TYPE_COLUMN_VALUE_ERROR";r[1655]="ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR";r[1656]="ER_MAXVALUE_IN_VALUES_IN";r[1657]="ER_TOO_MANY_VALUES_ERROR";r[1658]="ER_ROW_SINGLE_PARTITION_FIELD_ERROR";r[1659]="ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD";r[1660]="ER_PARTITION_FIELDS_TOO_LONG";r[1661]="ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE";r[1662]="ER_BINLOG_ROW_MODE_AND_STMT_ENGINE";r[1663]="ER_BINLOG_UNSAFE_AND_STMT_ENGINE";r[1664]="ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE";r[1665]="ER_BINLOG_STMT_MODE_AND_ROW_ENGINE";r[1666]="ER_BINLOG_ROW_INJECTION_AND_STMT_MODE";r[1667]="ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE";r[1668]="ER_BINLOG_UNSAFE_LIMIT";r[1669]="ER_BINLOG_UNSAFE_INSERT_DELAYED";r[1670]="ER_BINLOG_UNSAFE_SYSTEM_TABLE";r[1671]="ER_BINLOG_UNSAFE_AUTOINC_COLUMNS";r[1672]="ER_BINLOG_UNSAFE_UDF";r[1673]="ER_BINLOG_UNSAFE_SYSTEM_VARIABLE";r[1674]="ER_BINLOG_UNSAFE_SYSTEM_FUNCTION";r[1675]="ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS";r[1676]="ER_MESSAGE_AND_STATEMENT";r[1677]="ER_SLAVE_CONVERSION_FAILED";r[1678]="ER_SLAVE_CANT_CREATE_CONVERSION";r[1679]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT";r[1680]="ER_PATH_LENGTH";r[1681]="ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT";r[1682]="ER_WRONG_NATIVE_TABLE_STRUCTURE";r[1683]="ER_WRONG_PERFSCHEMA_USAGE";r[1684]="ER_WARN_I_S_SKIPPED_TABLE";r[1685]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT";r[1686]="ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT";r[1687]="ER_SPATIAL_MUST_HAVE_GEOM_COL";r[1688]="ER_TOO_LONG_INDEX_COMMENT";r[1689]="ER_LOCK_ABORTED";r[1690]="ER_DATA_OUT_OF_RANGE";r[1691]="ER_WRONG_SPVAR_TYPE_IN_LIMIT";r[1692]="ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE";r[1693]="ER_BINLOG_UNSAFE_MIXED_STATEMENT";r[1694]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN";r[1695]="ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN";r[1696]="ER_FAILED_READ_FROM_PAR_FILE";r[1697]="ER_VALUES_IS_NOT_INT_TYPE_ERROR";r[1698]="ER_ACCESS_DENIED_NO_PASSWORD_ERROR";r[1699]="ER_SET_PASSWORD_AUTH_PLUGIN";r[1700]="ER_GRANT_PLUGIN_USER_EXISTS";r[1701]="ER_TRUNCATE_ILLEGAL_FK";r[1702]="ER_PLUGIN_IS_PERMANENT";r[1703]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN";r[1704]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX";r[1705]="ER_STMT_CACHE_FULL";r[1706]="ER_MULTI_UPDATE_KEY_CONFLICT";r[1707]="ER_TABLE_NEEDS_REBUILD";r[1708]="WARN_OPTION_BELOW_LIMIT";r[1709]="ER_INDEX_COLUMN_TOO_LONG";r[1710]="ER_ERROR_IN_TRIGGER_BODY";r[1711]="ER_ERROR_IN_UNKNOWN_TRIGGER_BODY";r[1712]="ER_INDEX_CORRUPT";r[1713]="ER_UNDO_RECORD_TOO_BIG";r[1714]="ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT";r[1715]="ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE";r[1716]="ER_BINLOG_UNSAFE_REPLACE_SELECT";r[1717]="ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT";r[1718]="ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT";r[1719]="ER_BINLOG_UNSAFE_UPDATE_IGNORE";r[1720]="ER_UNUSED_15";r[1721]="ER_UNUSED_16";r[1722]="ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT";r[1723]="ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC";r[1724]="ER_BINLOG_UNSAFE_INSERT_TWO_KEYS";r[1725]="ER_UNUSED_28";r[1726]="ER_VERS_NOT_ALLOWED";r[1727]="ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST";r[1728]="ER_CANNOT_LOAD_FROM_TABLE_V2";r[1729]="ER_MASTER_DELAY_VALUE_OUT_OF_RANGE";r[1730]="ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT";r[1731]="ER_PARTITION_EXCHANGE_DIFFERENT_OPTION";r[1732]="ER_PARTITION_EXCHANGE_PART_TABLE";r[1733]="ER_PARTITION_EXCHANGE_TEMP_TABLE";r[1734]="ER_PARTITION_INSTEAD_OF_SUBPARTITION";r[1735]="ER_UNKNOWN_PARTITION";r[1736]="ER_TABLES_DIFFERENT_METADATA";r[1737]="ER_ROW_DOES_NOT_MATCH_PARTITION";r[1738]="ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX";r[1739]="ER_WARN_INDEX_NOT_APPLICABLE";r[1740]="ER_PARTITION_EXCHANGE_FOREIGN_KEY";r[1741]="ER_NO_SUCH_KEY_VALUE";r[1742]="ER_VALUE_TOO_LONG";r[1743]="ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE";r[1744]="ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE";r[1745]="ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX";r[1746]="ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT";r[1747]="ER_PARTITION_CLAUSE_ON_NONPARTITIONED";r[1748]="ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET";r[1749]="ER_UNUSED_5";r[1750]="ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE";r[1751]="ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE";r[1752]="ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE";r[1753]="ER_MTS_FEATURE_IS_NOT_SUPPORTED";r[1754]="ER_MTS_UPDATED_DBS_GREATER_MAX";r[1755]="ER_MTS_CANT_PARALLEL";r[1756]="ER_MTS_INCONSISTENT_DATA";r[1757]="ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING";r[1758]="ER_DA_INVALID_CONDITION_NUMBER";r[1759]="ER_INSECURE_PLAIN_TEXT";r[1760]="ER_INSECURE_CHANGE_MASTER";r[1761]="ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO";r[1762]="ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO";r[1763]="ER_SQLTHREAD_WITH_SECURE_SLAVE";r[1764]="ER_TABLE_HAS_NO_FT";r[1765]="ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER";r[1766]="ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION";r[1767]="ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST";r[1768]="ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL";r[1769]="ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION";r[1770]="ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL";r[1771]="ER_SKIPPING_LOGGED_TRANSACTION";r[1772]="ER_MALFORMED_GTID_SET_SPECIFICATION";r[1773]="ER_MALFORMED_GTID_SET_ENCODING";r[1774]="ER_MALFORMED_GTID_SPECIFICATION";r[1775]="ER_GNO_EXHAUSTED";r[1776]="ER_BAD_SLAVE_AUTO_POSITION";r[1777]="ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON";r[1778]="ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET";r[1779]="ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON";r[1780]="ER_GTID_MODE_REQUIRES_BINLOG";r[1781]="ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF";r[1782]="ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON";r[1783]="ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF";r[1784]="ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF";r[1785]="ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE";r[1786]="ER_GTID_UNSAFE_CREATE_SELECT";r[1787]="ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION";r[1788]="ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME";r[1789]="ER_MASTER_HAS_PURGED_REQUIRED_GTIDS";r[1790]="ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID";r[1791]="ER_UNKNOWN_EXPLAIN_FORMAT";r[1792]="ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION";r[1793]="ER_TOO_LONG_TABLE_PARTITION_COMMENT";r[1794]="ER_SLAVE_CONFIGURATION";r[1795]="ER_INNODB_FT_LIMIT";r[1796]="ER_NO_INDEX_ON_TEMPORARY";r[1797]="ER_INNODB_FT_WRONG_DOCID_COLUMN";r[1798]="ER_INNODB_FT_WRONG_DOCID_INDEX";r[1799]="ER_INNODB_ONLINE_LOG_TOO_BIG";r[1800]="ER_UNKNOWN_ALTER_ALGORITHM";r[1801]="ER_UNKNOWN_ALTER_LOCK";r[1802]="ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS";r[1803]="ER_MTS_RECOVERY_FAILURE";r[1804]="ER_MTS_RESET_WORKERS";r[1805]="ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2";r[1806]="ER_SLAVE_SILENT_RETRY_TRANSACTION";r[1807]="ER_UNUSED_22";r[1808]="ER_TABLE_SCHEMA_MISMATCH";r[1809]="ER_TABLE_IN_SYSTEM_TABLESPACE";r[1810]="ER_IO_READ_ERROR";r[1811]="ER_IO_WRITE_ERROR";r[1812]="ER_TABLESPACE_MISSING";r[1813]="ER_TABLESPACE_EXISTS";r[1814]="ER_TABLESPACE_DISCARDED";r[1815]="ER_INTERNAL_ERROR";r[1816]="ER_INNODB_IMPORT_ERROR";r[1817]="ER_INNODB_INDEX_CORRUPT";r[1818]="ER_INVALID_YEAR_COLUMN_LENGTH";r[1819]="ER_NOT_VALID_PASSWORD";r[1820]="ER_MUST_CHANGE_PASSWORD";r[1821]="ER_FK_NO_INDEX_CHILD";r[1822]="ER_FK_NO_INDEX_PARENT";r[1823]="ER_FK_FAIL_ADD_SYSTEM";r[1824]="ER_FK_CANNOT_OPEN_PARENT";r[1825]="ER_FK_INCORRECT_OPTION";r[1826]="ER_DUP_CONSTRAINT_NAME";r[1827]="ER_PASSWORD_FORMAT";r[1828]="ER_FK_COLUMN_CANNOT_DROP";r[1829]="ER_FK_COLUMN_CANNOT_DROP_CHILD";r[1830]="ER_FK_COLUMN_NOT_NULL";r[1831]="ER_DUP_INDEX";r[1832]="ER_FK_COLUMN_CANNOT_CHANGE";r[1833]="ER_FK_COLUMN_CANNOT_CHANGE_CHILD";r[1834]="ER_FK_CANNOT_DELETE_PARENT";r[1835]="ER_MALFORMED_PACKET";r[1836]="ER_READ_ONLY_MODE";r[1837]="ER_GTID_NEXT_TYPE_UNDEFINED_GROUP";r[1838]="ER_VARIABLE_NOT_SETTABLE_IN_SP";r[1839]="ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF";r[1840]="ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY";r[1841]="ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY";r[1842]="ER_GTID_PURGED_WAS_CHANGED";r[1843]="ER_GTID_EXECUTED_WAS_CHANGED";r[1844]="ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES";r[1845]="ER_ALTER_OPERATION_NOT_SUPPORTED";r[1846]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON";r[1847]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY";r[1848]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION";r[1849]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME";r[1850]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE";r[1851]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK";r[1852]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE";r[1853]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK";r[1854]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC";r[1855]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS";r[1856]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS";r[1857]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS";r[1858]="ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE";r[1859]="ER_DUP_UNKNOWN_IN_INDEX";r[1860]="ER_IDENT_CAUSES_TOO_LONG_PATH";r[1861]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL";r[1862]="ER_MUST_CHANGE_PASSWORD_LOGIN";r[1863]="ER_ROW_IN_WRONG_PARTITION";r[1864]="ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX";r[1865]="ER_INNODB_NO_FT_USES_PARSER";r[1866]="ER_BINLOG_LOGICAL_CORRUPTION";r[1867]="ER_WARN_PURGE_LOG_IN_USE";r[1868]="ER_WARN_PURGE_LOG_IS_ACTIVE";r[1869]="ER_AUTO_INCREMENT_CONFLICT";r[1870]="WARN_ON_BLOCKHOLE_IN_RBR";r[1871]="ER_SLAVE_MI_INIT_REPOSITORY";r[1872]="ER_SLAVE_RLI_INIT_REPOSITORY";r[1873]="ER_ACCESS_DENIED_CHANGE_USER_ERROR";r[1874]="ER_INNODB_READ_ONLY";r[1875]="ER_STOP_SLAVE_SQL_THREAD_TIMEOUT";r[1876]="ER_STOP_SLAVE_IO_THREAD_TIMEOUT";r[1877]="ER_TABLE_CORRUPT";r[1878]="ER_TEMP_FILE_WRITE_FAILURE";r[1879]="ER_INNODB_FT_AUX_NOT_HEX_ID";r[1880]="ER_LAST_MYSQL_ERROR_MESSAGE";r[1900]="ER_UNUSED_18";r[1901]="ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED";r[1902]="ER_UNUSED_19";r[1903]="ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN";r[1904]="ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN";r[1905]="ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN";r[1906]="ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN";r[1907]="ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN";r[1908]="ER_UNUSED_20";r[1909]="ER_UNUSED_21";r[1910]="ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS";r[1911]="ER_UNKNOWN_OPTION";r[1912]="ER_BAD_OPTION_VALUE";r[1913]="ER_UNUSED_6";r[1914]="ER_UNUSED_7";r[1915]="ER_UNUSED_8";r[1916]="ER_DATA_OVERFLOW";r[1917]="ER_DATA_TRUNCATED";r[1918]="ER_BAD_DATA";r[1919]="ER_DYN_COL_WRONG_FORMAT";r[1920]="ER_DYN_COL_IMPLEMENTATION_LIMIT";r[1921]="ER_DYN_COL_DATA";r[1922]="ER_DYN_COL_WRONG_CHARSET";r[1923]="ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES";r[1924]="ER_QUERY_CACHE_IS_DISABLED";r[1925]="ER_QUERY_CACHE_IS_GLOBALY_DISABLED";r[1926]="ER_VIEW_ORDERBY_IGNORED";r[1927]="ER_CONNECTION_KILLED";r[1928]="ER_UNUSED_12";r[1929]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION";r[1930]="ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION";r[1931]="ER_QUERY_RESULT_INCOMPLETE";r[1932]="ER_NO_SUCH_TABLE_IN_ENGINE";r[1933]="ER_TARGET_NOT_EXPLAINABLE";r[1934]="ER_CONNECTION_ALREADY_EXISTS";r[1935]="ER_MASTER_LOG_PREFIX";r[1936]="ER_CANT_START_STOP_SLAVE";r[1937]="ER_SLAVE_STARTED";r[1938]="ER_SLAVE_STOPPED";r[1939]="ER_SQL_DISCOVER_ERROR";r[1940]="ER_FAILED_GTID_STATE_INIT";r[1941]="ER_INCORRECT_GTID_STATE";r[1942]="ER_CANNOT_UPDATE_GTID_STATE";r[1943]="ER_DUPLICATE_GTID_DOMAIN";r[1944]="ER_GTID_OPEN_TABLE_FAILED";r[1945]="ER_GTID_POSITION_NOT_FOUND_IN_BINLOG";r[1946]="ER_CANNOT_LOAD_SLAVE_GTID_STATE";r[1947]="ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG";r[1948]="ER_MASTER_GTID_POS_MISSING_DOMAIN";r[1949]="ER_UNTIL_REQUIRES_USING_GTID";r[1950]="ER_GTID_STRICT_OUT_OF_ORDER";r[1951]="ER_GTID_START_FROM_BINLOG_HOLE";r[1952]="ER_SLAVE_UNEXPECTED_MASTER_SWITCH";r[1953]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO";r[1954]="ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO";r[1955]="ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2";r[1956]="ER_BINLOG_MUST_BE_EMPTY";r[1957]="ER_NO_SUCH_QUERY";r[1958]="ER_BAD_BASE64_DATA";r[1959]="ER_INVALID_ROLE";r[1960]="ER_INVALID_CURRENT_USER";r[1961]="ER_CANNOT_GRANT_ROLE";r[1962]="ER_CANNOT_REVOKE_ROLE";r[1963]="ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE";r[1964]="ER_PRIOR_COMMIT_FAILED";r[1965]="ER_IT_IS_A_VIEW";r[1966]="ER_SLAVE_SKIP_NOT_IN_GTID";r[1967]="ER_TABLE_DEFINITION_TOO_BIG";r[1968]="ER_PLUGIN_INSTALLED";r[1969]="ER_STATEMENT_TIMEOUT";r[1970]="ER_SUBQUERIES_NOT_SUPPORTED";r[1971]="ER_SET_STATEMENT_NOT_SUPPORTED";r[1972]="ER_UNUSED_9";r[1973]="ER_USER_CREATE_EXISTS";r[1974]="ER_USER_DROP_EXISTS";r[1975]="ER_ROLE_CREATE_EXISTS";r[1976]="ER_ROLE_DROP_EXISTS";r[1977]="ER_CANNOT_CONVERT_CHARACTER";r[1978]="ER_INVALID_DEFAULT_VALUE_FOR_FIELD";r[1979]="ER_KILL_QUERY_DENIED_ERROR";r[1980]="ER_NO_EIS_FOR_FIELD";r[1981]="ER_WARN_AGGFUNC_DEPENDENCE";r[1982]="WARN_INNODB_PARTITION_OPTION_IGNORED";r[3e3]="ER_FILE_CORRUPT";r[3001]="ER_ERROR_ON_MASTER";r[3002]="ER_INCONSISTENT_ERROR";r[3003]="ER_STORAGE_ENGINE_NOT_LOADED";r[3004]="ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER";r[3005]="ER_WARN_LEGACY_SYNTAX_CONVERTED";r[3006]="ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN";r[3007]="ER_CANNOT_DISCARD_TEMPORARY_TABLE";r[3008]="ER_FK_DEPTH_EXCEEDED";r[3009]="ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2";r[3010]="ER_WARN_TRIGGER_DOESNT_HAVE_CREATED";r[3011]="ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL";r[3012]="ER_EXPLAIN_NOT_SUPPORTED";r[3013]="ER_INVALID_FIELD_SIZE";r[3014]="ER_MISSING_HA_CREATE_OPTION";r[3015]="ER_ENGINE_OUT_OF_MEMORY";r[3016]="ER_PASSWORD_EXPIRE_ANONYMOUS_USER";r[3017]="ER_SLAVE_SQL_THREAD_MUST_STOP";r[3018]="ER_NO_FT_MATERIALIZED_SUBQUERY";r[3019]="ER_INNODB_UNDO_LOG_FULL";r[3020]="ER_INVALID_ARGUMENT_FOR_LOGARITHM";r[3021]="ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP";r[3022]="ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO";r[3023]="ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS";r[3024]="ER_UNUSED_1";r[3025]="ER_NON_RO_SELECT_DISABLE_TIMER";r[3026]="ER_DUP_LIST_ENTRY";r[3027]="ER_SQL_MODE_NO_EFFECT";r[3028]="ER_AGGREGATE_ORDER_FOR_UNION";r[3029]="ER_AGGREGATE_ORDER_NON_AGG_QUERY";r[3030]="ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR";r[3031]="ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER";r[3032]="ER_SERVER_OFFLINE_MODE";r[3033]="ER_GIS_DIFFERENT_SRIDS";r[3034]="ER_GIS_UNSUPPORTED_ARGUMENT";r[3035]="ER_GIS_UNKNOWN_ERROR";r[3036]="ER_GIS_UNKNOWN_EXCEPTION";r[3037]="ER_GIS_INVALID_DATA";r[3038]="ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION";r[3039]="ER_BOOST_GEOMETRY_CENTROID_EXCEPTION";r[3040]="ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION";r[3041]="ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION";r[3042]="ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION";r[3043]="ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION";r[3044]="ER_STD_BAD_ALLOC_ERROR";r[3045]="ER_STD_DOMAIN_ERROR";r[3046]="ER_STD_LENGTH_ERROR";r[3047]="ER_STD_INVALID_ARGUMENT";r[3048]="ER_STD_OUT_OF_RANGE_ERROR";r[3049]="ER_STD_OVERFLOW_ERROR";r[3050]="ER_STD_RANGE_ERROR";r[3051]="ER_STD_UNDERFLOW_ERROR";r[3052]="ER_STD_LOGIC_ERROR";r[3053]="ER_STD_RUNTIME_ERROR";r[3054]="ER_STD_UNKNOWN_EXCEPTION";r[3055]="ER_GIS_DATA_WRONG_ENDIANESS";r[3056]="ER_CHANGE_MASTER_PASSWORD_LENGTH";r[3057]="ER_USER_LOCK_WRONG_NAME";r[3058]="ER_USER_LOCK_DEADLOCK";r[3059]="ER_REPLACE_INACCESSIBLE_ROWS";r[3060]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS";r[3061]="ER_MYSQL_3061";r[3062]="ER_MYSQL_3062";r[3063]="ER_MYSQL_3063";r[3064]="ER_MYSQL_3064";r[3065]="ER_MYSQL_3065";r[3066]="ER_MYSQL_3066";r[3067]="ER_MYSQL_3067";r[3068]="ER_MYSQL_3068";r[3069]="ER_MYSQL_3069";r[3070]="ER_MYSQL_3070";r[3071]="ER_MYSQL_3071";r[3072]="ER_MYSQL_3072";r[3073]="ER_MYSQL_3073";r[3074]="ER_MYSQL_3074";r[3075]="ER_MYSQL_3075";r[3076]="ER_MYSQL_3076";r[3077]="ER_MYSQL_3077";r[3078]="ER_MYSQL_3078";r[3079]="ER_MYSQL_3079";r[3080]="ER_MYSQL_3080";r[3081]="ER_MYSQL_3081";r[3082]="ER_MYSQL_3082";r[3083]="ER_MYSQL_3083";r[3084]="ER_MYSQL_3084";r[3085]="ER_MYSQL_3085";r[3086]="ER_MYSQL_3086";r[3087]="ER_MYSQL_3087";r[3088]="ER_MYSQL_3088";r[3089]="ER_MYSQL_3089";r[3090]="ER_MYSQL_3090";r[3091]="ER_MYSQL_3091";r[3092]="ER_MYSQL_3092";r[3093]="ER_MYSQL_3093";r[3094]="ER_MYSQL_3094";r[3095]="ER_MYSQL_3095";r[3096]="ER_MYSQL_3096";r[3097]="ER_MYSQL_3097";r[3098]="ER_MYSQL_3098";r[3099]="ER_MYSQL_3099";r[3100]="ER_MYSQL_3100";r[3101]="ER_MYSQL_3101";r[3102]="ER_MYSQL_3102";r[3103]="ER_MYSQL_3103";r[3104]="ER_MYSQL_3104";r[3105]="ER_MYSQL_3105";r[3106]="ER_MYSQL_3106";r[3107]="ER_MYSQL_3107";r[3108]="ER_MYSQL_3108";r[3109]="ER_MYSQL_3109";r[3110]="ER_MYSQL_3110";r[3111]="ER_MYSQL_3111";r[3112]="ER_MYSQL_3112";r[3113]="ER_MYSQL_3113";r[3114]="ER_MYSQL_3114";r[3115]="ER_MYSQL_3115";r[3116]="ER_MYSQL_3116";r[3117]="ER_MYSQL_3117";r[3118]="ER_MYSQL_3118";r[3119]="ER_MYSQL_3119";r[3120]="ER_MYSQL_3120";r[3121]="ER_MYSQL_3121";r[3122]="ER_MYSQL_3122";r[3123]="ER_MYSQL_3123";r[3124]="ER_MYSQL_3124";r[3125]="ER_MYSQL_3125";r[3126]="ER_MYSQL_3126";r[3127]="ER_MYSQL_3127";r[3128]="ER_MYSQL_3128";r[3129]="ER_MYSQL_3129";r[3130]="ER_MYSQL_3130";r[3131]="ER_MYSQL_3131";r[3132]="ER_MYSQL_3132";r[3133]="ER_MYSQL_3133";r[3134]="ER_MYSQL_3134";r[3135]="ER_MYSQL_3135";r[3136]="ER_MYSQL_3136";r[3137]="ER_MYSQL_3137";r[3138]="ER_MYSQL_3138";r[3139]="ER_MYSQL_3139";r[3140]="ER_MYSQL_3140";r[3141]="ER_MYSQL_3141";r[3142]="ER_MYSQL_3142";r[3143]="ER_MYSQL_3143";r[3144]="ER_MYSQL_3144";r[3145]="ER_MYSQL_3145";r[3146]="ER_MYSQL_3146";r[3147]="ER_MYSQL_3147";r[3148]="ER_MYSQL_3148";r[3149]="ER_MYSQL_3149";r[3150]="ER_MYSQL_3150";r[3151]="ER_MYSQL_3151";r[3152]="ER_MYSQL_3152";r[3153]="ER_MYSQL_3153";r[3154]="ER_MYSQL_3154";r[3155]="ER_MYSQL_3155";r[3156]="ER_MYSQL_3156";r[3157]="ER_MYSQL_3157";r[3158]="ER_MYSQL_3158";r[3159]="ER_SECURE_TRANSPORT_REQUIRED";r[4e3]="ER_UNUSED_26";r[4001]="ER_UNUSED_27";r[4002]="ER_WITH_COL_WRONG_LIST";r[4003]="ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE";r[4004]="ER_DUP_QUERY_NAME";r[4005]="ER_RECURSIVE_WITHOUT_ANCHORS";r[4006]="ER_UNACCEPTABLE_MUTUAL_RECURSION";r[4007]="ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED";r[4008]="ER_NOT_STANDARD_COMPLIANT_RECURSIVE";r[4009]="ER_WRONG_WINDOW_SPEC_NAME";r[4010]="ER_DUP_WINDOW_NAME";r[4011]="ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC";r[4012]="ER_ORDER_LIST_IN_REFERENCING_WINDOW_SPEC";r[4013]="ER_WINDOW_FRAME_IN_REFERENCED_WINDOW_SPEC";r[4014]="ER_BAD_COMBINATION_OF_WINDOW_FRAME_BOUND_SPECS";r[4015]="ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION";r[4016]="ER_WINDOW_FUNCTION_IN_WINDOW_SPEC";r[4017]="ER_NOT_ALLOWED_WINDOW_FRAME";r[4018]="ER_NO_ORDER_LIST_IN_WINDOW_SPEC";r[4019]="ER_RANGE_FRAME_NEEDS_SIMPLE_ORDERBY";r[4020]="ER_WRONG_TYPE_FOR_ROWS_FRAME";r[4021]="ER_WRONG_TYPE_FOR_RANGE_FRAME";r[4022]="ER_FRAME_EXCLUSION_NOT_SUPPORTED";r[4023]="ER_WINDOW_FUNCTION_DONT_HAVE_FRAME";r[4024]="ER_INVALID_NTILE_ARGUMENT";r[4025]="ER_CONSTRAINT_FAILED";r[4026]="ER_EXPRESSION_IS_TOO_BIG";r[4027]="ER_ERROR_EVALUATING_EXPRESSION";r[4028]="ER_CALCULATING_DEFAULT_VALUE";r[4029]="ER_EXPRESSION_REFERS_TO_UNINIT_FIELD";r[4030]="ER_PARTITION_DEFAULT_ERROR";r[4031]="ER_REFERENCED_TRG_DOES_NOT_EXIST";r[4032]="ER_INVALID_DEFAULT_PARAM";r[4033]="ER_BINLOG_NON_SUPPORTED_BULK";r[4034]="ER_BINLOG_UNCOMPRESS_ERROR";r[4035]="ER_JSON_BAD_CHR";r[4036]="ER_JSON_NOT_JSON_CHR";r[4037]="ER_JSON_EOS";r[4038]="ER_JSON_SYNTAX";r[4039]="ER_JSON_ESCAPING";r[4040]="ER_JSON_DEPTH";r[4041]="ER_JSON_PATH_EOS";r[4042]="ER_JSON_PATH_SYNTAX";r[4043]="ER_JSON_PATH_DEPTH";r[4044]="ER_JSON_PATH_NO_WILDCARD";r[4045]="ER_JSON_PATH_ARRAY";r[4046]="ER_JSON_ONE_OR_ALL";r[4047]="ER_UNSUPPORTED_COMPRESSED_TABLE";r[4048]="ER_GEOJSON_INCORRECT";r[4049]="ER_GEOJSON_TOO_FEW_POINTS";r[4050]="ER_GEOJSON_NOT_CLOSED";r[4051]="ER_JSON_PATH_EMPTY";r[4052]="ER_SLAVE_SAME_ID";r[4053]="ER_FLASHBACK_NOT_SUPPORTED";r[4054]="ER_KEYS_OUT_OF_ORDER";r[4055]="ER_OVERLAPPING_KEYS";r[4056]="ER_REQUIRE_ROW_BINLOG_FORMAT";r[4057]="ER_ISOLATION_MODE_NOT_SUPPORTED";r[4058]="ER_ON_DUPLICATE_DISABLED";r[4059]="ER_UPDATES_WITH_CONSISTENT_SNAPSHOT";r[4060]="ER_ROLLBACK_ONLY";r[4061]="ER_ROLLBACK_TO_SAVEPOINT";r[4062]="ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT";r[4063]="ER_UNSUPPORTED_COLLATION";r[4064]="ER_METADATA_INCONSISTENCY";r[4065]="ER_CF_DIFFERENT";r[4066]="ER_RDB_TTL_DURATION_FORMAT";r[4067]="ER_RDB_STATUS_GENERAL";r[4068]="ER_RDB_STATUS_MSG";r[4069]="ER_RDB_TTL_UNSUPPORTED";r[4070]="ER_RDB_TTL_COL_FORMAT";r[4071]="ER_PER_INDEX_CF_DEPRECATED";r[4072]="ER_KEY_CREATE_DURING_ALTER";r[4073]="ER_SK_POPULATE_DURING_ALTER";r[4074]="ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG";r[4075]="ER_NET_OK_PACKET_TOO_LARGE";r[4076]="ER_GEOJSON_EMPTY_COORDINATES";r[4077]="ER_MYROCKS_CANT_NOPAD_COLLATION";r[4078]="ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION";r[4079]="ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION";r[4080]="ER_WRONG_PARAMCOUNT_TO_CURSOR";r[4081]="ER_UNKNOWN_STRUCTURED_VARIABLE";r[4082]="ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD";r[4083]="ER_END_IDENTIFIER_DOES_NOT_MATCH";r[4084]="ER_SEQUENCE_RUN_OUT";r[4085]="ER_SEQUENCE_INVALID_DATA";r[4086]="ER_SEQUENCE_INVALID_TABLE_STRUCTURE";r[4087]="ER_SEQUENCE_ACCESS_ERROR";r[4088]="ER_SEQUENCE_BINLOG_FORMAT";r[4089]="ER_NOT_SEQUENCE";r[4090]="ER_NOT_SEQUENCE2";r[4091]="ER_UNKNOWN_SEQUENCES";r[4092]="ER_UNKNOWN_VIEW";r[4093]="ER_WRONG_INSERT_INTO_SEQUENCE";r[4094]="ER_SP_STACK_TRACE";r[4095]="ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY";r[4096]="ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED";r[4097]="ER_COMPRESSED_COLUMN_USED_AS_KEY";r[4098]="ER_UNKNOWN_COMPRESSION_METHOD";r[4099]="ER_WRONG_NUMBER_OF_VALUES_IN_TVC";r[4100]="ER_FIELD_REFERENCE_IN_TVC";r[4101]="ER_WRONG_TYPE_FOR_PERCENTILE_FUNC";r[4102]="ER_ARGUMENT_NOT_CONSTANT";r[4103]="ER_ARGUMENT_OUT_OF_RANGE";r[4104]="ER_WRONG_TYPE_OF_ARGUMENT";r[4105]="ER_NOT_AGGREGATE_FUNCTION";r[4106]="ER_INVALID_AGGREGATE_FUNCTION";r[4107]="ER_INVALID_VALUE_TO_LIMIT";r[4108]="ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT";r[4109]="ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING";r[4110]="ER_VERS_FIELD_WRONG_TYPE";r[4111]="ER_VERS_ENGINE_UNSUPPORTED";r[4112]="ER_WRONG_VERSIONING_RANGE";r[4113]="ER_PARTITION_WRONG_TYPE";r[4114]="WARN_VERS_PART_FULL";r[4115]="WARN_VERS_PARAMETERS";r[4116]="ER_VERS_DROP_PARTITION_INTERVAL";r[4117]="ER_UNUSED_25";r[4118]="WARN_VERS_PART_NON_HISTORICAL";r[4119]="ER_VERS_ALTER_NOT_ALLOWED";r[4120]="ER_VERS_ALTER_ENGINE_PROHIBITED";r[4121]="ER_VERS_RANGE_PROHIBITED";r[4122]="ER_CONFLICTING_FOR_SYSTEM_TIME";r[4123]="ER_VERS_TABLE_MUST_HAVE_COLUMNS";r[4124]="ER_VERS_NOT_VERSIONED";r[4125]="ER_MISSING";r[4126]="ER_VERS_PERIOD_COLUMNS";r[4127]="ER_PART_WRONG_VALUE";r[4128]="ER_VERS_WRONG_PARTS";r[4129]="ER_VERS_NO_TRX_ID";r[4130]="ER_VERS_ALTER_SYSTEM_FIELD";r[4131]="ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION";r[4132]="ER_VERS_DB_NOT_SUPPORTED";r[4133]="ER_VERS_TRT_IS_DISABLED";r[4134]="ER_VERS_DUPLICATE_ROW_START_END";r[4135]="ER_VERS_ALREADY_VERSIONED";r[4136]="ER_UNUSED_24";r[4137]="ER_VERS_NOT_SUPPORTED";r[4138]="ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED";r[4139]="ER_INDEX_FILE_FULL";r[4140]="ER_UPDATED_COLUMN_ONLY_ONCE";r[4141]="ER_EMPTY_ROW_IN_TVC";r[4142]="ER_VERS_QUERY_IN_PARTITION";r[4143]="ER_KEY_DOESNT_SUPPORT";r[4144]="ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD";r[4145]="ER_BACKUP_LOCK_IS_ACTIVE";r[4146]="ER_BACKUP_NOT_RUNNING";r[4147]="ER_BACKUP_WRONG_STAGE";r[4148]="ER_BACKUP_STAGE_FAILED";r[4149]="ER_BACKUP_UNKNOWN_STAGE";r[4150]="ER_USER_IS_BLOCKED";r[4151]="ER_ACCOUNT_HAS_BEEN_LOCKED";r[4152]="ER_PERIOD_TEMPORARY_NOT_ALLOWED";r[4153]="ER_PERIOD_TYPES_MISMATCH";r[4154]="ER_MORE_THAN_ONE_PERIOD";r[4155]="ER_PERIOD_FIELD_WRONG_ATTRIBUTES";r[4156]="ER_PERIOD_NOT_FOUND";r[4157]="ER_PERIOD_COLUMNS_UPDATED";r[4158]="ER_PERIOD_CONSTRAINT_DROP";r[4159]="ER_TOO_LONG_KEYPART";r[4160]="ER_TOO_LONG_DATABASE_COMMENT";r[4161]="ER_UNKNOWN_DATA_TYPE";r[4162]="ER_UNKNOWN_OPERATOR";r[4163]="ER_SP_DUP_DECL";r[4164]="ER_PART_STARTS_BEYOND_INTERVAL";r[4165]="ER_GALERA_REPLICATION_NOT_SUPPORTED";r[4166]="ER_LOAD_INFILE_CAPABILITY_DISABLED";r[4167]="ER_NO_SECURE_TRANSPORTS_CONFIGURED";r[4168]="ER_SLAVE_IGNORED_SHARED_TABLE";r[4169]="ER_NO_AUTOINCREMENT_WITH_UNIQUE";r[4170]="ER_KEY_CONTAINS_PERIOD_FIELDS";r[4171]="ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS";r[4172]="ER_NOT_ALLOWED_IN_THIS_CONTEXT";r[4173]="ER_DATA_WAS_COMMITED_UNDER_ROLLBACK";r[4174]="ER_PK_INDEX_CANT_BE_IGNORED";r[4175]="ER_BINLOG_UNSAFE_SKIP_LOCKED";r[4176]="ER_JSON_TABLE_ERROR_ON_FIELD";r[4177]="ER_JSON_TABLE_ALIAS_REQUIRED";r[4178]="ER_JSON_TABLE_SCALAR_EXPECTED";r[4179]="ER_JSON_TABLE_MULTIPLE_MATCHES";r[4180]="ER_WITH_TIES_NEEDS_ORDER";r[4181]="ER_REMOVED_ORPHAN_TRIGGER";r[4182]="ER_STORAGE_ENGINE_DISABLED";r[4183]="WARN_SFORMAT_ERROR";r[4184]="ER_PARTITION_CONVERT_SUBPARTITIONED";r[4185]="ER_PROVIDER_NOT_LOADED";r[4186]="ER_JSON_HISTOGRAM_PARSE_FAILED";r[4187]="ER_SF_OUT_INOUT_ARG_NOT_ALLOWED";r[4188]="ER_INCONSISTENT_SLAVE_TEMP_TABLE";r[4189]="ER_VERS_HIST_PART_FAILED";r[4190]="WARN_OPTION_CHANGING";r[4191]="ER_CM_OPTION_MISSING_REQUIREMENT";r[4192]="ER_SLAVE_STATEMENT_TIMEOUT";r[4193]="ER_JSON_INVALID_VALUE_FOR_KEYWORD";r[4194]="ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED";r[4195]="ER_JSON_NO_VARIABLE_SCHEMA";r[4196]="ER_SEQUENCE_TABLE_HAS_WRONG_NUMBER_OF_COLUMNS";r[4197]="ER_SEQUENCE_TABLE_CANNOT_HAVE_ANY_KEYS";r[4198]="ER_SEQUENCE_TABLE_CANNOT_HAVE_ANY_CONSTRAINTS";r[4199]="ER_SEQUENCE_TABLE_ORDER_BY";r[4200]="ER_VARIABLE_IGNORED";r[4201]="ER_INCORRECT_COLUMN_NAME_COUNT";r[4202]="WARN_SORTING_ON_TRUNCATED_LENGTH";r[4203]="ER_VECTOR_BINARY_FORMAT_INVALID";r[4204]="ER_VECTOR_FORMAT_INVALID";r[4205]="ER_PSEUDO_THREAD_ID_OVERWRITE";r[4206]="ER_VEC_DISTANCE_TYPE";r[4207]="WARN_INDEX_HINTS_IGNORED";r[4208]="ER_SIGNAL_SKIP_ROW_FROM_TRIGGER";r[4209]="ER_TEMPORARY_TABLES_PREVENT_SWITCH_GTID_DOMAIN_ID";r[4210]="ER_TOO_MANY_OPEN_CURSORS";r[4211]="ER_INCOMPATIBLE_EVENT_FLAG";r[4212]="ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS";r[4213]="ER_LONGITUDE_OUT_OF_RANGE";r[4214]="ER_LATITUDE_OUT_OF_RANGE";r[4215]="ER_GIS_DIFFERENT_SRIDS_AGGREGATION";r[4216]="ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS";r[4217]="ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS";r[4218]="ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR";r[4219]="ER_WARN_CONFLICTING_HINT";r[4220]="ER_WARN_UNKNOWN_QB_NAME";r[4221]="ER_UNRESOLVED_TABLE_HINT_NAME";r[4222]="ER_UNRESOLVED_INDEX_HINT_NAME";r[4223]="ER_HINTS_INSIDE_VIEWS_NOT_SUPPORTED";r[4224]="ER_WARN_MALFORMED_HINT";r[4225]="ER_WARN_HINTS_ON_INSERT_PART_OF_INSERT_SELECT";r[4226]="ER_INIT_SLAVE_ERROR";r[4227]="ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP";var ri=r;var Ke=class extends Error{constructor(e,s,t,n,o,a,A,u=void 0,h){super((u!==!1?`(conn:${n&&n.threadId?n.threadId:-1}, no: ${a||-1}, SQLState: ${o}) `:"")+e+(s?`
sql: `+s:""),h),this.name="SqlError",this.sqlMessage=e,this.sql=s,this.fatal=t,this.errno=a,this.sqlState=o,a>45e3&&a<46e3?this.code=ii(a)||"UNKNOWN":this.code=ri[this.errno]||"UNKNOWN",A&&(this.stack+=`
From event:
`+A.substring(A.indexOf(`
`)+1))}get text(){return this.sqlMessage}};function f(E,e,s=null,t="HY000",n=null,o=!1,a=void 0,A=void 0,u=void 0){return u?new Ke(E,n,o,s,t,e,a,A,{cause:u}):new Ke(E,n,o,s,t,e,a,A,u)}function w(E,e,s=null,t="08S01",n=null,o=void 0,a=void 0){return new Ke(E,n,!0,s,t,e,o,a)}var N={ER_CONNECTION_ALREADY_CLOSED:45001,ER_MYSQL_CHANGE_USER_BUG:45003,ER_CMD_NOT_EXECUTED_DESTROYED:45004,ER_NULL_CHAR_ESCAPEID:45005,ER_NULL_ESCAPEID:45006,ER_NOT_IMPLEMENTED_FORMAT:45007,ER_NODE_NOT_SUPPORTED_TLS:45008,ER_SOCKET_UNEXPECTED_CLOSE:45009,ER_UNEXPECTED_PACKET:45011,ER_CONNECTION_TIMEOUT:45012,ER_CMD_CONNECTION_CLOSED:45013,ER_CHANGE_USER_BAD_PACKET:45014,ER_PING_BAD_PACKET:45015,ER_MISSING_PARAMETER:45016,ER_PARAMETER_UNDEFINED:45017,ER_PLACEHOLDER_UNDEFINED:45018,ER_SOCKET:45019,ER_EOF_EXPECTED:45020,ER_LOCAL_INFILE_DISABLED:45021,ER_LOCAL_INFILE_NOT_READABLE:45022,ER_SERVER_SSL_DISABLED:45023,ER_AUTHENTICATION_BAD_PACKET:45024,ER_AUTHENTICATION_PLUGIN_NOT_SUPPORTED:45025,ER_SOCKET_TIMEOUT:45026,ER_POOL_ALREADY_CLOSED:45027,ER_GET_CONNECTION_TIMEOUT:45028,ER_SETTING_SESSION_ERROR:45029,ER_INITIAL_SQL_ERROR:45030,ER_BATCH_WITH_NO_VALUES:45031,ER_RESET_BAD_PACKET:45032,ER_WRONG_IANA_TIMEZONE:45033,ER_LOCAL_INFILE_WRONG_FILENAME:45034,ER_ADD_CONNECTION_CLOSED_POOL:45035,ER_WRONG_AUTO_TIMEZONE:45036,ER_CLOSING_POOL:45037,ER_TIMEOUT_NOT_SUPPORTED:45038,ER_INITIAL_TIMEOUT_ERROR:45039,ER_DUPLICATE_FIELD:45040,ER_PING_TIMEOUT:45042,ER_BAD_PARAMETER_VALUE:45043,ER_CANNOT_RETRIEVE_RSA_KEY:45044,ER_MINIMUM_NODE_VERSION_REQUIRED:45045,ER_MAX_ALLOWED_PACKET:45046,ER_NOT_SUPPORTED_AUTH_PLUGIN:45047,ER_COMPRESSION_NOT_SUPPORTED:45048,ER_UNDEFINED_SQL:45049,ER_PARSING_PRECISION:45050,ER_PREPARE_CLOSED:45051,ER_MISSING_SQL_PARAMETER:45052,ER_MISSING_SQL_FILE:45053,ER_SQL_FILE_ERROR:45054,ER_MISSING_DATABASE_PARAMETER:45055,ER_SELF_SIGNED:45056,ER_SELF_SIGNED_NO_PWD:45057,ER_PRIVATE_FIELDS_USE:45058,ER_TLS_IDENTITY_ERROR:45059,ER_POOL_NOT_INITIALIZED:45060,ER_POOL_NO_CONNECTION:45061,ER_SELF_SIGNED_BAD_PLUGIN:45062,ER_SELF_SIGNED_SHA256:45063,ER_CLEAR_PASSWORD_WITHOUT_SSL:45064};function ii(E){for(let[e,s]of Object.entries(N))if(s===E)return e}var fs=class{update(e,s,t){return this.buf=e,this.pos=s,this.end=t,this}skip(e){this.pos+=e}readGeometry(e){let s=this.readBufferLengthEncoded();if(s===null||s.length===0)return e;let t=4;return o(!1);function n(A){t+=16;let u=A?s.readDoubleLE(t-16):s.readDoubleBE(t-16),h=A?s.readDoubleLE(t-8):s.readDoubleBE(t-8);return[u,h]}function o(A){let u=s[t++],h=u?s.readInt32LE(t):s.readInt32BE(t);switch(t+=4,h){case 1:let l=n(u);return A?l:{type:"Point",coordinates:l};case 2:let R=u?s.readInt32LE(t):s.readInt32BE(t);t+=4;let I=[];for(let d=0;d<R;d++)I.push(n(u));return A?I:{type:"LineString",coordinates:I};case 3:let S=[],C=u?s.readInt32LE(t):s.readInt32BE(t);t+=4;for(let d=0;d<C;d++){let b=u?s.readInt32LE(t):s.readInt32BE(t);t+=4;let g=[];for(let U=0;U<b;U++)g.push(n(u));S.push(g)}return A?S:{type:"Polygon",coordinates:S};case 4:return{type:"MultiPoint",coordinates:a(u,!0)};case 5:return{type:"MultiLineString",coordinates:a(u,!0)};case 6:return{type:"MultiPolygon",coordinates:a(u,!0)};case 7:return{type:"GeometryCollection",geometries:a(u,!1)}}return null}function a(A,u){let h=[],l=A?s.readInt32LE(t):s.readInt32BE(t);t+=4;for(let R=0;R<l;R++)h.push(o(u));return h}}peek(){return this.buf[this.pos]}remaining(){return this.end-this.pos>0}readInt8(){let e=this.buf[this.pos++];return e|(e&128)*33554430}readUInt8(){return this.buf[this.pos++]}readInt16(){this.pos+=2;let e=this.buf[this.pos-2],s=this.buf[this.pos-1],t=e+(s<<8);return t|(t&32768)*131070}readUInt16(){return this.pos+=2,this.buf[this.pos-2]+(this.buf[this.pos-1]<<8)}readInt24(){let e=this.buf[this.pos],s=this.buf[this.pos+2],t=e+(this.buf[this.pos+1]<<8)+(s<<16);return this.pos+=3,t|(t&8388608)*510}readUInt24(){return this.pos+=3,this.buf[this.pos-3]+(this.buf[this.pos-2]<<8)+(this.buf[this.pos-1]<<16)}readUInt32(){return this.pos+=4,this.buf[this.pos-4]+(this.buf[this.pos-3]<<8)+(this.buf[this.pos-2]<<16)+this.buf[this.pos-1]*16777216}readInt32(){return this.pos+=4,this.buf[this.pos-4]+(this.buf[this.pos-3]<<8)+(this.buf[this.pos-2]<<16)+(this.buf[this.pos-1]<<24)}readBigInt64(){let e=this.buf.readBigInt64LE(this.pos);return this.pos+=8,e}readBigUInt64(){let e=this.buf.readBigUInt64LE(this.pos);return this.pos+=8,e}readMetadataLength(){let e=this.buf[this.pos++];return e<251?e:this.readUInt16()}readUnsignedLength(){let e=this.buf[this.pos++];if(e<251)return e;switch(e){case 251:return null;case 252:return this.pos+=2,this.buf[this.pos-2]+(this.buf[this.pos-1]<<8);case 253:return this.pos+=3,this.buf[this.pos-3]+(this.buf[this.pos-2]<<8)+(this.buf[this.pos-1]<<16);case 254:return Number(this.readBigInt64())}}readBuffer(e){return this.pos+=e,this.buf.subarray(this.pos-e,this.pos)}readBufferLengthEncodedCopy(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,Buffer.from(this.buf.subarray(this.pos-e,this.pos)))}readBufferRemaining(){let e=this.buf.subarray(this.pos,this.end);return this.pos=this.end,e}readBufferLengthEncoded(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,this.buf.subarray(this.pos-e,this.pos))}readStringNullEnded(){let e=this.pos,s=0;for(;this.remaining()>0&&this.buf[this.pos++]!==0;)s++;return this.buf.toString(void 0,e,e+s)}readInsertId(){let e=this.buf[this.pos++];if(e<251)return BigInt(e);switch(e){case 252:return this.pos+=2,BigInt(this.buf[this.pos-2]+(this.buf[this.pos-1]<<8));case 253:return this.pos+=3,BigInt(this.buf[this.pos-3]+(this.buf[this.pos-2]<<8)+(this.buf[this.pos-1]<<16));case 254:return this.readBigInt64()}}readAsciiStringLengthEncoded(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,this.buf.toString("ascii",this.pos-e,this.pos))}readStringLengthEncoded(){throw new Error("code is normally superseded by Node encoder or Iconv depending on charset used")}readBigIntLengthEncoded(){let e=this.buf[this.pos++];return e<16?BigInt(this._atoi(e)):e===251?null:this.readBigIntFromLen(e)}readBigIntFromLen(e){let s=0n,t=!1,n=this.pos;for(e>0&&this.buf[n]===45&&(t=!0,n++);n<this.pos+e;n++)s=s*10n+BigInt(this.buf[n]-48);return this.pos+=e,t?-1n*s:s}readDecimalLengthEncoded(){let e=this.buf[this.pos++];return e===251?null:(this.pos+=e,this.buf.toString("ascii",this.pos-e,this.pos))}readDate(){let e=this.buf[this.pos++];if(e===251)return null;let s=[],t=0,n=this.pos;for(this.pos+=e;n<this.pos;){let o=this.buf[n++];o===45?(s.push(t),t=0):t=t*10+o-48}return s.push(t),s[0]===0&&s[1]===0&&s[2]===0?null:new Date(s[0],s[1]-1,s[2])}readBinaryDate(e){let s=this.buf[this.pos++],t=0,n=0,o=0;return s>0&&(t=this.readInt16(),s>2&&(n=this.readUInt8()-1,s>3&&(o=this.readUInt8()))),t===0&&n===0&&o===0?e.dateStrings?"0000-00-00":null:e.dateStrings?`${z(t,4)}-${z(n+1,2)}-${z(o,2)}`:new Date(t,n,o)}readDateTime(){let e=this.buf[this.pos++];if(e===251)return null;this.pos+=e;let s=this.buf.toString("ascii",this.pos-e,this.pos);return s.startsWith("0000-00-00 00:00:00")?null:new Date(s)}readBinaryDateTime(){let e=this.buf[this.pos++],s=0,t=0,n=0,o=0,a=0,A=0,u=0;return e>0&&(s=this.readInt16(),e>2&&(t=this.readUInt8(),e>3&&(n=this.readUInt8(),e>4&&(o=this.readUInt8(),a=this.readUInt8(),A=this.readUInt8(),e>7&&(u=this.readUInt32()))))),s===0&&t===0&&n===0&&o===0&&a===0&&A===0&&u===0?null:new Date(s,t-1,n,o,a,A,u/1e3)}readBinaryDateTimeAsString(e){let s=this.buf[this.pos++],t=0,n=0,o=0,a=0,A=0,u=0,h=0;return s>0&&(t=this.readInt16(),s>2&&(n=this.readUInt8(),s>3&&(o=this.readUInt8(),s>4&&(a=this.readUInt8(),A=this.readUInt8(),u=this.readUInt8(),s>7&&(h=this.readUInt32()))))),t===0&&n===0&&o===0&&a===0&&A===0&&u===0&&h===0?"0000-00-00 00:00:00"+(e>0?".000000".substring(0,e+1):""):z(t,4)+"-"+z(n,2)+"-"+z(o,2)+" "+z(a,2)+":"+z(A,2)+":"+z(u,2)+(h>0?e>0?"."+z(h,6).substring(0,e):"."+z(h,6):e>0?"."+z(h,6).substring(0,e):"")}readBinaryTime(){let e=this.buf[this.pos++],s=!1,t=0,n=0,o=0,a=0;e>0&&(s=this.buf[this.pos++]===1,t=this.readUInt32()*24+this.readUInt8(),n=this.readUInt8(),o=this.readUInt8(),e>8&&(a=this.readUInt32()));let A=z(t,2)+":"+z(n,2)+":"+z(o,2);return a>0&&(A+="."+z(a,6)),s?"-"+A:A}readFloat(){let e=this.buf.readFloatLE(this.pos);return this.pos+=4,e}readDouble(){let e=this.buf.readDoubleLE(this.pos);return this.pos+=8,e}readIntLengthEncoded(){let e=this.buf[this.pos++];return e===251?null:this._atoi(e)}_atoi(e){let s=0,t=!1,n=this.pos;for(e>0&&this.buf[n]===45&&(t=!0,n++);n<this.pos+e;n++)s=s*10+(this.buf[n]-48);return this.pos+=e,t?-1*s:s}readFloatLengthCoded(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,+this.buf.toString("ascii",this.pos-e,this.pos))}skipLengthCodedNumber(){let e=this.buf[this.pos++];switch(e){case 251:return;case 252:this.pos+=2+(65535&this.buf[this.pos]+(this.buf[this.pos+1]<<8));return;case 253:this.pos+=3+(16777215&this.buf[this.pos]+(this.buf[this.pos+1]<<8)+(this.buf[this.pos+2]<<16));return;case 254:this.pos+=8+Number(this.buf.readBigUInt64LE(this.pos));return;default:this.pos+=e;return}}length(){return this.end-this.pos}subPacketLengthEncoded(e){}readError(e,s,t){this.skip(1);let n=this.readUInt16(),o,a;this.peek()===35?(this.skip(6),o=this.buf.toString(void 0,this.pos-5,this.pos),a=this.readStringNullEnded()):(o="HY000",a=this.buf.toString(void 0,this.pos,this.end));let A=o.startsWith("08")||o==="70100";return f(a,n,e,o,s,A,t)}},z=(E,e)=>{let s=E.toString();for(;s.length<e;)s="0"+s;return s},Bt=fs;var Cs=class E extends Bt{constructor(e){super(),this.encoding=e==="utf8"?void 0:e}readStringLengthEncoded(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,this.buf.toString(this.encoding,this.pos-e,this.pos))}static readString(e,s,t,n){return s.toString(e,t,t+n)}subPacketLengthEncoded(e){return this.skip(e),new E(this.encoding).update(this.buf,this.pos-e,this.pos)}readStringRemaining(){let e=this.buf.toString(this.encoding,this.pos,this.end);return this.pos=this.end,e}},_i=Cs;var Gt=m(require("iconv-lite"),1),Ts=class E extends Bt{constructor(e){super(),this.encoding=e}readStringLengthEncoded(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,Gt.default.decode(this.buf.subarray(this.pos-e,this.pos),this.encoding))}static readString(e,s,t,n){return Gt.default.decode(s.subarray(t,t+n),e)}subPacketLengthEncoded(e){return this.skip(e),new E(this.encoding).update(this.buf,this.pos-e,this.pos)}readStringRemaining(){let e=Gt.default.decode(this.buf.subarray(this.pos,this.end),this.encoding);return this.pos=this.end,e}},ni=Ts;var i=[],T=[],_=class{constructor(e,s,t,n){this.index=e,this.name=s,this.charset=t,this.maxLength=n}static fromCharset(e){return T[e==="utf8mb3"?"utf8":e]}static fromIndex(e){if(!(e>=i.length))return i[e]}static fromCharsetAndName(e,s){for(let n=0;n<i.length;n++){let o=i[n];if(o&&o.name===s){if(o.name.startsWith("UTF8MB3_")||e==="utf8mb3"){if(o.charset==="utf8"&&o.maxLength===3)return o}else if(o.name.startsWith("UTF8MB4_")||e==="utf8mb4"||e==="utf8"){if(o.charset==="utf8"&&o.maxLength===4)return o}else if(o.charset===e)return o}}let t=s.replace("UTF8_","UTF8MB4_");for(let n=0;n<i.length;n++){let o=i[n];if(o&&o.name===t){if(o.name.startsWith("UTF8MB3_")||e==="utf8mb3"){if(o.charset==="utf8"&&o.maxLength===3)return o}else if(o.name.startsWith("UTF8MB4_")||e==="utf8mb4"||e==="utf8"){if(o.charset==="utf8"&&o.maxLength===4)return o}else if(o.charset===e)return o}}}static fromName(e){let s;for(let n=0;n<i.length;n++){let o=i[n];if(o&&o.name===e){if(o.charset==="utf8"&&o.maxLength===4)return o;s||(s=o)}}if(s)return s;let t=e.replace("UTF8_","UTF8MB4_");for(let n=0;n<i.length;n++){let o=i[n];if(o&&o.name===t){if(o.charset==="utf8"&&o.maxLength===4)return o;s||(s=o)}}return s}};i[1]=new _(1,"BIG5_CHINESE_CI","big5",2);i[2]=new _(2,"LATIN2_CZECH_CS","latin2",1);i[3]=new _(3,"DEC8_SWEDISH_CI","dec8",1);i[4]=new _(4,"CP850_GENERAL_CI","cp850",1);i[5]=new _(5,"LATIN1_GERMAN1_CI","latin1",1);i[6]=new _(6,"HP8_ENGLISH_CI","hp8",1);i[7]=new _(7,"KOI8R_GENERAL_CI","koi8r",1);i[8]=new _(8,"LATIN1_SWEDISH_CI","latin1",1);i[9]=new _(9,"LATIN2_GENERAL_CI","latin2",1);i[10]=new _(10,"SWE7_SWEDISH_CI","swe7",1);i[11]=new _(11,"ASCII_GENERAL_CI","ascii",1);i[12]=new _(12,"UJIS_JAPANESE_CI","ujis",3);i[13]=new _(13,"SJIS_JAPANESE_CI","sjis",2);i[14]=new _(14,"CP1251_BULGARIAN_CI","cp1251",1);i[15]=new _(15,"LATIN1_DANISH_CI","latin1",1);i[16]=new _(16,"HEBREW_GENERAL_CI","hebrew",1);i[18]=new _(18,"TIS620_THAI_CI","tis620",1);i[19]=new _(19,"EUCKR_KOREAN_CI","euckr",2);i[20]=new _(20,"LATIN7_ESTONIAN_CS","latin7",1);i[21]=new _(21,"LATIN2_HUNGARIAN_CI","latin2",1);i[22]=new _(22,"KOI8U_GENERAL_CI","koi8u",1);i[23]=new _(23,"CP1251_UKRAINIAN_CI","cp1251",1);i[24]=new _(24,"GB2312_CHINESE_CI","gb2312",2);i[25]=new _(25,"GREEK_GENERAL_CI","greek",1);i[26]=new _(26,"CP1250_GENERAL_CI","cp1250",1);i[27]=new _(27,"LATIN2_CROATIAN_CI","latin2",1);i[28]=new _(28,"GBK_CHINESE_CI","gbk",2);i[29]=new _(29,"CP1257_LITHUANIAN_CI","cp1257",1);i[30]=new _(30,"LATIN5_TURKISH_CI","latin5",1);i[31]=new _(31,"LATIN1_GERMAN2_CI","latin1",1);i[32]=new _(32,"ARMSCII8_GENERAL_CI","armscii8",1);i[33]=new _(33,"UTF8MB3_GENERAL_CI","utf8",3);i[34]=new _(34,"CP1250_CZECH_CS","cp1250",1);i[35]=new _(35,"UCS2_GENERAL_CI","ucs2",2);i[36]=new _(36,"CP866_GENERAL_CI","cp866",1);i[37]=new _(37,"KEYBCS2_GENERAL_CI","keybcs2",1);i[38]=new _(38,"MACCE_GENERAL_CI","macce",1);i[39]=new _(39,"MACROMAN_GENERAL_CI","macroman",1);i[40]=new _(40,"CP852_GENERAL_CI","cp852",1);i[41]=new _(41,"LATIN7_GENERAL_CI","latin7",1);i[42]=new _(42,"LATIN7_GENERAL_CS","latin7",1);i[43]=new _(43,"MACCE_BIN","macce",1);i[44]=new _(44,"CP1250_CROATIAN_CI","cp1250",1);i[45]=new _(45,"UTF8MB4_GENERAL_CI","utf8",4);i[46]=new _(46,"UTF8MB4_BIN","utf8",4);i[47]=new _(47,"LATIN1_BIN","latin1",1);i[48]=new _(48,"LATIN1_GENERAL_CI","latin1",1);i[49]=new _(49,"LATIN1_GENERAL_CS","latin1",1);i[50]=new _(50,"CP1251_BIN","cp1251",1);i[51]=new _(51,"CP1251_GENERAL_CI","cp1251",1);i[52]=new _(52,"CP1251_GENERAL_CS","cp1251",1);i[53]=new _(53,"MACROMAN_BIN","macroman",1);i[54]=new _(54,"UTF16_GENERAL_CI","utf16",4);i[55]=new _(55,"UTF16_BIN","utf16",4);i[56]=new _(56,"UTF16LE_GENERAL_CI","utf16le",4);i[57]=new _(57,"CP1256_GENERAL_CI","cp1256",1);i[58]=new _(58,"CP1257_BIN","cp1257",1);i[59]=new _(59,"CP1257_GENERAL_CI","cp1257",1);i[60]=new _(60,"UTF32_GENERAL_CI","utf32",4);i[61]=new _(61,"UTF32_BIN","utf32",4);i[62]=new _(62,"UTF16LE_BIN","utf16le",4);i[63]=new _(63,"BINARY","binary",1);i[64]=new _(64,"ARMSCII8_BIN","armscii8",1);i[65]=new _(65,"ASCII_BIN","ascii",1);i[66]=new _(66,"CP1250_BIN","cp1250",1);i[67]=new _(67,"CP1256_BIN","cp1256",1);i[68]=new _(68,"CP866_BIN","cp866",1);i[69]=new _(69,"DEC8_BIN","dec8",1);i[70]=new _(70,"GREEK_BIN","greek",1);i[71]=new _(71,"HEBREW_BIN","hebrew",1);i[72]=new _(72,"HP8_BIN","hp8",1);i[73]=new _(73,"KEYBCS2_BIN","keybcs2",1);i[74]=new _(74,"KOI8R_BIN","koi8r",1);i[75]=new _(75,"KOI8U_BIN","koi8u",1);i[76]=new _(76,"UTF8_TOLOWER_CI","utf8",3);i[77]=new _(77,"LATIN2_BIN","latin2",1);i[78]=new _(78,"LATIN5_BIN","latin5",1);i[79]=new _(79,"LATIN7_BIN","latin7",1);i[80]=new _(80,"CP850_BIN","cp850",1);i[81]=new _(81,"CP852_BIN","cp852",1);i[82]=new _(82,"SWE7_BIN","swe7",1);i[83]=new _(83,"UTF8MB3_BIN","utf8",3);i[84]=new _(84,"BIG5_BIN","big5",2);i[85]=new _(85,"EUCKR_BIN","euckr",2);i[86]=new _(86,"GB2312_BIN","gb2312",2);i[87]=new _(87,"GBK_BIN","gbk",2);i[88]=new _(88,"SJIS_BIN","sjis",2);i[89]=new _(89,"TIS620_BIN","tis620",1);i[90]=new _(90,"UCS2_BIN","ucs2",2);i[91]=new _(91,"UJIS_BIN","ujis",3);i[92]=new _(92,"GEOSTD8_GENERAL_CI","geostd8",1);i[93]=new _(93,"GEOSTD8_BIN","geostd8",1);i[94]=new _(94,"LATIN1_SPANISH_CI","latin1",1);i[95]=new _(95,"CP932_JAPANESE_CI","cp932",2);i[96]=new _(96,"CP932_BIN","cp932",2);i[97]=new _(97,"EUCJPMS_JAPANESE_CI","eucjpms",3);i[98]=new _(98,"EUCJPMS_BIN","eucjpms",3);i[99]=new _(99,"CP1250_POLISH_CI","cp1250",1);i[101]=new _(101,"UTF16_UNICODE_CI","utf16",4);i[102]=new _(102,"UTF16_ICELANDIC_CI","utf16",4);i[103]=new _(103,"UTF16_LATVIAN_CI","utf16",4);i[104]=new _(104,"UTF16_ROMANIAN_CI","utf16",4);i[105]=new _(105,"UTF16_SLOVENIAN_CI","utf16",4);i[106]=new _(106,"UTF16_POLISH_CI","utf16",4);i[107]=new _(107,"UTF16_ESTONIAN_CI","utf16",4);i[108]=new _(108,"UTF16_SPANISH_CI","utf16",4);i[109]=new _(109,"UTF16_SWEDISH_CI","utf16",4);i[110]=new _(110,"UTF16_TURKISH_CI","utf16",4);i[111]=new _(111,"UTF16_CZECH_CI","utf16",4);i[112]=new _(112,"UTF16_DANISH_CI","utf16",4);i[113]=new _(113,"UTF16_LITHUANIAN_CI","utf16",4);i[114]=new _(114,"UTF16_SLOVAK_CI","utf16",4);i[115]=new _(115,"UTF16_SPANISH2_CI","utf16",4);i[116]=new _(116,"UTF16_ROMAN_CI","utf16",4);i[117]=new _(117,"UTF16_PERSIAN_CI","utf16",4);i[118]=new _(118,"UTF16_ESPERANTO_CI","utf16",4);i[119]=new _(119,"UTF16_HUNGARIAN_CI","utf16",4);i[120]=new _(120,"UTF16_SINHALA_CI","utf16",4);i[121]=new _(121,"UTF16_GERMAN2_CI","utf16",4);i[122]=new _(122,"UTF16_CROATIAN_MYSQL561_CI","utf16",4);i[123]=new _(123,"UTF16_UNICODE_520_CI","utf16",4);i[124]=new _(124,"UTF16_VIETNAMESE_CI","utf16",4);i[128]=new _(128,"UCS2_UNICODE_CI","ucs2",2);i[129]=new _(129,"UCS2_ICELANDIC_CI","ucs2",2);i[130]=new _(130,"UCS2_LATVIAN_CI","ucs2",2);i[131]=new _(131,"UCS2_ROMANIAN_CI","ucs2",2);i[132]=new _(132,"UCS2_SLOVENIAN_CI","ucs2",2);i[133]=new _(133,"UCS2_POLISH_CI","ucs2",2);i[134]=new _(134,"UCS2_ESTONIAN_CI","ucs2",2);i[135]=new _(135,"UCS2_SPANISH_CI","ucs2",2);i[136]=new _(136,"UCS2_SWEDISH_CI","ucs2",2);i[137]=new _(137,"UCS2_TURKISH_CI","ucs2",2);i[138]=new _(138,"UCS2_CZECH_CI","ucs2",2);i[139]=new _(139,"UCS2_DANISH_CI","ucs2",2);i[140]=new _(140,"UCS2_LITHUANIAN_CI","ucs2",2);i[141]=new _(141,"UCS2_SLOVAK_CI","ucs2",2);i[142]=new _(142,"UCS2_SPANISH2_CI","ucs2",2);i[143]=new _(143,"UCS2_ROMAN_CI","ucs2",2);i[144]=new _(144,"UCS2_PERSIAN_CI","ucs2",2);i[145]=new _(145,"UCS2_ESPERANTO_CI","ucs2",2);i[146]=new _(146,"UCS2_HUNGARIAN_CI","ucs2",2);i[147]=new _(147,"UCS2_SINHALA_CI","ucs2",2);i[148]=new _(148,"UCS2_GERMAN2_CI","ucs2",2);i[149]=new _(149,"UCS2_CROATIAN_MYSQL561_CI","ucs2",2);i[150]=new _(150,"UCS2_UNICODE_520_CI","ucs2",2);i[151]=new _(151,"UCS2_VIETNAMESE_CI","ucs2",2);i[159]=new _(159,"UCS2_GENERAL_MYSQL500_CI","ucs2",2);i[160]=new _(160,"UTF32_UNICODE_CI","utf32",4);i[161]=new _(161,"UTF32_ICELANDIC_CI","utf32",4);i[162]=new _(162,"UTF32_LATVIAN_CI","utf32",4);i[163]=new _(163,"UTF32_ROMANIAN_CI","utf32",4);i[164]=new _(164,"UTF32_SLOVENIAN_CI","utf32",4);i[165]=new _(165,"UTF32_POLISH_CI","utf32",4);i[166]=new _(166,"UTF32_ESTONIAN_CI","utf32",4);i[167]=new _(167,"UTF32_SPANISH_CI","utf32",4);i[168]=new _(168,"UTF32_SWEDISH_CI","utf32",4);i[169]=new _(169,"UTF32_TURKISH_CI","utf32",4);i[170]=new _(170,"UTF32_CZECH_CI","utf32",4);i[171]=new _(171,"UTF32_DANISH_CI","utf32",4);i[172]=new _(172,"UTF32_LITHUANIAN_CI","utf32",4);i[173]=new _(173,"UTF32_SLOVAK_CI","utf32",4);i[174]=new _(174,"UTF32_SPANISH2_CI","utf32",4);i[175]=new _(175,"UTF32_ROMAN_CI","utf32",4);i[176]=new _(176,"UTF32_PERSIAN_CI","utf32",4);i[177]=new _(177,"UTF32_ESPERANTO_CI","utf32",4);i[178]=new _(178,"UTF32_HUNGARIAN_CI","utf32",4);i[179]=new _(179,"UTF32_SINHALA_CI","utf32",4);i[180]=new _(180,"UTF32_GERMAN2_CI","utf32",4);i[181]=new _(181,"UTF32_CROATIAN_MYSQL561_CI","utf32",4);i[182]=new _(182,"UTF32_UNICODE_520_CI","utf32",4);i[183]=new _(183,"UTF32_VIETNAMESE_CI","utf32",4);i[192]=new _(192,"UTF8MB3_UNICODE_CI","utf8",3);i[193]=new _(193,"UTF8MB3_ICELANDIC_CI","utf8",3);i[194]=new _(194,"UTF8MB3_LATVIAN_CI","utf8",3);i[195]=new _(195,"UTF8MB3_ROMANIAN_CI","utf8",3);i[196]=new _(196,"UTF8MB3_SLOVENIAN_CI","utf8",3);i[197]=new _(197,"UTF8MB3_POLISH_CI","utf8",3);i[198]=new _(198,"UTF8MB3_ESTONIAN_CI","utf8",3);i[199]=new _(199,"UTF8MB3_SPANISH_CI","utf8",3);i[200]=new _(200,"UTF8MB3_SWEDISH_CI","utf8",3);i[201]=new _(201,"UTF8MB3_TURKISH_CI","utf8",3);i[202]=new _(202,"UTF8MB3_CZECH_CI","utf8",3);i[203]=new _(203,"UTF8MB3_DANISH_CI","utf8",3);i[204]=new _(204,"UTF8MB3_LITHUANIAN_CI","utf8",3);i[205]=new _(205,"UTF8MB3_SLOVAK_CI","utf8",3);i[206]=new _(206,"UTF8MB3_SPANISH2_CI","utf8",3);i[207]=new _(207,"UTF8MB3_ROMAN_CI","utf8",3);i[208]=new _(208,"UTF8MB3_PERSIAN_CI","utf8",3);i[209]=new _(209,"UTF8MB3_ESPERANTO_CI","utf8",3);i[210]=new _(210,"UTF8MB3_HUNGARIAN_CI","utf8",3);i[211]=new _(211,"UTF8MB3_SINHALA_CI","utf8",3);i[212]=new _(212,"UTF8MB3_GERMAN2_CI","utf8",3);i[213]=new _(213,"UTF8MB3_CROATIAN_MYSQL561_CI","utf8",3);i[214]=new _(214,"UTF8MB3_UNICODE_520_CI","utf8",3);i[215]=new _(215,"UTF8MB3_VIETNAMESE_CI","utf8",3);i[223]=new _(223,"UTF8MB3_GENERAL_MYSQL500_CI","utf8",3);i[224]=new _(224,"UTF8MB4_UNICODE_CI","utf8",4);i[225]=new _(225,"UTF8MB4_ICELANDIC_CI","utf8",4);i[226]=new _(226,"UTF8MB4_LATVIAN_CI","utf8",4);i[227]=new _(227,"UTF8MB4_ROMANIAN_CI","utf8",4);i[228]=new _(228,"UTF8MB4_SLOVENIAN_CI","utf8",4);i[229]=new _(229,"UTF8MB4_POLISH_CI","utf8",4);i[230]=new _(230,"UTF8MB4_ESTONIAN_CI","utf8",4);i[231]=new _(231,"UTF8MB4_SPANISH_CI","utf8",4);i[232]=new _(232,"UTF8MB4_SWEDISH_CI","utf8",4);i[233]=new _(233,"UTF8MB4_TURKISH_CI","utf8",4);i[234]=new _(234,"UTF8MB4_CZECH_CI","utf8",4);i[235]=new _(235,"UTF8MB4_DANISH_CI","utf8",4);i[236]=new _(236,"UTF8MB4_LITHUANIAN_CI","utf8",4);i[237]=new _(237,"UTF8MB4_SLOVAK_CI","utf8",4);i[238]=new _(238,"UTF8MB4_SPANISH2_CI","utf8",4);i[239]=new _(239,"UTF8MB4_ROMAN_CI","utf8",4);i[240]=new _(240,"UTF8MB4_PERSIAN_CI","utf8",4);i[241]=new _(241,"UTF8MB4_ESPERANTO_CI","utf8",4);i[242]=new _(242,"UTF8MB4_HUNGARIAN_CI","utf8",4);i[243]=new _(243,"UTF8MB4_SINHALA_CI","utf8",4);i[244]=new _(244,"UTF8MB4_GERMAN2_CI","utf8",4);i[245]=new _(245,"UTF8MB4_CROATIAN_MYSQL561_CI","utf8",4);i[246]=new _(246,"UTF8MB4_UNICODE_520_CI","utf8",4);i[247]=new _(247,"UTF8MB4_VIETNAMESE_CI","utf8",4);i[248]=new _(248,"GB18030_CHINESE_CI","gb18030",4);i[249]=new _(249,"GB18030_BIN","gb18030",4);i[250]=new _(250,"GB18030_UNICODE_520_CI","gb18030",4);i[255]=new _(255,"UTF8MB4_0900_AI_CI","utf8",4);i[256]=new _(256,"UTF8MB4_DE_PB_0900_AI_CI","utf8",4);i[257]=new _(257,"UTF8MB4_IS_0900_AI_CI","utf8",4);i[258]=new _(258,"UTF8MB4_LV_0900_AI_CI","utf8",4);i[259]=new _(259,"UTF8MB4_RO_0900_AI_CI","utf8",4);i[260]=new _(260,"UTF8MB4_SL_0900_AI_CI","utf8",4);i[261]=new _(261,"UTF8MB4_PL_0900_AI_CI","utf8",4);i[262]=new _(262,"UTF8MB4_ET_0900_AI_CI","utf8",4);i[263]=new _(263,"UTF8MB4_ES_0900_AI_CI","utf8",4);i[264]=new _(264,"UTF8MB4_SV_0900_AI_CI","utf8",4);i[265]=new _(265,"UTF8MB4_TR_0900_AI_CI","utf8",4);i[266]=new _(266,"UTF8MB4_CS_0900_AI_CI","utf8",4);i[267]=new _(267,"UTF8MB4_DA_0900_AI_CI","utf8",4);i[268]=new _(268,"UTF8MB4_LT_0900_AI_CI","utf8",4);i[269]=new _(269,"UTF8MB4_SK_0900_AI_CI","utf8",4);i[270]=new _(270,"UTF8MB4_ES_TRAD_0900_AI_CI","utf8",4);i[271]=new _(271,"UTF8MB4_LA_0900_AI_CI","utf8",4);i[273]=new _(273,"UTF8MB4_EO_0900_AI_CI","utf8",4);i[274]=new _(274,"UTF8MB4_HU_0900_AI_CI","utf8",4);i[275]=new _(275,"UTF8MB4_HR_0900_AI_CI","utf8",4);i[277]=new _(277,"UTF8MB4_VI_0900_AI_CI","utf8",4);i[278]=new _(278,"UTF8MB4_0900_AS_CS","utf8",4);i[279]=new _(279,"UTF8MB4_DE_PB_0900_AS_CS","utf8",4);i[280]=new _(280,"UTF8MB4_IS_0900_AS_CS","utf8",4);i[281]=new _(281,"UTF8MB4_LV_0900_AS_CS","utf8",4);i[282]=new _(282,"UTF8MB4_RO_0900_AS_CS","utf8",4);i[283]=new _(283,"UTF8MB4_SL_0900_AS_CS","utf8",4);i[284]=new _(284,"UTF8MB4_PL_0900_AS_CS","utf8",4);i[285]=new _(285,"UTF8MB4_ET_0900_AS_CS","utf8",4);i[286]=new _(286,"UTF8MB4_ES_0900_AS_CS","utf8",4);i[287]=new _(287,"UTF8MB4_SV_0900_AS_CS","utf8",4);i[288]=new _(288,"UTF8MB4_TR_0900_AS_CS","utf8",4);i[289]=new _(289,"UTF8MB4_CS_0900_AS_CS","utf8",4);i[290]=new _(290,"UTF8MB4_DA_0900_AS_CS","utf8",4);i[291]=new _(291,"UTF8MB4_LT_0900_AS_CS","utf8",4);i[292]=new _(292,"UTF8MB4_SK_0900_AS_CS","utf8",4);i[293]=new _(293,"UTF8MB4_ES_TRAD_0900_AS_CS","utf8",4);i[294]=new _(294,"UTF8MB4_LA_0900_AS_CS","utf8",4);i[296]=new _(296,"UTF8MB4_EO_0900_AS_CS","utf8",4);i[297]=new _(297,"UTF8MB4_HU_0900_AS_CS","utf8",4);i[298]=new _(298,"UTF8MB4_HR_0900_AS_CS","utf8",4);i[300]=new _(300,"UTF8MB4_VI_0900_AS_CS","utf8",4);i[303]=new _(303,"UTF8MB4_JA_0900_AS_CS","utf8",4);i[304]=new _(304,"UTF8MB4_JA_0900_AS_CS_KS","utf8",4);i[305]=new _(305,"UTF8MB4_0900_AS_CI","utf8",4);i[306]=new _(306,"UTF8MB4_RU_0900_AI_CI","utf8",4);i[307]=new _(307,"UTF8MB4_RU_0900_AS_CS","utf8",4);i[308]=new _(308,"UTF8MB4_ZH_0900_AS_CS","utf8",4);i[309]=new _(309,"UTF8MB4_0900_BIN","utf8",4);i[576]=new _(576,"UTF8MB3_CROATIAN_CI","utf8",3);i[577]=new _(577,"UTF8MB3_MYANMAR_CI","utf8",3);i[578]=new _(578,"UTF8MB3_THAI_520_W2","utf8",3);i[608]=new _(608,"UTF8MB4_CROATIAN_CI","utf8",4);i[609]=new _(609,"UTF8MB4_MYANMAR_CI","utf8",4);i[610]=new _(610,"UTF8MB4_THAI_520_W2","utf8",4);i[640]=new _(640,"UCS2_CROATIAN_CI","ucs2",2);i[641]=new _(641,"UCS2_MYANMAR_CI","ucs2",2);i[642]=new _(642,"UCS2_THAI_520_W2","ucs2",2);i[672]=new _(672,"UTF16_CROATIAN_CI","utf16",4);i[673]=new _(673,"UTF16_MYANMAR_CI","utf16",4);i[674]=new _(674,"UTF16_THAI_520_W2","utf16",4);i[736]=new _(736,"UTF32_CROATIAN_CI","utf32",4);i[737]=new _(737,"UTF32_MYANMAR_CI","utf32",4);i[738]=new _(738,"UTF32_THAI_520_W2","utf32",4);i[1025]=new _(1025,"BIG5_CHINESE_NOPAD_CI","big5",2);i[1027]=new _(1027,"DEC8_SWEDISH_NOPAD_CI","dec8",1);i[1028]=new _(1028,"CP850_GENERAL_NOPAD_CI","cp850",1);i[1030]=new _(1030,"HP8_ENGLISH_NOPAD_CI","hp8",1);i[1031]=new _(1031,"KOI8R_GENERAL_NOPAD_CI","koi8r",1);i[1032]=new _(1032,"LATIN1_SWEDISH_NOPAD_CI","latin1",1);i[1033]=new _(1033,"LATIN2_GENERAL_NOPAD_CI","latin2",1);i[1034]=new _(1034,"SWE7_SWEDISH_NOPAD_CI","swe7",1);i[1035]=new _(1035,"ASCII_GENERAL_NOPAD_CI","ascii",1);i[1036]=new _(1036,"UJIS_JAPANESE_NOPAD_CI","ujis",3);i[1037]=new _(1037,"SJIS_JAPANESE_NOPAD_CI","sjis",2);i[1040]=new _(1040,"HEBREW_GENERAL_NOPAD_CI","hebrew",1);i[1042]=new _(1042,"TIS620_THAI_NOPAD_CI","tis620",1);i[1043]=new _(1043,"EUCKR_KOREAN_NOPAD_CI","euckr",2);i[1046]=new _(1046,"KOI8U_GENERAL_NOPAD_CI","koi8u",1);i[1048]=new _(1048,"GB2312_CHINESE_NOPAD_CI","gb2312",2);i[1049]=new _(1049,"GREEK_GENERAL_NOPAD_CI","greek",1);i[1050]=new _(1050,"CP1250_GENERAL_NOPAD_CI","cp1250",1);i[1052]=new _(1052,"GBK_CHINESE_NOPAD_CI","gbk",2);i[1054]=new _(1054,"LATIN5_TURKISH_NOPAD_CI","latin5",1);i[1056]=new _(1056,"ARMSCII8_GENERAL_NOPAD_CI","armscii8",1);i[1057]=new _(1057,"UTF8MB3_GENERAL_NOPAD_CI","utf8",3);i[1059]=new _(1059,"UCS2_GENERAL_NOPAD_CI","ucs2",2);i[1060]=new _(1060,"CP866_GENERAL_NOPAD_CI","cp866",1);i[1061]=new _(1061,"KEYBCS2_GENERAL_NOPAD_CI","keybcs2",1);i[1062]=new _(1062,"MACCE_GENERAL_NOPAD_CI","macce",1);i[1063]=new _(1063,"MACROMAN_GENERAL_NOPAD_CI","macroman",1);i[1064]=new _(1064,"CP852_GENERAL_NOPAD_CI","cp852",1);i[1065]=new _(1065,"LATIN7_GENERAL_NOPAD_CI","latin7",1);i[1067]=new _(1067,"MACCE_NOPAD_BIN","macce",1);i[1069]=new _(1069,"UTF8MB4_GENERAL_NOPAD_CI","utf8",4);i[1070]=new _(1070,"UTF8MB4_NOPAD_BIN","utf8",4);i[1071]=new _(1071,"LATIN1_NOPAD_BIN","latin1",1);i[1074]=new _(1074,"CP1251_NOPAD_BIN","cp1251",1);i[1075]=new _(1075,"CP1251_GENERAL_NOPAD_CI","cp1251",1);i[1077]=new _(1077,"MACROMAN_NOPAD_BIN","macroman",1);i[1078]=new _(1078,"UTF16_GENERAL_NOPAD_CI","utf16",4);i[1079]=new _(1079,"UTF16_NOPAD_BIN","utf16",4);i[1080]=new _(1080,"UTF16LE_GENERAL_NOPAD_CI","utf16le",4);i[1081]=new _(1081,"CP1256_GENERAL_NOPAD_CI","cp1256",1);i[1082]=new _(1082,"CP1257_NOPAD_BIN","cp1257",1);i[1083]=new _(1083,"CP1257_GENERAL_NOPAD_CI","cp1257",1);i[1084]=new _(1084,"UTF32_GENERAL_NOPAD_CI","utf32",4);i[1085]=new _(1085,"UTF32_NOPAD_BIN","utf32",4);i[1086]=new _(1086,"UTF16LE_NOPAD_BIN","utf16le",4);i[1088]=new _(1088,"ARMSCII8_NOPAD_BIN","armscii8",1);i[1089]=new _(1089,"ASCII_NOPAD_BIN","ascii",1);i[1090]=new _(1090,"CP1250_NOPAD_BIN","cp1250",1);i[1091]=new _(1091,"CP1256_NOPAD_BIN","cp1256",1);i[1092]=new _(1092,"CP866_NOPAD_BIN","cp866",1);i[1093]=new _(1093,"DEC8_NOPAD_BIN","dec8",1);i[1094]=new _(1094,"GREEK_NOPAD_BIN","greek",1);i[1095]=new _(1095,"HEBREW_NOPAD_BIN","hebrew",1);i[1096]=new _(1096,"HP8_NOPAD_BIN","hp8",1);i[1097]=new _(1097,"KEYBCS2_NOPAD_BIN","keybcs2",1);i[1098]=new _(1098,"KOI8R_NOPAD_BIN","koi8r",1);i[1099]=new _(1099,"KOI8U_NOPAD_BIN","koi8u",1);i[1101]=new _(1101,"LATIN2_NOPAD_BIN","latin2",1);i[1102]=new _(1102,"LATIN5_NOPAD_BIN","latin5",1);i[1103]=new _(1103,"LATIN7_NOPAD_BIN","latin7",1);i[1104]=new _(1104,"CP850_NOPAD_BIN","cp850",1);i[1105]=new _(1105,"CP852_NOPAD_BIN","cp852",1);i[1106]=new _(1106,"SWE7_NOPAD_BIN","swe7",1);i[1107]=new _(1107,"UTF8MB3_NOPAD_BIN","utf8",3);i[1108]=new _(1108,"BIG5_NOPAD_BIN","big5",2);i[1109]=new _(1109,"EUCKR_NOPAD_BIN","euckr",2);i[1110]=new _(1110,"GB2312_NOPAD_BIN","gb2312",2);i[1111]=new _(1111,"GBK_NOPAD_BIN","gbk",2);i[1112]=new _(1112,"SJIS_NOPAD_BIN","sjis",2);i[1113]=new _(1113,"TIS620_NOPAD_BIN","tis620",1);i[1114]=new _(1114,"UCS2_NOPAD_BIN","ucs2",2);i[1115]=new _(1115,"UJIS_NOPAD_BIN","ujis",3);i[1116]=new _(1116,"GEOSTD8_GENERAL_NOPAD_CI","geostd8",1);i[1117]=new _(1117,"GEOSTD8_NOPAD_BIN","geostd8",1);i[1119]=new _(1119,"CP932_JAPANESE_NOPAD_CI","cp932",2);i[1120]=new _(1120,"CP932_NOPAD_BIN","cp932",2);i[1121]=new _(1121,"EUCJPMS_JAPANESE_NOPAD_CI","eucjpms",3);i[1122]=new _(1122,"EUCJPMS_NOPAD_BIN","eucjpms",3);i[1125]=new _(1125,"UTF16_UNICODE_NOPAD_CI","utf16",4);i[1147]=new _(1147,"UTF16_UNICODE_520_NOPAD_CI","utf16",4);i[1152]=new _(1152,"UCS2_UNICODE_NOPAD_CI","ucs2",2);i[1174]=new _(1174,"UCS2_UNICODE_520_NOPAD_CI","ucs2",2);i[1184]=new _(1184,"UTF32_UNICODE_NOPAD_CI","utf32",4);i[1206]=new _(1206,"UTF32_UNICODE_520_NOPAD_CI","utf32",4);i[1216]=new _(1216,"UTF8MB3_UNICODE_NOPAD_CI","utf8",3);i[1238]=new _(1238,"UTF8MB3_UNICODE_520_NOPAD_CI","utf8",3);i[1248]=new _(1248,"UTF8MB4_UNICODE_NOPAD_CI","utf8",4);i[1270]=new _(1270,"UTF8MB4_UNICODE_520_NOPAD_CI","utf8",4);i[2048]=new _(2048,"UCA1400_AI_CI","utf8",3);i[2049]=new _(2049,"UCA1400_AI_CS","utf8",3);i[2050]=new _(2050,"UCA1400_AS_CI","utf8",3);i[2051]=new _(2051,"UCA1400_AS_CS","utf8",3);i[2052]=new _(2052,"UCA1400_NOPAD_AI_CI","utf8",3);i[2053]=new _(2053,"UCA1400_NOPAD_AI_CS","utf8",3);i[2054]=new _(2054,"UCA1400_NOPAD_AS_CI","utf8",3);i[2055]=new _(2055,"UCA1400_NOPAD_AS_CS","utf8",3);i[2056]=new _(2056,"UCA1400_ICELANDIC_AI_CI","utf8",3);i[2057]=new _(2057,"UCA1400_ICELANDIC_AI_CS","utf8",3);i[2058]=new _(2058,"UCA1400_ICELANDIC_AS_CI","utf8",3);i[2059]=new _(2059,"UCA1400_ICELANDIC_AS_CS","utf8",3);i[2060]=new _(2060,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf8",3);i[2061]=new _(2061,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf8",3);i[2062]=new _(2062,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf8",3);i[2063]=new _(2063,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf8",3);i[2064]=new _(2064,"UCA1400_LATVIAN_AI_CI","utf8",3);i[2065]=new _(2065,"UCA1400_LATVIAN_AI_CS","utf8",3);i[2066]=new _(2066,"UCA1400_LATVIAN_AS_CI","utf8",3);i[2067]=new _(2067,"UCA1400_LATVIAN_AS_CS","utf8",3);i[2068]=new _(2068,"UCA1400_LATVIAN_NOPAD_AI_CI","utf8",3);i[2069]=new _(2069,"UCA1400_LATVIAN_NOPAD_AI_CS","utf8",3);i[2070]=new _(2070,"UCA1400_LATVIAN_NOPAD_AS_CI","utf8",3);i[2071]=new _(2071,"UCA1400_LATVIAN_NOPAD_AS_CS","utf8",3);i[2072]=new _(2072,"UCA1400_ROMANIAN_AI_CI","utf8",3);i[2073]=new _(2073,"UCA1400_ROMANIAN_AI_CS","utf8",3);i[2074]=new _(2074,"UCA1400_ROMANIAN_AS_CI","utf8",3);i[2075]=new _(2075,"UCA1400_ROMANIAN_AS_CS","utf8",3);i[2076]=new _(2076,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf8",3);i[2077]=new _(2077,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf8",3);i[2078]=new _(2078,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf8",3);i[2079]=new _(2079,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf8",3);i[2080]=new _(2080,"UCA1400_SLOVENIAN_AI_CI","utf8",3);i[2081]=new _(2081,"UCA1400_SLOVENIAN_AI_CS","utf8",3);i[2082]=new _(2082,"UCA1400_SLOVENIAN_AS_CI","utf8",3);i[2083]=new _(2083,"UCA1400_SLOVENIAN_AS_CS","utf8",3);i[2084]=new _(2084,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf8",3);i[2085]=new _(2085,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf8",3);i[2086]=new _(2086,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf8",3);i[2087]=new _(2087,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf8",3);i[2088]=new _(2088,"UCA1400_POLISH_AI_CI","utf8",3);i[2089]=new _(2089,"UCA1400_POLISH_AI_CS","utf8",3);i[2090]=new _(2090,"UCA1400_POLISH_AS_CI","utf8",3);i[2091]=new _(2091,"UCA1400_POLISH_AS_CS","utf8",3);i[2092]=new _(2092,"UCA1400_POLISH_NOPAD_AI_CI","utf8",3);i[2093]=new _(2093,"UCA1400_POLISH_NOPAD_AI_CS","utf8",3);i[2094]=new _(2094,"UCA1400_POLISH_NOPAD_AS_CI","utf8",3);i[2095]=new _(2095,"UCA1400_POLISH_NOPAD_AS_CS","utf8",3);i[2096]=new _(2096,"UCA1400_ESTONIAN_AI_CI","utf8",3);i[2097]=new _(2097,"UCA1400_ESTONIAN_AI_CS","utf8",3);i[2098]=new _(2098,"UCA1400_ESTONIAN_AS_CI","utf8",3);i[2099]=new _(2099,"UCA1400_ESTONIAN_AS_CS","utf8",3);i[2100]=new _(2100,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf8",3);i[2101]=new _(2101,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf8",3);i[2102]=new _(2102,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf8",3);i[2103]=new _(2103,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf8",3);i[2104]=new _(2104,"UCA1400_SPANISH_AI_CI","utf8",3);i[2105]=new _(2105,"UCA1400_SPANISH_AI_CS","utf8",3);i[2106]=new _(2106,"UCA1400_SPANISH_AS_CI","utf8",3);i[2107]=new _(2107,"UCA1400_SPANISH_AS_CS","utf8",3);i[2108]=new _(2108,"UCA1400_SPANISH_NOPAD_AI_CI","utf8",3);i[2109]=new _(2109,"UCA1400_SPANISH_NOPAD_AI_CS","utf8",3);i[2110]=new _(2110,"UCA1400_SPANISH_NOPAD_AS_CI","utf8",3);i[2111]=new _(2111,"UCA1400_SPANISH_NOPAD_AS_CS","utf8",3);i[2112]=new _(2112,"UCA1400_SWEDISH_AI_CI","utf8",3);i[2113]=new _(2113,"UCA1400_SWEDISH_AI_CS","utf8",3);i[2114]=new _(2114,"UCA1400_SWEDISH_AS_CI","utf8",3);i[2115]=new _(2115,"UCA1400_SWEDISH_AS_CS","utf8",3);i[2116]=new _(2116,"UCA1400_SWEDISH_NOPAD_AI_CI","utf8",3);i[2117]=new _(2117,"UCA1400_SWEDISH_NOPAD_AI_CS","utf8",3);i[2118]=new _(2118,"UCA1400_SWEDISH_NOPAD_AS_CI","utf8",3);i[2119]=new _(2119,"UCA1400_SWEDISH_NOPAD_AS_CS","utf8",3);i[2120]=new _(2120,"UCA1400_TURKISH_AI_CI","utf8",3);i[2121]=new _(2121,"UCA1400_TURKISH_AI_CS","utf8",3);i[2122]=new _(2122,"UCA1400_TURKISH_AS_CI","utf8",3);i[2123]=new _(2123,"UCA1400_TURKISH_AS_CS","utf8",3);i[2124]=new _(2124,"UCA1400_TURKISH_NOPAD_AI_CI","utf8",3);i[2125]=new _(2125,"UCA1400_TURKISH_NOPAD_AI_CS","utf8",3);i[2126]=new _(2126,"UCA1400_TURKISH_NOPAD_AS_CI","utf8",3);i[2127]=new _(2127,"UCA1400_TURKISH_NOPAD_AS_CS","utf8",3);i[2128]=new _(2128,"UCA1400_CZECH_AI_CI","utf8",3);i[2129]=new _(2129,"UCA1400_CZECH_AI_CS","utf8",3);i[2130]=new _(2130,"UCA1400_CZECH_AS_CI","utf8",3);i[2131]=new _(2131,"UCA1400_CZECH_AS_CS","utf8",3);i[2132]=new _(2132,"UCA1400_CZECH_NOPAD_AI_CI","utf8",3);i[2133]=new _(2133,"UCA1400_CZECH_NOPAD_AI_CS","utf8",3);i[2134]=new _(2134,"UCA1400_CZECH_NOPAD_AS_CI","utf8",3);i[2135]=new _(2135,"UCA1400_CZECH_NOPAD_AS_CS","utf8",3);i[2136]=new _(2136,"UCA1400_DANISH_AI_CI","utf8",3);i[2137]=new _(2137,"UCA1400_DANISH_AI_CS","utf8",3);i[2138]=new _(2138,"UCA1400_DANISH_AS_CI","utf8",3);i[2139]=new _(2139,"UCA1400_DANISH_AS_CS","utf8",3);i[2140]=new _(2140,"UCA1400_DANISH_NOPAD_AI_CI","utf8",3);i[2141]=new _(2141,"UCA1400_DANISH_NOPAD_AI_CS","utf8",3);i[2142]=new _(2142,"UCA1400_DANISH_NOPAD_AS_CI","utf8",3);i[2143]=new _(2143,"UCA1400_DANISH_NOPAD_AS_CS","utf8",3);i[2144]=new _(2144,"UCA1400_LITHUANIAN_AI_CI","utf8",3);i[2145]=new _(2145,"UCA1400_LITHUANIAN_AI_CS","utf8",3);i[2146]=new _(2146,"UCA1400_LITHUANIAN_AS_CI","utf8",3);i[2147]=new _(2147,"UCA1400_LITHUANIAN_AS_CS","utf8",3);i[2148]=new _(2148,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf8",3);i[2149]=new _(2149,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf8",3);i[2150]=new _(2150,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf8",3);i[2151]=new _(2151,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf8",3);i[2152]=new _(2152,"UCA1400_SLOVAK_AI_CI","utf8",3);i[2153]=new _(2153,"UCA1400_SLOVAK_AI_CS","utf8",3);i[2154]=new _(2154,"UCA1400_SLOVAK_AS_CI","utf8",3);i[2155]=new _(2155,"UCA1400_SLOVAK_AS_CS","utf8",3);i[2156]=new _(2156,"UCA1400_SLOVAK_NOPAD_AI_CI","utf8",3);i[2157]=new _(2157,"UCA1400_SLOVAK_NOPAD_AI_CS","utf8",3);i[2158]=new _(2158,"UCA1400_SLOVAK_NOPAD_AS_CI","utf8",3);i[2159]=new _(2159,"UCA1400_SLOVAK_NOPAD_AS_CS","utf8",3);i[2160]=new _(2160,"UCA1400_SPANISH2_AI_CI","utf8",3);i[2161]=new _(2161,"UCA1400_SPANISH2_AI_CS","utf8",3);i[2162]=new _(2162,"UCA1400_SPANISH2_AS_CI","utf8",3);i[2163]=new _(2163,"UCA1400_SPANISH2_AS_CS","utf8",3);i[2164]=new _(2164,"UCA1400_SPANISH2_NOPAD_AI_CI","utf8",3);i[2165]=new _(2165,"UCA1400_SPANISH2_NOPAD_AI_CS","utf8",3);i[2166]=new _(2166,"UCA1400_SPANISH2_NOPAD_AS_CI","utf8",3);i[2167]=new _(2167,"UCA1400_SPANISH2_NOPAD_AS_CS","utf8",3);i[2168]=new _(2168,"UCA1400_ROMAN_AI_CI","utf8",3);i[2169]=new _(2169,"UCA1400_ROMAN_AI_CS","utf8",3);i[2170]=new _(2170,"UCA1400_ROMAN_AS_CI","utf8",3);i[2171]=new _(2171,"UCA1400_ROMAN_AS_CS","utf8",3);i[2172]=new _(2172,"UCA1400_ROMAN_NOPAD_AI_CI","utf8",3);i[2173]=new _(2173,"UCA1400_ROMAN_NOPAD_AI_CS","utf8",3);i[2174]=new _(2174,"UCA1400_ROMAN_NOPAD_AS_CI","utf8",3);i[2175]=new _(2175,"UCA1400_ROMAN_NOPAD_AS_CS","utf8",3);i[2176]=new _(2176,"UCA1400_PERSIAN_AI_CI","utf8",3);i[2177]=new _(2177,"UCA1400_PERSIAN_AI_CS","utf8",3);i[2178]=new _(2178,"UCA1400_PERSIAN_AS_CI","utf8",3);i[2179]=new _(2179,"UCA1400_PERSIAN_AS_CS","utf8",3);i[2180]=new _(2180,"UCA1400_PERSIAN_NOPAD_AI_CI","utf8",3);i[2181]=new _(2181,"UCA1400_PERSIAN_NOPAD_AI_CS","utf8",3);i[2182]=new _(2182,"UCA1400_PERSIAN_NOPAD_AS_CI","utf8",3);i[2183]=new _(2183,"UCA1400_PERSIAN_NOPAD_AS_CS","utf8",3);i[2184]=new _(2184,"UCA1400_ESPERANTO_AI_CI","utf8",3);i[2185]=new _(2185,"UCA1400_ESPERANTO_AI_CS","utf8",3);i[2186]=new _(2186,"UCA1400_ESPERANTO_AS_CI","utf8",3);i[2187]=new _(2187,"UCA1400_ESPERANTO_AS_CS","utf8",3);i[2188]=new _(2188,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf8",3);i[2189]=new _(2189,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf8",3);i[2190]=new _(2190,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf8",3);i[2191]=new _(2191,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf8",3);i[2192]=new _(2192,"UCA1400_HUNGARIAN_AI_CI","utf8",3);i[2193]=new _(2193,"UCA1400_HUNGARIAN_AI_CS","utf8",3);i[2194]=new _(2194,"UCA1400_HUNGARIAN_AS_CI","utf8",3);i[2195]=new _(2195,"UCA1400_HUNGARIAN_AS_CS","utf8",3);i[2196]=new _(2196,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf8",3);i[2197]=new _(2197,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf8",3);i[2198]=new _(2198,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf8",3);i[2199]=new _(2199,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf8",3);i[2200]=new _(2200,"UCA1400_SINHALA_AI_CI","utf8",3);i[2201]=new _(2201,"UCA1400_SINHALA_AI_CS","utf8",3);i[2202]=new _(2202,"UCA1400_SINHALA_AS_CI","utf8",3);i[2203]=new _(2203,"UCA1400_SINHALA_AS_CS","utf8",3);i[2204]=new _(2204,"UCA1400_SINHALA_NOPAD_AI_CI","utf8",3);i[2205]=new _(2205,"UCA1400_SINHALA_NOPAD_AI_CS","utf8",3);i[2206]=new _(2206,"UCA1400_SINHALA_NOPAD_AS_CI","utf8",3);i[2207]=new _(2207,"UCA1400_SINHALA_NOPAD_AS_CS","utf8",3);i[2208]=new _(2208,"UCA1400_GERMAN2_AI_CI","utf8",3);i[2209]=new _(2209,"UCA1400_GERMAN2_AI_CS","utf8",3);i[2210]=new _(2210,"UCA1400_GERMAN2_AS_CI","utf8",3);i[2211]=new _(2211,"UCA1400_GERMAN2_AS_CS","utf8",3);i[2212]=new _(2212,"UCA1400_GERMAN2_NOPAD_AI_CI","utf8",3);i[2213]=new _(2213,"UCA1400_GERMAN2_NOPAD_AI_CS","utf8",3);i[2214]=new _(2214,"UCA1400_GERMAN2_NOPAD_AS_CI","utf8",3);i[2215]=new _(2215,"UCA1400_GERMAN2_NOPAD_AS_CS","utf8",3);i[2232]=new _(2232,"UCA1400_VIETNAMESE_AI_CI","utf8",3);i[2233]=new _(2233,"UCA1400_VIETNAMESE_AI_CS","utf8",3);i[2234]=new _(2234,"UCA1400_VIETNAMESE_AS_CI","utf8",3);i[2235]=new _(2235,"UCA1400_VIETNAMESE_AS_CS","utf8",3);i[2236]=new _(2236,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf8",3);i[2237]=new _(2237,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf8",3);i[2238]=new _(2238,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf8",3);i[2239]=new _(2239,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf8",3);i[2240]=new _(2240,"UCA1400_CROATIAN_AI_CI","utf8",3);i[2241]=new _(2241,"UCA1400_CROATIAN_AI_CS","utf8",3);i[2242]=new _(2242,"UCA1400_CROATIAN_AS_CI","utf8",3);i[2243]=new _(2243,"UCA1400_CROATIAN_AS_CS","utf8",3);i[2244]=new _(2244,"UCA1400_CROATIAN_NOPAD_AI_CI","utf8",3);i[2245]=new _(2245,"UCA1400_CROATIAN_NOPAD_AI_CS","utf8",3);i[2246]=new _(2246,"UCA1400_CROATIAN_NOPAD_AS_CI","utf8",3);i[2247]=new _(2247,"UCA1400_CROATIAN_NOPAD_AS_CS","utf8",3);i[2304]=new _(2304,"UCA1400_AI_CI","utf8",4);i[2305]=new _(2305,"UCA1400_AI_CS","utf8",4);i[2306]=new _(2306,"UCA1400_AS_CI","utf8",4);i[2307]=new _(2307,"UCA1400_AS_CS","utf8",4);i[2308]=new _(2308,"UCA1400_NOPAD_AI_CI","utf8",4);i[2309]=new _(2309,"UCA1400_NOPAD_AI_CS","utf8",4);i[2310]=new _(2310,"UCA1400_NOPAD_AS_CI","utf8",4);i[2311]=new _(2311,"UCA1400_NOPAD_AS_CS","utf8",4);i[2312]=new _(2312,"UCA1400_ICELANDIC_AI_CI","utf8",4);i[2313]=new _(2313,"UCA1400_ICELANDIC_AI_CS","utf8",4);i[2314]=new _(2314,"UCA1400_ICELANDIC_AS_CI","utf8",4);i[2315]=new _(2315,"UCA1400_ICELANDIC_AS_CS","utf8",4);i[2316]=new _(2316,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf8",4);i[2317]=new _(2317,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf8",4);i[2318]=new _(2318,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf8",4);i[2319]=new _(2319,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf8",4);i[2320]=new _(2320,"UCA1400_LATVIAN_AI_CI","utf8",4);i[2321]=new _(2321,"UCA1400_LATVIAN_AI_CS","utf8",4);i[2322]=new _(2322,"UCA1400_LATVIAN_AS_CI","utf8",4);i[2323]=new _(2323,"UCA1400_LATVIAN_AS_CS","utf8",4);i[2324]=new _(2324,"UCA1400_LATVIAN_NOPAD_AI_CI","utf8",4);i[2325]=new _(2325,"UCA1400_LATVIAN_NOPAD_AI_CS","utf8",4);i[2326]=new _(2326,"UCA1400_LATVIAN_NOPAD_AS_CI","utf8",4);i[2327]=new _(2327,"UCA1400_LATVIAN_NOPAD_AS_CS","utf8",4);i[2328]=new _(2328,"UCA1400_ROMANIAN_AI_CI","utf8",4);i[2329]=new _(2329,"UCA1400_ROMANIAN_AI_CS","utf8",4);i[2330]=new _(2330,"UCA1400_ROMANIAN_AS_CI","utf8",4);i[2331]=new _(2331,"UCA1400_ROMANIAN_AS_CS","utf8",4);i[2332]=new _(2332,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf8",4);i[2333]=new _(2333,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf8",4);i[2334]=new _(2334,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf8",4);i[2335]=new _(2335,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf8",4);i[2336]=new _(2336,"UCA1400_SLOVENIAN_AI_CI","utf8",4);i[2337]=new _(2337,"UCA1400_SLOVENIAN_AI_CS","utf8",4);i[2338]=new _(2338,"UCA1400_SLOVENIAN_AS_CI","utf8",4);i[2339]=new _(2339,"UCA1400_SLOVENIAN_AS_CS","utf8",4);i[2340]=new _(2340,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf8",4);i[2341]=new _(2341,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf8",4);i[2342]=new _(2342,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf8",4);i[2343]=new _(2343,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf8",4);i[2344]=new _(2344,"UCA1400_POLISH_AI_CI","utf8",4);i[2345]=new _(2345,"UCA1400_POLISH_AI_CS","utf8",4);i[2346]=new _(2346,"UCA1400_POLISH_AS_CI","utf8",4);i[2347]=new _(2347,"UCA1400_POLISH_AS_CS","utf8",4);i[2348]=new _(2348,"UCA1400_POLISH_NOPAD_AI_CI","utf8",4);i[2349]=new _(2349,"UCA1400_POLISH_NOPAD_AI_CS","utf8",4);i[2350]=new _(2350,"UCA1400_POLISH_NOPAD_AS_CI","utf8",4);i[2351]=new _(2351,"UCA1400_POLISH_NOPAD_AS_CS","utf8",4);i[2352]=new _(2352,"UCA1400_ESTONIAN_AI_CI","utf8",4);i[2353]=new _(2353,"UCA1400_ESTONIAN_AI_CS","utf8",4);i[2354]=new _(2354,"UCA1400_ESTONIAN_AS_CI","utf8",4);i[2355]=new _(2355,"UCA1400_ESTONIAN_AS_CS","utf8",4);i[2356]=new _(2356,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf8",4);i[2357]=new _(2357,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf8",4);i[2358]=new _(2358,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf8",4);i[2359]=new _(2359,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf8",4);i[2360]=new _(2360,"UCA1400_SPANISH_AI_CI","utf8",4);i[2361]=new _(2361,"UCA1400_SPANISH_AI_CS","utf8",4);i[2362]=new _(2362,"UCA1400_SPANISH_AS_CI","utf8",4);i[2363]=new _(2363,"UCA1400_SPANISH_AS_CS","utf8",4);i[2364]=new _(2364,"UCA1400_SPANISH_NOPAD_AI_CI","utf8",4);i[2365]=new _(2365,"UCA1400_SPANISH_NOPAD_AI_CS","utf8",4);i[2366]=new _(2366,"UCA1400_SPANISH_NOPAD_AS_CI","utf8",4);i[2367]=new _(2367,"UCA1400_SPANISH_NOPAD_AS_CS","utf8",4);i[2368]=new _(2368,"UCA1400_SWEDISH_AI_CI","utf8",4);i[2369]=new _(2369,"UCA1400_SWEDISH_AI_CS","utf8",4);i[2370]=new _(2370,"UCA1400_SWEDISH_AS_CI","utf8",4);i[2371]=new _(2371,"UCA1400_SWEDISH_AS_CS","utf8",4);i[2372]=new _(2372,"UCA1400_SWEDISH_NOPAD_AI_CI","utf8",4);i[2373]=new _(2373,"UCA1400_SWEDISH_NOPAD_AI_CS","utf8",4);i[2374]=new _(2374,"UCA1400_SWEDISH_NOPAD_AS_CI","utf8",4);i[2375]=new _(2375,"UCA1400_SWEDISH_NOPAD_AS_CS","utf8",4);i[2376]=new _(2376,"UCA1400_TURKISH_AI_CI","utf8",4);i[2377]=new _(2377,"UCA1400_TURKISH_AI_CS","utf8",4);i[2378]=new _(2378,"UCA1400_TURKISH_AS_CI","utf8",4);i[2379]=new _(2379,"UCA1400_TURKISH_AS_CS","utf8",4);i[2380]=new _(2380,"UCA1400_TURKISH_NOPAD_AI_CI","utf8",4);i[2381]=new _(2381,"UCA1400_TURKISH_NOPAD_AI_CS","utf8",4);i[2382]=new _(2382,"UCA1400_TURKISH_NOPAD_AS_CI","utf8",4);i[2383]=new _(2383,"UCA1400_TURKISH_NOPAD_AS_CS","utf8",4);i[2384]=new _(2384,"UCA1400_CZECH_AI_CI","utf8",4);i[2385]=new _(2385,"UCA1400_CZECH_AI_CS","utf8",4);i[2386]=new _(2386,"UCA1400_CZECH_AS_CI","utf8",4);i[2387]=new _(2387,"UCA1400_CZECH_AS_CS","utf8",4);i[2388]=new _(2388,"UCA1400_CZECH_NOPAD_AI_CI","utf8",4);i[2389]=new _(2389,"UCA1400_CZECH_NOPAD_AI_CS","utf8",4);i[2390]=new _(2390,"UCA1400_CZECH_NOPAD_AS_CI","utf8",4);i[2391]=new _(2391,"UCA1400_CZECH_NOPAD_AS_CS","utf8",4);i[2392]=new _(2392,"UCA1400_DANISH_AI_CI","utf8",4);i[2393]=new _(2393,"UCA1400_DANISH_AI_CS","utf8",4);i[2394]=new _(2394,"UCA1400_DANISH_AS_CI","utf8",4);i[2395]=new _(2395,"UCA1400_DANISH_AS_CS","utf8",4);i[2396]=new _(2396,"UCA1400_DANISH_NOPAD_AI_CI","utf8",4);i[2397]=new _(2397,"UCA1400_DANISH_NOPAD_AI_CS","utf8",4);i[2398]=new _(2398,"UCA1400_DANISH_NOPAD_AS_CI","utf8",4);i[2399]=new _(2399,"UCA1400_DANISH_NOPAD_AS_CS","utf8",4);i[2400]=new _(2400,"UCA1400_LITHUANIAN_AI_CI","utf8",4);i[2401]=new _(2401,"UCA1400_LITHUANIAN_AI_CS","utf8",4);i[2402]=new _(2402,"UCA1400_LITHUANIAN_AS_CI","utf8",4);i[2403]=new _(2403,"UCA1400_LITHUANIAN_AS_CS","utf8",4);i[2404]=new _(2404,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf8",4);i[2405]=new _(2405,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf8",4);i[2406]=new _(2406,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf8",4);i[2407]=new _(2407,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf8",4);i[2408]=new _(2408,"UCA1400_SLOVAK_AI_CI","utf8",4);i[2409]=new _(2409,"UCA1400_SLOVAK_AI_CS","utf8",4);i[2410]=new _(2410,"UCA1400_SLOVAK_AS_CI","utf8",4);i[2411]=new _(2411,"UCA1400_SLOVAK_AS_CS","utf8",4);i[2412]=new _(2412,"UCA1400_SLOVAK_NOPAD_AI_CI","utf8",4);i[2413]=new _(2413,"UCA1400_SLOVAK_NOPAD_AI_CS","utf8",4);i[2414]=new _(2414,"UCA1400_SLOVAK_NOPAD_AS_CI","utf8",4);i[2415]=new _(2415,"UCA1400_SLOVAK_NOPAD_AS_CS","utf8",4);i[2416]=new _(2416,"UCA1400_SPANISH2_AI_CI","utf8",4);i[2417]=new _(2417,"UCA1400_SPANISH2_AI_CS","utf8",4);i[2418]=new _(2418,"UCA1400_SPANISH2_AS_CI","utf8",4);i[2419]=new _(2419,"UCA1400_SPANISH2_AS_CS","utf8",4);i[2420]=new _(2420,"UCA1400_SPANISH2_NOPAD_AI_CI","utf8",4);i[2421]=new _(2421,"UCA1400_SPANISH2_NOPAD_AI_CS","utf8",4);i[2422]=new _(2422,"UCA1400_SPANISH2_NOPAD_AS_CI","utf8",4);i[2423]=new _(2423,"UCA1400_SPANISH2_NOPAD_AS_CS","utf8",4);i[2424]=new _(2424,"UCA1400_ROMAN_AI_CI","utf8",4);i[2425]=new _(2425,"UCA1400_ROMAN_AI_CS","utf8",4);i[2426]=new _(2426,"UCA1400_ROMAN_AS_CI","utf8",4);i[2427]=new _(2427,"UCA1400_ROMAN_AS_CS","utf8",4);i[2428]=new _(2428,"UCA1400_ROMAN_NOPAD_AI_CI","utf8",4);i[2429]=new _(2429,"UCA1400_ROMAN_NOPAD_AI_CS","utf8",4);i[2430]=new _(2430,"UCA1400_ROMAN_NOPAD_AS_CI","utf8",4);i[2431]=new _(2431,"UCA1400_ROMAN_NOPAD_AS_CS","utf8",4);i[2432]=new _(2432,"UCA1400_PERSIAN_AI_CI","utf8",4);i[2433]=new _(2433,"UCA1400_PERSIAN_AI_CS","utf8",4);i[2434]=new _(2434,"UCA1400_PERSIAN_AS_CI","utf8",4);i[2435]=new _(2435,"UCA1400_PERSIAN_AS_CS","utf8",4);i[2436]=new _(2436,"UCA1400_PERSIAN_NOPAD_AI_CI","utf8",4);i[2437]=new _(2437,"UCA1400_PERSIAN_NOPAD_AI_CS","utf8",4);i[2438]=new _(2438,"UCA1400_PERSIAN_NOPAD_AS_CI","utf8",4);i[2439]=new _(2439,"UCA1400_PERSIAN_NOPAD_AS_CS","utf8",4);i[2440]=new _(2440,"UCA1400_ESPERANTO_AI_CI","utf8",4);i[2441]=new _(2441,"UCA1400_ESPERANTO_AI_CS","utf8",4);i[2442]=new _(2442,"UCA1400_ESPERANTO_AS_CI","utf8",4);i[2443]=new _(2443,"UCA1400_ESPERANTO_AS_CS","utf8",4);i[2444]=new _(2444,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf8",4);i[2445]=new _(2445,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf8",4);i[2446]=new _(2446,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf8",4);i[2447]=new _(2447,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf8",4);i[2448]=new _(2448,"UCA1400_HUNGARIAN_AI_CI","utf8",4);i[2449]=new _(2449,"UCA1400_HUNGARIAN_AI_CS","utf8",4);i[2450]=new _(2450,"UCA1400_HUNGARIAN_AS_CI","utf8",4);i[2451]=new _(2451,"UCA1400_HUNGARIAN_AS_CS","utf8",4);i[2452]=new _(2452,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf8",4);i[2453]=new _(2453,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf8",4);i[2454]=new _(2454,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf8",4);i[2455]=new _(2455,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf8",4);i[2456]=new _(2456,"UCA1400_SINHALA_AI_CI","utf8",4);i[2457]=new _(2457,"UCA1400_SINHALA_AI_CS","utf8",4);i[2458]=new _(2458,"UCA1400_SINHALA_AS_CI","utf8",4);i[2459]=new _(2459,"UCA1400_SINHALA_AS_CS","utf8",4);i[2460]=new _(2460,"UCA1400_SINHALA_NOPAD_AI_CI","utf8",4);i[2461]=new _(2461,"UCA1400_SINHALA_NOPAD_AI_CS","utf8",4);i[2462]=new _(2462,"UCA1400_SINHALA_NOPAD_AS_CI","utf8",4);i[2463]=new _(2463,"UCA1400_SINHALA_NOPAD_AS_CS","utf8",4);i[2464]=new _(2464,"UCA1400_GERMAN2_AI_CI","utf8",4);i[2465]=new _(2465,"UCA1400_GERMAN2_AI_CS","utf8",4);i[2466]=new _(2466,"UCA1400_GERMAN2_AS_CI","utf8",4);i[2467]=new _(2467,"UCA1400_GERMAN2_AS_CS","utf8",4);i[2468]=new _(2468,"UCA1400_GERMAN2_NOPAD_AI_CI","utf8",4);i[2469]=new _(2469,"UCA1400_GERMAN2_NOPAD_AI_CS","utf8",4);i[2470]=new _(2470,"UCA1400_GERMAN2_NOPAD_AS_CI","utf8",4);i[2471]=new _(2471,"UCA1400_GERMAN2_NOPAD_AS_CS","utf8",4);i[2488]=new _(2488,"UCA1400_VIETNAMESE_AI_CI","utf8",4);i[2489]=new _(2489,"UCA1400_VIETNAMESE_AI_CS","utf8",4);i[2490]=new _(2490,"UCA1400_VIETNAMESE_AS_CI","utf8",4);i[2491]=new _(2491,"UCA1400_VIETNAMESE_AS_CS","utf8",4);i[2492]=new _(2492,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf8",4);i[2493]=new _(2493,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf8",4);i[2494]=new _(2494,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf8",4);i[2495]=new _(2495,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf8",4);i[2496]=new _(2496,"UCA1400_CROATIAN_AI_CI","utf8",4);i[2497]=new _(2497,"UCA1400_CROATIAN_AI_CS","utf8",4);i[2498]=new _(2498,"UCA1400_CROATIAN_AS_CI","utf8",4);i[2499]=new _(2499,"UCA1400_CROATIAN_AS_CS","utf8",4);i[2500]=new _(2500,"UCA1400_CROATIAN_NOPAD_AI_CI","utf8",4);i[2501]=new _(2501,"UCA1400_CROATIAN_NOPAD_AI_CS","utf8",4);i[2502]=new _(2502,"UCA1400_CROATIAN_NOPAD_AS_CI","utf8",4);i[2503]=new _(2503,"UCA1400_CROATIAN_NOPAD_AS_CS","utf8",4);i[2560]=new _(2560,"UCA1400_AI_CI","ucs2",2);i[2561]=new _(2561,"UCA1400_AI_CS","ucs2",2);i[2562]=new _(2562,"UCA1400_AS_CI","ucs2",2);i[2563]=new _(2563,"UCA1400_AS_CS","ucs2",2);i[2564]=new _(2564,"UCA1400_NOPAD_AI_CI","ucs2",2);i[2565]=new _(2565,"UCA1400_NOPAD_AI_CS","ucs2",2);i[2566]=new _(2566,"UCA1400_NOPAD_AS_CI","ucs2",2);i[2567]=new _(2567,"UCA1400_NOPAD_AS_CS","ucs2",2);i[2568]=new _(2568,"UCA1400_ICELANDIC_AI_CI","ucs2",2);i[2569]=new _(2569,"UCA1400_ICELANDIC_AI_CS","ucs2",2);i[2570]=new _(2570,"UCA1400_ICELANDIC_AS_CI","ucs2",2);i[2571]=new _(2571,"UCA1400_ICELANDIC_AS_CS","ucs2",2);i[2572]=new _(2572,"UCA1400_ICELANDIC_NOPAD_AI_CI","ucs2",2);i[2573]=new _(2573,"UCA1400_ICELANDIC_NOPAD_AI_CS","ucs2",2);i[2574]=new _(2574,"UCA1400_ICELANDIC_NOPAD_AS_CI","ucs2",2);i[2575]=new _(2575,"UCA1400_ICELANDIC_NOPAD_AS_CS","ucs2",2);i[2576]=new _(2576,"UCA1400_LATVIAN_AI_CI","ucs2",2);i[2577]=new _(2577,"UCA1400_LATVIAN_AI_CS","ucs2",2);i[2578]=new _(2578,"UCA1400_LATVIAN_AS_CI","ucs2",2);i[2579]=new _(2579,"UCA1400_LATVIAN_AS_CS","ucs2",2);i[2580]=new _(2580,"UCA1400_LATVIAN_NOPAD_AI_CI","ucs2",2);i[2581]=new _(2581,"UCA1400_LATVIAN_NOPAD_AI_CS","ucs2",2);i[2582]=new _(2582,"UCA1400_LATVIAN_NOPAD_AS_CI","ucs2",2);i[2583]=new _(2583,"UCA1400_LATVIAN_NOPAD_AS_CS","ucs2",2);i[2584]=new _(2584,"UCA1400_ROMANIAN_AI_CI","ucs2",2);i[2585]=new _(2585,"UCA1400_ROMANIAN_AI_CS","ucs2",2);i[2586]=new _(2586,"UCA1400_ROMANIAN_AS_CI","ucs2",2);i[2587]=new _(2587,"UCA1400_ROMANIAN_AS_CS","ucs2",2);i[2588]=new _(2588,"UCA1400_ROMANIAN_NOPAD_AI_CI","ucs2",2);i[2589]=new _(2589,"UCA1400_ROMANIAN_NOPAD_AI_CS","ucs2",2);i[2590]=new _(2590,"UCA1400_ROMANIAN_NOPAD_AS_CI","ucs2",2);i[2591]=new _(2591,"UCA1400_ROMANIAN_NOPAD_AS_CS","ucs2",2);i[2592]=new _(2592,"UCA1400_SLOVENIAN_AI_CI","ucs2",2);i[2593]=new _(2593,"UCA1400_SLOVENIAN_AI_CS","ucs2",2);i[2594]=new _(2594,"UCA1400_SLOVENIAN_AS_CI","ucs2",2);i[2595]=new _(2595,"UCA1400_SLOVENIAN_AS_CS","ucs2",2);i[2596]=new _(2596,"UCA1400_SLOVENIAN_NOPAD_AI_CI","ucs2",2);i[2597]=new _(2597,"UCA1400_SLOVENIAN_NOPAD_AI_CS","ucs2",2);i[2598]=new _(2598,"UCA1400_SLOVENIAN_NOPAD_AS_CI","ucs2",2);i[2599]=new _(2599,"UCA1400_SLOVENIAN_NOPAD_AS_CS","ucs2",2);i[2600]=new _(2600,"UCA1400_POLISH_AI_CI","ucs2",2);i[2601]=new _(2601,"UCA1400_POLISH_AI_CS","ucs2",2);i[2602]=new _(2602,"UCA1400_POLISH_AS_CI","ucs2",2);i[2603]=new _(2603,"UCA1400_POLISH_AS_CS","ucs2",2);i[2604]=new _(2604,"UCA1400_POLISH_NOPAD_AI_CI","ucs2",2);i[2605]=new _(2605,"UCA1400_POLISH_NOPAD_AI_CS","ucs2",2);i[2606]=new _(2606,"UCA1400_POLISH_NOPAD_AS_CI","ucs2",2);i[2607]=new _(2607,"UCA1400_POLISH_NOPAD_AS_CS","ucs2",2);i[2608]=new _(2608,"UCA1400_ESTONIAN_AI_CI","ucs2",2);i[2609]=new _(2609,"UCA1400_ESTONIAN_AI_CS","ucs2",2);i[2610]=new _(2610,"UCA1400_ESTONIAN_AS_CI","ucs2",2);i[2611]=new _(2611,"UCA1400_ESTONIAN_AS_CS","ucs2",2);i[2612]=new _(2612,"UCA1400_ESTONIAN_NOPAD_AI_CI","ucs2",2);i[2613]=new _(2613,"UCA1400_ESTONIAN_NOPAD_AI_CS","ucs2",2);i[2614]=new _(2614,"UCA1400_ESTONIAN_NOPAD_AS_CI","ucs2",2);i[2615]=new _(2615,"UCA1400_ESTONIAN_NOPAD_AS_CS","ucs2",2);i[2616]=new _(2616,"UCA1400_SPANISH_AI_CI","ucs2",2);i[2617]=new _(2617,"UCA1400_SPANISH_AI_CS","ucs2",2);i[2618]=new _(2618,"UCA1400_SPANISH_AS_CI","ucs2",2);i[2619]=new _(2619,"UCA1400_SPANISH_AS_CS","ucs2",2);i[2620]=new _(2620,"UCA1400_SPANISH_NOPAD_AI_CI","ucs2",2);i[2621]=new _(2621,"UCA1400_SPANISH_NOPAD_AI_CS","ucs2",2);i[2622]=new _(2622,"UCA1400_SPANISH_NOPAD_AS_CI","ucs2",2);i[2623]=new _(2623,"UCA1400_SPANISH_NOPAD_AS_CS","ucs2",2);i[2624]=new _(2624,"UCA1400_SWEDISH_AI_CI","ucs2",2);i[2625]=new _(2625,"UCA1400_SWEDISH_AI_CS","ucs2",2);i[2626]=new _(2626,"UCA1400_SWEDISH_AS_CI","ucs2",2);i[2627]=new _(2627,"UCA1400_SWEDISH_AS_CS","ucs2",2);i[2628]=new _(2628,"UCA1400_SWEDISH_NOPAD_AI_CI","ucs2",2);i[2629]=new _(2629,"UCA1400_SWEDISH_NOPAD_AI_CS","ucs2",2);i[2630]=new _(2630,"UCA1400_SWEDISH_NOPAD_AS_CI","ucs2",2);i[2631]=new _(2631,"UCA1400_SWEDISH_NOPAD_AS_CS","ucs2",2);i[2632]=new _(2632,"UCA1400_TURKISH_AI_CI","ucs2",2);i[2633]=new _(2633,"UCA1400_TURKISH_AI_CS","ucs2",2);i[2634]=new _(2634,"UCA1400_TURKISH_AS_CI","ucs2",2);i[2635]=new _(2635,"UCA1400_TURKISH_AS_CS","ucs2",2);i[2636]=new _(2636,"UCA1400_TURKISH_NOPAD_AI_CI","ucs2",2);i[2637]=new _(2637,"UCA1400_TURKISH_NOPAD_AI_CS","ucs2",2);i[2638]=new _(2638,"UCA1400_TURKISH_NOPAD_AS_CI","ucs2",2);i[2639]=new _(2639,"UCA1400_TURKISH_NOPAD_AS_CS","ucs2",2);i[2640]=new _(2640,"UCA1400_CZECH_AI_CI","ucs2",2);i[2641]=new _(2641,"UCA1400_CZECH_AI_CS","ucs2",2);i[2642]=new _(2642,"UCA1400_CZECH_AS_CI","ucs2",2);i[2643]=new _(2643,"UCA1400_CZECH_AS_CS","ucs2",2);i[2644]=new _(2644,"UCA1400_CZECH_NOPAD_AI_CI","ucs2",2);i[2645]=new _(2645,"UCA1400_CZECH_NOPAD_AI_CS","ucs2",2);i[2646]=new _(2646,"UCA1400_CZECH_NOPAD_AS_CI","ucs2",2);i[2647]=new _(2647,"UCA1400_CZECH_NOPAD_AS_CS","ucs2",2);i[2648]=new _(2648,"UCA1400_DANISH_AI_CI","ucs2",2);i[2649]=new _(2649,"UCA1400_DANISH_AI_CS","ucs2",2);i[2650]=new _(2650,"UCA1400_DANISH_AS_CI","ucs2",2);i[2651]=new _(2651,"UCA1400_DANISH_AS_CS","ucs2",2);i[2652]=new _(2652,"UCA1400_DANISH_NOPAD_AI_CI","ucs2",2);i[2653]=new _(2653,"UCA1400_DANISH_NOPAD_AI_CS","ucs2",2);i[2654]=new _(2654,"UCA1400_DANISH_NOPAD_AS_CI","ucs2",2);i[2655]=new _(2655,"UCA1400_DANISH_NOPAD_AS_CS","ucs2",2);i[2656]=new _(2656,"UCA1400_LITHUANIAN_AI_CI","ucs2",2);i[2657]=new _(2657,"UCA1400_LITHUANIAN_AI_CS","ucs2",2);i[2658]=new _(2658,"UCA1400_LITHUANIAN_AS_CI","ucs2",2);i[2659]=new _(2659,"UCA1400_LITHUANIAN_AS_CS","ucs2",2);i[2660]=new _(2660,"UCA1400_LITHUANIAN_NOPAD_AI_CI","ucs2",2);i[2661]=new _(2661,"UCA1400_LITHUANIAN_NOPAD_AI_CS","ucs2",2);i[2662]=new _(2662,"UCA1400_LITHUANIAN_NOPAD_AS_CI","ucs2",2);i[2663]=new _(2663,"UCA1400_LITHUANIAN_NOPAD_AS_CS","ucs2",2);i[2664]=new _(2664,"UCA1400_SLOVAK_AI_CI","ucs2",2);i[2665]=new _(2665,"UCA1400_SLOVAK_AI_CS","ucs2",2);i[2666]=new _(2666,"UCA1400_SLOVAK_AS_CI","ucs2",2);i[2667]=new _(2667,"UCA1400_SLOVAK_AS_CS","ucs2",2);i[2668]=new _(2668,"UCA1400_SLOVAK_NOPAD_AI_CI","ucs2",2);i[2669]=new _(2669,"UCA1400_SLOVAK_NOPAD_AI_CS","ucs2",2);i[2670]=new _(2670,"UCA1400_SLOVAK_NOPAD_AS_CI","ucs2",2);i[2671]=new _(2671,"UCA1400_SLOVAK_NOPAD_AS_CS","ucs2",2);i[2672]=new _(2672,"UCA1400_SPANISH2_AI_CI","ucs2",2);i[2673]=new _(2673,"UCA1400_SPANISH2_AI_CS","ucs2",2);i[2674]=new _(2674,"UCA1400_SPANISH2_AS_CI","ucs2",2);i[2675]=new _(2675,"UCA1400_SPANISH2_AS_CS","ucs2",2);i[2676]=new _(2676,"UCA1400_SPANISH2_NOPAD_AI_CI","ucs2",2);i[2677]=new _(2677,"UCA1400_SPANISH2_NOPAD_AI_CS","ucs2",2);i[2678]=new _(2678,"UCA1400_SPANISH2_NOPAD_AS_CI","ucs2",2);i[2679]=new _(2679,"UCA1400_SPANISH2_NOPAD_AS_CS","ucs2",2);i[2680]=new _(2680,"UCA1400_ROMAN_AI_CI","ucs2",2);i[2681]=new _(2681,"UCA1400_ROMAN_AI_CS","ucs2",2);i[2682]=new _(2682,"UCA1400_ROMAN_AS_CI","ucs2",2);i[2683]=new _(2683,"UCA1400_ROMAN_AS_CS","ucs2",2);i[2684]=new _(2684,"UCA1400_ROMAN_NOPAD_AI_CI","ucs2",2);i[2685]=new _(2685,"UCA1400_ROMAN_NOPAD_AI_CS","ucs2",2);i[2686]=new _(2686,"UCA1400_ROMAN_NOPAD_AS_CI","ucs2",2);i[2687]=new _(2687,"UCA1400_ROMAN_NOPAD_AS_CS","ucs2",2);i[2688]=new _(2688,"UCA1400_PERSIAN_AI_CI","ucs2",2);i[2689]=new _(2689,"UCA1400_PERSIAN_AI_CS","ucs2",2);i[2690]=new _(2690,"UCA1400_PERSIAN_AS_CI","ucs2",2);i[2691]=new _(2691,"UCA1400_PERSIAN_AS_CS","ucs2",2);i[2692]=new _(2692,"UCA1400_PERSIAN_NOPAD_AI_CI","ucs2",2);i[2693]=new _(2693,"UCA1400_PERSIAN_NOPAD_AI_CS","ucs2",2);i[2694]=new _(2694,"UCA1400_PERSIAN_NOPAD_AS_CI","ucs2",2);i[2695]=new _(2695,"UCA1400_PERSIAN_NOPAD_AS_CS","ucs2",2);i[2696]=new _(2696,"UCA1400_ESPERANTO_AI_CI","ucs2",2);i[2697]=new _(2697,"UCA1400_ESPERANTO_AI_CS","ucs2",2);i[2698]=new _(2698,"UCA1400_ESPERANTO_AS_CI","ucs2",2);i[2699]=new _(2699,"UCA1400_ESPERANTO_AS_CS","ucs2",2);i[2700]=new _(2700,"UCA1400_ESPERANTO_NOPAD_AI_CI","ucs2",2);i[2701]=new _(2701,"UCA1400_ESPERANTO_NOPAD_AI_CS","ucs2",2);i[2702]=new _(2702,"UCA1400_ESPERANTO_NOPAD_AS_CI","ucs2",2);i[2703]=new _(2703,"UCA1400_ESPERANTO_NOPAD_AS_CS","ucs2",2);i[2704]=new _(2704,"UCA1400_HUNGARIAN_AI_CI","ucs2",2);i[2705]=new _(2705,"UCA1400_HUNGARIAN_AI_CS","ucs2",2);i[2706]=new _(2706,"UCA1400_HUNGARIAN_AS_CI","ucs2",2);i[2707]=new _(2707,"UCA1400_HUNGARIAN_AS_CS","ucs2",2);i[2708]=new _(2708,"UCA1400_HUNGARIAN_NOPAD_AI_CI","ucs2",2);i[2709]=new _(2709,"UCA1400_HUNGARIAN_NOPAD_AI_CS","ucs2",2);i[2710]=new _(2710,"UCA1400_HUNGARIAN_NOPAD_AS_CI","ucs2",2);i[2711]=new _(2711,"UCA1400_HUNGARIAN_NOPAD_AS_CS","ucs2",2);i[2712]=new _(2712,"UCA1400_SINHALA_AI_CI","ucs2",2);i[2713]=new _(2713,"UCA1400_SINHALA_AI_CS","ucs2",2);i[2714]=new _(2714,"UCA1400_SINHALA_AS_CI","ucs2",2);i[2715]=new _(2715,"UCA1400_SINHALA_AS_CS","ucs2",2);i[2716]=new _(2716,"UCA1400_SINHALA_NOPAD_AI_CI","ucs2",2);i[2717]=new _(2717,"UCA1400_SINHALA_NOPAD_AI_CS","ucs2",2);i[2718]=new _(2718,"UCA1400_SINHALA_NOPAD_AS_CI","ucs2",2);i[2719]=new _(2719,"UCA1400_SINHALA_NOPAD_AS_CS","ucs2",2);i[2720]=new _(2720,"UCA1400_GERMAN2_AI_CI","ucs2",2);i[2721]=new _(2721,"UCA1400_GERMAN2_AI_CS","ucs2",2);i[2722]=new _(2722,"UCA1400_GERMAN2_AS_CI","ucs2",2);i[2723]=new _(2723,"UCA1400_GERMAN2_AS_CS","ucs2",2);i[2724]=new _(2724,"UCA1400_GERMAN2_NOPAD_AI_CI","ucs2",2);i[2725]=new _(2725,"UCA1400_GERMAN2_NOPAD_AI_CS","ucs2",2);i[2726]=new _(2726,"UCA1400_GERMAN2_NOPAD_AS_CI","ucs2",2);i[2727]=new _(2727,"UCA1400_GERMAN2_NOPAD_AS_CS","ucs2",2);i[2744]=new _(2744,"UCA1400_VIETNAMESE_AI_CI","ucs2",2);i[2745]=new _(2745,"UCA1400_VIETNAMESE_AI_CS","ucs2",2);i[2746]=new _(2746,"UCA1400_VIETNAMESE_AS_CI","ucs2",2);i[2747]=new _(2747,"UCA1400_VIETNAMESE_AS_CS","ucs2",2);i[2748]=new _(2748,"UCA1400_VIETNAMESE_NOPAD_AI_CI","ucs2",2);i[2749]=new _(2749,"UCA1400_VIETNAMESE_NOPAD_AI_CS","ucs2",2);i[2750]=new _(2750,"UCA1400_VIETNAMESE_NOPAD_AS_CI","ucs2",2);i[2751]=new _(2751,"UCA1400_VIETNAMESE_NOPAD_AS_CS","ucs2",2);i[2752]=new _(2752,"UCA1400_CROATIAN_AI_CI","ucs2",2);i[2753]=new _(2753,"UCA1400_CROATIAN_AI_CS","ucs2",2);i[2754]=new _(2754,"UCA1400_CROATIAN_AS_CI","ucs2",2);i[2755]=new _(2755,"UCA1400_CROATIAN_AS_CS","ucs2",2);i[2756]=new _(2756,"UCA1400_CROATIAN_NOPAD_AI_CI","ucs2",2);i[2757]=new _(2757,"UCA1400_CROATIAN_NOPAD_AI_CS","ucs2",2);i[2758]=new _(2758,"UCA1400_CROATIAN_NOPAD_AS_CI","ucs2",2);i[2759]=new _(2759,"UCA1400_CROATIAN_NOPAD_AS_CS","ucs2",2);i[2816]=new _(2816,"UCA1400_AI_CI","utf16",4);i[2817]=new _(2817,"UCA1400_AI_CS","utf16",4);i[2818]=new _(2818,"UCA1400_AS_CI","utf16",4);i[2819]=new _(2819,"UCA1400_AS_CS","utf16",4);i[2820]=new _(2820,"UCA1400_NOPAD_AI_CI","utf16",4);i[2821]=new _(2821,"UCA1400_NOPAD_AI_CS","utf16",4);i[2822]=new _(2822,"UCA1400_NOPAD_AS_CI","utf16",4);i[2823]=new _(2823,"UCA1400_NOPAD_AS_CS","utf16",4);i[2824]=new _(2824,"UCA1400_ICELANDIC_AI_CI","utf16",4);i[2825]=new _(2825,"UCA1400_ICELANDIC_AI_CS","utf16",4);i[2826]=new _(2826,"UCA1400_ICELANDIC_AS_CI","utf16",4);i[2827]=new _(2827,"UCA1400_ICELANDIC_AS_CS","utf16",4);i[2828]=new _(2828,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf16",4);i[2829]=new _(2829,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf16",4);i[2830]=new _(2830,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf16",4);i[2831]=new _(2831,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf16",4);i[2832]=new _(2832,"UCA1400_LATVIAN_AI_CI","utf16",4);i[2833]=new _(2833,"UCA1400_LATVIAN_AI_CS","utf16",4);i[2834]=new _(2834,"UCA1400_LATVIAN_AS_CI","utf16",4);i[2835]=new _(2835,"UCA1400_LATVIAN_AS_CS","utf16",4);i[2836]=new _(2836,"UCA1400_LATVIAN_NOPAD_AI_CI","utf16",4);i[2837]=new _(2837,"UCA1400_LATVIAN_NOPAD_AI_CS","utf16",4);i[2838]=new _(2838,"UCA1400_LATVIAN_NOPAD_AS_CI","utf16",4);i[2839]=new _(2839,"UCA1400_LATVIAN_NOPAD_AS_CS","utf16",4);i[2840]=new _(2840,"UCA1400_ROMANIAN_AI_CI","utf16",4);i[2841]=new _(2841,"UCA1400_ROMANIAN_AI_CS","utf16",4);i[2842]=new _(2842,"UCA1400_ROMANIAN_AS_CI","utf16",4);i[2843]=new _(2843,"UCA1400_ROMANIAN_AS_CS","utf16",4);i[2844]=new _(2844,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf16",4);i[2845]=new _(2845,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf16",4);i[2846]=new _(2846,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf16",4);i[2847]=new _(2847,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf16",4);i[2848]=new _(2848,"UCA1400_SLOVENIAN_AI_CI","utf16",4);i[2849]=new _(2849,"UCA1400_SLOVENIAN_AI_CS","utf16",4);i[2850]=new _(2850,"UCA1400_SLOVENIAN_AS_CI","utf16",4);i[2851]=new _(2851,"UCA1400_SLOVENIAN_AS_CS","utf16",4);i[2852]=new _(2852,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf16",4);i[2853]=new _(2853,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf16",4);i[2854]=new _(2854,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf16",4);i[2855]=new _(2855,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf16",4);i[2856]=new _(2856,"UCA1400_POLISH_AI_CI","utf16",4);i[2857]=new _(2857,"UCA1400_POLISH_AI_CS","utf16",4);i[2858]=new _(2858,"UCA1400_POLISH_AS_CI","utf16",4);i[2859]=new _(2859,"UCA1400_POLISH_AS_CS","utf16",4);i[2860]=new _(2860,"UCA1400_POLISH_NOPAD_AI_CI","utf16",4);i[2861]=new _(2861,"UCA1400_POLISH_NOPAD_AI_CS","utf16",4);i[2862]=new _(2862,"UCA1400_POLISH_NOPAD_AS_CI","utf16",4);i[2863]=new _(2863,"UCA1400_POLISH_NOPAD_AS_CS","utf16",4);i[2864]=new _(2864,"UCA1400_ESTONIAN_AI_CI","utf16",4);i[2865]=new _(2865,"UCA1400_ESTONIAN_AI_CS","utf16",4);i[2866]=new _(2866,"UCA1400_ESTONIAN_AS_CI","utf16",4);i[2867]=new _(2867,"UCA1400_ESTONIAN_AS_CS","utf16",4);i[2868]=new _(2868,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf16",4);i[2869]=new _(2869,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf16",4);i[2870]=new _(2870,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf16",4);i[2871]=new _(2871,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf16",4);i[2872]=new _(2872,"UCA1400_SPANISH_AI_CI","utf16",4);i[2873]=new _(2873,"UCA1400_SPANISH_AI_CS","utf16",4);i[2874]=new _(2874,"UCA1400_SPANISH_AS_CI","utf16",4);i[2875]=new _(2875,"UCA1400_SPANISH_AS_CS","utf16",4);i[2876]=new _(2876,"UCA1400_SPANISH_NOPAD_AI_CI","utf16",4);i[2877]=new _(2877,"UCA1400_SPANISH_NOPAD_AI_CS","utf16",4);i[2878]=new _(2878,"UCA1400_SPANISH_NOPAD_AS_CI","utf16",4);i[2879]=new _(2879,"UCA1400_SPANISH_NOPAD_AS_CS","utf16",4);i[2880]=new _(2880,"UCA1400_SWEDISH_AI_CI","utf16",4);i[2881]=new _(2881,"UCA1400_SWEDISH_AI_CS","utf16",4);i[2882]=new _(2882,"UCA1400_SWEDISH_AS_CI","utf16",4);i[2883]=new _(2883,"UCA1400_SWEDISH_AS_CS","utf16",4);i[2884]=new _(2884,"UCA1400_SWEDISH_NOPAD_AI_CI","utf16",4);i[2885]=new _(2885,"UCA1400_SWEDISH_NOPAD_AI_CS","utf16",4);i[2886]=new _(2886,"UCA1400_SWEDISH_NOPAD_AS_CI","utf16",4);i[2887]=new _(2887,"UCA1400_SWEDISH_NOPAD_AS_CS","utf16",4);i[2888]=new _(2888,"UCA1400_TURKISH_AI_CI","utf16",4);i[2889]=new _(2889,"UCA1400_TURKISH_AI_CS","utf16",4);i[2890]=new _(2890,"UCA1400_TURKISH_AS_CI","utf16",4);i[2891]=new _(2891,"UCA1400_TURKISH_AS_CS","utf16",4);i[2892]=new _(2892,"UCA1400_TURKISH_NOPAD_AI_CI","utf16",4);i[2893]=new _(2893,"UCA1400_TURKISH_NOPAD_AI_CS","utf16",4);i[2894]=new _(2894,"UCA1400_TURKISH_NOPAD_AS_CI","utf16",4);i[2895]=new _(2895,"UCA1400_TURKISH_NOPAD_AS_CS","utf16",4);i[2896]=new _(2896,"UCA1400_CZECH_AI_CI","utf16",4);i[2897]=new _(2897,"UCA1400_CZECH_AI_CS","utf16",4);i[2898]=new _(2898,"UCA1400_CZECH_AS_CI","utf16",4);i[2899]=new _(2899,"UCA1400_CZECH_AS_CS","utf16",4);i[2900]=new _(2900,"UCA1400_CZECH_NOPAD_AI_CI","utf16",4);i[2901]=new _(2901,"UCA1400_CZECH_NOPAD_AI_CS","utf16",4);i[2902]=new _(2902,"UCA1400_CZECH_NOPAD_AS_CI","utf16",4);i[2903]=new _(2903,"UCA1400_CZECH_NOPAD_AS_CS","utf16",4);i[2904]=new _(2904,"UCA1400_DANISH_AI_CI","utf16",4);i[2905]=new _(2905,"UCA1400_DANISH_AI_CS","utf16",4);i[2906]=new _(2906,"UCA1400_DANISH_AS_CI","utf16",4);i[2907]=new _(2907,"UCA1400_DANISH_AS_CS","utf16",4);i[2908]=new _(2908,"UCA1400_DANISH_NOPAD_AI_CI","utf16",4);i[2909]=new _(2909,"UCA1400_DANISH_NOPAD_AI_CS","utf16",4);i[2910]=new _(2910,"UCA1400_DANISH_NOPAD_AS_CI","utf16",4);i[2911]=new _(2911,"UCA1400_DANISH_NOPAD_AS_CS","utf16",4);i[2912]=new _(2912,"UCA1400_LITHUANIAN_AI_CI","utf16",4);i[2913]=new _(2913,"UCA1400_LITHUANIAN_AI_CS","utf16",4);i[2914]=new _(2914,"UCA1400_LITHUANIAN_AS_CI","utf16",4);i[2915]=new _(2915,"UCA1400_LITHUANIAN_AS_CS","utf16",4);i[2916]=new _(2916,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf16",4);i[2917]=new _(2917,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf16",4);i[2918]=new _(2918,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf16",4);i[2919]=new _(2919,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf16",4);i[2920]=new _(2920,"UCA1400_SLOVAK_AI_CI","utf16",4);i[2921]=new _(2921,"UCA1400_SLOVAK_AI_CS","utf16",4);i[2922]=new _(2922,"UCA1400_SLOVAK_AS_CI","utf16",4);i[2923]=new _(2923,"UCA1400_SLOVAK_AS_CS","utf16",4);i[2924]=new _(2924,"UCA1400_SLOVAK_NOPAD_AI_CI","utf16",4);i[2925]=new _(2925,"UCA1400_SLOVAK_NOPAD_AI_CS","utf16",4);i[2926]=new _(2926,"UCA1400_SLOVAK_NOPAD_AS_CI","utf16",4);i[2927]=new _(2927,"UCA1400_SLOVAK_NOPAD_AS_CS","utf16",4);i[2928]=new _(2928,"UCA1400_SPANISH2_AI_CI","utf16",4);i[2929]=new _(2929,"UCA1400_SPANISH2_AI_CS","utf16",4);i[2930]=new _(2930,"UCA1400_SPANISH2_AS_CI","utf16",4);i[2931]=new _(2931,"UCA1400_SPANISH2_AS_CS","utf16",4);i[2932]=new _(2932,"UCA1400_SPANISH2_NOPAD_AI_CI","utf16",4);i[2933]=new _(2933,"UCA1400_SPANISH2_NOPAD_AI_CS","utf16",4);i[2934]=new _(2934,"UCA1400_SPANISH2_NOPAD_AS_CI","utf16",4);i[2935]=new _(2935,"UCA1400_SPANISH2_NOPAD_AS_CS","utf16",4);i[2936]=new _(2936,"UCA1400_ROMAN_AI_CI","utf16",4);i[2937]=new _(2937,"UCA1400_ROMAN_AI_CS","utf16",4);i[2938]=new _(2938,"UCA1400_ROMAN_AS_CI","utf16",4);i[2939]=new _(2939,"UCA1400_ROMAN_AS_CS","utf16",4);i[2940]=new _(2940,"UCA1400_ROMAN_NOPAD_AI_CI","utf16",4);i[2941]=new _(2941,"UCA1400_ROMAN_NOPAD_AI_CS","utf16",4);i[2942]=new _(2942,"UCA1400_ROMAN_NOPAD_AS_CI","utf16",4);i[2943]=new _(2943,"UCA1400_ROMAN_NOPAD_AS_CS","utf16",4);i[2944]=new _(2944,"UCA1400_PERSIAN_AI_CI","utf16",4);i[2945]=new _(2945,"UCA1400_PERSIAN_AI_CS","utf16",4);i[2946]=new _(2946,"UCA1400_PERSIAN_AS_CI","utf16",4);i[2947]=new _(2947,"UCA1400_PERSIAN_AS_CS","utf16",4);i[2948]=new _(2948,"UCA1400_PERSIAN_NOPAD_AI_CI","utf16",4);i[2949]=new _(2949,"UCA1400_PERSIAN_NOPAD_AI_CS","utf16",4);i[2950]=new _(2950,"UCA1400_PERSIAN_NOPAD_AS_CI","utf16",4);i[2951]=new _(2951,"UCA1400_PERSIAN_NOPAD_AS_CS","utf16",4);i[2952]=new _(2952,"UCA1400_ESPERANTO_AI_CI","utf16",4);i[2953]=new _(2953,"UCA1400_ESPERANTO_AI_CS","utf16",4);i[2954]=new _(2954,"UCA1400_ESPERANTO_AS_CI","utf16",4);i[2955]=new _(2955,"UCA1400_ESPERANTO_AS_CS","utf16",4);i[2956]=new _(2956,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf16",4);i[2957]=new _(2957,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf16",4);i[2958]=new _(2958,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf16",4);i[2959]=new _(2959,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf16",4);i[2960]=new _(2960,"UCA1400_HUNGARIAN_AI_CI","utf16",4);i[2961]=new _(2961,"UCA1400_HUNGARIAN_AI_CS","utf16",4);i[2962]=new _(2962,"UCA1400_HUNGARIAN_AS_CI","utf16",4);i[2963]=new _(2963,"UCA1400_HUNGARIAN_AS_CS","utf16",4);i[2964]=new _(2964,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf16",4);i[2965]=new _(2965,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf16",4);i[2966]=new _(2966,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf16",4);i[2967]=new _(2967,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf16",4);i[2968]=new _(2968,"UCA1400_SINHALA_AI_CI","utf16",4);i[2969]=new _(2969,"UCA1400_SINHALA_AI_CS","utf16",4);i[2970]=new _(2970,"UCA1400_SINHALA_AS_CI","utf16",4);i[2971]=new _(2971,"UCA1400_SINHALA_AS_CS","utf16",4);i[2972]=new _(2972,"UCA1400_SINHALA_NOPAD_AI_CI","utf16",4);i[2973]=new _(2973,"UCA1400_SINHALA_NOPAD_AI_CS","utf16",4);i[2974]=new _(2974,"UCA1400_SINHALA_NOPAD_AS_CI","utf16",4);i[2975]=new _(2975,"UCA1400_SINHALA_NOPAD_AS_CS","utf16",4);i[2976]=new _(2976,"UCA1400_GERMAN2_AI_CI","utf16",4);i[2977]=new _(2977,"UCA1400_GERMAN2_AI_CS","utf16",4);i[2978]=new _(2978,"UCA1400_GERMAN2_AS_CI","utf16",4);i[2979]=new _(2979,"UCA1400_GERMAN2_AS_CS","utf16",4);i[2980]=new _(2980,"UCA1400_GERMAN2_NOPAD_AI_CI","utf16",4);i[2981]=new _(2981,"UCA1400_GERMAN2_NOPAD_AI_CS","utf16",4);i[2982]=new _(2982,"UCA1400_GERMAN2_NOPAD_AS_CI","utf16",4);i[2983]=new _(2983,"UCA1400_GERMAN2_NOPAD_AS_CS","utf16",4);i[3e3]=new _(3e3,"UCA1400_VIETNAMESE_AI_CI","utf16",4);i[3001]=new _(3001,"UCA1400_VIETNAMESE_AI_CS","utf16",4);i[3002]=new _(3002,"UCA1400_VIETNAMESE_AS_CI","utf16",4);i[3003]=new _(3003,"UCA1400_VIETNAMESE_AS_CS","utf16",4);i[3004]=new _(3004,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf16",4);i[3005]=new _(3005,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf16",4);i[3006]=new _(3006,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf16",4);i[3007]=new _(3007,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf16",4);i[3008]=new _(3008,"UCA1400_CROATIAN_AI_CI","utf16",4);i[3009]=new _(3009,"UCA1400_CROATIAN_AI_CS","utf16",4);i[3010]=new _(3010,"UCA1400_CROATIAN_AS_CI","utf16",4);i[3011]=new _(3011,"UCA1400_CROATIAN_AS_CS","utf16",4);i[3012]=new _(3012,"UCA1400_CROATIAN_NOPAD_AI_CI","utf16",4);i[3013]=new _(3013,"UCA1400_CROATIAN_NOPAD_AI_CS","utf16",4);i[3014]=new _(3014,"UCA1400_CROATIAN_NOPAD_AS_CI","utf16",4);i[3015]=new _(3015,"UCA1400_CROATIAN_NOPAD_AS_CS","utf16",4);i[3072]=new _(3072,"UCA1400_AI_CI","utf32",4);i[3073]=new _(3073,"UCA1400_AI_CS","utf32",4);i[3074]=new _(3074,"UCA1400_AS_CI","utf32",4);i[3075]=new _(3075,"UCA1400_AS_CS","utf32",4);i[3076]=new _(3076,"UCA1400_NOPAD_AI_CI","utf32",4);i[3077]=new _(3077,"UCA1400_NOPAD_AI_CS","utf32",4);i[3078]=new _(3078,"UCA1400_NOPAD_AS_CI","utf32",4);i[3079]=new _(3079,"UCA1400_NOPAD_AS_CS","utf32",4);i[3080]=new _(3080,"UCA1400_ICELANDIC_AI_CI","utf32",4);i[3081]=new _(3081,"UCA1400_ICELANDIC_AI_CS","utf32",4);i[3082]=new _(3082,"UCA1400_ICELANDIC_AS_CI","utf32",4);i[3083]=new _(3083,"UCA1400_ICELANDIC_AS_CS","utf32",4);i[3084]=new _(3084,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf32",4);i[3085]=new _(3085,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf32",4);i[3086]=new _(3086,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf32",4);i[3087]=new _(3087,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf32",4);i[3088]=new _(3088,"UCA1400_LATVIAN_AI_CI","utf32",4);i[3089]=new _(3089,"UCA1400_LATVIAN_AI_CS","utf32",4);i[3090]=new _(3090,"UCA1400_LATVIAN_AS_CI","utf32",4);i[3091]=new _(3091,"UCA1400_LATVIAN_AS_CS","utf32",4);i[3092]=new _(3092,"UCA1400_LATVIAN_NOPAD_AI_CI","utf32",4);i[3093]=new _(3093,"UCA1400_LATVIAN_NOPAD_AI_CS","utf32",4);i[3094]=new _(3094,"UCA1400_LATVIAN_NOPAD_AS_CI","utf32",4);i[3095]=new _(3095,"UCA1400_LATVIAN_NOPAD_AS_CS","utf32",4);i[3096]=new _(3096,"UCA1400_ROMANIAN_AI_CI","utf32",4);i[3097]=new _(3097,"UCA1400_ROMANIAN_AI_CS","utf32",4);i[3098]=new _(3098,"UCA1400_ROMANIAN_AS_CI","utf32",4);i[3099]=new _(3099,"UCA1400_ROMANIAN_AS_CS","utf32",4);i[3100]=new _(3100,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf32",4);i[3101]=new _(3101,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf32",4);i[3102]=new _(3102,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf32",4);i[3103]=new _(3103,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf32",4);i[3104]=new _(3104,"UCA1400_SLOVENIAN_AI_CI","utf32",4);i[3105]=new _(3105,"UCA1400_SLOVENIAN_AI_CS","utf32",4);i[3106]=new _(3106,"UCA1400_SLOVENIAN_AS_CI","utf32",4);i[3107]=new _(3107,"UCA1400_SLOVENIAN_AS_CS","utf32",4);i[3108]=new _(3108,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf32",4);i[3109]=new _(3109,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf32",4);i[3110]=new _(3110,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf32",4);i[3111]=new _(3111,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf32",4);i[3112]=new _(3112,"UCA1400_POLISH_AI_CI","utf32",4);i[3113]=new _(3113,"UCA1400_POLISH_AI_CS","utf32",4);i[3114]=new _(3114,"UCA1400_POLISH_AS_CI","utf32",4);i[3115]=new _(3115,"UCA1400_POLISH_AS_CS","utf32",4);i[3116]=new _(3116,"UCA1400_POLISH_NOPAD_AI_CI","utf32",4);i[3117]=new _(3117,"UCA1400_POLISH_NOPAD_AI_CS","utf32",4);i[3118]=new _(3118,"UCA1400_POLISH_NOPAD_AS_CI","utf32",4);i[3119]=new _(3119,"UCA1400_POLISH_NOPAD_AS_CS","utf32",4);i[3120]=new _(3120,"UCA1400_ESTONIAN_AI_CI","utf32",4);i[3121]=new _(3121,"UCA1400_ESTONIAN_AI_CS","utf32",4);i[3122]=new _(3122,"UCA1400_ESTONIAN_AS_CI","utf32",4);i[3123]=new _(3123,"UCA1400_ESTONIAN_AS_CS","utf32",4);i[3124]=new _(3124,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf32",4);i[3125]=new _(3125,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf32",4);i[3126]=new _(3126,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf32",4);i[3127]=new _(3127,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf32",4);i[3128]=new _(3128,"UCA1400_SPANISH_AI_CI","utf32",4);i[3129]=new _(3129,"UCA1400_SPANISH_AI_CS","utf32",4);i[3130]=new _(3130,"UCA1400_SPANISH_AS_CI","utf32",4);i[3131]=new _(3131,"UCA1400_SPANISH_AS_CS","utf32",4);i[3132]=new _(3132,"UCA1400_SPANISH_NOPAD_AI_CI","utf32",4);i[3133]=new _(3133,"UCA1400_SPANISH_NOPAD_AI_CS","utf32",4);i[3134]=new _(3134,"UCA1400_SPANISH_NOPAD_AS_CI","utf32",4);i[3135]=new _(3135,"UCA1400_SPANISH_NOPAD_AS_CS","utf32",4);i[3136]=new _(3136,"UCA1400_SWEDISH_AI_CI","utf32",4);i[3137]=new _(3137,"UCA1400_SWEDISH_AI_CS","utf32",4);i[3138]=new _(3138,"UCA1400_SWEDISH_AS_CI","utf32",4);i[3139]=new _(3139,"UCA1400_SWEDISH_AS_CS","utf32",4);i[3140]=new _(3140,"UCA1400_SWEDISH_NOPAD_AI_CI","utf32",4);i[3141]=new _(3141,"UCA1400_SWEDISH_NOPAD_AI_CS","utf32",4);i[3142]=new _(3142,"UCA1400_SWEDISH_NOPAD_AS_CI","utf32",4);i[3143]=new _(3143,"UCA1400_SWEDISH_NOPAD_AS_CS","utf32",4);i[3144]=new _(3144,"UCA1400_TURKISH_AI_CI","utf32",4);i[3145]=new _(3145,"UCA1400_TURKISH_AI_CS","utf32",4);i[3146]=new _(3146,"UCA1400_TURKISH_AS_CI","utf32",4);i[3147]=new _(3147,"UCA1400_TURKISH_AS_CS","utf32",4);i[3148]=new _(3148,"UCA1400_TURKISH_NOPAD_AI_CI","utf32",4);i[3149]=new _(3149,"UCA1400_TURKISH_NOPAD_AI_CS","utf32",4);i[3150]=new _(3150,"UCA1400_TURKISH_NOPAD_AS_CI","utf32",4);i[3151]=new _(3151,"UCA1400_TURKISH_NOPAD_AS_CS","utf32",4);i[3152]=new _(3152,"UCA1400_CZECH_AI_CI","utf32",4);i[3153]=new _(3153,"UCA1400_CZECH_AI_CS","utf32",4);i[3154]=new _(3154,"UCA1400_CZECH_AS_CI","utf32",4);i[3155]=new _(3155,"UCA1400_CZECH_AS_CS","utf32",4);i[3156]=new _(3156,"UCA1400_CZECH_NOPAD_AI_CI","utf32",4);i[3157]=new _(3157,"UCA1400_CZECH_NOPAD_AI_CS","utf32",4);i[3158]=new _(3158,"UCA1400_CZECH_NOPAD_AS_CI","utf32",4);i[3159]=new _(3159,"UCA1400_CZECH_NOPAD_AS_CS","utf32",4);i[3160]=new _(3160,"UCA1400_DANISH_AI_CI","utf32",4);i[3161]=new _(3161,"UCA1400_DANISH_AI_CS","utf32",4);i[3162]=new _(3162,"UCA1400_DANISH_AS_CI","utf32",4);i[3163]=new _(3163,"UCA1400_DANISH_AS_CS","utf32",4);i[3164]=new _(3164,"UCA1400_DANISH_NOPAD_AI_CI","utf32",4);i[3165]=new _(3165,"UCA1400_DANISH_NOPAD_AI_CS","utf32",4);i[3166]=new _(3166,"UCA1400_DANISH_NOPAD_AS_CI","utf32",4);i[3167]=new _(3167,"UCA1400_DANISH_NOPAD_AS_CS","utf32",4);i[3168]=new _(3168,"UCA1400_LITHUANIAN_AI_CI","utf32",4);i[3169]=new _(3169,"UCA1400_LITHUANIAN_AI_CS","utf32",4);i[3170]=new _(3170,"UCA1400_LITHUANIAN_AS_CI","utf32",4);i[3171]=new _(3171,"UCA1400_LITHUANIAN_AS_CS","utf32",4);i[3172]=new _(3172,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf32",4);i[3173]=new _(3173,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf32",4);i[3174]=new _(3174,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf32",4);i[3175]=new _(3175,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf32",4);i[3176]=new _(3176,"UCA1400_SLOVAK_AI_CI","utf32",4);i[3177]=new _(3177,"UCA1400_SLOVAK_AI_CS","utf32",4);i[3178]=new _(3178,"UCA1400_SLOVAK_AS_CI","utf32",4);i[3179]=new _(3179,"UCA1400_SLOVAK_AS_CS","utf32",4);i[3180]=new _(3180,"UCA1400_SLOVAK_NOPAD_AI_CI","utf32",4);i[3181]=new _(3181,"UCA1400_SLOVAK_NOPAD_AI_CS","utf32",4);i[3182]=new _(3182,"UCA1400_SLOVAK_NOPAD_AS_CI","utf32",4);i[3183]=new _(3183,"UCA1400_SLOVAK_NOPAD_AS_CS","utf32",4);i[3184]=new _(3184,"UCA1400_SPANISH2_AI_CI","utf32",4);i[3185]=new _(3185,"UCA1400_SPANISH2_AI_CS","utf32",4);i[3186]=new _(3186,"UCA1400_SPANISH2_AS_CI","utf32",4);i[3187]=new _(3187,"UCA1400_SPANISH2_AS_CS","utf32",4);i[3188]=new _(3188,"UCA1400_SPANISH2_NOPAD_AI_CI","utf32",4);i[3189]=new _(3189,"UCA1400_SPANISH2_NOPAD_AI_CS","utf32",4);i[3190]=new _(3190,"UCA1400_SPANISH2_NOPAD_AS_CI","utf32",4);i[3191]=new _(3191,"UCA1400_SPANISH2_NOPAD_AS_CS","utf32",4);i[3192]=new _(3192,"UCA1400_ROMAN_AI_CI","utf32",4);i[3193]=new _(3193,"UCA1400_ROMAN_AI_CS","utf32",4);i[3194]=new _(3194,"UCA1400_ROMAN_AS_CI","utf32",4);i[3195]=new _(3195,"UCA1400_ROMAN_AS_CS","utf32",4);i[3196]=new _(3196,"UCA1400_ROMAN_NOPAD_AI_CI","utf32",4);i[3197]=new _(3197,"UCA1400_ROMAN_NOPAD_AI_CS","utf32",4);i[3198]=new _(3198,"UCA1400_ROMAN_NOPAD_AS_CI","utf32",4);i[3199]=new _(3199,"UCA1400_ROMAN_NOPAD_AS_CS","utf32",4);i[3200]=new _(3200,"UCA1400_PERSIAN_AI_CI","utf32",4);i[3201]=new _(3201,"UCA1400_PERSIAN_AI_CS","utf32",4);i[3202]=new _(3202,"UCA1400_PERSIAN_AS_CI","utf32",4);i[3203]=new _(3203,"UCA1400_PERSIAN_AS_CS","utf32",4);i[3204]=new _(3204,"UCA1400_PERSIAN_NOPAD_AI_CI","utf32",4);i[3205]=new _(3205,"UCA1400_PERSIAN_NOPAD_AI_CS","utf32",4);i[3206]=new _(3206,"UCA1400_PERSIAN_NOPAD_AS_CI","utf32",4);i[3207]=new _(3207,"UCA1400_PERSIAN_NOPAD_AS_CS","utf32",4);i[3208]=new _(3208,"UCA1400_ESPERANTO_AI_CI","utf32",4);i[3209]=new _(3209,"UCA1400_ESPERANTO_AI_CS","utf32",4);i[3210]=new _(3210,"UCA1400_ESPERANTO_AS_CI","utf32",4);i[3211]=new _(3211,"UCA1400_ESPERANTO_AS_CS","utf32",4);i[3212]=new _(3212,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf32",4);i[3213]=new _(3213,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf32",4);i[3214]=new _(3214,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf32",4);i[3215]=new _(3215,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf32",4);i[3216]=new _(3216,"UCA1400_HUNGARIAN_AI_CI","utf32",4);i[3217]=new _(3217,"UCA1400_HUNGARIAN_AI_CS","utf32",4);i[3218]=new _(3218,"UCA1400_HUNGARIAN_AS_CI","utf32",4);i[3219]=new _(3219,"UCA1400_HUNGARIAN_AS_CS","utf32",4);i[3220]=new _(3220,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf32",4);i[3221]=new _(3221,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf32",4);i[3222]=new _(3222,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf32",4);i[3223]=new _(3223,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf32",4);i[3224]=new _(3224,"UCA1400_SINHALA_AI_CI","utf32",4);i[3225]=new _(3225,"UCA1400_SINHALA_AI_CS","utf32",4);i[3226]=new _(3226,"UCA1400_SINHALA_AS_CI","utf32",4);i[3227]=new _(3227,"UCA1400_SINHALA_AS_CS","utf32",4);i[3228]=new _(3228,"UCA1400_SINHALA_NOPAD_AI_CI","utf32",4);i[3229]=new _(3229,"UCA1400_SINHALA_NOPAD_AI_CS","utf32",4);i[3230]=new _(3230,"UCA1400_SINHALA_NOPAD_AS_CI","utf32",4);i[3231]=new _(3231,"UCA1400_SINHALA_NOPAD_AS_CS","utf32",4);i[3232]=new _(3232,"UCA1400_GERMAN2_AI_CI","utf32",4);i[3233]=new _(3233,"UCA1400_GERMAN2_AI_CS","utf32",4);i[3234]=new _(3234,"UCA1400_GERMAN2_AS_CI","utf32",4);i[3235]=new _(3235,"UCA1400_GERMAN2_AS_CS","utf32",4);i[3236]=new _(3236,"UCA1400_GERMAN2_NOPAD_AI_CI","utf32",4);i[3237]=new _(3237,"UCA1400_GERMAN2_NOPAD_AI_CS","utf32",4);i[3238]=new _(3238,"UCA1400_GERMAN2_NOPAD_AS_CI","utf32",4);i[3239]=new _(3239,"UCA1400_GERMAN2_NOPAD_AS_CS","utf32",4);i[3256]=new _(3256,"UCA1400_VIETNAMESE_AI_CI","utf32",4);i[3257]=new _(3257,"UCA1400_VIETNAMESE_AI_CS","utf32",4);i[3258]=new _(3258,"UCA1400_VIETNAMESE_AS_CI","utf32",4);i[3259]=new _(3259,"UCA1400_VIETNAMESE_AS_CS","utf32",4);i[3260]=new _(3260,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf32",4);i[3261]=new _(3261,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf32",4);i[3262]=new _(3262,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf32",4);i[3263]=new _(3263,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf32",4);i[3264]=new _(3264,"UCA1400_CROATIAN_AI_CI","utf32",4);i[3265]=new _(3265,"UCA1400_CROATIAN_AI_CS","utf32",4);i[3266]=new _(3266,"UCA1400_CROATIAN_AS_CI","utf32",4);i[3267]=new _(3267,"UCA1400_CROATIAN_AS_CS","utf32",4);i[3268]=new _(3268,"UCA1400_CROATIAN_NOPAD_AI_CI","utf32",4);i[3269]=new _(3269,"UCA1400_CROATIAN_NOPAD_AI_CS","utf32",4);i[3270]=new _(3270,"UCA1400_CROATIAN_NOPAD_AS_CI","utf32",4);i[3271]=new _(3271,"UCA1400_CROATIAN_NOPAD_AS_CS","utf32",4);for(let E=0;E<i.length;E++){let e=i[E];e&&(_.prototype[e.name]=e)}T.big5=i[1];T.dec8=i[3];T.cp850=i[4];T.hp8=i[6];T.koi8r=i[7];T.latin1=i[8];T.latin2=i[9];T.swe7=i[10];T.ascii=i[11];T.ujis=i[12];T.sjis=i[13];T.hebrew=i[16];T.tis620=i[18];T.euckr=i[19];T.koi8u=i[22];T.gb2312=i[24];T.greek=i[25];T.cp1250=i[26];T.gbk=i[28];T.latin5=i[30];T.armscii8=i[32];T.utf8=i[33];T.ucs2=i[35];T.cp866=i[36];T.keybcs2=i[37];T.macce=i[38];T.macroman=i[39];T.cp852=i[40];T.latin7=i[41];T.utf8mb4=i[45];T.cp1251=i[51];T.utf16=i[54];T.utf16le=i[56];T.cp1256=i[57];T.cp1257=i[59];T.utf32=i[60];T.binary=i[63];T.geostd8=i[92];T.cp932=i[95];T.eucjpms=i[97];T.gb18030=i[248];var P=_;var Ei=m(require("iconv-lite"),1);var ln=new Set(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),ve=function(E,e){let s=`${E}`;return s.length<e?"0".repeat(e-s.length)+s:s},Os=class E{static writeParam(e,s,t,n){switch(typeof s){case"boolean":e.writeStringAscii(s?"true":"false");break;case"bigint":case"number":e.writeStringAscii(`${s}`);break;case"string":e.writeStringEscapeQuote(s);break;case"object":if(Object.prototype.toString.call(s)==="[object Date]")e.writeStringAscii(E.getLocalDate(s));else if(Buffer.isBuffer(s))e.writeStringAscii("_BINARY '"),e.writeBufferEscape(s),e.writeInt8(39);else if(typeof s.toSqlString=="function")e.writeStringEscapeQuote(String(s.toSqlString()));else if(Array.isArray(s)){t.arrayParenthesis&&e.writeStringAscii("(");for(let o=0;o<s.length;o++)o!==0&&e.writeStringAscii(","),s[o]==null?e.writeStringAscii("NULL"):E.writeParam(e,s[o],t,n);t.arrayParenthesis&&e.writeStringAscii(")")}else if(s.type!=null&&ln.has(s.type)){let o=n.isMariaDB(),a=o&&n.hasMinVersion(10,1,4)||!o&&n.hasMinVersion(5,7,6)?"ST_":"";switch(s.type){case"Point":e.writeStringAscii(a+"PointFromText('POINT("+E.geoPointToString(s.coordinates)+")')");break;case"LineString":e.writeStringAscii(a+"LineFromText('LINESTRING("+E.geoArrayPointToString(s.coordinates)+")')");break;case"Polygon":e.writeStringAscii(a+"PolygonFromText('POLYGON("+E.geoMultiArrayPointToString(s.coordinates)+")')");break;case"MultiPoint":e.writeStringAscii(a+"MULTIPOINTFROMTEXT('MULTIPOINT("+E.geoArrayPointToString(s.coordinates)+")')");break;case"MultiLineString":e.writeStringAscii(a+"MLineFromText('MULTILINESTRING("+E.geoMultiArrayPointToString(s.coordinates)+")')");break;case"MultiPolygon":e.writeStringAscii(a+"MPolyFromText('MULTIPOLYGON("+E.geoMultiPolygonToString(s.coordinates)+")')");break;case"GeometryCollection":e.writeStringAscii(a+"GeomCollFromText('GEOMETRYCOLLECTION("+E.geometricCollectionToString(s.geometries)+")')");break}}else if(String===s.constructor){e.writeStringEscapeQuote(s);break}else if(t.permitSetMultiParamEntries){let o=!0;for(let a in s){let A=s[a];typeof A!="function"&&(o?o=!1:e.writeStringAscii(","),e.writeString("`"+a+"`"),A==null?e.writeStringAscii("=NULL"):(e.writeStringAscii("="),E.writeParam(e,A,t,n)))}o&&e.writeStringEscapeQuote(JSON.stringify(s))}else e.writeStringEscapeQuote(JSON.stringify(s));break}}static geometricCollectionToString(e){if(!e)return"";let s=e.length,t="";for(let n=0;n<s;n++){let o=e[n];switch(n!==0&&(t+=","),o.type){case"Point":t+=`POINT(${E.geoPointToString(o.coordinates)})`;break;case"LineString":t+=`LINESTRING(${E.geoArrayPointToString(o.coordinates)})`;break;case"Polygon":t+=`POLYGON(${E.geoMultiArrayPointToString(o.coordinates)})`;break;case"MultiPoint":t+=`MULTIPOINT(${E.geoArrayPointToString(o.coordinates)})`;break;case"MultiLineString":t+=`MULTILINESTRING(${E.geoMultiArrayPointToString(o.coordinates)})`;break;case"MultiPolygon":t+=`MULTIPOLYGON(${E.geoMultiPolygonToString(o.coordinates)})`;break}}return t}static geoMultiPolygonToString(e){if(!e)return"";let s=e.length;if(s===0)return"";let t="(";for(let n=0;n<s;n++)n!==0&&(t+=",("),t+=E.geoMultiArrayPointToString(e[n])+")";return t}static geoMultiArrayPointToString(e){if(!e)return"";let s=e.length;if(s===0)return"";let t="(";for(let n=0;n<s;n++)n!==0&&(t+=",("),t+=E.geoArrayPointToString(e[n])+")";return t}static geoArrayPointToString(e){if(!e)return"";let s=e.length;if(s===0)return"";let t="";for(let n=0;n<s;n++)n!==0&&(t+=","),t+=E.geoPointToString(e[n]);return t}static geoPointToString(e){if(!e)return"";let s=isNaN(e[0])?"":e[0],t=isNaN(e[1])?"":e[1];return s+" "+t}static getLocalDate(e){let s=e.getFullYear(),t=e.getMonth()+1,n=e.getDate(),o=e.getHours(),a=e.getMinutes(),A=e.getSeconds(),u=e.getMilliseconds(),h="'"+s+"-"+t+"-"+n+" "+o+":"+a+":"+A;return u===0?h+"'":h+"."+(u<10?"00":u<100?"0":"")+u+"'"}static getFixedFormatDate(e){let s=e.getFullYear(),t=e.getMonth()+1,n=e.getDate(),o=e.getHours(),a=e.getMinutes(),A=e.getSeconds(),u=e.getMilliseconds(),h="'"+ve(s,4)+"-"+ve(t,2)+"-"+ve(n,2)+" "+ve(o,2)+":"+ve(a,2)+":"+ve(A,2);return u>0&&(h+="."+ve(u,3)),h+"'"}},G=Os;var Ft="0123456789ABCDEF".split("");function ie(E,e,s,t,n){let o=[];if(!e)return"";s==null&&(s=0),t==null&&(t=e.length);let a=new Array(16);a[8]=" ";let A=n!==void 0,u=s||0,h=Math.min(A?E.debugLen-n.length:E.debugLen,t-u),l=t-u>h,R,I=0,S=0;if(o.push(`+--------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------------------------------------------------+------------------+
`),A)for(;S<n.length;)I===0&&o.push("| "),R=n[S++]&255,o.push(Ft[R>>>4],Ft[R&15]," "),a[I++]=R>31&&R<127?String.fromCharCode(R):".",I===8&&o.push(" ");for(S=u;S<h+u;)I===0&&o.push("| "),R=e[S]&255,o.push(Ft[R>>>4],Ft[R&15]," "),a[I++]=R>31&&R<127?String.fromCharCode(R):".",I===8&&o.push(" "),I===16&&(o.push("| ",a.join(""),` |
`),I=0),S++;let C=I;if(C>0){if(C<8){for(;C<8;C++)o.push(" "),a[I++]=" ";o.push(" ")}for(;C<16;C++)o.push(" "),a[I++]=" ";o.push("| ",a.join(""),l?` |...
`:` |
`)}else l&&(o[o.length-1]=` |...
`);return o.push(`+--------------------------------------------------+------------------+
`),o.join("")}function ai(E){return Array.from(E,e=>("0"+(e&255).toString(16)).slice(-2)).join("")}function Ht(E,e,s){if(!s||s==="")throw f("Cannot escape empty ID value",N.ER_NULL_ESCAPEID,e,"0A000");if(s.includes("\0"))throw f("Cannot escape ID with null character (u0000)",N.ER_NULL_CHAR_ESCAPEID,e,"0A000");return"`"+s.replace(/`/g,"``")+"`"}function ct(E,e,s){if(s==null)return"NULL";switch(typeof s){case"boolean":return s?"true":"false";case"bigint":case"number":return`${s}`;case"object":if(Object.prototype.toString.call(s)==="[object Date]")return G.getFixedFormatDate(s);if(Buffer.isBuffer(s)){let t;return Buffer.isEncoding(e.collation.charset)?t=s.toString(e.collation.charset,0,s.length):t=Ei.default.decode(s,e.collation.charset),"_binary'"+lt(t)+"'"}else{if(typeof s.toSqlString=="function")return"'"+lt(String(s.toSqlString()))+"'";if(Array.isArray(s)){let t=E.arrayParenthesis?"(":"";for(let n=0;n<s.length;n++)n!==0&&(t+=","),t+=ct(E,e,s[n]);return E.arrayParenthesis&&(t+=")"),t}else if(s.type!=null&&["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].includes(s.type)){let t=e&&(e.isMariaDB()&&e.hasMinVersion(10,1,4)||!e.isMariaDB()&&e.hasMinVersion(5,7,6))?"ST_":"";switch(s.type){case"Point":return t+"PointFromText('POINT("+G.geoPointToString(s.coordinates)+")')";case"LineString":return t+"LineFromText('LINESTRING("+G.geoArrayPointToString(s.coordinates)+")')";case"Polygon":return t+"PolygonFromText('POLYGON("+G.geoMultiArrayPointToString(s.coordinates)+")')";case"MultiPoint":return t+"MULTIPOINTFROMTEXT('MULTIPOINT("+G.geoArrayPointToString(s.coordinates)+")')";case"MultiLineString":return t+"MLineFromText('MULTILINESTRING("+G.geoMultiArrayPointToString(s.coordinates)+")')";case"MultiPolygon":return t+"MPolyFromText('MULTIPOLYGON("+G.geoMultiPolygonToString(s.coordinates)+")')";case"GeometryCollection":return t+"GeomCollFromText('GEOMETRYCOLLECTION("+G.geometricCollectionToString(s.geometries)+")')"}}else if(E.permitSetMultiParamEntries){let t="",n=!0;for(let o in s){let a=s[o];typeof a!="function"&&(n?n=!1:t+=",",t+="`"+o+"`=",t+=this.escape(a))}return t===""?"'"+lt(JSON.stringify(s))+"'":t}else return"'"+lt(JSON.stringify(s))+"'"}default:return"'"+lt(s)+"'"}}var cn={"\0":"\\0","'":"\\'",'"':'\\"',"\b":"\\b","\n":"\\n","\r":"\\r"," ":"\\t","":"\\Z","\\":"\\\\"},oi=/[\000\032"'\\\b\n\r\t]/g,lt=E=>{let e=0,s="",t;for(;t=oi.exec(E);)s+=E.substring(e,t.index),s+=cn[t[0]],e=oi.lastIndex;return e===0?E:(e<E.length&&(s+=E.substring(e)),s)};var ds=class{constructor(e,s,t,n,o){this.unexpectedPacket=e,this.opts=n,this.receiveQueue=s,this.info=o,this.out=t,this.header=Buffer.allocUnsafe(4),this.headerLen=0,this.packetLen=null,this.remainingLen=null,this.parts=null,this.partsTotalLen=0,this._cmd=null,this.changeEncoding(this.opts.collation?this.opts.collation:P.fromIndex(224)),this.changeDebug(this.opts.debug),this.opts.on("collation",this.changeEncoding.bind(this)),this.opts.on("debug",this.changeDebug.bind(this))}changeEncoding(e){this.encoding=e.charset,this.packet=Buffer.isEncoding(this.encoding)?new _i(this.encoding):new ni(this.encoding)}changeDebug(e){this._debug=e,this.receivePacket=e?this.receivePacketDebug:this.receivePacketBasic}receivePacketDebug(e){let s=this._cmd;if((!s||!s.onPacketReceive)&&(s=this.currentCmd()),this.header[0]=this.packetLen,this.header[1]=this.packetLen>>8,this.header[2]=this.packetLen>>16,this.header[3]=this.sequenceNo,e&&this.opts.logger.network(`<== conn:${this.info.threadId?this.info.threadId:-1} ${s?s.onPacketReceive?s.constructor.name+"."+s.onPacketReceive.name:s.constructor.name:"no command"} (${e.pos},${e.end})
${ie(this.opts,e.buf,e.pos,e.end,this.header)}`),!s){this.unexpectedPacket(e);return}s.sequenceNo=this.sequenceNo,s.onPacketReceive(e,this.out,this.opts,this.info),s.onPacketReceive||(this._cmd=null,this.receiveQueue.shift())}receivePacketBasic(e){let s=this._cmd;if((!s||!s.onPacketReceive)&&(s=this.currentCmd(),!s)){this.unexpectedPacket(e);return}s.sequenceNo=this.sequenceNo,s.onPacketReceive(e,this.out,this.opts,this.info),s.onPacketReceive||(this._cmd=null,this.receiveQueue.shift())}resetHeader(){this.remainingLen=null,this.headerLen=0}currentCmd(){let e;for(;e=this.receiveQueue.peek();){if(e.onPacketReceive)return this._cmd=e,e;this.receiveQueue.shift()}return this._cmd=null,null}onData(e){let s=0,t,n=e.length;do{if(this.remainingLen)t=this.remainingLen;else if(this.headerLen===0&&n-s>=4)this.packetLen=e[s]+(e[s+1]<<8)+(e[s+2]<<16),this.sequenceNo=e[s+3],s+=4,t=this.packetLen;else for(t=null;n-s>0;)if(this.header[this.headerLen++]=e[s++],this.headerLen===4){this.packetLen=this.header[0]+(this.header[1]<<8)+(this.header[2]<<16),this.sequenceNo=this.header[3],t=this.packetLen;break}if(t)if(n-s>=t){if(s+=t,this.parts){if(this.parts.push(e.subarray(s-t,s)),this.partsTotalLen+=t,this.packetLen<16777215){let o=Buffer.concat(this.parts,this.partsTotalLen);this.parts=null,this.receivePacket(this.packet.update(o,0,this.partsTotalLen))}}else if(this.packetLen<16777215){this.receivePacket(this.packet.update(e,s-t,s));let o=this._cmd,a=this.packet;for(;s+4<n;)if(this.packetLen=e[s]+(e[s+1]<<8)+(e[s+2]<<16),this.sequenceNo=e[s+3],s+=4,n-s>=this.packetLen)if(s+=this.packetLen,this.packetLen<16777215)!this._debug&&o&&o.onPacketReceive&&e[s-this.packetLen]<254?(o.sequenceNo=this.sequenceNo,o.onPacketReceive(a.update(e,s-this.packetLen,s),this.out,this.opts,this.info)):(this.receivePacket(a.update(e,s-this.packetLen,s)),o=this._cmd);else{this.parts=[e.subarray(s-this.packetLen,s)],this.partsTotalLen=this.packetLen;break}else{let A=e.subarray(s,n);this.parts?(this.parts.push(A),this.partsTotalLen+=n-s):(this.parts=[A],this.partsTotalLen=n-s),this.remainingLen=this.packetLen-(n-s);return}}else this.parts=[e.subarray(s-t,s)],this.partsTotalLen=t;this.resetHeader()}else{let o=e.subarray(s,n);this.parts?(this.parts.push(o),this.partsTotalLen+=n-s):(this.parts=[o],this.partsTotalLen=n-s),this.remainingLen=t-(n-s);return}else if(t===0&&this.parts){this.parts.push(e.subarray(s-t,s));let o=Buffer.concat(this.parts,this.partsTotalLen);this.receivePacket(this.packet.update(o,0,this.partsTotalLen)),this.parts=null,this.resetHeader()}}while(s<n)}},ui=ds;var Vt=m(require("iconv-lite"),1);var Nn={isHead:E=>E>=161&&E<=254,length:(E,e,s)=>{if(e+1>=s)return 0;let t=E[e+1];return t>=64&&t<=126||t>=161&&t<=254?2:0}},In={isHead:E=>E>=129&&E<=254,length:(E,e,s)=>{if(e+1>=s)return 0;let t=E[e+1];return t>=64&&t<=126||t>=128&&t<=254?2:0}},ci={isHead:E=>E>=129&&E<=159||E>=224&&E<=252,length:(E,e,s)=>{if(e+1>=s)return 0;let t=E[e+1];return t>=64&&t<=126||t>=128&&t<=252?2:0}},Rn=ci,hi=E=>E>=129&&E<=254,Sn=E=>E>=64&&E<=126||E>=128&&E<=254,li=E=>E>=48&&E<=57,fn={isHead:hi,length:(E,e,s)=>e+1>=s?0:Sn(E[e+1])?2:e+3<s&&li(E[e+1])&&hi(E[e+2])&&li(E[e+3])?4:0},Cn={big5:Nn,gbk:In,sjis:ci,cp932:Rn,gb18030:fn},Ni=E=>Cn[E]||null;var he=39,Nt=34,It=0,le=92,tt=256,yt=16384,kt=131072,xt=1048576,Re=16777219,Ii=/[\000\032"'\\\n\r\t]/g,ps=class{constructor(e,s){this.opts=e,this.info=s,this.pos=4,this.markPos=-1,this.bufContainDataAfterMark=!1,this.cmdLength=0,this.buf=Buffer.allocUnsafe(tt),this.maxAllowedPacket=e.maxAllowedPacket||16777216,this.maxPacketLength=Math.min(Re,this.maxAllowedPacket+4),this.changeEncoding(this.opts.collation?this.opts.collation:P.fromIndex(224)),this.changeDebug(this.opts.debug),this.opts.on("collation",this.changeEncoding.bind(this)),this.opts.on("debug",this.changeDebug.bind(this))}changeEncoding(e){this.encoding=e.charset,this.encoding==="utf8"?(this.writeString=this.writeDefaultBufferString,this.encodeString=this.encodeNodeString,this.writeLengthEncodedString=this.writeDefaultBufferLengthEncodedString,this.writeStringEscapeQuote=this.writeUtf8StringEscapeQuote):Buffer.isEncoding(this.encoding)?(this.writeString=this.writeDefaultBufferString,this.encodeString=this.encodeNodeString,this.writeLengthEncodedString=this.writeDefaultBufferLengthEncodedString,this.writeStringEscapeQuote=this.writeDefaultStringEscapeQuote):(this.writeString=this.writeDefaultIconvString,this.encodeString=this.encodeIconvString,this.writeLengthEncodedString=this.writeDefaultIconvLengthEncodedString,this.writeStringEscapeQuote=this.writeDefaultStringEscapeQuote);let s=Ni(this.encoding);this.writeBufferEscape=s?this.writeBufferEscapeMb.bind(this,s):this.writeBufferEscapeFast}changeDebug(e){this.debug=e,this.flushBuffer=e?this.flushBufferDebug:this.flushBufferBasic,this.fastFlush=e?this.fastFlushDebug:this.fastFlushBasic}setStream(e){this.stream=e}growBuffer(e){let s;if(e+this.pos<yt?s=yt:e+this.pos<kt?s=kt:e+this.pos<xt?s=xt:this.bufContainDataAfterMark?s=e+this.pos:s=Re,e+this.pos>s&&this.markPos!==-1)return this.flushBufferStopAtMark(),e+this.pos<=this.buf.length?void 0:this.growBuffer(e);let t=Buffer.allocUnsafe(s);this.buf.copy(t,0,0,this.pos),this.buf=t}mark(){this.markPos=this.pos}isMarked(){return this.markPos!==-1}hasFlushed(){return this.cmd.sequenceNo!==-1}hasDataAfterMark(){return this.bufContainDataAfterMark}bufIsAfterMaxPacketLength(){return this.pos>this.maxPacketLength}resetMark(){if(this.pos=this.markPos,this.markPos=-1,this.bufContainDataAfterMark){let e=Buffer.allocUnsafe(this.pos-4);return this.buf.copy(e,0,4,this.pos),this.cmd.sequenceNo=-1,this.cmd.compressSequenceNo=-1,this.bufContainDataAfterMark=!1,e}return null}flush(){this.flushBuffer(!0,0),this.buf=Buffer.allocUnsafe(tt),this.cmd.sequenceNo=-1,this.cmd.compressSequenceNo=-1,this.cmdLength=0,this.markPos=-1}flushPacket(){this.flushBuffer(!1,0),this.buf=Buffer.allocUnsafe(tt),this.cmdLength=0,this.markPos=-1}startPacket(e){this.cmd=e,this.pos=4}writeInt8(e){if(this.pos+1>=this.buf.length){let s=Buffer.allocUnsafe(1);s[0]=e,this.writeBuffer(s,0,1);return}this.buf[this.pos++]=e}writeInt16(e){if(this.pos+2>=this.buf.length){let s=Buffer.allocUnsafe(2);s[0]=e,s[1]=e>>>8,this.writeBuffer(s,0,2);return}this.buf[this.pos]=e,this.buf[this.pos+1]=e>>8,this.pos+=2}writeInt16AtPos(e){this.buf[e]=this.pos-e-2,this.buf[e+1]=this.pos-e-2>>8}writeInt24(e){if(this.pos+3>=this.buf.length){let s=Buffer.allocUnsafe(3);s[0]=e,s[1]=e>>8,s[2]=e>>16,this.writeBuffer(s,0,3);return}this.buf[this.pos]=e,this.buf[this.pos+1]=e>>8,this.buf[this.pos+2]=e>>16,this.pos+=3}writeInt32(e){if(this.pos+4>=this.buf.length){let s=Buffer.allocUnsafe(4);s.writeInt32LE(e,0),this.writeBuffer(s,0,4);return}this.buf[this.pos]=e,this.buf[this.pos+1]=e>>8,this.buf[this.pos+2]=e>>16,this.buf[this.pos+3]=e>>24,this.pos+=4}writeBigInt(e){if(this.pos+8>=this.buf.length){let s=Buffer.allocUnsafe(8);s.writeBigInt64LE(e,0),this.writeBuffer(s,0,8);return}this.buf.writeBigInt64LE(e,this.pos),this.pos+=8}writeDouble(e){if(this.pos+8>=this.buf.length){let s=Buffer.allocUnsafe(8);s.writeDoubleLE(e,0),this.writeBuffer(s,0,8);return}this.buf.writeDoubleLE(e,this.pos),this.pos+=8}writeLengthCoded(e){if(e<251){this.writeInt8(e);return}e<65536?(this.writeInt8(252),this.writeInt16(e)):e<16777216?(this.writeInt8(253),this.writeInt24(e)):(this.writeInt8(254),this.writeBigInt(BigInt(e)))}writeBuffer(e,s,t){if(t>this.buf.length-this.pos&&(this.buf.length!==Re&&this.growBuffer(t),t>this.buf.length-this.pos&&(this.markPos!==-1&&(this.growBuffer(t),this.markPos!==-1&&this.flushBufferStopAtMark()),t>this.buf.length-this.pos))){let n=t;for(;;){let o=Math.min(Re-this.pos,n);if(e.copy(this.buf,this.pos,s,s+o),n-=o,s+=o,this.pos+=o,n===0)return;this.flushBuffer(!1,n)}}if(t>50)e.copy(this.buf,this.pos,s,s+t),this.pos+=t;else for(let n=0;n<t;)this.buf[this.pos++]=e[s+n++]}writeStringAscii(e){let s=e.length;if(s>=this.buf.length-this.pos){let t=Buffer.from(e,"ascii");this.writeBuffer(t,0,t.length);return}for(let t=0;t<s;)this.buf[this.pos++]=e.charCodeAt(t++)}writeLengthEncodedBuffer(e){let s=e.length;this.writeLengthCoded(s),this.writeBuffer(e,0,s)}writeUtf8StringEscapeQuote(e){let s=e.length;if(s*3+2>=this.buf.length-this.pos){let o=Buffer.from(e,"utf8");this.writeInt8(he),this.writeBufferEscape(o),this.writeInt8(he);return}let t=0,n;for(this.buf[this.pos++]=he;t<s&&(n=e.charCodeAt(t))<128;t++)(n===le||n===he||n===It||n===Nt)&&(this.buf[this.pos++]=le),this.buf[this.pos++]=n;for(;t<s;)if(n=e.charCodeAt(t++),n<128)(n===le||n===he||n===It||n===Nt)&&(this.buf[this.pos++]=le),this.buf[this.pos++]=n;else if(n<2048)this.buf[this.pos++]=192|n>>6,this.buf[this.pos++]=128|n&63;else if(n>=55296&&n<57344)if(n<56320)if(t+1>s)this.buf[this.pos++]=63;else{let o=e.charCodeAt(t);if(o>=56320&&o<57344){let a=(n<<10)+o+-56613888;this.buf[this.pos++]=240|a>>18,this.buf[this.pos++]=128|a>>12&63,this.buf[this.pos++]=128|a>>6&63,this.buf[this.pos++]=128|a&63,t++}else this.buf[this.pos++]=63}else this.buf[this.pos++]=63;else this.buf[this.pos++]=224|n>>12,this.buf[this.pos++]=128|n>>6&63,this.buf[this.pos++]=128|n&63;this.buf[this.pos++]=he}encodeIconvString(e){return Vt.default.encode(e,this.encoding)}encodeNodeString(e){return Buffer.from(e,this.encoding)}writeDefaultBufferString(e){if(e.length*3<this.buf.length-this.pos){this.pos+=this.buf.write(e,this.pos,this.encoding);return}let s=Buffer.byteLength(e,this.encoding);if(s>this.buf.length-this.pos&&(this.buf.length<Re&&this.growBuffer(s),s>this.buf.length-this.pos)){let t=Buffer.from(e,this.encoding);this.writeBuffer(t,0,t.length);return}this.pos+=this.buf.write(e,this.pos,this.encoding)}writeDefaultBufferLengthEncodedString(e){let s=Buffer.byteLength(e,this.encoding);if(this.writeLengthCoded(s),s>this.buf.length-this.pos&&(this.buf.length<Re&&this.growBuffer(s),s>this.buf.length-this.pos)){let t=Buffer.from(e,this.encoding);this.writeBuffer(t,0,t.length);return}this.pos+=this.buf.write(e,this.pos,this.encoding)}writeDefaultIconvString(e){let s=Vt.default.encode(e,this.encoding);this.writeBuffer(s,0,s.length)}writeDefaultIconvLengthEncodedString(e){let s=Vt.default.encode(e,this.encoding);this.writeLengthCoded(s.length),this.writeBuffer(s,0,s.length)}writeDefaultStringEscapeQuote(e){this.writeInt8(he);let s,t=0;for(;(s=Ii.exec(e))!==null;)this.writeString(e.slice(t,s.index)),this.writeInt8(le),this.writeInt8(s[0].charCodeAt(0)),t=Ii.lastIndex;if(t===0){this.writeString(e),this.writeInt8(he);return}t<e.length&&this.writeString(e.slice(t)),this.writeInt8(he)}writeBinaryDate(e){let s=e.getFullYear(),t=e.getMonth()+1,n=e.getDate(),o=e.getHours(),a=e.getMinutes(),A=e.getSeconds(),u=e.getMilliseconds(),h=u===0?7:11;if(h+1>this.buf.length-this.pos){let l=Buffer.allocUnsafe(h+1);if(l[0]=h,l[1]=s,l[2]=s>>>8,l[3]=t,l[4]=n,l[5]=o,l[6]=a,l[7]=A,u!==0){let R=u*1e3;l[8]=R,l[9]=R>>>8,l[10]=R>>>16,l[11]=R>>>24}this.writeBuffer(l,0,h+1);return}if(this.buf[this.pos]=h,this.buf[this.pos+1]=s,this.buf[this.pos+2]=s>>>8,this.buf[this.pos+3]=t,this.buf[this.pos+4]=n,this.buf[this.pos+5]=o,this.buf[this.pos+6]=a,this.buf[this.pos+7]=A,u!==0){let l=u*1e3;this.buf[this.pos+8]=l,this.buf[this.pos+9]=l>>>8,this.buf[this.pos+10]=l>>>16,this.buf[this.pos+11]=l>>>24}this.pos+=h+1}writeBufferEscape(e){this.writeBufferEscapeFast(e)}writeBufferEscapeFast(e){let s=e.length;if(s*2>this.buf.length-this.pos&&(this.buf.length!==Re&&this.growBuffer(s*2),s*2>this.buf.length-this.pos)){for(let t=0;t<s;t++){switch(e[t]){case he:case le:case Nt:case It:this.pos>=this.buf.length&&this.flushBuffer(!1,(s-t)*2),this.buf[this.pos++]=le}this.pos>=this.buf.length&&this.flushBuffer(!1,(s-t)*2),this.buf[this.pos++]=e[t]}return}for(let t=0;t<s;t++){switch(e[t]){case he:case le:case Nt:case It:this.buf[this.pos++]=le}this.buf[this.pos++]=e[t]}}writeBufferEscapeMb(e,s){let t=s.length;t*2>this.buf.length-this.pos&&this.buf.length!==Re&&this.growBuffer(t*2);let n=0;for(;n<t;){let o=s[n];if(e.isHead(o)){let a=e.length(s,n,t);if(a>=2){for(let A=0;A<a;A++)this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=s[n+A];n+=a;continue}this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=le,this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=o,n++;continue}(o===he||o===le||o===Nt||o===It)&&(this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=le),this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=o,n++}}checkMaxAllowedLength(e,s){return this.opts.maxAllowedPacket&&this.cmdLength+e>=this.maxAllowedPacket?f(`query size (${this.cmdLength+e}) is >= to max_allowed_packet (${this.maxAllowedPacket})`,N.ER_MAX_ALLOWED_PACKET,s):null}isEmpty(){return this.pos<=4}flushBufferDebug(e,s){this.pos>4&&(this.buf[0]=this.pos-4,this.buf[1]=this.pos-4>>>8,this.buf[2]=this.pos-4>>>16,this.buf[3]=++this.cmd.sequenceNo,this.stream.writeBuf(this.buf.subarray(0,this.pos),this.cmd),this.stream.flush(!0,this.cmd),this.cmdLength+=this.pos-4,this.opts.logger.network(`==> conn:${this.info.threadId?this.info.threadId:-1} ${this.cmd.constructor.name+"(0,"+this.pos+")"}
${ie(this.opts,this.buf,0,this.pos)}`),e&&this.pos===Re&&this.writeEmptyPacket(),this.buf=this.createBufferWithMinSize(s),this.pos=4)}flushBufferStopAtMark(){let e=this.pos;this.pos=this.markPos;let s=Buffer.allocUnsafe(Math.max(tt,e+4-this.pos));this.buf.copy(s,4,this.markPos,e),this.flushBuffer(!0,e-this.pos),this.cmdLength=0,this.buf=s,this.pos=4+e-this.markPos,this.markPos=-1,this.bufContainDataAfterMark=!0}flushBufferBasic(e,s){this.buf[0]=this.pos-4,this.buf[1]=this.pos-4>>>8,this.buf[2]=this.pos-4>>>16,this.buf[3]=++this.cmd.sequenceNo,this.stream.writeBuf(this.buf.subarray(0,this.pos),this.cmd),this.stream.flush(!0,this.cmd),this.cmdLength+=this.pos-4,e&&this.pos===Re&&this.writeEmptyPacket(),this.buf=this.createBufferWithMinSize(s),this.pos=4}createBufferWithMinSize(e){let s;return e+4<tt?s=tt:e+4<yt?s=yt:e+4<kt?s=kt:e+4<xt?s=xt:s=Re,Buffer.allocUnsafe(s)}fastFlushDebug(e,s){this.stream.writeBuf(s,e),this.stream.flush(!0,e),this.cmdLength+=s.length,this.opts.logger.network(`==> conn:${this.info.threadId?this.info.threadId:-1} ${e.constructor.name+"(0,"+s.length+")"}
${ie(this.opts,s,0,s.length)}`),this.cmdLength=0,this.markPos=-1}fastFlushBasic(e,s){this.stream.writeBuf(s,e),this.stream.flush(!0,e),this.cmdLength=0,this.markPos=-1}writeEmptyPacket(){let e=Buffer.from([0,0,0,++this.cmd.sequenceNo]);this.debug&&this.opts.logger.network(`==> conn:${this.info.threadId?this.info.threadId:-1} ${this.cmd.constructor.name}(0,4)
${ie(this.opts,e,0,4)}`),this.stream.writeBuf(e,this.cmd),this.stream.flush(!0,this.cmd),this.cmdLength=0}},Ri=ps;var Si=m(require("node:zlib"),1);var Us=class{constructor(e,s,t,n){this.reader=e,this.receiveQueue=s,this.info=n,this.opts=t,this.header=Buffer.allocUnsafe(7),this.headerLen=0,this.compressPacketLen=null,this.packetLen=null,this.remainingLen=null,this.parts=null,this.partsTotalLen=0}receivePacket(e){let s=this.currentCmd();if(this.opts.debugCompress&&this.opts.logger.network(`<== conn:${this.info.threadId?this.info.threadId:-1} ${s?s.onPacketReceive?s.constructor.name+"."+s.onPacketReceive.name:s.constructor.name:"no command"} (compress)
${ie(this.opts,e,0,e.length,this.header)}`),s&&(s.compressSequenceNo=this.header[3]),(this.header[4]|this.header[5]<<8|this.header[6]<<16)===0)this.reader.onData(e);else{let n=Si.default.inflateSync(e);this.reader.onData(n)}}currentCmd(){let e;for(;e=this.receiveQueue.peek();){if(e.onPacketReceive)return e;this.receiveQueue.shift()}return null}resetHeader(){this.remainingLen=null,this.headerLen=0}onData(e){let s=0,t,n=e.length;do{if(this.remainingLen)t=this.remainingLen;else if(this.headerLen===0&&n-s>=7)this.header[0]=e[s],this.header[1]=e[s+1],this.header[2]=e[s+2],this.header[3]=e[s+3],this.header[4]=e[s+4],this.header[5]=e[s+5],this.header[6]=e[s+6],this.headerLen=7,s+=7,this.compressPacketLen=this.header[0]+(this.header[1]<<8)+(this.header[2]<<16),this.packetLen=this.header[4]|this.header[5]<<8|this.header[6]<<16,this.packetLen===0&&(this.packetLen=this.compressPacketLen),t=this.compressPacketLen;else for(t=null;n-s>0;)if(this.header[this.headerLen++]=e[s++],this.headerLen===7){this.compressPacketLen=this.header[0]+(this.header[1]<<8)+(this.header[2]<<16),this.packetLen=this.header[4]|this.header[5]<<8|this.header[6]<<16,this.packetLen===0&&(this.packetLen=this.compressPacketLen),t=this.compressPacketLen;break}if(t)if(n-s>=t){let o=e.subarray(s,s+t);if(s+=t,this.parts){if(this.parts.push(o),this.partsTotalLen+=t,this.compressPacketLen<16777215){let a=Buffer.concat(this.parts,this.partsTotalLen);this.parts=null,this.receivePacket(a)}}else this.compressPacketLen<16777215?this.receivePacket(o):(this.parts=[o],this.partsTotalLen=t);this.resetHeader()}else{let o=e.subarray(s,n);this.parts?(this.parts.push(o),this.partsTotalLen+=n-s):(this.parts=[o],this.partsTotalLen=n-s),this.remainingLen=t-(n-s);return}}while(s<n)}},fi=Us;var Ci=m(require("node:zlib"),1),Wt=2048,Yt=131072,Kt=1048576,Rt=16777222,Ls=class E{constructor(e,s,t){this.info=t,this.opts=s,this.pos=7,this.header=Buffer.allocUnsafe(7),this.buf=Buffer.allocUnsafe(Wt),this.writer=n=>{e.write(n)}}growBuffer(e){let s;e+this.pos<Yt?s=Yt:e+this.pos<Kt?s=Kt:s=Rt;let t=Buffer.allocUnsafe(s);this.buf.copy(t,0,0,this.pos),this.buf=t}writeBuf(e,s){let t=0,n=e.length;if(e instanceof Uint8Array&&(e=Buffer.from(e)),n>this.buf.length-this.pos&&(this.buf.length!==Rt&&this.growBuffer(n),n>this.buf.length-this.pos)){let o=n;for(;;){let a=Math.min(Rt-this.pos,o);if(e.copy(this.buf,this.pos,t,t+a),o-=a,t+=a,this.pos+=a,o===0)return;this.flush(!1,s,o)}}e.copy(this.buf,this.pos,t,t+n),this.pos+=n}flush(e,s,t){if(this.pos<1536)this.buf[0]=this.pos-7,this.buf[1]=this.pos-7>>>8,this.buf[2]=this.pos-7>>>16,this.buf[3]=++s.compressSequenceNo,this.buf[4]=0,this.buf[5]=0,this.buf[6]=0,this.opts.debugCompress&&this.opts.logger.network(`==> conn:${this.info.threadId?this.info.threadId:-1} ${s?s.constructor.name+"(0,"+this.pos+")":"unknown"} (compress)
${ie(this.opts,this.buf,0,this.pos)}`),this.writer(this.buf.subarray(0,this.pos));else{let n=Ci.default.deflateSync(this.buf.subarray(7,this.pos)),o=n.length;this.header[0]=o,this.header[1]=o>>>8,this.header[2]=o>>>16,this.header[3]=++s.compressSequenceNo,this.header[4]=this.pos-7,this.header[5]=this.pos-7>>>8,this.header[6]=this.pos-7>>>16,this.opts.debugCompress&&this.opts.logger.network(`==> conn:${this.info.threadId?this.info.threadId:-1} ${s?s.constructor.name+"(0,"+this.pos+"=>"+o+")":"unknown"} (compress)
${ie(this.opts,n,0,o,this.header)}`),this.writer(this.header),this.writer(n),e&&o===Rt&&this.writeEmptyPacket(s),this.header=Buffer.allocUnsafe(7)}this.buf=t?E.allocateBuffer(t):Buffer.allocUnsafe(Wt),this.pos=7}static allocateBuffer(e){return e+4<Wt?Buffer.allocUnsafe(Wt):e+4<Yt?Buffer.allocUnsafe(Yt):e+4<Kt?Buffer.allocUnsafe(Kt):Buffer.allocUnsafe(Rt)}writeEmptyPacket(e){let s=Buffer.from([0,0,0,e.compressSequenceNo,0,0,0]);this.opts.debugCompress&&this.opts.logger.network(`==> conn:${this.info.threadId?this.info.threadId:-1} ${e?e.constructor.name+"(0,"+this.pos+")":"unknown"} (compress)
${ie(this.opts,s,0,7)}`),this.writer(s)}},Ti=Ls;var Ps=class{#e;constructor(e,s){this.threadId=-1,this.status=null,this.serverVersion=null,this.serverCapabilities=null,this.database=e.database,this.port=e.port,this.#e=s,this.redirectRequest=null}hasMinVersion(e,s,t){if(!this.serverVersion)throw new Error("cannot know if server version until connection is established");if(!e)throw new Error("a major version must be set");s||(s=0),t||(t=0);let n=this.serverVersion;return n.major>e||n.major===e&&n.minor>s||n.major===e&&n.minor===s&&n.patch>=t}redirect(e,s){return this.#e(e,s)}isMariaDB(){if(!this.serverVersion)throw new Error("cannot know if server is MariaDB until connection is established");return this.serverVersion.mariaDb}static parseVersionString(e){let s,t=0,n=0,o=0;for(;t<e.serverVersion.raw.length;t++)if(s=e.serverVersion.raw.charCodeAt(t),s<48||s>57){switch(n){case 0:e.serverVersion.major=o;break;case 1:e.serverVersion.minor=o;break;case 2:e.serverVersion.patch=o;return}n++,o=0}else o=o*10+s-48;n===2&&(e.serverVersion.patch=o)}},St=Ps;var y_=m(require("node:tls"),1);var ft=1n,Oi=2n;var qe=8n,mE=1n<<4n,Ct=1n<<5n,DE=1n<<6n,di=1n<<7n,pi=1n<<8n,Ui=1n<<9n,wE=1n<<10n,ms=1n<<11n,gE=1n<<12n,Li=1n<<13n,bE=1n<<14n,Be=1n<<15n,Pi=1n<<16n,mi=1n<<17n,Di=1n<<18n,Se=1n<<19n,st=1n<<20n,vt=1n<<21n,wi=1n<<22n,gi=1n<<23n,Ds=1n<<24n,ME=1n<<30n,Tt=1n<<34n,Qt=1n<<35n,ws=1n<<36n,rt=1n<<37n;var Tn=/mariadb:\/\/(([^/@:]+)?(:([^/]+))?@)?(([^/:]+)(:([0-9]+))?)\/([^?]+)(\?(.*))?$/,gs=class E{constructor(e){if(typeof e=="string"&&(e=E.parse(e)),e||(e={}),this.host=e.host||"localhost",this.port=e.port?Number(e.port):3306,this.keepEof=!!e.keepEof||!1,this.user=e.user||process.env.USERNAME,this.password=e.password,this.database=e.database,this.stream=e.stream,this.fullResult=e.fullResult,this.debug=!!e.debug||!1,this.debugCompress=!!e.debugCompress||!1,this.debugLen=e.debugLen?Number(e.debugLen):256,this.logParam=e.logParam===void 0?!0:!!e.logParam,e.logger?typeof e.logger=="function"?this.logger={network:e.logger,query:e.logger,error:e.logger,warning:e.logger}:(this.logger={network:e.logger.network,query:e.logger.query,error:e.logger.error,warning:e.logger.warning||console.log},e.logger.logParam!==void 0&&(this.logParam=!!e.logger.logParam)):this.logger={network:this.debug||this.debugCompress?console.log:null,query:null,error:null,warning:console.log},this.debug=!!this.logger.network,e.charset&&typeof e.charset=="string"){if(e.collation&&typeof e.collation=="string"&&(this.collation=P.fromCharsetAndName(e.charset.toLowerCase(),e.collation.toUpperCase()),this.collation===void 0))throw new RangeError("Unknown collation '"+e.collation+"' with charset '"+e.charset+"'");this.collation=P.fromCharset(e.charset.toLowerCase()),this.collation===void 0&&(this.collation=P.fromName(e.charset.toUpperCase()),this.collation!==void 0?this.logger.warning("warning: please use option 'collation' in replacement of 'charset' when using a collation name ('"+e.charset+`')
(collation looks like 'UTF8MB4_UNICODE_CI', charset like 'utf8').`):this.charset=e.charset)}else if(e.collation&&typeof e.collation=="string"){if(this.collation=P.fromName(e.collation.toUpperCase()),this.collation===void 0)throw new RangeError("Unknown collation '"+e.collation+"'")}else this.collation=e.charsetNumber?P.fromIndex(Number(e.charsetNumber)):void 0;if(this.initSql=e.initSql,this.connectTimeout=e.connectTimeout===void 0?1e3:Number(e.connectTimeout),this.connectAttributes=e.connectAttributes||!1,this.compress=!!e.compress||!1,this.rsaPublicKey=e.rsaPublicKey,this.cachingRsaPublicKey=e.cachingRsaPublicKey,this.allowPublicKeyRetrieval=!!e.allowPublicKeyRetrieval||!1,this.forceVersionCheck=!!e.forceVersionCheck||!1,this.maxAllowedPacket=e.maxAllowedPacket?Number(e.maxAllowedPacket):void 0,this.permitConnectionWhenExpired=!!e.permitConnectionWhenExpired||!1,this.pipelining=e.pipelining,this.timezone=e.timezone||"local",this.socketPath=e.socketPath,this.sessionVariables=e.sessionVariables,this.infileStreamFactory=e.infileStreamFactory,this.ssl=e.ssl,e.ssl&&typeof e.ssl!="boolean"&&typeof e.ssl!="string"&&(this.ssl.rejectUnauthorized=e.ssl.rejectUnauthorized!==!1),this.permitRedirect=e.permitRedirect===void 0?!!this.ssl&&this.ssl.rejectUnauthorized!==!1:!!e.permitRedirect,this.queryTimeout=isNaN(e.queryTimeout)||Number(e.queryTimeout)<0?0:Number(e.queryTimeout),this.socketTimeout=isNaN(e.socketTimeout)||Number(e.socketTimeout)<0?0:Number(e.socketTimeout),this.keepAliveDelay=e.keepAliveDelay===void 0?void 0:Number(e.keepAliveDelay),e.keepAliveDelay||e.enableKeepAlive===!0&&e.keepAliveInitialDelay!==void 0&&(this.keepAliveDelay=Number(e.keepAliveInitialDelay)),this.trace=!!e.trace||!1,this.checkDuplicate=e.checkDuplicate===void 0?!0:!!e.checkDuplicate,this.dateStrings=!!e.dateStrings||!1,this.foundRows=e.foundRows===void 0||!!e.foundRows,this.metaAsArray=!!e.metaAsArray||!1,this.metaEnumerable=!!e.metaEnumerable||!1,this.multipleStatements=!!e.multipleStatements||!1,this.namedPlaceholders=!!e.namedPlaceholders||!1,this.nestTables=e.nestTables,this.autoJsonMap=e.autoJsonMap===void 0?!0:!!e.autoJsonMap,this.jsonStrings=!!e.jsonStrings||!1,e.jsonStrings!==void 0&&(this.autoJsonMap=!this.jsonStrings),this.bitOneIsBoolean=e.bitOneIsBoolean===void 0?!0:!!e.bitOneIsBoolean,this.arrayParenthesis=!!e.arrayParenthesis||!1,this.permitSetMultiParamEntries=!!e.permitSetMultiParamEntries||!1,this.rowsAsArray=!!e.rowsAsArray||!1,this.typeCast=e.typeCast,this.typeCast!==void 0&&typeof this.typeCast!="function"&&(this.typeCast=void 0),this.bulk=e.bulk===void 0||!!e.bulk,this.checkNumberRange=!!e.checkNumberRange||!1,e.pipelining===void 0)this.permitLocalInfile=!!e.permitLocalInfile||!1,this.pipelining=!this.permitLocalInfile;else{if(this.pipelining=!!e.pipelining,e.permitLocalInfile===!0&&this.pipelining)throw new Error("enabling options `permitLocalInfile` and `pipelining` is not possible, options are incompatible.");this.permitLocalInfile=this.pipelining?!1:!!e.permitLocalInfile||!1}if(this.prepareCacheLength=e.prepareCacheLength===void 0?256:Number(e.prepareCacheLength),this.restrictedAuth=e.restrictedAuth,this.restrictedAuth!=null&&(Array.isArray(this.restrictedAuth)||(this.restrictedAuth=this.restrictedAuth.split(","))),this.bigIntAsNumber=!!e.bigIntAsNumber||!1,this.insertIdAsNumber=!!e.insertIdAsNumber||!1,this.decimalAsNumber=!!e.decimalAsNumber||!1,this.supportBigNumbers=!!e.supportBigNumbers||!1,this.bigNumberStrings=!!e.bigNumberStrings||!1,e.maxAllowedPacket&&isNaN(this.maxAllowedPacket))throw new RangeError(`maxAllowedPacket must be an integer. was '${e.maxAllowedPacket}'`)}static parseOptionDataType(e){if(["bulk","allowPublicKeyRetrieval","insertIdAsNumber","decimalAsNumber","bigIntAsNumber","permitRedirect","logParam","compress","dateStrings","debug","autoJsonMap","arrayParenthesis","checkDuplicate","debugCompress","foundRows","metaAsArray","metaEnumerable","multipleStatements","namedPlaceholders","nestTables","permitSetMultiParamEntries","pipelining","forceVersionCheck","rowsAsArray","trace","bitOneIsBoolean","jsonStrings","enableKeepAlive","supportBigNumbers","bigNumberStrings","keepEof","permitLocalInfile","permitConnectionWhenExpired"].forEach(n=>{e[n]!==void 0&&typeof e[n]=="string"&&(e[n]=e[n]==="true")}),["charsetNumber","connectTimeout","keepAliveDelay","socketTimeout","debugLen","prepareCacheLength","queryTimeout","maxAllowedPacket","keepAliveInitialDelay","port"].forEach(n=>{if(e[n]!==void 0&&typeof e[n]=="string"){let o=parseInt(e[n],10);isNaN(o)||(e[n]=o)}}),e.ssl!==void 0&&typeof e.ssl=="string"&&(e.ssl=e.ssl==="true"),e.connectAttributes!==void 0&&typeof e.connectAttributes=="string")try{e.connectAttributes=JSON.parse(e.connectAttributes)}catch(n){throw new Error(`Failed to parse connectAttributes as JSON: ${n.message}`)}if(e.sessionVariables!==void 0&&typeof e.sessionVariables=="string"&&e.sessionVariables.trim().startsWith("{"))try{e.sessionVariables=JSON.parse(e.sessionVariables)}catch{}return e}static parse(e){let s=e.match(Tn);if(!s)throw new Error("error parsing connection string "+e+". format must be 'mariadb://[<user>[:<password>]@]<host>[:<port>]/[<db>[?<opt1>=<value1>[&<opt2>=<value2>]]]'");let t={user:s[2]?decodeURIComponent(s[2]):void 0,password:s[4]?decodeURIComponent(s[4]):void 0,host:s[6]?decodeURIComponent(s[6]):s[6],port:s[8]?parseInt(s[8]):void 0,database:s[9]?decodeURIComponent(s[9]):s[9]},n=s[11];return n&&n.split("&").forEach(function(a){let A=a.indexOf("=");if(A!==1){let u=a.substring(A+1);u=u?decodeURIComponent(u):void 0,t[a.substring(0,A)]=u}}),this.parseOptionDataType(t)}},fe=gs;var bi=m(require("node:events"),1);var bs=class extends bi.default{constructor(e,s,t){super(),this.cmdParam=e,this.sequenceNo=-1,this.compressSequenceNo=-1,this.resolve=s,this.reject=t,this.sending=!1,this.unexpectedError=this.throwUnexpectedError.bind(this)}displaySql(){return null}throwUnexpectedError(e,s,t,n,o){let a=f(e,o,t,n,this.opts&&this.opts.logParam?this.displaySql():this.sql,s,this.cmdParam?this.cmdParam.stack:null,!1);return this.reject&&(process.nextTick(this.reject,a),this.resolve=null,this.reject=null),a}throwNewError(e,s,t,n,o){this.onPacketReceive=null;let a=this.throwUnexpectedError(e,s,t,n,o);return this.emit("end"),a}sendCancelled(e,s,t){let n=f(e,s,t,"HY000",this.opts.logParam?this.displaySql():this.sql);this.emit("send_end"),this.throwError(n,t)}throwError(e,s){this.onPacketReceive=null,this.reject&&(this.cmdParam&&this.cmdParam.stack&&(e=f(e.text?e.text:e.message,e.errno,s,e.sqlState,e.sql,e.fatal,this.cmdParam.stack,!1)),this.resolve=null,process.nextTick(this.reject,e),this.reject=null),this.emit("end",e)}successEnd(e){this.onPacketReceive=null,this.resolve&&(this.reject=null,process.nextTick(this.resolve,e),this.resolve=null),this.emit("end")}},_e=bs;var Ms=class extends _e{constructor(e,s,t){super(e,s,t),this.onPacketReceive=s}isMitmProof(){return!1}requireSecure(){return!1}isSecureConnection(e){return!!e.ssl||!!e.socketPath&&process.platform!=="win32"}hash(e){return null}},ee=Ms;var Bs=class{constructor(e,s){e.skip(1),s.serverVersion={},s.serverVersion.raw=e.readStringNullEnded(),s.threadId=e.readUInt32();let t=e.readBuffer(8);e.skip(1);let n=BigInt(e.readUInt16());s.collation=P.fromIndex(e.readUInt8()),s.status=e.readUInt16(),n+=BigInt(e.readUInt16())<<16n;let o=0;if(n&Se?o=Math.max(12,e.readUInt8()-9):e.skip(1),n&ft?e.skip(10):(e.skip(6),n+=BigInt(e.readUInt32())<<32n),n&Be){let a=e.readBuffer(o);s.seed=Buffer.concat([t,a])}else s.seed=t;e.skip(1),s.serverCapabilities=n,s.serverVersion.raw.startsWith("5.5.5-")?(s.serverVersion.mariaDb=!0,s.serverVersion.raw=s.serverVersion.raw.substring(6)):s.serverVersion.mariaDb=s.serverVersion.raw.includes("MariaDB")||(n&ft)===0n,n&Se?this.pluginName=e.readStringNullEnded():this.pluginName="",St.parseVersionString(s)}},Mi=Bs;function Gs(E,e){let s=pi|Ui|Li|Be|mi|Di|gi|st|vt|Qt|Se;E.foundRows&&(s|=Oi),E.permitLocalInfile&&(s|=di),E.multipleStatements&&(s|=Pi),e.eofDeprecated=!E.keepEof&&(e.serverCapabilities&Ds)>0,e.eofDeprecated&&(s|=Ds),E.database&&e.serverCapabilities&qe&&(s|=qe),e.serverPermitSkipMeta=(e.serverCapabilities&ws)>0,e.serverPermitSkipMeta&&(s|=ws),E.compress&&(e.serverCapabilities&Ct?s|=Ct:E.compress=!1),E.bulk&&e.serverCapabilities&Tt&&(s|=Tt,s|=rt),E.permitConnectionWhenExpired&&(s|=wi),e.clientCapabilities=s&e.serverCapabilities}function Fs(E,e,s,t){e.startPacket(E),e.writeInt32(Number(s.clientCapabilities&BigInt(4294967295))),e.writeInt32(1024*1024*1024),e.writeInt8(t.collation&&t.collation.index<=255?t.collation.index:224);for(let n=0;n<19;n++)e.writeInt8(0);s.serverCapabilities&ft?e.writeInt32(0):e.writeInt32(Number(s.clientCapabilities>>32n)),e.flushPacket()}var it=m(require("node:crypto"),1),Hs=class E extends ee{constructor(e,s,t,n,o,a){super(n,a,o),this.pluginData=t,this.sequenceNo=e,this.compressSequenceNo=s}start(e,s,t){let n=this.pluginData.slice(0,20),o=E.encryptSha1Password(s.password,n);e.startPacket(this),o.length>0?(e.writeBuffer(o,0,o.length),e.flushPacket()):e.writeEmptyPacket(!0),this.emit("send_end")}static encryptSha1Password(e,s){if(!e)return Buffer.alloc(0);let t=it.default.createHash("sha1"),n=t.update(e,"utf8").digest();t=it.default.createHash("sha1");let o=t.update(n).digest();t=it.default.createHash("sha1"),t.update(s),t.update(o);let a=t.digest(),A=Buffer.allocUnsafe(a.length);for(let u=0;u<a.length;u++)A[u]=n[u]^a[u];return A}isMitmProof(){return!0}hash(e){let s=it.default.createHash("sha1"),t=s.update(e.password,"utf8").digest();return s=it.default.createHash("sha1"),s.update(t).digest()}},_t=Hs;var Bi=m(require("iconv-lite"),1),ys=m(require("node:crypto"),1),Gi=m(require("node:os"),1);var On=Me.version,ks=class E extends ee{constructor(e,s,t,n,o){super(null,n,o),this.sequenceNo=0,this.compressSequenceNo=0,this.auth=e,this.getSocket=t,this.counter=0,this.onPacketReceive=this.parseHandshakeInit,this.host=s}start(e,s,t){}parseHandshakeInit(e,s,t,n){if(e.peek()===255){let a=e.readError(n);return a.fatal=!0,this.throwError(a,n)}let o=new Mi(e,n);if(Gs(t,n),this.pluginName=o.pluginName,this.requireSecure()&&!this.isSecureConnection(t))return this.throwNewError(`${this.pluginName} authentication requires TLS or a local socket`,!0,n,"08S01",N.ER_CLEAR_PASSWORD_WITHOUT_SSL);if(t.ssl)if(n.serverCapabilities&ms)n.clientCapabilities|=ms,Fs(this,s,n,t),this.auth._createSecureContext(n,()=>{let a=this.getSocket();n.selfSignedCertificate=!a.authorized,n.tlsAuthorizationError=a.authorizationError;let A=a.getPeerCertificate(!1);if(n.tlsCert=A,n.tlsFingerprint=A?A.fingerprint256.replace(/:/gi,"").toLowerCase():null,n.requireValidCert&&n.selfSignedCertificate&&t.password&&!this.isMitmProof())return this.throwNewError(`Unsupported authentication plugin ${this.pluginName} with Self signed certificates.
Either set 'ssl: { rejectUnauthorized: false }' (trust mode) or provide server certificate to client`,!0,n,"08000",N.ER_SELF_SIGNED_BAD_PLUGIN);E.send.call(this,this,s,t,o.pluginName,n)});else return this.throwNewError("Trying to connect with ssl, but ssl not enabled in the server",!0,n,"08S01",N.ER_SERVER_SSL_DISABLED);else E.send(this,s,t,o.pluginName,n);this.onPacketReceive=this.auth.handshakeResult.bind(this.auth)}isMitmProof(){return this.pluginName!=="mysql_clear_password"}requireSecure(){return this.pluginName==="mysql_clear_password"}hash(e){let s=ys.default.createHash("sha1"),t=s.update(e.password,"utf8").digest();return s=ys.default.createHash("sha1"),s.update(t).digest()}static send(e,s,t,n,o){s.startPacket(e),o.defaultPluginName=n;let a=Array.isArray(t.password)?t.password[0]:t.password,A,u;n==="mysql_clear_password"?(A=Buffer.from(a),u="mysql_clear_password"):(A=_t.encryptSha1Password(a,o.seed),u="mysql_native_password"),s.writeInt32(Number(o.clientCapabilities&BigInt(4294967295))),s.writeInt32(1024*1024*1024),s.writeInt8(t.collation&&t.collation.index<=255?t.collation.index:224);for(let h=0;h<19;h++)s.writeInt8(0);if(s.writeInt32(Number(o.clientCapabilities>>32n)),s.writeString(t.user||""),s.writeInt8(0),o.serverCapabilities&vt?(s.writeLengthCoded(A.length),s.writeBuffer(A,0,A.length)):o.serverCapabilities&Be?(s.writeInt8(A.length),s.writeBuffer(A,0,A.length)):(s.writeBuffer(A,0,A.length),s.writeInt8(0)),o.clientCapabilities&qe&&(s.writeString(t.database),s.writeInt8(0),o.database=t.database),o.clientCapabilities&Se&&(s.writeString(u),s.writeInt8(0)),o.clientCapabilities&st){s.writeInt8(252);let h=s.pos;s.writeInt16(0);let l=o.collation?o.collation.charset:"utf8";if(E.writeAttribute(s,"_client_name",l),E.writeAttribute(s,"MariaDB connector/Node",l),E.writeAttribute(s,"_client_version",l),E.writeAttribute(s,On,l),this.host&&(E.writeAttribute(s,"_server_host",l),E.writeAttribute(s,this.host,l)),E.writeAttribute(s,"_os",l),E.writeAttribute(s,process.platform,l),E.writeAttribute(s,"_client_host",l),E.writeAttribute(s,Gi.default.hostname(),l),E.writeAttribute(s,"_node_version",l),E.writeAttribute(s,process.versions.node,l),t.connectAttributes!==!0){let R=Object.keys(t.connectAttributes);for(let I=0;I<R.length;++I)E.writeAttribute(s,R[I],l),E.writeAttribute(s,t.connectAttributes[R[I]],l)}s.writeInt16AtPos(h)}s.flushPacket()}static writeAttribute(e,s,t){let n=Buffer.isEncoding(t)?Buffer.from(s,t):Bi.encode(s,t);e.writeLengthCoded(n.length),e.writeBuffer(n,0,n.length)}},Fi=ks;var Js=m(require("node:crypto"),1);var zi=m(require("node:tls"),1);var xs=class extends ee{constructor(e,s,t,n,o,a){super(n,a,o),this.sequenceNo=e,this.compressSequenceNo=s,this.counter=0,this.multiAuthResolver=a}requireSecure(){return!0}start(e,s,t){e.startPacket(this);let n=s.password;n&&(Array.isArray(n)?e.writeString(n[this.counter++]):e.writeString(n)),e.writeInt8(0),e.flushPacket(),this.onPacketReceive=this.response}response(e,s,t,n){switch(e.peek()){case 0:case 255:return this.emit("send_end"),this.multiAuthResolver(e,s,t,n);default:e.readBuffer(),s.startPacket(this),s.writeString("password"),s.writeInt8(0),s.flushPacket()}}},yi=xs;var nt=m(require("node:crypto"),1),vs=class E extends ee{constructor(e,s,t,n,o,a){super(n,a,o),this.pluginData=t,this.sequenceNo=e,this.compressSequenceNo=s}start(e,s,t){let n=this.pluginData,o=E.encryptPassword(s.password,n);e.startPacket(this),e.writeBuffer(o,0,o.length),e.flushPacket(),this.emit("send_end")}static encryptPassword(e,s){if(!e)return Buffer.alloc(0);let t,n,o=[O(),O(),O(),O()],a=Buffer.alloc(96),A=Buffer.from(e),u=nt.default.createHash("sha512"),h=u.update(A).digest();for(h[0]&=248,h[31]&=127,h[31]|=64,t=0;t<32;t++)a[64+t]=s[t];for(t=0;t<32;t++)a[32+t]=h[32+t];u=nt.default.createHash("sha512");let l=u.update(a.subarray(32,96)).digest();Ws(l),Ys(o,l),Wi(a,o),o=[O(),O(),O(),O()],Ys(o,h);let R=Buffer.alloc(32);for(Wi(R,o),t=32;t<64;t++)a[t]=R[t-32];u=nt.default.createHash("sha512");let I=u.update(a).digest();Ws(I);let S=new Float64Array(64);for(t=0;t<64;t++)S[t]=0;for(t=0;t<32;t++)S[t]=l[t];for(t=0;t<32;t++)for(n=0;n<32;n++)S[t+n]+=I[t]*h[n];return vi(a.subarray(32),S),a.subarray(0,64)}isMitmProof(){return!0}hash(e){let s,t=[O(),O(),O(),O()],n=Buffer.alloc(96),o=Buffer.from(e.password),a=nt.default.createHash("sha512"),A=a.update(o).digest();for(A[0]&=248,A[31]&=127,A[31]|=64,s=0;s<32;s++)n[64+s]=seed[s];for(s=0;s<32;s++)n[32+s]=A[32+s];a=nt.default.createHash("sha512");let u=a.update(n.subarray(32,96)).digest();return Ws(u),Ys(t,u),u}},O=function(E){let e=new Float64Array(16);if(E)for(let s=0;s<E.length;s++)e[s]=E[s];return e},ki=O(),Qs=O([1]),dn=O([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),xi=O([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Vi=O([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Vs=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ws(E){let e=new Float64Array(64),s;for(s=0;s<64;s++)e[s]=E[s];for(s=0;s<64;s++)E[s]=0;vi(E,e)}function vi(E,e){let s,t,n,o;for(t=63;t>=32;--t){for(s=0,n=t-32,o=t-12;n<o;++n)e[n]+=s-16*e[t]*Vs[n-(t-32)],s=e[n]+128>>8,e[n]-=s*256;e[n]+=s,e[t]=0}for(s=0,n=0;n<32;n++)e[n]+=s-(e[31]>>4)*Vs[n],s=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=s*Vs[n];for(t=0;t<32;t++)e[t+1]+=e[t]>>8,E[t]=e[t]&255}function Ys(E,e){let s=[O(),O(),O(),O()];Xe(s[0],xi),Xe(s[1],Vi),Xe(s[2],Qs),ne(s[3],xi,Vi),pn(E,s,e)}function Xe(E,e){for(let s=0;s<16;s++)E[s]=e[s]|0}function ne(E,e,s){let t,n,o=0,a=0,A=0,u=0,h=0,l=0,R=0,I=0,S=0,C=0,d=0,b=0,g=0,U=0,M=0,B=0,F=0,se=0,re=0,ae=0,ue=0,Ie=0,Te=0,Ue=0,be=0,Ye=0,et=0,ht=0,bt=0,Ss=0,zr=0,H=s[0],y=s[1],k=s[2],x=s[3],V=s[4],W=s[5],Y=s[6],K=s[7],v=s[8],Q=s[9],q=s[10],X=s[11],j=s[12],$=s[13],Z=s[14],J=s[15];t=e[0],o+=t*H,a+=t*y,A+=t*k,u+=t*x,h+=t*V,l+=t*W,R+=t*Y,I+=t*K,S+=t*v,C+=t*Q,d+=t*q,b+=t*X,g+=t*j,U+=t*$,M+=t*Z,B+=t*J,t=e[1],a+=t*H,A+=t*y,u+=t*k,h+=t*x,l+=t*V,R+=t*W,I+=t*Y,S+=t*K,C+=t*v,d+=t*Q,b+=t*q,g+=t*X,U+=t*j,M+=t*$,B+=t*Z,F+=t*J,t=e[2],A+=t*H,u+=t*y,h+=t*k,l+=t*x,R+=t*V,I+=t*W,S+=t*Y,C+=t*K,d+=t*v,b+=t*Q,g+=t*q,U+=t*X,M+=t*j,B+=t*$,F+=t*Z,se+=t*J,t=e[3],u+=t*H,h+=t*y,l+=t*k,R+=t*x,I+=t*V,S+=t*W,C+=t*Y,d+=t*K,b+=t*v,g+=t*Q,U+=t*q,M+=t*X,B+=t*j,F+=t*$,se+=t*Z,re+=t*J,t=e[4],h+=t*H,l+=t*y,R+=t*k,I+=t*x,S+=t*V,C+=t*W,d+=t*Y,b+=t*K,g+=t*v,U+=t*Q,M+=t*q,B+=t*X,F+=t*j,se+=t*$,re+=t*Z,ae+=t*J,t=e[5],l+=t*H,R+=t*y,I+=t*k,S+=t*x,C+=t*V,d+=t*W,b+=t*Y,g+=t*K,U+=t*v,M+=t*Q,B+=t*q,F+=t*X,se+=t*j,re+=t*$,ae+=t*Z,ue+=t*J,t=e[6],R+=t*H,I+=t*y,S+=t*k,C+=t*x,d+=t*V,b+=t*W,g+=t*Y,U+=t*K,M+=t*v,B+=t*Q,F+=t*q,se+=t*X,re+=t*j,ae+=t*$,ue+=t*Z,Ie+=t*J,t=e[7],I+=t*H,S+=t*y,C+=t*k,d+=t*x,b+=t*V,g+=t*W,U+=t*Y,M+=t*K,B+=t*v,F+=t*Q,se+=t*q,re+=t*X,ae+=t*j,ue+=t*$,Ie+=t*Z,Te+=t*J,t=e[8],S+=t*H,C+=t*y,d+=t*k,b+=t*x,g+=t*V,U+=t*W,M+=t*Y,B+=t*K,F+=t*v,se+=t*Q,re+=t*q,ae+=t*X,ue+=t*j,Ie+=t*$,Te+=t*Z,Ue+=t*J,t=e[9],C+=t*H,d+=t*y,b+=t*k,g+=t*x,U+=t*V,M+=t*W,B+=t*Y,F+=t*K,se+=t*v,re+=t*Q,ae+=t*q,ue+=t*X,Ie+=t*j,Te+=t*$,Ue+=t*Z,be+=t*J,t=e[10],d+=t*H,b+=t*y,g+=t*k,U+=t*x,M+=t*V,B+=t*W,F+=t*Y,se+=t*K,re+=t*v,ae+=t*Q,ue+=t*q,Ie+=t*X,Te+=t*j,Ue+=t*$,be+=t*Z,Ye+=t*J,t=e[11],b+=t*H,g+=t*y,U+=t*k,M+=t*x,B+=t*V,F+=t*W,se+=t*Y,re+=t*K,ae+=t*v,ue+=t*Q,Ie+=t*q,Te+=t*X,Ue+=t*j,be+=t*$,Ye+=t*Z,et+=t*J,t=e[12],g+=t*H,U+=t*y,M+=t*k,B+=t*x,F+=t*V,se+=t*W,re+=t*Y,ae+=t*K,ue+=t*v,Ie+=t*Q,Te+=t*q,Ue+=t*X,be+=t*j,Ye+=t*$,et+=t*Z,ht+=t*J,t=e[13],U+=t*H,M+=t*y,B+=t*k,F+=t*x,se+=t*V,re+=t*W,ae+=t*Y,ue+=t*K,Ie+=t*v,Te+=t*Q,Ue+=t*q,be+=t*X,Ye+=t*j,et+=t*$,ht+=t*Z,bt+=t*J,t=e[14],M+=t*H,B+=t*y,F+=t*k,se+=t*x,re+=t*V,ae+=t*W,ue+=t*Y,Ie+=t*K,Te+=t*v,Ue+=t*Q,be+=t*q,Ye+=t*X,et+=t*j,ht+=t*$,bt+=t*Z,Ss+=t*J,t=e[15],B+=t*H,F+=t*y,se+=t*k,re+=t*x,ae+=t*V,ue+=t*W,Ie+=t*Y,Te+=t*K,Ue+=t*v,be+=t*Q,Ye+=t*q,et+=t*X,ht+=t*j,bt+=t*$,Ss+=t*Z,zr+=t*J,o+=38*F,a+=38*se,A+=38*re,u+=38*ae,h+=38*ue,l+=38*Ie,R+=38*Te,I+=38*Ue,S+=38*be,C+=38*Ye,d+=38*et,b+=38*ht,g+=38*bt,U+=38*Ss,M+=38*zr,n=1,t=o+n+65535,n=Math.floor(t/65536),o=t-n*65536,t=a+n+65535,n=Math.floor(t/65536),a=t-n*65536,t=A+n+65535,n=Math.floor(t/65536),A=t-n*65536,t=u+n+65535,n=Math.floor(t/65536),u=t-n*65536,t=h+n+65535,n=Math.floor(t/65536),h=t-n*65536,t=l+n+65535,n=Math.floor(t/65536),l=t-n*65536,t=R+n+65535,n=Math.floor(t/65536),R=t-n*65536,t=I+n+65535,n=Math.floor(t/65536),I=t-n*65536,t=S+n+65535,n=Math.floor(t/65536),S=t-n*65536,t=C+n+65535,n=Math.floor(t/65536),C=t-n*65536,t=d+n+65535,n=Math.floor(t/65536),d=t-n*65536,t=b+n+65535,n=Math.floor(t/65536),b=t-n*65536,t=g+n+65535,n=Math.floor(t/65536),g=t-n*65536,t=U+n+65535,n=Math.floor(t/65536),U=t-n*65536,t=M+n+65535,n=Math.floor(t/65536),M=t-n*65536,t=B+n+65535,n=Math.floor(t/65536),B=t-n*65536,o+=n-1+37*(n-1),n=1,t=o+n+65535,n=Math.floor(t/65536),o=t-n*65536,t=a+n+65535,n=Math.floor(t/65536),a=t-n*65536,t=A+n+65535,n=Math.floor(t/65536),A=t-n*65536,t=u+n+65535,n=Math.floor(t/65536),u=t-n*65536,t=h+n+65535,n=Math.floor(t/65536),h=t-n*65536,t=l+n+65535,n=Math.floor(t/65536),l=t-n*65536,t=R+n+65535,n=Math.floor(t/65536),R=t-n*65536,t=I+n+65535,n=Math.floor(t/65536),I=t-n*65536,t=S+n+65535,n=Math.floor(t/65536),S=t-n*65536,t=C+n+65535,n=Math.floor(t/65536),C=t-n*65536,t=d+n+65535,n=Math.floor(t/65536),d=t-n*65536,t=b+n+65535,n=Math.floor(t/65536),b=t-n*65536,t=g+n+65535,n=Math.floor(t/65536),g=t-n*65536,t=U+n+65535,n=Math.floor(t/65536),U=t-n*65536,t=M+n+65535,n=Math.floor(t/65536),M=t-n*65536,t=B+n+65535,n=Math.floor(t/65536),B=t-n*65536,o+=n-1+37*(n-1),E[0]=o,E[1]=a,E[2]=A,E[3]=u,E[4]=h,E[5]=l,E[6]=R,E[7]=I,E[8]=S,E[9]=C,E[10]=d,E[11]=b,E[12]=g,E[13]=U,E[14]=M,E[15]=B}function pn(E,e,s){let t,n;for(Xe(E[0],ki),Xe(E[1],Qs),Xe(E[2],Qs),Xe(E[3],ki),n=255;n>=0;--n)t=s[n/8|0]>>(n&7)&1,Yi(E,e,t),Ki(e,E),Ki(E,E),Yi(E,e,t)}function Wi(E,e){let s=O(),t=O(),n=O();Un(n,e[2]),ne(s,e[0],n),ne(t,e[1],n),Qi(E,t),E[31]^=Pn(s)<<7}function Un(E,e){let s=O(),t;for(t=0;t<16;t++)s[t]=e[t];for(t=253;t>=0;t--)Ln(s,s),t!==2&&t!==4&&ne(s,s,e);for(t=0;t<16;t++)E[t]=s[t]}function Ln(E,e){ne(E,e,e)}function Pn(E){let e=new Uint8Array(32);return Qi(e,E),e[0]&1}function Ks(E){let e,s,t=1;for(e=0;e<16;e++)s=E[e]+t+65535,t=Math.floor(s/65536),E[e]=s-t*65536;E[0]+=t-1+37*(t-1)}function Qi(E,e){let s,t,n,o=O(),a=O();for(s=0;s<16;s++)a[s]=e[s];for(Ks(a),Ks(a),Ks(a),t=0;t<2;t++){for(o[0]=a[0]-65517,s=1;s<15;s++)o[s]=a[s]-65535-(o[s-1]>>16&1),o[s-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),n=o[15]>>16&1,o[14]&=65535,qi(a,o,1-n)}for(s=0;s<16;s++)E[2*s]=a[s]&255,E[2*s+1]=a[s]>>8}function Yi(E,e,s){for(let t=0;t<4;t++)qi(E[t],e[t],s)}function Ot(E,e,s){for(let t=0;t<16;t++)E[t]=e[t]+s[t]}function qt(E,e,s){for(let t=0;t<16;t++)E[t]=e[t]-s[t]}function Ki(E,e){let s=O(),t=O(),n=O(),o=O(),a=O(),A=O(),u=O(),h=O(),l=O();qt(s,E[1],E[0]),qt(l,e[1],e[0]),ne(s,s,l),Ot(t,E[0],E[1]),Ot(l,e[0],e[1]),ne(t,t,l),ne(n,E[3],e[3]),ne(n,n,dn),ne(o,E[2],e[2]),Ot(o,o,o),qt(a,t,s),qt(A,o,n),Ot(u,o,n),Ot(h,t,s),ne(E[0],a,A),ne(E[1],h,u),ne(E[2],u,A),ne(E[3],a,h)}function qi(E,e,s){let t=~(s-1),n;for(let o=0;o<16;o++)n=t&(E[o]^e[o]),E[o]^=n,e[o]^=n}var Xt=vs;var je=m(require("node:crypto"),1);var mn=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),qs=class extends ee{#e;constructor(e,s,t,n,o,a){super(n,a,o),this.multiAuthResolver=a,this.pluginData=t,this.sequenceNo=e,this.compressSequenceNo=s}start(e,s,t){t.extSalt?(this.parseExtSalt(Buffer.from(t.extSalt,"hex"),t),this.sendScramble(e,s,t)):(e.startPacket(this),e.writeEmptyPacket(!0),this.onPacketReceive=this.requestForSalt)}requestForSalt(e,s,t,n){this.parseExtSalt(e.readBufferRemaining(),n),this.sendScramble(s,t,n)}parseExtSalt(e,s){let t=0;if(e[t]==1&&(t+=1),e.length<2||e[t]!==80||e[t+1]>20)return this.throwError(w("Wrong parsec authentication format",N.ER_AUTHENTICATION_BAD_PACKET,s),s);this.iterations=e[t+1],this.salt=e.slice(t+2)}sendScramble(e,s,t){let n=je.default.pbkdf2Sync(s.password||"",this.salt,1024<<this.iterations,32,"sha512"),o=Dn(n),a=this.getEd25519PublicKeyFromPrivateKey(n);this.#e=Buffer.concat([Buffer.from([80,this.iterations]),this.salt,a]);let A=je.default.randomBytes(32),u=Buffer.concat([this.pluginData,A]),h=je.default.sign(null,u,o);e.startPacket(this),e.writeBuffer(A,0,32),e.writeBuffer(h,0,64),e.flushPacket(),this.emit("send_end"),this.onPacketReceive=this.multiAuthResolver}getEd25519PublicKeyFromPrivateKey(e){let s=je.default.createPrivateKey({key:Buffer.concat([mn,e]),format:"der",type:"pkcs8",name:"ed25519"});return je.default.createPublicKey(s).export({type:"spki",format:"der"}).subarray(-32)}isMitmProof(){return!0}hash(e){return this.#e}},Dn=E=>{let e=Buffer.from("302e020100300506032b657004220420","hex"),s=Buffer.concat([e,E]);return je.default.createPrivateKey({key:s,format:"der",type:"pkcs8"})},Xi=qs;var Xs=class extends ee{constructor(e,s,t,n,o,a){super(n,a,o),this.pluginData=t,this.sequenceNo=e,this.compressSequenceNo=s,this.counter=0,this.multiAuthResolver=a}requireSecure(){return!0}start(e,s,t){this.exchange(this.pluginData,e,s,t),this.onPacketReceive=this.response}exchange(e,s,t,n){s.startPacket(this);let o;Array.isArray(t.password)?(o=t.password[this.counter],this.counter++):o=t.password,o&&s.writeString(o),s.writeInt8(0),s.flushPacket()}response(e,s,t,n){switch(e.peek()){case 0:case 255:return this.emit("send_end"),this.multiAuthResolver(e,s,t,n);default:let a=e.readBuffer();this.exchange(a,s,t,n),this.onPacketReceive=this.response}}},ji=Xs;var $i=m(require("node:fs"),1),js=m(require("node:crypto"),1);var jt=m(require("node:crypto"),1),$s=class E extends ee{constructor(e,s,t,n,o,a){super(n,a,o),this.pluginData=t,this.sequenceNo=e,this.compressSequenceNo=s,this.counter=0,this.counter=0,this.initialState=!0,this.multiAuthResolver=a}start(e,s,t){this.exchange(this.pluginData,e,s,t),this.onPacketReceive=this.response}exchange(e,s,t,n){if(this.initialState){if(t.password)if(t.ssl){s.startPacket(this),t.password&&s.writeString(t.password),s.writeInt8(0),s.flushPacket();return}else if(t.rsaPublicKey)try{let o=t.rsaPublicKey;o.includes("-----BEGIN")||(o=$i.default.readFileSync(o,"utf8")),this.publicKey=E.retrievePublicKey(o)}catch(o){return this.throwError(o,n)}else{if(!t.allowPublicKeyRetrieval)return this.throwError(w("RSA public key is not available client side. Either set option `rsaPublicKey` to indicate public key path, or allow public key retrieval with option `allowPublicKeyRetrieval`",N.ER_CANNOT_RETRIEVE_RSA_KEY,n),n);this.initialState=!1,s.startPacket(this),s.writeInt8(1),s.flushPacket();return}else{s.startPacket(this),s.writeEmptyPacket(!0);return}E.sendSha256PwdPacket(this,this.pluginData,this.publicKey,t.password,s)}else this.publicKey=E.retrievePublicKey(e.toString("utf8",1)),E.sendSha256PwdPacket(this,this.pluginData,this.publicKey,t.password,s)}static retrievePublicKey(e){return e.replace("(-+BEGIN PUBLIC KEY-+\\r?\\n|\\n?-+END PUBLIC KEY-+\\r?\\n?)","")}static sendSha256PwdPacket(e,s,t,n,o){let a=s.slice(0,s.length-1);o.startPacket(e);let A=E.encrypt(a,n,t);o.writeBuffer(A,0,A.length),o.flushPacket()}static encryptSha256Password(e,s){if(!e)return Buffer.alloc(0);let t=jt.default.createHash("sha256"),n=t.update(e,"utf8").digest();t=jt.default.createHash("sha256");let o=t.update(n).digest();t=jt.default.createHash("sha256"),t.update(o),t.update(s);let a=t.digest(),A=Buffer.allocUnsafe(a.length);for(let u=0;u<a.length;u++)A[u]=n[u]^a[u];return A}static encrypt(e,s,t){let n=Buffer.from(s+"\0"),o=Buffer.allocUnsafe(n.length),a=e.length;for(let A=0;A<o.length;A++)o[A]=n[A]^e[A%a];return js.default.publicEncrypt({key:t,padding:js.default.constants.RSA_PKCS1_OAEP_PADDING},o)}response(e,s,t,n){switch(e.peek()){case 0:case 255:return this.emit("send_end"),this.multiAuthResolver(e,s,t,n);default:let a=e.readBufferRemaining();this.exchange(a,s,t,n),this.onPacketReceive=this.response}}},Ge=$s;var Zi=m(require("node:fs"),1);var $e={INIT:"INIT",FAST_AUTH_RESULT:"FAST_AUTH_RESULT",REQUEST_SERVER_KEY:"REQUEST_SERVER_KEY",SEND_AUTH:"SEND_AUTH"},Zs=class extends ee{constructor(e,s,t,n,o,a){super(n,a,o),this.multiAuthResolver=a,this.pluginData=t,this.sequenceNo=e,this.compressSequenceNo=s,this.counter=0,this.state=$e.INIT}start(e,s,t){this.exchange(this.pluginData,e,s,t),this.onPacketReceive=this.response}exchange(e,s,t,n){switch(this.state){case $e.INIT:let o=this.pluginData.slice(0,this.pluginData.length-1),a=Ge.encryptSha256Password(t.password,o);s.startPacket(this),a.length>0?(s.writeBuffer(a,0,a.length),s.flushPacket()):s.writeEmptyPacket(!0),this.state=$e.FAST_AUTH_RESULT;return;case $e.FAST_AUTH_RESULT:switch(e[1]){case 3:return;case 4:if(this.isSecureConnection(t)){if(n.requireValidCert&&n.selfSignedCertificate)return this.throwError(w("cannot send a `caching_sha2_password` and SSL without providing server certificates, cannot send password in clear on an untrusted SSL connection",N.ER_SELF_SIGNED_SHA256,n),n);s.startPacket(this),s.writeString(t.password),s.writeInt8(0),s.flushPacket();return}if(t.cachingRsaPublicKey){try{let u=t.cachingRsaPublicKey;u.includes("-----BEGIN")||(u=Zi.default.readFileSync(u,"utf8")),this.publicKey=Ge.retrievePublicKey(u)}catch(u){return this.throwError(u,n)}Ge.sendSha256PwdPacket(this,this.pluginData,this.publicKey,t.password,s)}else{if(!t.allowPublicKeyRetrieval)return this.throwError(w("RSA public key is not available client side. Either set option `cachingRsaPublicKey` to indicate public key path, or allow public key retrieval with option `allowPublicKeyRetrieval`",N.ER_CANNOT_RETRIEVE_RSA_KEY,n),n);this.state=$e.REQUEST_SERVER_KEY,s.startPacket(this),s.writeInt8(2),s.flushPacket()}}return;case $e.REQUEST_SERVER_KEY:this.publicKey=Ge.retrievePublicKey(e.toString(void 0,1)),this.state=$e.SEND_AUTH,Ge.sendSha256PwdPacket(this,this.pluginData,this.publicKey,t.password,s);return}}response(e,s,t,n){switch(e.peek()){case 0:case 255:return this.emit("send_end"),this.multiAuthResolver(e,s,t,n);default:let a=e.readBufferRemaining();this.exchange(a,s,t,n),this.onPacketReceive=this.response}}},Ji=Zs;var wn={mysql_native_password:_t,mysql_clear_password:yi,client_ed25519:Xt,parsec:Xi,dialog:ji,sha256_password:Ge,caching_sha2_password:Ji},zs=class E extends _e{constructor(e,s,t,n,o,a){super(e,t,n),this.cmdParam=e,this._createSecureContext=o,this.getSocket=a,this.plugin=new Fi(this,s,a,this.handshakeResult,n)}onPacketReceive(e,s,t,n){this.plugin.sequenceNo=this.sequenceNo,this.plugin.compressSequenceNo=this.compressSequenceNo,this.plugin.onPacketReceive(e,s,t,n)}handshakeResult(e,s,t,n){let o=e.peek();switch(o){case 254:this.dispatchAuthSwitchRequest(e,s,t,n);return;case 0:if(this.plugin.onPacketReceive=null,e.skip(1),e.skipLengthCodedNumber(),e.skipLengthCodedNumber(),n.status=e.readUInt16(),n.requireValidCert)if(n.selfSignedCertificate){if(e.skip(2),e.remaining()){let u=e.readBufferLengthEncoded();if(u.length>0){if(!this.plugin.isMitmProof()||!this.cmdParam.opts.password)return this.throwNewError("Self signed certificates. Either set `ssl: { rejectUnauthorized: false }` (trust mode) or provide server certificate to client",!0,n,"08000",N.ER_SELF_SIGNED_NO_PWD);if(this.validateFingerPrint(u,n))return this.successEnd()}}return this.throwNewError("self-signed certificate",!0,n,"08000",N.ER_SELF_SIGNED)}else{let h=(t.ssl===!0||typeof t.ssl.checkServerIdentity!="function"?zi.default.checkServerIdentity:t.ssl.checkServerIdentity)(typeof t.ssl=="object"&&t.ssl.servername?t.ssl.servername:t.host,n.tlsCert);if(h)return this.throwNewError("certificate identify Error: "+h.message,!0,n,"08000",N.ER_TLS_IDENTITY_ERROR)}let a=!1;if(n.status&16384)for(e.skip(2),e.skipLengthCodedNumber();e.remaining();){let u=e.readUnsignedLength();if(u>0){let h=e.subPacketLengthEncoded(u);for(;h.remaining();)switch(h.readUInt8()){case 0:let R;do{R=h.subPacketLengthEncoded(h.readUnsignedLength());let S=R.readStringLengthEncoded(),C=R.readStringLengthEncoded();switch(S){case"character_set_client":if(n.collation=P.fromCharset(C),n.collation===void 0){this.throwError(new Error("unknown charset : '"+C+"'"),n);return}t.emit("collation",n.collation);break;case"redirect_url":C!==""&&(a=!0,n.redirect(C,this.successEnd.bind(this)));break;case"maxscale":n.maxscaleVersion=C;break;case"connection_id":n.threadId=parseInt(C);break;default:}}while(R.remaining()>0);break;case 1:let I=h.subPacketLengthEncoded(h.readUnsignedLength());n.database=I.readStringLengthEncoded();break}}}a||this.successEnd();return;case 255:this.plugin.onPacketReceive=null;let A=e.readError(n,this.displaySql(),void 0);return A.fatal=!0,n.requireValidCert&&n.selfSignedCertificate?this.plugin.throwNewError("Self signed certificates. Either set `ssl: { rejectUnauthorized: false }` (trust mode) or provide server certificate to client",!0,n,"08000",N.ER_SELF_SIGNED_NO_PWD):this.plugin.throwError(A,n);default:this.throwNewError(`Unexpected type of packet during handshake phase : ${o}`,!0,n,"42000",N.ER_AUTHENTICATION_BAD_PACKET)}}validateFingerPrint(e,s){if(e.length===0||!s.tlsFingerprint)return!1;if(e[0]!==1){let l=w("Unexpected hash format for fingerprint hash encoding",N.ER_UNEXPECTED_PACKET,this.info);return this.opts.logger.error&&this.opts.logger.error(l),!1}let t=this.plugin.hash(this.cmdParam.opts),o=Js.default.createHash("sha256").update(t).update(s.seed).update(Buffer.from(s.tlsFingerprint,"hex")).digest(),a=ai(o),A=e.toString("ascii",1,e.length).toLowerCase(),u=Buffer.from(a,"ascii"),h=Buffer.from(A,"ascii");return u.length===h.length&&Js.default.timingSafeEqual(u,h)}dispatchAuthSwitchRequest(e,s,t,n){let o,a;if(n.clientCapabilities&Se?(e.skip(1),e.remaining()?(o=e.readStringNullEnded(),a=e.readBufferRemaining()):(o="mysql_old_password",a=n.seed.subarray(0,8))):(o=e.readStringNullEnded("ascii"),a=e.readBufferRemaining()),t.restrictedAuth&&!t.restrictedAuth.includes(o)){this.throwNewError(`Unsupported authentication plugin ${o}. Authorized plugin: ${t.restrictedAuth.toString()}`,!0,n,"42000",N.ER_NOT_SUPPORTED_AUTH_PLUGIN);return}try{if(this.plugin.emit("end"),this.plugin.onPacketReceive=null,this.plugin=E.pluginHandler(o,this.plugin.sequenceNo,this.plugin.compressSequenceNo,a,n,t,s,this.cmdParam,this.reject,this.handshakeResult.bind(this)),this.plugin.requireSecure()&&!this.plugin.isSecureConnection(t))return this.throwNewError(`${o} authentication requires TLS or a local socket`,!0,n,"08S01",N.ER_CLEAR_PASSWORD_WITHOUT_SSL);if(n.requireValidCert&&n.selfSignedCertificate&&this.cmdParam.opts.password&&!this.plugin.isMitmProof())return this.throwNewError(`Unsupported authentication plugin ${o} with Self signed certificates.
Either set 'ssl: { rejectUnauthorized: false }' (trust mode) or provide server certificate to client`,!0,n,"08000",N.ER_SELF_SIGNED_BAD_PLUGIN);this.plugin.start(s,t,n)}catch(A){this.reject(A)}}static pluginHandler(e,s,t,n,o,a,A,u,h,l){let R=wn[e];if(!R)throw w(`Client does not support authentication protocol '${e}' requested by server.`,N.ER_AUTHENTICATION_PLUGIN_NOT_SUPPORTED,o,"08004");return new R(s,t,n,u,h,l)}},$t=zs;var gn=new Uint8Array([1,0,0,0,1]),rr=class extends _e{constructor(e,s,t){super(e,s,t)}start(e,s,t){s.logger.query&&s.logger.query("QUIT"),this.onPacketReceive=this.skipResults,e.fastFlush(this,gn),this.emit("send_end"),this.successEnd()}skipResults(e,s,t,n){}},ir=rr;var bn=new Uint8Array([1,0,0,0,14]),_r=class extends _e{constructor(e,s,t){super(e,s,t)}start(e,s,t){s.logger.query&&s.logger.query("PING"),this.onPacketReceive=this.readPingResponsePacket,e.fastFlush(this,bn),this.emit("send_end")}readPingResponsePacket(e,s,t,n){e.skip(1),e.skipLengthCodedNumber(),e.skipLengthCodedNumber(),n.status=e.readUInt16(),n.redirectRequest&&(n.status&1)===0?n.redirect(n.redirectRequest,this.successEnd.bind(this,null)):this.successEnd(null)}},nr=_r;var Mn=new Uint8Array([1,0,0,0,31]),or=class extends _e{constructor(e,s,t){super(e,s,t)}start(e,s,t){s.logger.query&&s.logger.query("RESET"),this.onPacketReceive=this.readResetResponsePacket,e.fastFlush(this,Mn),this.emit("send_end")}readResetResponsePacket(e,s,t,n){e.skip(1),e.skipLengthCodedNumber(),e.skipLengthCodedNumber(),n.status=e.readUInt16(),n.redirectRequest&&(n.status&1)===0?n.redirect(n.redirectRequest,this.successEnd.bind(this)):this.successEnd()}},e_=or;var p=[];p[0]="DECIMAL";p[1]="TINY";p[2]="SHORT";p[3]="INT";p[4]="FLOAT";p[5]="DOUBLE";p[6]="NULL";p[7]="TIMESTAMP";p[8]="BIGINT";p[9]="INT24";p[10]="DATE";p[11]="TIME";p[12]="DATETIME";p[13]="YEAR";p[14]="NEWDATE";p[15]="VARCHAR";p[16]="BIT";p[17]="TIMESTAMP2";p[18]="DATETIME2";p[19]="TIME2";p[245]="JSON";p[246]="NEWDECIMAL";p[247]="ENUM";p[248]="SET";p[249]="TINY_BLOB";p[250]="MEDIUM_BLOB";p[251]="LONG_BLOB";p[252]="BLOB";p[253]="VAR_STRING";p[254]="STRING";p[255]="GEOMETRY";var t_=p;var Hn=Buffer.from("point"),yn=Buffer.from("linestring"),kn=Buffer.from("polygon"),xn=Buffer.from("multipoint"),Vn=Buffer.from("multilinestring"),Wn=Buffer.from("multipolygon"),Yn=Buffer.from("json"),Kn={type:"Point"},vn={type:"LineString"},Qn={type:"Polygon"},qn={type:"MultiPoint"},Xn={type:"MultiLineString"},jn={type:"MultiPolygon"},Er=class{#e;constructor(e,s,t){if(this.#e=t?new ar(e):new Ar(e),s.clientCapabilities&Qt){let n=e.readUnsignedLength();if(n>0){let o=e.subPacketLengthEncoded(n);for(;o.remaining();)switch(o.readUInt8()){case 0:this._dataTypeName=o.readBufferLengthEncodedCopy();break;case 1:this._dataTypeFormat=o.readBufferLengthEncodedCopy();break;default:o.skip(o.readUnsignedLength());break}}}e.skip(1),this.collation=P.fromIndex(e.readUInt16()),this.columnLength=e.readUInt32(),this.columnType=e.readUInt8(),this.flags=e.readUInt16(),this.scale=e.readUInt8(),this.type=t_[this.columnType]}__getDefaultGeomVal(){let e=this._dataTypeName;return e?Buffer.compare(e,Hn)===0?Kn:Buffer.compare(e,yn)===0?vn:Buffer.compare(e,kn)===0?Qn:Buffer.compare(e,xn)===0?qn:Buffer.compare(e,Vn)===0?Xn:Buffer.compare(e,Wn)===0?jn:{type:e.toString("ascii")}:null}isDataTypeFormatJson(){return this._dataTypeFormat!=null&&Buffer.compare(this._dataTypeFormat,Yn)===0}get dataTypeName(){return this._dataTypeName?this._dataTypeName.toString("ascii"):void 0}db(){return this.#e.db()}schema(){return this.#e.schema()}table(){return this.#e.table()}orgTable(){return this.#e.orgTable()}name(){return this.#e.name()}orgName(){return this.#e.orgName()}signed(){return(this.flags&32)===0}isSet(){return(this.flags&2048)!==0}},Zt=class{constructor(e,s,t,n){this.buf=t,this.encoding=e,this.readString=s,this.initialPos=n}_readIdentifier(e){let s=this.initialPos;for(;e-- >0;){let o=this.buf[s++];s+=o<251?o:2+this.buf[s]+(this.buf[s+1]<<8)}let t=this.buf[s++],n=t<251?t:this.buf[s++]+(this.buf[s++]<<8);return this.readString(this.encoding,this.buf,s,n)}name(){return this._readIdentifier(3)}db(){let e=this.initialPos;return this.readString(this.encoding,this.buf,e+1,this.buf[e])}schema(){return this.db()}table(){let e=this.initialPos+1+this.buf[this.initialPos],s=this.buf[e++],t=s<251?s:this.buf[e++]+(this.buf[e++]<<8);return this.readString(this.encoding,this.buf,e,t)}orgTable(){return this._readIdentifier(2)}orgName(){return this._readIdentifier(4)}},ar=class extends Zt{constructor(e){e.skip(e.readUInt8());let s=e.pos;e.skip(e.readUInt8()),e.skip(e.readMetadataLength()),e.skip(e.readUInt8()),e.skip(e.readMetadataLength()),e.skip(e.readUInt8()),super(e.encoding,e.constructor.readString,e.buf,s)}},Ar=class extends Zt{colName;constructor(e){e.skip(e.readUInt8());let s=e.pos;e.skip(e.readUInt8()),e.skip(e.readMetadataLength()),e.skip(e.readUInt8());let t=e.readStringLengthEncoded();e.skip(e.readUInt8()),super(e.encoding,e.constructor.readString,e.buf,s),this.colName=t}name(){return this.colName}},Jt=Er;var p_=m(require("node:fs"),1);var c={Normal:1,String:2,SlashStarComment:3,Escape:4,EOLComment:5,Backtick:6,Placeholder:7},Fe=47,ot=42,ur=92,hr=35,Et=45,lr=10,at=34,At=39,cr=96,s_=63,$n=58,Zn=59;function r_(E){let e=[],s=c.Normal,t=0,n=!1,o,a=E.length;for(let A=0;A<a;A++){if(o=E[A],s===c.Escape&&!(o===At&&n||o===at&&!n)){s=c.String,t=o;continue}switch(o){case ot:s===c.Normal&&t===Fe&&(s=c.SlashStarComment);break;case Fe:if(s===c.SlashStarComment&&t===ot){s=c.Normal,t=0;continue}break;case hr:s===c.Normal&&(s=c.EOLComment);break;case Et:s===c.Normal&&t===Et&&(A+1<a?E[A+1]:0)<=32&&(s=c.EOLComment);break;case lr:s===c.EOLComment&&(s=c.Normal);break;case at:s===c.Normal?(s=c.String,n=!1):s===c.String&&!n?s=c.Normal:s===c.Escape&&(s=c.String);break;case At:s===c.Normal?(s=c.String,n=!0):s===c.String&&n?s=c.Normal:s===c.Escape&&(s=c.String);break;case ur:s===c.String&&(s=c.Escape);break;case s_:s===c.Normal&&e.push(A,++A);break;case cr:s===c.Backtick?s=c.Normal:s===c.Normal&&(s=c.Backtick);break}t=o}return e}function i_(E,e,s,t){let n=Object.assign({},s),o=[],a=[],A=c.Normal,u=0,h=!1,l,R=E.length;for(let I=0;I<R;I++){if(l=E[I],A===c.Escape&&!(l===At&&h||l===at&&!h)){A=c.String,u=l;continue}switch(l){case ot:A===c.Normal&&u===Fe&&(A=c.SlashStarComment);break;case Fe:if(A===c.SlashStarComment&&u===ot){A=c.Normal,u=0;continue}else A===c.Normal&&u===Fe&&(A=c.EOLComment);break;case hr:A===c.Normal&&(A=c.EOLComment);break;case Et:A===c.Normal&&u===Et&&(I+1<R?E[I+1]:0)<=32&&(A=c.EOLComment);break;case lr:A===c.EOLComment&&(A=c.Normal);break;case at:A===c.Normal?(A=c.String,h=!1):A===c.String&&!h?A=c.Normal:A===c.Escape&&(A=c.String);break;case At:A===c.Normal?(A=c.String,h=!0):A===c.String&&h?A=c.Normal:A===c.Escape&&(A=c.String);break;case ur:A===c.String&&(A=c.Escape);break;case s_:if(A===c.Normal){let S=Object.keys(n)[0];a.push(n[S]),delete n[S],o.push(I),o.push(++I)}break;case $n:if(A===c.Normal){let S=1;for(;I+S<R&&E[I+S]>=48&&E[I+S]<=57||E[I+S]>=65&&E[I+S]<=90||E[I+S]>=97&&E[I+S]<=122||E[I+S]===45||E[I+S]===95;)S++;o.push(I,I+S);let C=E.toString("utf8",I+1,I+S);I+=S;let d;if(C in n?(d=n[C],delete n[C]):d=s[C],d===void 0)throw f(`Placeholder '${C}' is not defined`,N.ER_PLACEHOLDER_UNDEFINED,e,"HY000",t.call());a.push(d)}break;case cr:A===c.Backtick?A=c.Normal:A===c.Normal&&(A=c.Backtick);break}u=l}return{paramPositions:o,values:a}}function zt(E){let e="",s=[],t=c.Normal,n="\0",o=!1,a=0,A=0,u=E.charAt(A++),h;for(;u!=="";){if(t===c.Escape&&!(u==="'"&&o||u==='"'&&!o)){t=c.String,n=u,u=E.charAt(A++);continue}switch(u){case"*":t===c.Normal&&n==="/"&&(t=c.SlashStarComment);break;case"/":if(t===c.SlashStarComment&&n==="*"){t=c.Normal,n="\0",u=E.charAt(A++);continue}break;case"#":t===c.Normal&&(t=c.EOLComment);break;case"-":if(t===c.Normal&&n==="-"){let l=E.charAt(A);(l===""||l<=" ")&&(t=c.EOLComment)}break;case`
`:t===c.EOLComment&&(t=c.Normal);break;case'"':t===c.Normal?(t=c.String,o=!1):t===c.String&&!o?t=c.Normal:t===c.Escape&&!o&&(t=c.String);break;case"'":t===c.Normal?(t=c.String,o=!0):t===c.String&&o?(t=c.Normal,o=!1):t===c.Escape&&o&&(t=c.String);break;case"\\":t===c.String&&(t=c.Escape);break;case":":if(t===c.Normal){for(e+=E.substring(a,A-1)+"?",h="";(u=E.charAt(A++))!==""&&u>="0"&&u<="9"||u>="A"&&u<="Z"||u>="a"&&u<="z"||u==="-"||u==="_";)h+=u;A--,s.push(h),a=A}break;case"`":t===c.Backtick?t=c.Normal:t===c.Normal&&(t=c.Backtick)}n=u,u=E.charAt(A++)}return a===0?e=E:e+=E.substring(a),{sql:e,placeHolderIndex:s}}function __(E,e,s){let t=new RegExp("^(\\s*\\/\\*([^\\*]|\\*[^\\/])*\\*\\/)*\\s*LOAD\\s+DATA\\s+((LOW_PRIORITY|CONCURRENT)\\s+)?LOCAL\\s+INFILE\\s+'"+s.replace(/\\/g,"\\\\\\\\").replace(".","\\.")+"'","i");return t.test(E)?!0:e!=null&&(t=new RegExp("^(\\s*\\/\\*([^\\*]|\\*[^\\/])*\\*\\/)*\\s*LOAD\\s+DATA\\s+((LOW_PRIORITY|CONCURRENT)\\s+)?LOCAL\\s+INFILE\\s+\\?","i"),t.test(E)&&e.length>0)?Array.isArray(e)?e[0].toLowerCase()===s.toLowerCase():e.toLowerCase()===s.toLowerCase():!1}function n_(E){let e=c.Normal,s=0,t,n=[],o=!1;for(let a=E.offset;a<E.end;a++){if(t=E.buffer[a],e===c.Escape&&!(t===At&&o||t===at&&!o)){e=c.String,s=t;continue}switch(t){case ot:e===c.Normal&&s===Fe&&(e=c.SlashStarComment);break;case Fe:e===c.SlashStarComment&&s===ot?e=c.Normal:e===c.Normal&&s===Fe&&(e=c.EOLComment);break;case hr:e===c.Normal&&(e=c.EOLComment);break;case Et:e===c.Normal&&s===Et&&(e=c.EOLComment);break;case lr:e===c.EOLComment&&(e=c.Normal);break;case at:e===c.Normal?(e=c.String,o=!1):e===c.String&&!o?e=c.Normal:e===c.Escape&&(e=c.String);break;case At:e===c.Normal?(e=c.String,o=!0):e===c.String&&o?e=c.Normal:e===c.Escape&&(e=c.String);break;case ur:e===c.String&&(e=c.Escape);break;case Zn:e===c.Normal&&(n.push(E.buffer.toString("utf8",E.offset,a)),E.offset=a+1);break;case cr:e===c.Backtick?e=c.Normal:e===c.Normal&&(e=c.Backtick);break}s=t}return n}function ns(E,e){E.skip(1);let s=e.length+9>>3,t=E.buf.subarray(E.pos,E.pos+s);return E.pos+=s,t}function A_(E,e,s,t,n){let o=(t[n+2>>3]&1<<(n+2&7))>0;E.string=()=>o?null:e.readStringLengthEncoded(),E.buffer=()=>o?null:e.readBufferLengthEncoded(),E.float=()=>o?null:e.readFloat(),E.tiny=()=>o?null:E.signed()?e.readInt8():e.readUInt8(),E.short=()=>o?null:E.signed()?e.readInt16():e.readUInt16(),E.int=()=>o?null:e.readInt32(),E.long=()=>o?null:e.readBigInt64(),E.decimal=()=>o?null:e.readDecimalLengthEncoded(),E.date=()=>o?null:e.readBinaryDate(s),E.datetime=()=>o?null:e.readBinaryDateTime(),E.geometry=()=>{let a=E.__getDefaultGeomVal();return o?a:e.readGeometry(a)}}function fr(E,e){let s=E.signed()?Oe[E.columnType]:de[E.columnType];if(s)return s;switch(E.columnType){case 8:return E.signed()?e.bigIntAsNumber||e.supportBigNumbers?Eo:no:e.bigIntAsNumber||e.supportBigNumbers?oo:_o;case 12:case 7:return e.dateStrings?uo.bind(null,E.scale):Ao;case 0:case 246:return E.scale===0?ho:lo;case 255:let t=E.__getDefaultGeomVal();return ao.bind(null,t);case 16:return E.columnLength===1&&e.bitOneIsBoolean?co:E_;case 245:return e.jsonStrings?a_:o_;default:return E.isDataTypeFormatJson()&&e.autoJsonMap?o_:E.collation.index===63?E_:E.isSet()?No:a_}}var D=(E,e)=>(e[E+2>>3]&1<<(E+2&7))>0,zn=(E,e,s,t,n)=>D(n,t)?null:E.readInt8(),eo=(E,e,s,t,n)=>D(n,t)?null:E.readUInt8(),u_=(E,e,s,t,n)=>D(n,t)?null:E.readInt16(),h_=(E,e,s,t,n)=>D(n,t)?null:E.readUInt16(),to=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readInt24();return E.skip(1),o},so=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readUInt24();return E.skip(1),o},ro=(E,e,s,t,n)=>D(n,t)?null:E.readInt32(),io=(E,e,s,t,n)=>D(n,t)?null:E.readUInt32(),l_=(E,e,s,t,n)=>D(n,t)?null:E.readFloat(),c_=(E,e,s,t,n)=>D(n,t)?null:E.readDouble(),_o=function(E,e,s,t,n){return D(n,t)?null:E.readBigUInt64()},no=function(E,e,s,t,n){return D(n,t)?null:E.readBigInt64()},oo=function(E,e,s,t,n){if(D(n,t))return null;let o=E.readBigUInt64();return e.bigIntAsNumber&&e.checkNumberRange&&!Number.isSafeInteger(Number(o))?s(`value ${o} can't safely be converted to number`,!1,null,"42000",N.ER_PARSING_PRECISION):e.supportBigNumbers&&(e.bigNumberStrings||!Number.isSafeInteger(Number(o)))?o.toString():Number(o)},Eo=function(E,e,s,t,n){if(D(n,t))return null;let o=E.readBigInt64();return e.bigIntAsNumber&&e.checkNumberRange&&!Number.isSafeInteger(Number(o))?s(`value ${o} can't safely be converted to number`,!1,null,"42000",N.ER_PARSING_PRECISION):e.supportBigNumbers&&(e.bigNumberStrings||!Number.isSafeInteger(Number(o)))?o.toString():Number(o)},ao=(E,e,s,t,n,o)=>D(o,n)?E:e.readGeometry(E),N_=(E,e,s,t,n)=>D(n,t)?null:E.readBinaryDate(e),Ao=(E,e,s,t,n)=>D(n,t)?null:E.readBinaryDateTime(),uo=(E,e,s,t,n,o)=>D(o,n)?null:e.readBinaryDateTimeAsString(E),I_=(E,e,s,t,n)=>D(n,t)?null:E.readBinaryTime(),ho=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readDecimalLengthEncoded();return o!=null&&(e.decimalAsNumber||e.supportBigNumbers)?e.decimalAsNumber&&e.checkNumberRange&&!Number.isSafeInteger(Number(o))?s(`value ${o} can't safely be converted to number`,!1,null,"42000",N.ER_PARSING_PRECISION):e.supportBigNumbers&&(e.bigNumberStrings||!Number.isSafeInteger(Number(o)))?o:Number(o):o},lo=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readDecimalLengthEncoded();if(o!=null&&(e.decimalAsNumber||e.supportBigNumbers)){let a=Number(o);return e.supportBigNumbers&&(e.bigNumberStrings||Number.isInteger(a)&&!Number.isSafeInteger(a))?o:a}return o},o_=(E,e,s,t,n)=>D(n,t)?null:JSON.parse(E.readStringLengthEncoded()),co=(E,e,s,t,n)=>D(n,t)?null:E.readBufferLengthEncoded()[0]===1,E_=(E,e,s,t,n)=>D(n,t)?null:E.readBufferLengthEncoded(),No=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readStringLengthEncoded();return o==null?null:o===""?[]:o.split(",")},a_=(E,e,s,t,n)=>D(n,t)?null:E.readStringLengthEncoded(),Oe=Array(256);Oe[1]=zn;Oe[13]=u_;Oe[2]=u_;Oe[9]=to;Oe[3]=ro;Oe[4]=l_;Oe[5]=c_;Oe[10]=N_;Oe[11]=I_;var de=Array(256);de[1]=eo;de[13]=h_;de[2]=h_;de[9]=so;de[3]=io;de[4]=l_;de[5]=c_;de[10]=N_;de[11]=I_;var R_=1024;function Cr(E,e){let s=ce[E.columnType];if(s)return s;switch(E.columnType){case 0:case 246:return E.scale===0?po:Uo;case 8:return e.bigIntAsNumber||e.supportBigNumbers?Oo:Ro;case 255:let t=E.__getDefaultGeomVal();return function(n,o,a){return n.readGeometry(t)};case 16:return E.columnLength===1&&e.bitOneIsBoolean?fo:f_;case 245:return e.jsonStrings?S_:C_;default:return E.isDataTypeFormatJson()&&e.autoJsonMap?C_:E.collation.index===63?f_:E.isSet()?Co:S_}}function T_(E,e,s,t,n){let o=e;E.string=()=>o.readStringLengthEncoded(),E.buffer=()=>o.readBufferLengthEncoded(),E.float=()=>o.readFloatLengthCoded(),E.tiny=E.short=E.int=()=>o.readIntLengthEncoded(),E.long=()=>o.readBigIntLengthEncoded(),E.decimal=()=>o.readDecimalLengthEncoded(),E.date=()=>o.readDate(s),E.datetime=()=>o.readDateTime(),E.geometry=()=>o.readGeometry(E.__getDefaultGeomVal())}var Ut=(E,e,s)=>E.readIntLengthEncoded(),S_=(E,e,s)=>E.readStringLengthEncoded(),O_=(E,e,s)=>E.readFloatLengthCoded(),Ro=(E,e,s)=>E.readBigIntLengthEncoded(),So=(E,e,s)=>E.readAsciiStringLengthEncoded(),fo=(E,e,s)=>{let t=E.readBufferLengthEncoded();return t==null?null:t[0]===1},f_=(E,e,s)=>E.readBufferLengthEncoded(),C_=(E,e,s)=>{let t=E.readStringLengthEncoded();return t===null?null:JSON.parse(t)},Co=(E,e,s)=>{let t=E.readStringLengthEncoded();return t==null?null:t===""?[]:t.split(",")},To=(E,e,s)=>e.dateStrings?E.readAsciiStringLengthEncoded():E.readDate(),d_=(E,e,s)=>e.dateStrings?E.readAsciiStringLengthEncoded():E.readDateTime(),ce=new Array(256);ce[1]=Ut;ce[2]=Ut;ce[3]=Ut;ce[9]=Ut;ce[13]=Ut;ce[4]=O_;ce[5]=O_;ce[10]=To;ce[12]=d_;ce[7]=d_;ce[11]=So;var Oo=(E,e,s)=>{let t=E.readUnsignedLength();if(t===null)return null;if(t<16){let a=E._atoi(t);return e.supportBigNumbers&&e.bigNumberStrings?`${a}`:a}if(t>R_)return E.skip(t),s(`numeric value length (${t}) exceeds maximum of ${R_} characters - refusing to parse`,!1,null,"42000",N.ER_PARSING_PRECISION);let n=E.readBigIntFromLen(t);if(e.bigIntAsNumber&&e.checkNumberRange&&!Number.isSafeInteger(Number(n)))return s(`value ${n} can't safely be converted to number`,!1,null,"42000",N.ER_PARSING_PRECISION);let o=Number(n);return e.supportBigNumbers&&(e.bigNumberStrings||!Number.isSafeInteger(o))?n.toString():o},po=(E,e,s)=>{let t=E.readDecimalLengthEncoded();if(t===null)return null;if(!(e.decimalAsNumber||e.supportBigNumbers))return t;let n=Number(t);return e.decimalAsNumber&&e.checkNumberRange&&!Number.isSafeInteger(n)?s(`value ${t} can't safely be converted to number`,!1,null,"42000",N.ER_PARSING_PRECISION):e.supportBigNumbers&&(e.bigNumberStrings||!Number.isSafeInteger(n))?t:n},Uo=(E,e,s)=>{let t=E.readDecimalLengthEncoded();if(t===null)return null;if(!(e.decimalAsNumber||e.supportBigNumbers))return t;let n=Number(t);return e.supportBigNumbers&&(e.bigNumberStrings||Number.isInteger(n)&&!Number.isSafeInteger(n))?t:n};var Tr=class{constructor(e,s,t){this.affectedRows=e,this.insertId=s,this.warningStatus=t}},Ne=Tr;var mo=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__"]),Or=class E extends _e{constructor(e,s,t,n){super(n,e,s),this._responseIndex=0,this._rows=[],this.opts=n.opts?Object.assign({},t,n.opts):t,this.sql=n.sql,this.initialValues=n.values,this.canSkipMeta=!1}readResponsePacket(e,s,t,n){switch(e.peek()){case 0:return this.readOKPacket(e,s,t,n);case 255:return this.handleErrorPacket(e,n);case 251:return this.readLocalInfile(e,s,t,n);default:return this.readResultSet(e,n)}}handleErrorPacket(e,s){this._columns=null;let t=e.readError(s,this.opts.logParam?this.displaySql():this.sql,this.cmdParam.stack);return s.status|=1,this.throwError(t,s)}readResultSet(e,s){if(this._columnCount=e.readUnsignedLength(),this._rows.push([]),this.canSkipMeta&&s.serverPermitSkipMeta&&e.readUInt8()===0)return this.handleSkippedMeta(s);this._columns=[],this.onPacketReceive=this.readColumn}handleSkippedMeta(e){this._columns=this.prepare.columns,this._columnCount=this._columns.length,this.emit("fields",this._columns),this.setParser(),this.onPacketReceive=e.eofDeprecated?this.readResultSetRow:this.readIntermediateEOF}readOKPacket(e,s,t,n){e.skip(1);let o=e.readUnsignedLength(),a=this.processInsertId(e.readInsertId(),n);n.status=e.readUInt16();let A=new Ne(o,a,e.readUInt16()),u=!1;return n.status&16384&&(u=this.processSessionStateChanges(e,n,t)),this.inStream&&this.handleNewRows(A),u||(n.redirectRequest&&(n.status&1)===0&&(n.status&8)===0?n.redirect(n.redirectRequest,this.okPacketSuccess.bind(this,A,n)):this.okPacketSuccess(A,n)),null}processInsertId(e,s){return this.opts.supportBigNumbers||this.opts.insertIdAsNumber?this.opts.insertIdAsNumber&&this.opts.checkNumberRange&&!Number.isSafeInteger(Number(e))?(this.onPacketReceive=s.status&8?this.readResponsePacket:null,this.throwUnexpectedError(`last insert id value ${e} can't safely be converted to number`,!1,s,"42000",N.ER_PARSING_PRECISION),e):this.opts.supportBigNumbers&&(this.opts.bigNumberStrings||!Number.isSafeInteger(Number(e)))?e.toString():Number(e):e}processSessionStateChanges(e,s,t){let n=!1;for(e.skipLengthCodedNumber();e.remaining();){let o=e.readUnsignedLength();if(o>0){let a=e.subPacketLengthEncoded(o);for(;a.remaining();)switch(a.readUInt8()){case 0:n=this.processSystemVariables(a,s,t)||n;break;case 1:s.database=this.readSchemaChange(a);break}}}return n}processSystemVariables(e,s,t){let n=!1,o;do{o=e.subPacketLengthEncoded(e.readUnsignedLength());let a=o.readStringLengthEncoded(),A=o.readStringLengthEncoded();switch(a){case"character_set_client":if(s.collation=P.fromCharset(A),s.collation===void 0)return this.throwError(new Error(`unknown charset: '${A}'`),s),!1;t.emit("collation",s.collation);break;case"redirect_url":A!==""&&(n=!0,s.redirect(A,this.okPacketSuccess.bind(this,this.okPacket,s)));break;case"connection_id":s.threadId=parseInt(A);break}}while(o.remaining()>0);return n}readSchemaChange(e){return e.subPacketLengthEncoded(e.readUnsignedLength()).readStringLengthEncoded()}okPacketSuccess(e,s){if(this._responseIndex===0)return s.status&8?(this._rows.push(e),this._responseIndex++,this.onPacketReceive=this.readResponsePacket):this.success(this.opts.metaAsArray?[e,[]]:e);if(this._rows.push(e),s.status&8)return this._responseIndex++,this.onPacketReceive=this.readResponsePacket;this.opts.metaAsArray?(this._meta||(this._meta=new Array(this._responseIndex)),this._meta[this._responseIndex]=null,this.success([this._rows,this._meta])):this.success(this._rows)}success(e){this.successEnd(e),this._columns=null,this._rows=[]}readColumn(e,s,t,n){this._columns.push(new Jt(e,n,this.opts.rowsAsArray)),this._columns.length===this._columnCount&&(this.setParser(),this.canSkipMeta&&n.serverPermitSkipMeta&&this.prepare!=null&&this._responseIndex===0&&(this.prepare.columns=this._columns),this.emit("fields",this._columns),this.onPacketReceive=n.eofDeprecated?this.readResultSetRow:this.readIntermediateEOF)}setParser(){if(this._parseFunction=new Array(this._columnCount),this.opts.typeCast)for(let e=0;e<this._columnCount;e++)this._parseFunction[e]=this.readCastValue.bind(this,this._columns[e]);else{let e=this.binary?fr:Cr;for(let s=0;s<this._columnCount;s++)this._parseFunction[s]=e(this._columns[s],this.opts)}if(this.opts.rowsAsArray)this.parseRow=this.parseRowAsArray;else if(this.tableHeader=new Array(this._columnCount),this.parseRow=this.binary?this.parseRowStdBinary:this.parseRowStdText,this.opts.nestTables)this.configureNestedTables();else{for(let e=0;e<this._columnCount;e++)this.tableHeader[e]=this._columns[e].name();this.checkDuplicates()}}configureNestedTables(){if(typeof this.opts.nestTables=="string"){for(let e=0;e<this._columnCount;e++)this.tableHeader[e]=this._columns[e].table()+this.opts.nestTables+this._columns[e].name();this.checkDuplicates()}else if(this.opts.nestTables===!0){this.parseRow=this.parseRowNested;for(let e=0;e<this._columnCount;e++)this.tableHeader[e]=[this._columns[e].table(),this._columns[e].name()];this.checkNestTablesDuplicatesAndPrivateFields()}}checkDuplicates(){if(this.opts.checkDuplicate){let e=new Set;for(let s=0;s<this._columnCount;s++){let t=this.tableHeader[s];if(e.has(t)){this.throwUnexpectedError(`Error in results, duplicate field name \`${t}\`.
(see option \`checkDuplicate\`)`,!1,null,"42000",N.ER_DUPLICATE_FIELD);return}e.add(t)}}}checkNestTablesDuplicatesAndPrivateFields(){if(this.opts.checkDuplicate)for(let e=0;e<this._columnCount;e++)for(let s=0;s<e;s++)this.tableHeader[s][0]===this.tableHeader[e][0]&&this.tableHeader[s][1]===this.tableHeader[e][1]&&this.throwUnexpectedError(`Error in results, duplicate field name \`${this.tableHeader[e][0]}\`.\`${this.tableHeader[e][1]}\`
(see option \`checkDuplicate\`)`,!1,null,"42000",N.ER_DUPLICATE_FIELD);for(let e=0;e<this._columnCount;e++)mo.has(this.tableHeader[e][0])&&(this.throwUnexpectedError(`Use of \`${this.tableHeader[e][0]}\` is not permitted with option \`nestTables\``,!1,null,"42000",N.ER_PRIVATE_FIELDS_USE),this.parseRow=()=>({}))}readIntermediateEOF(e,s,t,n){if(e.peek()!==254)return this.throwNewError("Error in protocol, expected EOF packet",!0,n,"42000",N.ER_EOF_EXPECTED);e.skip(3),n.status=e.readUInt16(),this.isOutParameter=n.status&4096,this.onPacketReceive=this.readResultSetRow}handleNewRows(e){this._rows[this._responseIndex].push(e)}readResultSetRow(e,s,t,n){let o=e.peek();if(o>=254){if(o===255)return n.status|=1,this.throwError(e.readError(n,this.opts.logParam?this.displaySql():this.sql,this.cmdParam.err),n);if(!n.eofDeprecated&&e.length()<13||n.eofDeprecated&&e.length()<16777215){n.eofDeprecated?(e.skip(1),e.skipLengthCodedNumber(),e.skipLengthCodedNumber(),n.status=e.readUInt16()):(e.skip(3),n.status=e.readUInt16()),n.redirectRequest&&(n.status&1)===0&&(n.status&8)===0?n.redirect(n.redirectRequest,this.resultSetEndingPacketResult.bind(this,n)):this.resultSetEndingPacketResult(n);return}}this.handleNewRows(this.parseRow(e))}resultSetEndingPacketResult(e){if(this.opts.metaAsArray){if(e.status&8||this.isOutParameter)return this._meta||(this._meta=[]),this._meta[this._responseIndex]=this._columns,this._responseIndex++,this.onPacketReceive=this.readResponsePacket;this._responseIndex===0?this.success([this._rows[0],this._columns]):(this._meta||(this._meta=[]),this._meta[this._responseIndex]=this._columns,this.success([this._rows,this._meta]))}else{if(Object.defineProperty(this._rows[this._responseIndex],"meta",{value:this._columns,writable:!0,enumerable:this.opts.metaEnumerable}),e.status&8||this.isOutParameter)return this._responseIndex++,this.onPacketReceive=this.readResponsePacket;this.success(this._responseIndex===0?this._rows[0]:this._rows)}}displaySql(){if(this.opts&&this.initialValues){if(this.sql.length>this.opts.debugLen)return this.sql.substring(0,this.opts.debugLen)+"...";let e=this.sql+" - parameters:";return E.logParameters(this.opts,e,this.initialValues)}return this.sql.length>this.opts.debugLen?this.sql.substring(0,this.opts.debugLen)+"... - parameters:[]":this.sql+" - parameters:[]"}static logParameters(e,s,t){if(e.namedPlaceholders){s+="{";let n=!0;for(let o in t){n?n=!1:s+=",",s+="'"+o+"':";let a=t[o];if(s=E.logParam(s,a),s.length>e.debugLen)return s.substring(0,e.debugLen)+"..."}s+="}"}else{if(s+="[",Array.isArray(t))for(let n=0;n<t.length;n++){n!==0&&(s+=",");let o=t[n];if(s=E.logParam(s,o),s.length>e.debugLen)return s.substring(0,e.debugLen)+"..."}else if(s=E.logParam(s,t),s.length>e.debugLen)return s.substring(0,e.debugLen)+"...";s+="]"}return s}parseRowAsArray(e){let s=new Array(this._columnCount),t=this.binary?ns(e,this._columns):null;for(let n=0;n<this._columnCount;n++)s[n]=this._parseFunction[n](e,this.opts,this.unexpectedError,t,n);return s}parseRowNested(e){let s={},t=this.binary?ns(e,this._columns):null;for(let n=0;n<this._columnCount;n++)s[this.tableHeader[n][0]]||(s[this.tableHeader[n][0]]={}),s[this.tableHeader[n][0]][this.tableHeader[n][1]]=this._parseFunction[n](e,this.opts,this.unexpectedError,t,n);return s}parseRowStdText(e){let s={};for(let t=0;t<this._columnCount;t++)s[this.tableHeader[t]]=this._parseFunction[t](e,this.opts,this.unexpectedError);return s}parseRowStdBinary(e){let s=ns(e,this._columns),t={};for(let n=0;n<this._columnCount;n++)t[this.tableHeader[n]]=this._parseFunction[n](e,this.opts,this.unexpectedError,s,n);return t}readCastValue(e,s,t,n,o,a){this.binary?A_(e,s,t,o,a):T_(e,s,t,o,a);let A=this.binary?fr:Cr;return t.typeCast(e,A(e,t).bind(null,s,t,n,o,a))}readLocalInfile(e,s,t,n){if(e.skip(1),s.startPacket(this),!t.permitLocalInfile){s.writeEmptyPacket();let A=f("Cannot send local file when `permitLocalInfile` option is disabled. The server requested a local file although the capability was not advertised. Check for malicious server / proxy",N.ER_LOCAL_INFILE_DISABLED,n,"HY000",this.sql);return process.nextTick(this.reject,A),this.reject=null,this.resolve=null,this.onPacketReceive=this.readResponsePacket}let o=e.readStringRemaining();if(!__(this.sql,this.initialValues,o)){s.writeEmptyPacket();let A=f("LOCAL INFILE wrong filename. '"+o+"' doesn't correspond to query "+this.sql+". Query cancelled. Check for malicious server / proxy",N.ER_LOCAL_INFILE_WRONG_FILENAME,n,"HY000",this.sql);return process.nextTick(this.reject,A),this.reject=null,this.resolve=null,this.onPacketReceive=this.readResponsePacket}let a;try{a=this.opts.infileStreamFactory?this.opts.infileStreamFactory(o):p_.default.createReadStream(o)}catch(A){s.writeEmptyPacket();let u=f("LOCAL INFILE infileStreamFactory failed",N.ER_LOCAL_INFILE_NOT_READABLE,n,"22000",this.opts.logParam?this.displaySql():this.sql);return u.cause=A,process.nextTick(this.reject,u),this.reject=null,this.resolve=null,this.onPacketReceive=this.readResponsePacket}a.on("error",function(A){s.writeEmptyPacket();let u=f(`LOCAL INFILE command failed: ${A.message}`,N.ER_LOCAL_INFILE_NOT_READABLE,n,"22000",this.sql);process.nextTick(this.reject,u),this.reject=null,this.resolve=null}.bind(this)),a.on("data",A=>{s.writeBuffer(A,0,A.length)}),a.on("end",()=>{s.isEmpty()||s.flushBuffer(!1),s.writeEmptyPacket()}),this.onPacketReceive=this.readResponsePacket}static logParam(e,s){if(s==null)e+=s===void 0?"undefined":"null";else switch(s.constructor.name){case"Buffer":e+="0x"+s.toString("hex",0,Math.min(1024,s.length));break;case"String":e+="'"+s+"'";break;case"Date":e+=Do(s);break;case"Object":e+=JSON.stringify(s);break;default:e+=s.toString()}return e}};function Do(E){return"'"+("00"+(E.getMonth()+1)).slice(-2)+"/"+("00"+E.getDate()).slice(-2)+"/"+E.getFullYear()+" "+("00"+E.getHours()).slice(-2)+":"+("00"+E.getMinutes()).slice(-2)+":"+("00"+E.getSeconds()).slice(-2)+"."+("000"+E.getMilliseconds()).slice(-3)+"'"}var Ce=Or;var U_=require("node:stream"),Lt=39,dr=class extends Ce{constructor(e,s,t,n){super(e,s,t,n),this.binary=!1}start(e,s,t){if(s.logger.query&&s.logger.query(`QUERY: ${s.logParam?this.displaySql():this.sql}`),this.onPacketReceive=this.readResponsePacket,this.initialValues===void 0){if(e.startPacket(this),e.writeInt8(3),!this.handleTimeout(e,t))return;e.writeString(this.sql),e.flush(),this.emit("send_end");return}if(this.encodedSql=e.encodeString(this.sql),this.opts.namedPlaceholders)try{let o=i_(this.encodedSql,t,this.initialValues,this.opts.logParam?this.displaySql.bind(this):()=>this.sql);this.paramPositions=o.paramPositions,this.values=o.values}catch(o){return this.emit("send_end"),this.throwError(o,t)}else if(this.paramPositions=r_(this.encodedSql),this.values=Array.isArray(this.initialValues)?this.initialValues:[this.initialValues],!this.validateParameters(t))return;if(e.startPacket(this),e.writeInt8(3),!this.handleTimeout(e,t))return;this.paramPos=0,this.sqlPos=0;let n=this.paramPositions.length/2;for(this.valueIdx=0;this.valueIdx<n;){e.writeBuffer(this.encodedSql,this.sqlPos,this.paramPositions[this.paramPos++]-this.sqlPos),this.sqlPos=this.paramPositions[this.paramPos++];let o=this.values[this.valueIdx++];if(o==null){e.writeStringAscii("NULL");continue}switch(typeof o){case"boolean":e.writeStringAscii(o?"true":"false");break;case"bigint":case"number":e.writeStringAscii(`${o}`);break;case"string":e.writeStringEscapeQuote(o);break;case"object":if(typeof o.pipe=="function"&&typeof o.read=="function"){this.sending=!0,this.paramWritten=this._paramWritten.bind(this,e,t),e.writeInt8(Lt),o.on("data",e.writeBufferEscape.bind(e)),o.on("end",function(){e.writeInt8(Lt),this.paramWritten()}.bind(this));return}if(Object.prototype.toString.call(o)==="[object Date]")e.writeStringAscii(G.getLocalDate(o));else if(Buffer.isBuffer(o))e.writeStringAscii("_BINARY '"),e.writeBufferEscape(o),e.writeInt8(Lt);else if(typeof o.toSqlString=="function")e.writeStringEscapeQuote(String(o.toSqlString()));else if(Array.isArray(o)){s.arrayParenthesis&&e.writeStringAscii("(");for(let a=0;a<o.length;a++)a!==0&&e.writeStringAscii(","),o[a]==null?e.writeStringAscii("NULL"):G.writeParam(e,o[a],s,t);s.arrayParenthesis&&e.writeStringAscii(")")}else if(o.type!=null&&["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].includes(o.type)){let a=t.isMariaDB()&&t.hasMinVersion(10,1,4)||!t.isMariaDB()&&t.hasMinVersion(5,7,6)?"ST_":"";switch(o.type){case"Point":e.writeStringAscii(a+"PointFromText('POINT("+G.geoPointToString(o.coordinates)+")')");break;case"LineString":e.writeStringAscii(a+"LineFromText('LINESTRING("+G.geoArrayPointToString(o.coordinates)+")')");break;case"Polygon":e.writeStringAscii(a+"PolygonFromText('POLYGON("+G.geoMultiArrayPointToString(o.coordinates)+")')");break;case"MultiPoint":e.writeStringAscii(a+"MULTIPOINTFROMTEXT('MULTIPOINT("+G.geoArrayPointToString(o.coordinates)+")')");break;case"MultiLineString":e.writeStringAscii(a+"MLineFromText('MULTILINESTRING("+G.geoMultiArrayPointToString(o.coordinates)+")')");break;case"MultiPolygon":e.writeStringAscii(a+"MPolyFromText('MULTIPOLYGON("+G.geoMultiPolygonToString(o.coordinates)+")')");break;case"GeometryCollection":e.writeStringAscii(a+"GeomCollFromText('GEOMETRYCOLLECTION("+G.geometricCollectionToString(o.geometries)+")')");break}}else if(String===o.constructor){e.writeStringEscapeQuote(o);break}else if(s.permitSetMultiParamEntries){let a=!0;for(let A in o){let u=o[A];typeof u!="function"&&(a?a=!1:e.writeStringAscii(","),e.writeString("`"+A+"`"),u==null?e.writeStringAscii("=NULL"):(e.writeStringAscii("="),G.writeParam(e,u,s,t)))}a&&e.writeStringEscapeQuote(JSON.stringify(o))}else e.writeStringEscapeQuote(JSON.stringify(o));break}}e.writeBuffer(this.encodedSql,this.sqlPos,this.encodedSql.length-this.sqlPos),e.flush(),this.emit("send_end")}handleTimeout(e,s){return this.opts.timeout?s.isMariaDB()?s.hasMinVersion(10,1,2)?(e.writeString(`SET STATEMENT max_statement_time=${this.opts.timeout/1e3} FOR `),!0):(this.sendCancelled(`Cannot use timeout for xpand/MariaDB server before 10.1.2. timeout value: ${this.opts.timeout}`,N.ER_TIMEOUT_NOT_SUPPORTED,s),!1):(this.sendCancelled(`Cannot use timeout for MySQL server. timeout value: ${this.opts.timeout}`,N.ER_TIMEOUT_NOT_SUPPORTED,s),!1):!0}validateParameters(e){return this.paramPositions.length/2>this.values.length?(this.sendCancelled(`Parameter at position ${this.values.length+1} is not set`,N.ER_MISSING_PARAMETER,e),!1):!0}_paramWritten(e,s){for(;;)if(this.valueIdx===this.paramPositions.length/2){e.writeBuffer(this.encodedSql,this.sqlPos,this.encodedSql.length-this.sqlPos),e.flush(),this.sending=!1,this.emit("send_end");return}else{let t=this.values[this.valueIdx++];if(e.writeBuffer(this.encodedSql,this.sqlPos,this.paramPositions[this.paramPos++]-this.sqlPos),this.sqlPos=this.paramPositions[this.paramPos++],t==null){e.writeStringAscii("NULL");continue}if(typeof t=="object"&&typeof t.pipe=="function"&&typeof t.read=="function"){e.writeInt8(Lt),t.once("end",function(){e.writeInt8(Lt),this._paramWritten(e,s)}.bind(this)),t.on("data",e.writeBufferEscape.bind(e));return}G.writeParam(e,t,this.opts,s)}}_stream(e,s){return this.socket=e,s=s||{},s.objectMode=!0,s.read=()=>{this.socket.resume()},this.inStream=new U_.Readable(s),this.on("fields",function(t){this.inStream.emit("fields",t)}),this.on("error",function(t){this.inStream.emit("error",t)}),this.on("close",function(t){this.inStream.emit("error",t)}),this.on("end",function(t){t&&this.inStream.emit("error",t),this.socket.resume(),this.inStream.push(null)}),this.inStream.close=function(){this.handleNewRows=()=>{},this.socket.resume()}.bind(this),this.handleNewRows=function(t){this.inStream.push(t)||this.socket.pause()},this.inStream}},ge=dr;var pr=class{static writeParam(e,s,t,n){switch(typeof s){case"boolean":e.writeInt8(s?1:0);break;case"bigint":s>=2n**63n?e.writeLengthEncodedString(s.toString()):e.writeBigInt(s);break;case"number":if(Number.isInteger(s)&&s>=-2147483648&&s<2147483647){e.writeInt32(s);break}e.writeDouble(s);break;case"string":e.writeLengthEncodedString(s);break;case"object":Object.prototype.toString.call(s)==="[object Date]"?e.writeBinaryDate(s):Buffer.isBuffer(s)?e.writeLengthEncodedBuffer(s):typeof s.toSqlString=="function"?e.writeLengthEncodedString(String(s.toSqlString())):e.writeLengthEncodedString(JSON.stringify(s));break;default:e.writeLengthEncodedBuffer(s)}}static getBufferFromGeometryValue(e,s){let t,n,o;if(s){switch(s){case"MultiPoint":return e&&Array.isArray(e)&&e.length>=2&&!isNaN(e[0])&&!isNaN(e[1])?(t=Buffer.allocUnsafe(21),t.writeInt8(1,0),t.writeInt32LE(1,1),t.writeDoubleLE(e[0],5),t.writeDoubleLE(e[1],13),t):null;case"MultiLineString":if(e&&Array.isArray(e)){let a=e.length;t=Buffer.allocUnsafe(9+16*a),t.writeInt8(1,0),t.writeInt32LE(2,1),t.writeInt32LE(a,5);for(let A=0;A<a;A++)if(e[A]&&Array.isArray(e[A])&&e[A].length>=2&&!isNaN(e[A][0])&&!isNaN(e[A][1]))t.writeDoubleLE(e[A][0],9+16*A),t.writeDoubleLE(e[A][1],17+16*A);else return null;return t}return null;case"MultiPolygon":if(e&&Array.isArray(e)){let a=e.length,A=0;for(let u=0;u<a;u++)A+=4+16*e[u].length;t=Buffer.allocUnsafe(9+A),t.writeInt8(1,0),t.writeInt32LE(3,1),t.writeInt32LE(a,5),n=9;for(let u=0;u<a;u++){let h=e[u];if(h&&Array.isArray(h)){t.writeInt32LE(h.length,n),n+=4;for(let l=0;l<h.length;l++)if(h[l]&&Array.isArray(h[l])&&h[l].length>=2&&!isNaN(h[l][0])&&!isNaN(h[l][1]))t.writeDoubleLE(h[l][0],n),t.writeDoubleLE(h[l][1],n+8),n+=16;else return null}}return t}return null}return null}else{switch(e.type){case"Point":return t=Buffer.allocUnsafe(21),t.writeInt8(1,0),t.writeInt32LE(1,1),e.coordinates&&Array.isArray(e.coordinates)&&e.coordinates.length>=2&&!isNaN(e.coordinates[0])&&!isNaN(e.coordinates[1])?(t.writeDoubleLE(e.coordinates[0],5),t.writeDoubleLE(e.coordinates[1],13),t):null;case"LineString":if(e.coordinates&&Array.isArray(e.coordinates)){let a=e.coordinates.length;t=Buffer.allocUnsafe(9+16*a),t.writeInt8(1,0),t.writeInt32LE(2,1),t.writeInt32LE(a,5);for(let A=0;A<a;A++)if(e.coordinates[A]&&Array.isArray(e.coordinates[A])&&e.coordinates[A].length>=2&&!isNaN(e.coordinates[A][0])&&!isNaN(e.coordinates[A][1]))t.writeDoubleLE(e.coordinates[A][0],9+16*A),t.writeDoubleLE(e.coordinates[A][1],17+16*A);else return null;return t}else return null;case"Polygon":if(e.coordinates&&Array.isArray(e.coordinates)){let a=e.coordinates.length,A=0;for(let u=0;u<a;u++)A+=4+16*e.coordinates[u].length;t=Buffer.allocUnsafe(9+A),t.writeInt8(1,0),t.writeInt32LE(3,1),t.writeInt32LE(a,5),n=9;for(let u=0;u<a;u++){let h=e.coordinates[u];if(h&&Array.isArray(h)){t.writeInt32LE(h.length,n),n+=4;for(let l=0;l<h.length;l++)if(h[l]&&Array.isArray(h[l])&&h[l].length>=2&&!isNaN(h[l][0])&&!isNaN(h[l][1]))t.writeDoubleLE(h[l][0],n),t.writeDoubleLE(h[l][1],n+8),n+=16;else return null}}return t}else return null;case"MultiPoint":o="MultiPoint",t=Buffer.allocUnsafe(9),t.writeInt8(1,0),t.writeInt32LE(4,1);break;case"MultiLineString":o="MultiLineString",t=Buffer.allocUnsafe(9),t.writeInt8(1,0),t.writeInt32LE(5,1);break;case"MultiPolygon":o="MultiPolygon",t=Buffer.allocUnsafe(9),t.writeInt8(1,0),t.writeInt32LE(6,1);break;case"GeometryCollection":if(t=Buffer.allocUnsafe(9),t.writeInt8(1,0),t.writeInt32LE(7,1),e.geometries&&Array.isArray(e.geometries)){let a=e.geometries.length,A=[t];for(let u=0;u<a;u++){let h=this.getBufferFromGeometryValue(e.geometries[u]);if(h===null)break;A.push(h)}return t.writeInt32LE(A.length-1,5),Buffer.concat(A)}else return t.writeInt32LE(0,5),t;default:return null}if(e.coordinates&&Array.isArray(e.coordinates)){let a=e.coordinates.length,A=[t];for(let u=0;u<a;u++){let h=this.getBufferFromGeometryValue(e.coordinates[u],o);if(h===null)break;A.push(h)}return t.writeInt32LE(A.length-1,5),Buffer.concat(A)}else return t.writeInt32LE(0,5),t}}},ye=pr;var Ur=class{#e=!1;#t;#s;#r;constructor(e,s){this.#t=e,this.#s=s,this.#r=s.conn,this.execute=this.#s.execute,this.executeStream=this.#s.executeStream}get conn(){return this.#r}get id(){return this.#s.id}get parameterCount(){return this.#s.parameterCount}get _placeHolderIndex(){return this.#s._placeHolderIndex}get columns(){return this.#s.columns}set columns(e){this.#s.columns=e}get database(){return this.#s.database}get query(){return this.#s.query}isClose(){return this.#e}close(){this.#e||(this.#e=!0,this.#t.decrementUse())}toString(){return"PrepareWrapper{closed:"+this.#e+",cache:"+this.#t+"}"}},L_=Ur;var Lr=class{#e=0;#t;#s;constructor(e){this.#s=e,this.#t=!0}incrementUse(){return this.#e+=1,new L_(this,this.#s)}unCache(){this.#t=!1,this.#e===0&&this.#s.close()}decrementUse(){this.#e-=1,this.#e===0&&!this.#t&&this.#s.close()}toString(){return"Prepare{use:"+this.#e+",cached:"+this.#t+"}"}},P_=Lr;var wo=new Set(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),go=2n**63n,bo=Buffer.from([0,0,0,0]),Pr=class extends Ce{constructor(e,s,t,n,o){super(e,s,t,n),this.binary=!0,this.prepare=o,this.canSkipMeta=!0}start(e,s,t){if(this.onPacketReceive=this.readResponsePacket,this.values=[],this.opts.namedPlaceholders){if(this.prepare)this.values=new Array(this.prepare.parameterCount),this.placeHolderIndex=this.prepare._placeHolderIndex;else{let a=zt(this.sql);this.placeHolderIndex=a.placeHolderIndex,this.values=new Array(this.placeHolderIndex.length)}if(this.initialValues)for(let a=0;a<this.placeHolderIndex.length;a++)this.values[a]=this.initialValues[this.placeHolderIndex[a]]}else this.initialValues&&(this.values=Array.isArray(this.initialValues)?this.initialValues:[this.initialValues]);if(this.parameterCount=this.prepare?this.prepare.parameterCount:this.values.length,!this.validateParameters(t))return;this.parametersType=new Array(this.parameterCount);let n=!1,o;for(let a=0;a<this.parameterCount;a++){if(o=this.values[a],o&&o.type!=null&&wo.has(o.type)){let A=ye.getBufferFromGeometryValue(o);A==null?(this.values[a]=null,o=null):(this.values[a]=Buffer.concat([bo,A]),o=this.values[a])}if(o==null)this.parametersType[a]=Mo;else switch(typeof o){case"boolean":this.parametersType[a]=Bo;break;case"bigint":o>=go?this.parametersType[a]=Go:this.parametersType[a]=Fo;break;case"number":if(Number.isInteger(o)&&o>=-2147483648&&o<2147483647){this.parametersType[a]=Ho;break}this.parametersType[a]=yo;break;case"string":this.parametersType[a]=ko;break;case"object":o instanceof Date?this.parametersType[a]=Vo:Buffer.isBuffer(o)?o.length<16384||!this.prepare?this.parametersType[a]=Wo:(this.parametersType[a]=Yo,n=!0):typeof o.toSqlString=="function"?this.parametersType[a]=Ko:typeof o.pipe=="function"&&typeof o.read=="function"?(n=!0,this.parametersType[a]=vo):String===o.constructor?this.parametersType[a]=xo:this.parametersType[a]=Qo;break}}if(this.longDataStep=!1,n){for(let a=0;a<this.parameterCount;a++)if(this.parametersType[a].isLongData()){s.logger.query&&s.logger.query(`EXECUTE: (${this.prepare?this.prepare.id:-1}) sql: ${s.logParam?this.displaySql():this.sql}`),this.longDataStep||(this.longDataStep=!0,this.registerStreamSendEvent(e,t),this.currentParam=a),this.sendComStmtLongData(e,t,this.values[a]);return}}this.longDataStep||(s.logger.query&&s.logger.query(`EXECUTE: (${this.prepare?this.prepare.id:-1}) sql: ${s.logParam?this.displaySql():this.sql}`),this.sendComStmtExecute(e,t))}validateParameters(e){if(this.parameterCount>this.values.length)return this.sendCancelled(`Parameter at position ${this.values.length} is not set\\nsql: ${this.opts.logParam?this.displaySql():this.sql}`,N.ER_MISSING_PARAMETER,e),!1;if(this.opts.namedPlaceholders&&this.placeHolderIndex){for(let s=0;s<this.parameterCount;s++)if(this.values[s]===void 0){let t=`Parameter named ${this.placeHolderIndex[s]} is not set`;return this.placeHolderIndex.length<this.parameterCount&&(t=`Command expect ${this.parameterCount} parameters, but found only ${this.placeHolderIndex.length} named parameters. You probably use question mark in place of named parameters`),this.sendCancelled(t,N.ER_PARAMETER_UNDEFINED,e),!1}}return!0}sendComStmtLongData(e,s,t){if(e.startPacket(this),e.writeInt8(24),e.writeInt32(this.prepare.id),e.writeInt16(this.currentParam),Buffer.isBuffer(t))return e.writeBuffer(t,0,t.length),e.flush(),this.currentParam++,this.paramWritten();this.sending=!0,t.on("data",n=>{e.writeBuffer(n,0,n.length)}),t.on("end",()=>{e.flush(),this.currentParam++,this.paramWritten()})}sendComStmtExecute(e,s){let t=~~((this.parameterCount+7)/8),n=Buffer.alloc(t);for(let o=0;o<this.parameterCount;o++)this.values[o]==null&&(n[o>>3]|=1<<(o&7));e.startPacket(this),e.writeInt8(23),e.writeInt32(this.prepare?this.prepare.id:-1),e.writeInt8(0),e.writeInt32(1),e.writeBuffer(n,0,t),e.writeInt8(1);for(let o=0;o<this.parameterCount;o++)e.writeInt16(this.parametersType[o].type);for(let o=0;o<this.parameterCount;o++){let a=this.parametersType[o];a.encoder&&a.encoder(e,this.values[o])}e.flush(),this.sending=!1,this.emit("send_end")}registerStreamSendEvent(e,s){this.paramWritten=()=>{if(this.longDataStep){for(;this.currentParam<this.parameterCount;this.currentParam++)if(this.parametersType[this.currentParam].isLongData()){let t=this.values[this.currentParam];this.sendComStmtLongData(e,s,t);return}this.longDataStep=!1}this.longDataStep||this.sendComStmtExecute(e,s)}}},te=class{constructor(e,s,t=!1){this.type=e,this.encoder=s,this.isNull=t}isLongData(){return this.encoder===null&&!this.isNull}},Mo=new te(253,null,!0),Bo=new te(1,(E,e)=>E.writeInt8(e?1:0)),Go=new te(246,(E,e)=>E.writeLengthEncodedString(e.toString())),Fo=new te(8,(E,e)=>E.writeBigInt(e)),Ho=new te(3,(E,e)=>E.writeInt32(e)),yo=new te(5,(E,e)=>E.writeDouble(e)),ko=new te(253,(E,e)=>E.writeLengthEncodedString(e)),xo=new te(253,(E,e)=>E.writeLengthEncodedString(e.toString())),Vo=new te(12,(E,e)=>E.writeBinaryDate(e)),Wo=new te(252,(E,e)=>E.writeLengthEncodedBuffer(e)),Yo=new te(252,null),Ko=new te(253,(E,e)=>E.writeLengthEncodedString(String(e.toSqlString()))),vo=new te(252,null),Qo=new te(253,(E,e)=>E.writeLengthEncodedString(JSON.stringify(e))),Pt=Pr;var m_=require("node:stream"),mr=class extends Pt{constructor(e,s,t,n){super(()=>{},()=>{},s,e,t),this.socket=n,this.inStream=new m_.Readable({objectMode:!0,read:()=>{this.socket.resume()}}),this.on("fields",function(o){this.inStream.emit("fields",o)}),this.on("error",function(o){this.inStream.emit("error",o)}),this.on("close",function(o){this.inStream.emit("error",o)}),this.on("end",function(o){o&&this.inStream.emit("error",o),this.socket.resume(),this.inStream.push(null)}),this.inStream.close=function(){this.handleNewRows=()=>{},this.socket.resume()}.bind(this)}handleNewRows(e){this.inStream.push(e)||this.socket.pause()}},D_=mr;var Dr=class{#e;constructor(e,s,t,n,o,a,A){this.id=e,this.parameterCount=s,this.columns=t,this.database=n,this.query=o,this.closed=!1,this._placeHolderIndex=a,this.#e=A}get conn(){return this.#e}execute(e,s,t,n){let o=s,a=t;if(typeof o=="function"&&(a=o,o=void 0),this.isClose()){let l=this.query;if(this.conn.opts.logParam)if(this.query.length>this.conn.opts.debugLen)l=this.query.substring(0,this.conn.opts.debugLen)+"...";else{let I=this.query+" - parameters:";l=Ce.logParameters(this.conn.opts,I,e)}let R=f("Execute fails, prepare command as already been closed",N.ER_PREPARE_CLOSED,null,"22000",l);if(a){a(R);return}else return Promise.reject(R)}let A={sql:this.query,values:e,opts:o,callback:a};n&&(A.stack=n);let u=this.conn,h=new Promise((l,R)=>u.executePromise.call(u,A,this,l,R));if(a)h.then(l=>{a&&a(null,l,null)}).catch(a||function(l){});else return h}executeStream(e,s,t,n){let o=s,a=t;if(typeof o=="function"&&(a=o,o=void 0),this.isClose()){let h=f("Execute fails, prepare command as already been closed",N.ER_PREPARE_CLOSED,null,"22000",this.query);if(a){a(h);return}else throw h}let A={sql:this.query,values:e,opts:o,callback:a};n&&(A.stack=n);let u=new D_(A,this.conn.opts,this,this.conn.socket);return this.conn.opts.logger.error&&u.on("error",this.conn.opts.logger.error),this.conn.addCommand(u,!0),u.inStream}isClose(){return this.closed}close(){this.closed||(this.closed=!0,this.#e.emit("close_prepare",this))}toString(){return"Prepare{closed:"+this.closed+"}"}},w_=Dr;var wr=class extends Ce{constructor(e,s,t,n,o){super(e,s,t,n),this.encoder=new ye(this.opts),this.binary=!0,this.conn=o,this.executeCommand=n.executeCommand}start(e,s,t){if(this.conn.prepareCache){let n=this.conn.prepareCache.get(this.sql);if(n)return this.emit("send_end"),this.successEnd(n)}if(s.logger.query&&s.logger.query(`PREPARE: ${this.sql}`),this.onPacketReceive=this.readPrepareResultPacket,this.opts.namedPlaceholders){let n=zt(this.sql);this.sql=n.sql,this.placeHolderIndex=n.placeHolderIndex}e.startPacket(this),e.writeInt8(22),e.writeString(this.sql),e.flush(),this.emit("send_end")}successPrepare(e,s){let t=new w_(this.statementId,this.parameterCount,this._columns,e.database,this.sql,this.placeHolderIndex,this.conn);if(this.conn.prepareCache){let n=new P_(t);this.conn.prepareCache.set(this.sql,n);let o=n.incrementUse();return this.executeCommand&&(this.executeCommand.prepare=o),this.successEnd(o)}this.executeCommand&&(this.executeCommand.prepare=t),this.successEnd(t)}readPrepareResultPacket(e,s,t,n){switch(e.peek()){case 0:return e.skip(1),this.statementId=e.readInt32(),this.columnNo=e.readUInt16(),this.parameterCount=e.readUInt16(),this._parameterNo=this.parameterCount,this._columns=[],this._parameterNo>0?this.onPacketReceive=this.skipPrepareParameterPacket:this.columnNo>0?this.onPacketReceive=this.readPrepareColumnsPacket:this.successPrepare(n,t);case 255:let o=e.readError(n,this.displaySql(),this.stack);return n.status|=1,this.onPacketReceive=this.readResponsePacket,this.throwError(o,n);default:return n.status|=1,this.onPacketReceive=this.readResponsePacket,this.throwError(N.ER_UNEXPECTED_PACKET,n)}}readPrepareColumnsPacket(e,s,t,n){if(this.columnNo--,this._columns.push(new Jt(e,n,t.rowsAsArray)),this.columnNo===0){if(n.eofDeprecated)return this.successPrepare(n,t);this.onPacketReceive=this.skipEofPacket}}skipEofPacket(e,s,t,n){if(this.columnNo>0)return this.onPacketReceive=this.readPrepareColumnsPacket;this.successPrepare(n,t)}skipPrepareParameterPacket(e,s,t,n){if(this._parameterNo--,this._parameterNo===0){if(n.eofDeprecated)return this.columnNo>0?this.onPacketReceive=this.readPrepareColumnsPacket:this.successPrepare(n,t);this.onPacketReceive=this.skipEofPacket}}displaySql(){return this.opts&&this.sql.length>this.opts.debugLen?this.sql.substring(0,this.opts.debugLen)+"...":this.sql}},os=wr;var gr=class extends _e{constructor(e,s,t,n){super(e,s,t),this.prepare=n}start(e,s,t){s.logger.query&&s.logger.query(`CLOSE PREPARE: (${this.prepare.id}) ${this.prepare.query}`);let n=new Uint8Array([5,0,0,0,25,this.prepare.id,this.prepare.id>>8,this.prepare.id>>16,this.prepare.id>>24]);e.fastFlush(this,n),this.onPacketReceive=null,this.emit("send_end"),this.emit("end")}},g_=gr;var br=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],Mr=class extends Ce{constructor(e,s,t,n,o){super(e,s,t,o),this.cmdOpts=o.opts,this.binary=!0,this.prepare=n,this.canSkipMeta=!0,this.bulkPacketNo=0,this.sending=!1,this.firstError=null}start(e,s,t){if(this.info=t,this.values=this.initialValues,this.cmdOpts&&this.cmdOpts.timeout)return this.handleTimeoutError(t);this.onPacketReceive=this.readResponsePacket,this.opts.namedPlaceholders&&this.prepare._placeHolderIndex&&this.processNamedPlaceholders(),this.validateParameters(t)&&this.sendComStmtBulkExecute(e,s,t)}handleTimeoutError(e){return this.bulkPacketNo=1,this.sending=!1,this.sendCancelled("Cannot use timeout for Batch statement",N.ER_TIMEOUT_NOT_SUPPORTED)}processNamedPlaceholders(){if(this.values=[],!this.initialValues)return;let e=this.prepare._placeHolderIndex,s=this.prepare.parameterCount;for(let t=0;t<this.initialValues.length;t++){let n=this.initialValues[t],o=new Array(s);for(let a=0;a<e.length;a++)o[a]=n[e[a]];this.values[t]=o}}parameterHeaderFromValue(e,s){let t=new Array(s);for(let n=0;n<s;n++){let o=e[n];if(o==null){t[n]=253;continue}switch(typeof o){case"boolean":t[n]=1;break;case"bigint":t[n]=o>=2n**63n?246:8;break;case"number":Number.isInteger(o)&&o>=-2147483648&&o<2147483647?t[n]=3:t[n]=5;break;case"string":t[n]=253;break;case"object":t[n]=this.getObjectFieldType(o);break;default:t[n]=252}}return t}getObjectFieldType(e){return Object.prototype.toString.call(e)==="[object Date]"?12:Buffer.isBuffer(e)?252:typeof e.toSqlString=="function"?253:e.type!=null&&br.includes(e.type)?252:253}checkSameHeader(e,s,t){for(let n=0;n<t;n++){let o=s[n];if(o==null)continue;switch(typeof o){case"boolean":if(e[n]!==1)return!1;break;case"bigint":if(o>=2n**63n){if(e[n]!==253)return!1}else if(e[n]!==8)return!1;break;case"number":if(Number.isInteger(o)&&o>=-2147483648&&o<2147483647){if(e[n]!==3)return!1}else if(e[n]!==5)return!1;break;case"string":if(e[n]!==253)return!1;break;case"object":if(!this.checkObjectHeaderType(o,e[n]))return!1;break;default:if(e[n]!==252)return!1}}return!0}checkObjectHeaderType(e,s){return Object.prototype.toString.call(e)==="[object Date]"?s===7:Buffer.isBuffer(e)?s===252:typeof e.toSqlString=="function"?s===253:e.type!=null&&br.includes(e.type)?s===252:s===253}sendComStmtBulkExecute(e,s,t){s.logger.query&&s.logger.query(`BULK: (${this.prepare.id}) sql: ${s.logParam?this.displaySql():this.sql}`);let n=this.prepare.parameterCount;this.rowIdx=0,this.vals=this.values[this.rowIdx++];let o=this.parameterHeaderFromValue(this.vals,n),a=null;this.bulkPacketNo=0,this.sending=!0;e:for(;;){this.bulkPacketNo++,e.startPacket(this),e.writeInt8(250),e.writeInt32(this.prepare.id),this.useUnitResult=(t.clientCapabilities&rt)>0,e.writeInt16(this.useUnitResult?192:128);for(let A=0;A<n;A++)e.writeInt16(o[A]);if(a!=null){let A=e.checkMaxAllowedLength(a.length,t);if(A){this.sending=!1,this.throwError(A,t);return}if(e.writeBuffer(a,0,a.length),e.mark(),a=null,this.rowIdx>=this.values.length)break;this.vals=this.values[this.rowIdx++]}t:for(;;){for(let A=0;A<n;A++){let u=this.vals[A];u!=null?u.type!=null&&br.includes(u.type)?this.writeGeoJSONParam(e,u,t):(e.writeInt8(0),ye.writeParam(e,u,this.opts,t)):e.writeInt8(1)}if(e.isMarked()&&(e.hasDataAfterMark()||e.bufIsAfterMaxPacketLength())){e.flushBufferStopAtMark(),e.mark(),a=e.resetMark();break}if(e.mark(),e.hasDataAfterMark()){a=e.resetMark();break}if(this.rowIdx>=this.values.length)break e;if(this.vals=this.values[this.rowIdx++],!this.checkSameHeader(o,this.vals,n)){e.flush(),o=this.parameterHeaderFromValue(this.vals,n);break t}}}e.flush(),this.sending=!1,this.emit("send_end")}writeGeoJSONParam(e,s,t){let n=ye.getBufferFromGeometryValue(s);if(n==null)e.writeInt8(1);else{e.writeInt8(0);let o=Buffer.concat([Buffer.from([0,0,0,0]),n]);ye.writeParam(e,o,this.opts,t)}}displaySql(){if(this.sql.length>this.opts.debugLen)return this.sql.substring(0,this.opts.debugLen)+"...";let e=this.sql+" - parameters:[";for(let s=0;s<this.initialValues.length;s++){s!==0&&(e+=",");let t=this.initialValues[s];if(e=Ce.logParameters(this.opts,e,t),e.length>this.opts.debugLen)return e.substring(0,this.opts.debugLen)+"..."}return e+="]",e}success(e){if(this.bulkPacketNo--,!this.sending&&this.bulkPacketNo===0){this.packet=null,this.firstError?(this.resolve=null,this.onPacketReceive=null,this._columns=null,this._rows=null,process.nextTick(this.reject,this.firstError),this.reject=null,this.emit("end",this.firstError)):this.processResults();return}this.firstError||(this._responseIndex++,this.onPacketReceive=this.readResponsePacket)}processResults(){this._rows[0]&&this._rows[0][0]&&this._rows[0][0].Affected_rows!==void 0?this.processUnitResults():this._rows[0].affectedRows!==void 0&&!(this.opts.fullResult===void 0||this.opts.fullResult===!0)?this.processAggregatedResults():this.processRowResults(),this._columns=null,this._rows=null}processUnitResults(){if(this.opts.fullResult===void 0||this.opts.fullResult===!0){let e=[];this._rows.forEach(s=>{s.forEach(t=>{e.push(new Ne(Number(t.Affected_rows),BigInt(t.Id),0))})}),this.successEnd(this.opts.metaAsArray?[e,[]]:e)}else{let e=0;this._rows.forEach(t=>{t.forEach(n=>{e+=Number(n.Affected_rows)})});let s=new Ne(e,BigInt(this._rows[0][0].Id),0);this.successEnd(this.opts.metaAsArray?[s,[]]:s)}}processAggregatedResults(){let e=0;this._rows.forEach(t=>{e+=t.affectedRows});let s=new Ne(e,this._rows[0].insertId,this._rows[this._rows.length-1].warningStatus);this.successEnd(this.opts.metaAsArray?[s,[]]:s)}processRowResults(){if(this._rows.length===1){this.successEnd(this.opts.metaAsArray?[this._rows[0],this._columns]:this._rows[0]);return}if(this.opts.metaAsArray)if(this.useUnitResult){let e=[];this._rows.forEach((s,t)=>{t%2===0&&e.push(...s)}),this.successEnd([e,this.prepare.columns])}else{let e=[];this._rows.forEach(s=>{e.push(...s)}),this.successEnd([e,this._columns])}else if(this.useUnitResult){let e=[];this._rows.forEach((s,t)=>{t%2===0&&e.push(...s)}),Object.defineProperty(e,"meta",{value:this._columns,writable:!0,enumerable:this.opts.metaEnumerable}),this.successEnd(e)}else if(this._rows.length===1)this.successEnd(this._rows[0]);else{let e=[];Array.isArray(this._rows[0])?this._rows.forEach(s=>{e.push(...s)}):e.push(...this._rows),Object.defineProperty(e,"meta",{value:this._columns,writable:!0,enumerable:this.opts.metaEnumerable}),this.successEnd(e)}}okPacketSuccess(e,s){if(this._rows.push(e),s.status&8)return this._responseIndex++,this.onPacketReceive=this.readResponsePacket;this.opts.metaAsArray?(this._meta||(this._meta=new Array(this._responseIndex)),this._meta[this._responseIndex]=null,this.success([this._rows,this._meta])):this.success(this._rows)}throwError(e,s){this.bulkPacketNo--,this.firstError||(e.fatal&&(this.bulkPacketNo=0),this.cmdParam.stack&&(e=f(e.message,e.errno,s,e.sqlState,this.opts.logParam?this.displaySql():this.sql,e.fatal,this.cmdParam.stack,!1)),this.firstError=e),!this.sending&&this.bulkPacketNo===0?(this.resolve=null,this.emit("send_end"),process.nextTick(this.reject,this.firstError),this.reject=null,this.onPacketReceive=null,this.emit("end",this.firstError)):this.onPacketReceive=this.readResponsePacket}validateParameters(e){let s=this.prepare.parameterCount;for(let t=0;t<this.values.length;t++)if(Array.isArray(this.values[t])||(this.values[t]=[this.values[t]]),this.values[t].length<s)return this.emit("send_end"),this.throwNewError(`Expect ${s} parameters, but at index ${t}, parameters only contains ${this.values[t].length}
${this.opts.logParam?this.displaySql():this.sql}`,!1,e,"HY000",N.ER_PARAMETER_UNDEFINED),!1;return!0}},b_=Mr;var M_=m(require("iconv-lite"),1);var Br=class extends $t{constructor(e,s,t,n,o){super(e,s.host,t,n,()=>{},o),this.configAssign(s,e.opts)}start(e,s,t){s.logger.query&&s.logger.query(`CHANGE USER to '${this.opts.user||""}'`);let n,o=Array.isArray(this.opts.password)?this.opts.password[0]:this.opts.password;switch(t.defaultPluginName){case"mysql_native_password":case"":n=_t.encryptSha1Password(o,t.seed);break;case"client_ed25519":n=Xt.encryptPassword(o,t.seed);break;default:n=Buffer.alloc(0);break}if(e.startPacket(this),e.writeInt8(17),e.writeString(this.opts.user||""),e.writeInt8(0),t.serverCapabilities&Be?(e.writeInt8(n.length),e.writeBuffer(n,0,n.length)):(e.writeBuffer(n,0,n.length),e.writeInt8(0)),t.clientCapabilities&qe&&(e.writeString(this.opts.database),e.writeInt8(0),t.database=this.opts.database),this.opts.collation?(!this.opts.charset||t.collation.charset!==this.opts.collation.charset)&&(t.collation=this.opts.collation):(t.collation.charset!=="utf8"||t.collation.maxLength===3)&&(t.collation=P.fromIndex(224)),e.writeInt16(t.collation.index),t.clientCapabilities&Se&&(e.writeString(t.defaultPluginName),e.writeInt8(0)),t.clientCapabilities&st){e.writeInt8(252);let a=e.pos;e.writeInt16(0);let A=t.collation.charset;if(ke(e,"_client_name",A),ke(e,"MariaDB connector/Node",A),ke(e,"_client_version",A),ke(e,Me.version,A),ke(e,"_node_version",A),ke(e,process.versions.node,A),s.connectAttributes!==!0){let u=Object.keys(this.opts.connectAttributes);for(let h=0;h<u.length;++h)ke(e,u[h],A),ke(e,this.opts.connectAttributes[u[h]],A)}e.writeInt16AtPos(a)}e.flush(),this.plugin.onPacketReceive=this.handshakeResult.bind(this)}configAssign(e,s){if(!s){this.opts=e;return}if(this.opts=s?Object.assign({},e,s):e,s.charset&&typeof s.charset=="string"){if(this.opts.collation=P.fromCharset(s.charset.toLowerCase()),this.opts.collation===void 0&&(this.opts.collation=P.fromName(s.charset.toUpperCase()),this.opts.collation!==void 0&&this.opts.logger.warning("warning: please use option 'collation' in replacement of 'charset' when using a collation name ('"+s.charset+`')
(collation looks like 'UTF8MB4_UNICODE_CI', charset like 'utf8').`)),this.opts.collation===void 0)throw new RangeError("Unknown charset '"+s.charset+"'")}else if(s.collation&&typeof s.collation=="string"){let t=s.collation;if(this.opts.collation=P.fromName(t.toUpperCase()),this.opts.collation===void 0)throw new RangeError("Unknown collation '"+t+"'")}else this.opts.collation=P.fromIndex(s.charsetNumber)||e.collation;e.password=s.password}};function ke(E,e,s){let t=Buffer.isEncoding(s)?Buffer.from(e,s):M_.default.encode(e,s);E.writeLengthCoded(t.length),E.writeBuffer(t,0,t.length)}var B_=Br;var F_=require("lru-cache"),Gr=class{#e;#t;constructor(e,s){if(!Number.isInteger(s)||s<=0)throw new TypeError("prepareCacheLength must be a positive integer");this.#t=e,this.#e=new F_.LRUCache({max:s,dispose:(t,n)=>t.unCache()})}get(e){let s=this.#t.database+"|"+e,t=this.#e.get(s);return t?t.incrementUse():null}set(e,s){let t=this.#t.database+"|"+e;this.#e.set(t,s)}toString(){let e=[...this.#e.keys()];return`info{cache:${e.length?e.map(t=>`[${t}]`).join(","):""}}`}reset(){this.#e.clear()}},H_=Gr;var k_=require("node:fs");var Es=function(E,e){if(E==="UTC"||E==="Etc/UTC"||E==="Z"||E==="Etc/GMT")return"+00:00";if(E.startsWith("Etc/GMT")||E.startsWith("GMT")){let s,t;E.startsWith("Etc/GMT")?(s=E.substring(7),t=!s.startsWith("-")):(s=E.substring(3),t=s.startsWith("-"));let n=parseInt(s.substring(1));if(isNaN(n))throw w(`Automatic timezone setting fails. wrong Server timezone '${E}' conversion to +/-HH:00 conversion.`,N.ER_WRONG_AUTO_TIMEZONE,e.info);return(t?"-":"+")+(n>=10?n:"0"+n)+":00"}return E},qo=/(mariadb|mysql):\/\/(([^/@:]+)?(:([^/]+))?@)?(([^/:]+)(:([0-9]+))?)(\/([^?]+)(\?(.*))?)?$/,Hr=class E extends Fr.default{opts;sendQueue=new mt.default;receiveQueue=new mt.default;waitingAuthenticationQueue=new mt.default;status=1;socket=null;timeout=null;addCommand;streamOut;streamIn;info;prepareCache;constructor(e){super(),this.opts=Object.assign(new Fr.default,e),this.info=new St(this.opts,this.redirect.bind(this)),this.prepareCache=this.opts.prepareCacheLength>0?new H_(this.info,this.opts.prepareCacheLength):null,this.addCommand=this.addCommandQueue,this.streamOut=new Ri(this.opts,this.info),this.streamIn=new ui(this.unexpectedPacket.bind(this),this.receiveQueue,this.streamOut,this.opts,this.info),this._boundSendNextCmd=this._sendNextCmdImmediate.bind(this),this.on("close_prepare",this._closePrepare.bind(this)),this.escape=ct.bind(this,this.opts,this.info),this.escapeId=Ht.bind(this,this.opts,this.info)}connect(){let e=this;this.status=2;let s={opts:this.opts};return new Promise(function(t,n){e.connectRejectFct=n,e.connectResolveFct=t;let o=new $t(s,e.opts.host,e.authSucceedHandler.bind(e),e.authFailHandler.bind(e),e.createSecureContext.bind(e),e.getSocket.bind(e));Error.captureStackTrace(o),o.once("end",()=>{e.receiveQueue.shift(),!e.opts.collation&&e.info.collation&&e.opts.emit("collation",e.info.collation),process.nextTick(e.nextSendCmd.bind(e))}),e.receiveQueue.push(o),e.streamInitSocket.call(e)})}executePromise(e,s,t,n){let o=new Pt(t,this._logAndReject.bind(this,n),this.opts,e,s);this.addCommand(o,!0)}batch(e,s,t){if(!e.sql)return this.handleMissingSqlError(t);if(!e.values)return this.handleMissingValuesError(e,t);Array.isArray(e.values)&&e.values.length===0&&s(),this.prepare(e,n=>this.executeBatch(e,n,s,t),n=>this._logAndReject(t,n))}handleMissingSqlError(e){let s=f("sql parameter is mandatory",N.ER_UNDEFINED_SQL,this.info,"HY000",null,!1);Error.captureStackTrace(s,this.handleMissingSqlError),this._logAndReject(e,s)}handleMissingValuesError(e,s){let t=e.sql,n=t.length>this.opts.debugLen?t.substring(0,this.opts.debugLen)+"...":t,o=f("Batch must have values set",N.ER_BATCH_WITH_NO_VALUES,this.info,"HY000",n,!1,e.stack);this._logAndReject(s,o)}executeBatch(e,s,t,n){let o=e.opts&&e.opts.namedPlaceholders||this.opts.namedPlaceholders,a=this.formatBatchValues(e.values,o,s.parameterCount);e.values=a,this._canUseBulk(a,e.opts)?this.executeBulkPromise(e,s,this.opts,t,n):this.executeIndividualBatches(e,s,t,n)}executeBulkPromise(e,s,t,n,o){let a=new b_(A=>(s.close(),n(A)),A=>{s.close(),t.logger.error&&t.logger.error(A),o(A)},t,s,e);this.addCommand(a,!0)}formatBatchValues(e,s,t){if(!Array.isArray(e))return[[e]];if(s||Array.isArray(e[0]))return e;if(t===1){let n=new Array(e.length);for(let o=0;o<e.length;o++)n[o]=[e[o]];return n}return[e]}executeIndividualBatches(e,s,t,n){let o=[],A=Math.ceil(e.values.length/1e3);this.executeBatchChunk(e,s,0,1e3,A,o,t,n)}executeBatchChunk(e,s,t,n,o,a,A,u){let h=e.values,l=t*n,R=Math.min(l+n,h.length),I=[];for(let S=l;S<R;S++)I.push(s.execute(h[S],e.opts,null,e.stack));Promise.all(I).then(S=>{if(a.push(...S),t===o-1){let C=Object.assign({},this.opts,e.opts);this.processBatchResults(a,C,e,A),s.close()}else setImmediate(()=>{this.executeBatchChunk(e,s,t+1,n,o,a,A,u)})},S=>{s.close(),u(S)}).catch(S=>{s.close(),u(S)})}processBatchResults(e,s,t,n){if(!e.length){n(s.metaAsArray?[[],[]]:[]);return}if(s.fullResult===void 0||s.fullResult){if(s.metaAsArray){let A=e.reduce((h,l)=>(Array.isArray(l[0])?h.push(...l[0]):l[0]instanceof Ne?h.push(l[0]):h.push([l[0]]),h),[]),u=e[0][1];n([A,u])}else{let A=e.reduce((h,l)=>(l instanceof Ne?h.push(l):!s.rowsAsArray&&Array.isArray(l[0])?h.push(...l[0]):h.push(l[0]),h),[]),u=e[0].meta;Object.defineProperty(A,"meta",{value:u,writable:!0,enumerable:s.metaEnumerable}),n(A)}return}(s.metaAsArray?e[0][0]:e[0])instanceof Ne?this.aggregateOkPackets(e,s,n):this.aggregateResultSets(e,s,n)}aggregateOkPackets(e,s,t){let n=e[0].insertId,o=e[e.length-1].warningStatus,a=0;s.metaAsArray?(a=e.reduce((A,u)=>A+u[0].affectedRows,0),t([new Ne(a,n,o),[]])):(a=e.reduce((A,u)=>A+u.affectedRows,0),t(new Ne(a,n,o)))}aggregateResultSets(e,s,t){if(s.metaAsArray){let n=e.reduce((A,u)=>A+(u[0]?.length||0),0),o=new Array(n),a=0;for(let A of e)if(A[0]&&A[0].length){let u=A[0];for(let h=0;h<u.length;h++)o[a++]=u[h]}t([o.slice(0,a),e[0][1]])}else{let n=e.reduce((u,h)=>u+(Array.isArray(h)?h.length:0),0),o=new Array(n),a=0;for(let u of e)if(Array.isArray(u)&&u.length)for(let h=0;h<u.length;h++)o[a++]=u[h];let A=o.slice(0,a);e[0]&&e[0].meta&&Object.defineProperty(A,"meta",{value:e[0].meta,writable:!0,enumerable:s.metaEnumerable}),t(A)}}ping(e,s,t){if(e.opts&&e.opts.timeout!==void 0){if(e.opts.timeout<0){let o=f("Ping cannot have negative timeout value",N.ER_BAD_PARAMETER_VALUE,this.info,"0A000");this._logAndReject(t,o);return}let n=setTimeout(function(){n=void 0;let o=w("Ping timeout",N.ER_PING_TIMEOUT,this.info,"0A000");this.addCommand=this.addCommandDisabled,clearTimeout(this.timeout),this.status<=6&&(this.sendQueue.clear(),this.status=8,this.socket.destroy()),this.clear(),this._logAndReject(t,o)}.bind(this),e.opts.timeout);this.addCommand(new nr(e,()=>{n&&(clearTimeout(n),s())},o=>{n&&(clearTimeout(n),this._logAndReject(t,o))}),!0);return}this.addCommand(new nr(e,s,t),!0)}reset(e,s,t){if(this.info.isMariaDB()&&this.info.hasMinVersion(10,2,4)||!this.info.isMariaDB()&&this.info.hasMinVersion(5,7,3)){let o=this,a=new e_(e,()=>{o.prepareCache&&o.prepareCache.reset(),Promise.resolve().then(o.handleCharset.bind(o)).then(o.handleTimezone.bind(o)).then(o.executeInitQuery.bind(o)).then(o.executeSessionTimeout.bind(o)).then(s).catch(t)},t);this.addCommand(a,!0);return}let n=new Error(`Reset command not permitted for server ${this.info.serverVersion.raw} (requires server MariaDB version 10.2.4+ or MySQL 5.7.3+)`);n.stack=e.stack,this._logAndReject(t,n)}isValid(){return this.status===5}end(e,s,t){if(this.addCommand=this.addCommandDisabled,clearTimeout(this.timeout),this.status<7&&this.status!==1){this.status=7;let n=()=>{this.status=8,this.socket.destroy(),this.socket.unref(),this.clear(),this.receiveQueue.clear(),s()},o=new ir(e,n,n);this.sendQueue.push(o),this.receiveQueue.push(o);let a=typeof Deno<"u";this.sendQueue.length===1&&(a?this.nextSendCmd():process.nextTick(this.nextSendCmd.bind(this)))}else s()}destroy(){if(this.addCommand=this.addCommandDisabled,clearTimeout(this.timeout),this.status<7)if(this.status=7,this.sendQueue.clear(),this.receiveQueue.length>0){let e=this,s=this.socket.remoteAddress,t=s?Object.assign({},this.opts,{host:s}):this.opts,n=new E(t);n.connect().then(()=>{new Promise(n.query.bind(n,{sql:`KILL ${e.info.threadId}`})).finally(o=>{let a=w("Connection destroyed, command was killed",N.ER_CMD_NOT_EXECUTED_DESTROYED,e.info);if(e.opts.logger.error&&e.opts.logger.error(a),e.socketErrorDispatchToQueries(a),e.socket){let A=e.socket;process.nextTick(()=>{A.destroy()})}e.status=8,e.clear(),new Promise(n.end.bind(n)).catch(()=>{})})}).catch(()=>{let o=()=>{let A=e.socket;e.clear(),e.status=8,A.destroy(),e.receiveQueue.clear()},a=new ir(o,o);e.sendQueue.push(a),e.receiveQueue.push(a),e.sendQueue.length===1&&(typeof Deno<"u"?e.nextSendCmd():process.nextTick(e.nextSendCmd.bind(e)))})}else this.status=8,this.socket.destroy(),this.clear()}pause(){this.socket.pause()}resume(){this.socket.resume()}format(e,s){let t=f('"Connection.format intentionally not implemented. please use Connection.query(sql, values), it will be more secure and faster',N.ER_NOT_IMPLEMENTED_FORMAT,this.info,"0A000");throw this.opts.logger.error&&this.opts.logger.error(t),t}serverVersion(){if(!this.info.serverVersion){let e=new Error("cannot know if server information until connection is established");throw this.opts.logger.error&&this.opts.logger.error(e),e}return this.info.serverVersion.raw}debug(e){typeof e=="boolean"?e?this.opts.logger.network||(this.opts.logger.network=console.log):this.opts.logger.network=null:typeof e=="function"&&(this.opts.logger.network=e),this.opts.emit("debug",e)}debugCompress(e){e?typeof e=="boolean"?(this.opts.debugCompress=e,e&&!this.opts.logger.network&&(this.opts.logger.network=console.log)):typeof e=="function"&&(this.opts.debugCompress=!0,this.opts.logger.network=e):this.opts.debugCompress=!1}get __tests(){return new yr(this.info.collation,this.socket)}_canUseBulk(e,s){if(s&&s.fullResult&&(this.info.clientCapabilities&rt)===0n)return!1;let t=s==null?this.opts.bulk:s.bulk!==void 0&&s.bulk!==null?s.bulk:this.opts.bulk;return!(this.info.serverVersion&&this.info.serverVersion.mariaDb&&this.info.hasMinVersion(10,2,7)&&(this.info.serverCapabilities&Tt)>0n)||!t?!1:e===void 0?!0:this.opts.namedPlaceholders?this._validateNamedParameters(e):this._validatePositionalParameters(e)}_validatePositionalParameters(e){let s=Array.isArray(e[0])?e[0].length:e[0]?1:0;if(s===0)return!1;for(let t of e){let n=Array.isArray(t)?t:[t];if(s!==n.length)return!1;for(let o of n)if(this._isStreamingValue(o))return!1}return!0}_validateNamedParameters(e){for(let s of e)for(let t of Object.values(s))if(this._isStreamingValue(t))return!1;return!0}_isStreamingValue(e){return e!=null&&typeof e=="object"&&typeof e.pipe=="function"&&typeof e.read=="function"}executeSessionVariableQuery(){if(this.opts.sessionVariables){let e=[],s="set ",t=Object.keys(this.opts.sessionVariables);if(t.length>0){for(let n=0;n<t.length;++n)s+=(n!==0?",":"")+"@@"+t[n].replace(/[^a-z0-9_]/gi,"")+"=?",e.push(this.opts.sessionVariables[t[n]]);return new Promise(this.query.bind(this,{sql:s,values:e})).catch(n=>{let o=w(`Error setting session variable (value ${JSON.stringify(this.opts.sessionVariables)}). Error: ${n.message}`,N.ER_SETTING_SESSION_ERROR,this.info,"08S01",s);return this.opts.logger.error&&this.opts.logger.error(o),Promise.reject(o)})}}return Promise.resolve()}handleCharset(){if(this.opts.collation){if(this.opts.collation.index<=255)return Promise.resolve();let s=this.opts.collation.charset==="utf8"&&this.opts.collation.maxLength===4?"utf8mb4":this.opts.collation.charset;return new Promise(this.query.bind(this,{sql:`SET NAMES ${s} COLLATE ${this.opts.collation.name}`}))}if(!this.opts.charset&&this.info.collation&&this.info.collation.charset==="utf8"&&this.info.collation.maxLength===4)return this.info.collation=P.fromCharset("utf8mb4"),Promise.resolve();let e=this.opts.charset?this.opts.charset:"utf8mb4";return this.info.collation=P.fromCharset(e),new Promise(this.query.bind(this,{sql:`SET NAMES ${e}`}))}handleTimezone(){let e=this;return this.opts.timezone==="local"&&(this.opts.timezone=void 0),this.opts.timezone==="auto"?new Promise(this.query.bind(this,{sql:"SELECT @@system_time_zone stz, @@time_zone tz"})).then(s=>{let t=s[0].tz==="SYSTEM"?s[0].stz:s[0].tz,n=Intl.DateTimeFormat().resolvedOptions().timeZone;return t===n||Es(t,e)===Es(n,e)?(this.opts.timezone=n,Promise.resolve()):this._setSessionTimezone(Es(n,e))}):this.opts.timezone?this._setSessionTimezone(Es(this.opts.timezone,e)):Promise.resolve()}_setSessionTimezone(e){return new Promise(this.query.bind(this,{sql:"SET time_zone=?",values:[e]})).catch(s=>{let t=f(`setting timezone '${e}' fails on server.
look at https://mariadb.com/kb/en/mysql_tzinfo_to_sql/ to load IANA timezone. `,N.ER_WRONG_IANA_TIMEZONE,this.info,"08S01",null,!1,null,null,s);return Promise.reject(t)})}checkServerVersion(){return this.opts.forceVersionCheck?new Promise(this.query.bind(this,{sql:"SELECT @@VERSION AS v"})).then(function(e){return this.info.serverVersion.raw=e[0].v,this.info.serverVersion.mariaDb=this.info.serverVersion.raw.includes("MariaDB"),St.parseVersionString(this.info),Promise.resolve()}.bind(this)):Promise.resolve()}executeInitQuery(){if(this.opts.initSql){let e=Array.isArray(this.opts.initSql)?this.opts.initSql:[this.opts.initSql],s=[];return e.forEach(t=>{s.push(new Promise(this.query.bind(this,{sql:t})))}),Promise.all(s).catch(t=>{let n=w(`Error executing initial sql command: ${t.message}`,N.ER_INITIAL_SQL_ERROR,this.info);return this.opts.logger.error&&this.opts.logger.error(n),Promise.reject(n)})}return Promise.resolve()}executeSessionTimeout(){if(this.opts.queryTimeout)if(this.info.isMariaDB()&&this.info.hasMinVersion(10,1,2)){let e=`SET max_statement_time=${this.opts.queryTimeout/1e3}`;new Promise(this.query.bind(this,{sql:e})).catch(function(s){let t=w(`Error setting session queryTimeout: ${s.message}`,N.ER_INITIAL_TIMEOUT_ERROR,this.info,"08S01",e);return this.opts.logger.error&&this.opts.logger.error(t),Promise.reject(t)}.bind(this))}else{let e=f(`Can only use queryTimeout for MariaDB server after 10.1.1. queryTimeout value: ${this.opts.queryTimeout}`,N.ER_TIMEOUT_NOT_SUPPORTED,this.info,"HY000",this.opts.queryTimeout);return this.opts.logger.error&&this.opts.logger.error(e),Promise.reject(e)}return Promise.resolve()}getSocket(){return this.socket}streamInitSocket(){if(this.opts.connectTimeout&&(this.timeout=setTimeout(this.connectTimeoutReached.bind(this),this.opts.connectTimeout,Date.now())),this.opts.socketPath)this.socket=as.default.connect(this.opts.socketPath);else if(this.opts.stream){if(typeof this.opts.stream=="function"){let e=this.opts.stream(function(s,t){if(s){this.authFailHandler(s);return}this.socket=t||as.default.connect(this.opts.port,this.opts.host),this.socketInit()}.bind(this));e&&(this.socket=e,this.socketInit())}else this.authFailHandler(f("stream option is not a function. stream must be a function with (error, callback) parameter",N.ER_BAD_PARAMETER_VALUE,this.info));return}else this.socket=as.default.connect(this.opts.port,this.opts.host),this.socket.setNoDelay(!0);this.socketInit()}socketInit(){this.socket.on("data",this.streamIn.onData.bind(this.streamIn)),this.socket.on("error",this.socketErrorHandler.bind(this)),this.socket.on("end",this.socketErrorHandler.bind(this)),this.socket.on("connect",function(){this.status===2&&(this.status=3,this.socket.setTimeout(this.opts.socketTimeout,this.socketTimeoutReached.bind(this)),this.opts.keepAliveDelay!==void 0&&(this.opts.keepAliveDelay>=0?this.socket.setKeepAlive(!0,this.opts.keepAliveDelay):this.socket.setKeepAlive(!0)))}.bind(this)),this.socket.writeBuf=e=>this.socket.write(e),this.socket.flush=()=>{},this.streamOut.setStream(this.socket)}authSucceedHandler(){this.opts.compress&&(this.info.serverCapabilities&Ct?(this.streamOut.setStream(new Ti(this.socket,this.opts,this.info)),this.streamIn=new fi(this.streamIn,this.receiveQueue,this.opts,this.info),this.socket.removeAllListeners("data"),this.socket.on("data",this.streamIn.onData.bind(this.streamIn))):this.opts.logger.error&&this.opts.logger.error(f("connection is configured to use packet compression, but the server doesn't have this capability",N.ER_COMPRESSION_NOT_SUPPORTED,this.info))),this.addCommand=this.opts.pipelining?this.addCommandEnablePipeline:this.addCommandEnable;let e=this;this.status=4,this.executeSessionVariableQuery().then(e.handleCharset.bind(e)).then(this.handleTimezone.bind(this)).then(this.checkServerVersion.bind(this)).then(this.executeInitQuery.bind(this)).then(this.executeSessionTimeout.bind(this)).then(()=>{clearTimeout(this.timeout),e.status=5,process.nextTick(e.connectResolveFct,e),e.waitingAuthenticationQueue.toArray().forEach(t=>{e.addCommand(t,!0)}),e.waitingAuthenticationQueue=null,e.connectRejectFct=null,e.connectResolveFct=null}).catch(s=>{if(s.fatal)e.authFailHandler.call(e,s);else{let t=()=>{e.authFailHandler.call(e,s)};e.end(t,t)}})}authFailHandler(e){clearTimeout(this.timeout),this.timeout=null,this.connectRejectFct&&(this.opts.logger.error&&this.opts.logger.error(e),this.receiveQueue.shift(),this.fatalError(e,!0),process.nextTick(this.connectRejectFct,e),this.connectRejectFct=null)}createSecureContext(e,s){e.requireValidCert=this.opts.ssl===!0||this.opts.ssl&&(this.opts.ssl.rejectUnauthorized===void 0||this.opts.ssl.rejectUnauthorized===!0);let t={socket:this.socket};typeof Deno<"u"?e.requireValidCert=!1:e.requireValidCert&&e.isMariaDB()&&!this.opts.socketPath&&this.opts.password&&!(this.opts.ssl&&this.opts.ssl.ca)&&(t.rejectUnauthorized=!1);let n=this.opts.ssl===!0?t:Object.assign({},this.opts.ssl,t);try{let o=y_.default.connect(n,s);o.on("data",this.streamIn.onData.bind(this.streamIn)),o.on("error",this.socketErrorHandler.bind(this)),o.on("end",this.socketErrorHandler.bind(this)),o.writeBuf=a=>o.write(a),o.flush=()=>{},this.socket.removeAllListeners("data"),this.socket=o,this.streamOut.setStream(o)}catch(o){this.socketErrorHandler(o)}}unexpectedPacket(e){if(e&&e.peek()===255){let s=e.readError(this.info);s.fatal&&this.status<6&&(this.status=6,this.emit("error",s),this.opts.logger.error&&this.opts.logger.error(s),this.end(()=>{},()=>{}))}else if(this.status<6){this.status=6;let s=w(`receiving packet from server without active commands
conn:${this.info.threadId?this.info.threadId:-1}(${e.pos},${e.end})
${ie(this.opts,e.buf,e.pos,e.end)}`,N.ER_UNEXPECTED_PACKET,this.info);this.opts.logger.error&&this.opts.logger.error(s),this.emit("error",s),this.destroy()}}connectTimeoutReached(e){this.timeout=null;let s=this.receiveQueue.peekFront(),t=w(`Connection timeout: failed to create socket after ${Date.now()-e}ms`,N.ER_CONNECTION_TIMEOUT,this.info,"08S01",null,s?s.stack:null);this.opts.logger.error&&this.opts.logger.error(t),this.authFailHandler(t)}socketTimeoutReached(){clearTimeout(this.timeout);let e=w("socket timeout",N.ER_SOCKET_TIMEOUT,this.info);this.opts.logger.error&&this.opts.logger.error(e),this.fatalError(e,!0)}addCommandQueue(e){this.waitingAuthenticationQueue.push(e)}addCommandEnable(e,s){e.once("end",this._boundSendNextCmd),this.sendQueue.isEmpty()&&this.receiveQueue.isEmpty()?(s&&this.receiveQueue.push(e),e.start(this.streamOut,this.opts,this.info)):(s&&this.receiveQueue.push(e),this.sendQueue.push(e))}addCommandEnablePipeline(e,s){e.once("send_end",this._boundSendNextCmd),s&&this.receiveQueue.push(e),this.sendQueue.isEmpty()?(e.start(this.streamOut,this.opts,this.info),e.sending&&(this.sendQueue.push(e),e.prependOnceListener("send_end",this.sendQueue.shift.bind(this.sendQueue)))):this.sendQueue.push(e)}addCommandDisabled(e){let s=e.throwNewError("Cannot execute new commands: connection closed",!0,this.info,"08S01",N.ER_CMD_CONNECTION_CLOSED);this.opts.logger.error&&this.opts.logger.error(s)}socketErrorHandler(e){if(!(this.status>=7))switch(this.socket&&(this.socket.writeBuf=()=>{},this.socket.flush=()=>{}),e?(e.fatal=!0,e.sqlState="HY000"):e=w("socket has unexpectedly been closed",N.ER_SOCKET_UNEXPECTED_CLOSE,this.info),this.status){case 2:case 3:let s=this.receiveQueue.peekFront();s&&s.stack&&e&&(e.stack+=`
From event:
`+s.stack.substring(s.stack.indexOf(`
`)+1)),this.authFailHandler(e);break;default:this.fatalError(e,!1)}}fatalError(e,s){if(this.status>=6){this.socketErrorDispatchToQueries(e);return}let t=this.status!==2;this.status=7,this.addCommand=this.addCommandDisabled,this.socket&&(this.socket.removeAllListeners(),this.socket.destroyed||this.socket.destroy(),this.socket=void 0),this.status=8;let n=this.socketErrorDispatchToQueries(e);if(t){if(this.opts.logger.error&&this.opts.logger.error(e),this.listenerCount("error")>0)this.emit("error",e),this.emit("end"),this.clear();else if(this.emit("end"),this.clear(),!s&&!n)throw e}else this.clear()}socketErrorDispatchToQueries(e){let s,t=!1;for(;s=this.receiveQueue.shift();)s&&s.onPacketReceive&&(t=!0,setImmediate(s.throwError.bind(s,e,this.info)));return t}nextSendCmd(){let e;(e=this.sendQueue.shift())&&(e.sending?this.sendQueue.unshift(e):(e.start(this.streamOut,this.opts,this.info),e.sending&&(this.sendQueue.unshift(e),e.prependOnceListener("send_end",this.sendQueue.shift.bind(this.sendQueue)))))}changeTransaction(e,s,t){if(this.status>=6){let n=w("Cannot execute new commands: connection closed",N.ER_CMD_CONNECTION_CLOSED,this.info,"08S01",e.sql);this._logAndReject(t,n);return}if(this.receiveQueue.peekFront()||this.info.status&1){let n=new ge(s,this._logAndReject.bind(this,t),this.opts,e);this.addCommand(n,!0)}else s()}changeUser(e,s,t){if(!this.info.isMariaDB()){let o=f("method changeUser not available for MySQL server due to Bug #83472",N.ER_MYSQL_CHANGE_USER_BUG,this.info,"0A000");this._logAndReject(t,o);return}this.status<6&&(this.addCommand=this.addCommandEnable);let n=this;if(e.opts&&e.opts.collation&&typeof e.opts.collation=="string"){let o=e.opts.collation.toUpperCase();if(e.opts.collation=P.fromName(e.opts.collation.toUpperCase()),e.opts.collation===void 0)return t(new RangeError(`Unknown collation '${o}'`))}this.addCommand(new B_(e,this.opts,o=>{n.status<6&&n.opts.pipelining&&(n.addCommand=n.addCommandEnablePipeline),e.opts&&e.opts.collation&&(n.opts.collation=e.opts.collation),n.handleCharset().then(()=>{e.opts&&e.opts.collation&&(n.info.collation=e.opts.collation,n.opts.emit("collation",e.opts.collation)),s(o)}).catch(a=>{let A=()=>n.authFailHandler.call(n,a);a.fatal?A():n.end(A,A),t(a)})},this.authFailHandler.bind(this,t),this.getSocket.bind(this)),!0)}query(e,s,t){if(!e.sql)return t(f("sql parameter is mandatory",N.ER_UNDEFINED_SQL,this.info,"HY000",null,!1,e.stack));let n=new ge(s,o=>this._logAndReject(t,o),this.opts,e);this.addCommand(n,!0)}prepare(e,s,t){if(!e.sql){t(f("sql parameter is mandatory",N.ER_UNDEFINED_SQL,this.info,"HY000"));return}if(this.prepareCache&&(this.sendQueue.isEmpty()||!this.receiveQueue.peekFront())){let o=this.prepareCache.get(e.sql);if(o){s(o);return}}let n=new os(s,o=>this._logAndReject(t,o),this.opts,e,this);this.addCommand(n,!0)}prepareExecute(e,s,t){if(!e.sql){t(f("sql parameter is mandatory",N.ER_UNDEFINED_SQL,this.info,"HY000"));return}if(this.prepareCache&&(this.sendQueue.isEmpty()||!this.receiveQueue.peekFront())){let a=this.prepareCache.get(e.sql);if(a){this.executePromise(e,a,A=>{s(A),a.close()},A=>{t(A),a.close()});return}}let n=this;if(this.opts.pipelining&&this.info.isMariaDB()&&this.info.hasMinVersion(10,2,4)){let a=!1,A=e.values?Array.isArray(e.values)?e.values:[e.values]:[];for(let u=0;u<A.length;u++){let h=A[u];h!=null&&typeof h=="object"&&typeof h.pipe=="function"&&typeof h.read=="function"&&(a=!0)}if(!a){let u=0,h=new Pt(R=>{u++===0&&(h.prepare.close(),s(R))},R=>{u++===0&&(n.opts.logger.error&&n.opts.logger.error(R),t(R),h.prepare&&h.prepare.close())},n.opts,e,null);e.executeCommand=h;let l=new os(R=>{u>0&&R.close()},R=>{u++===0&&(n.opts.logger.error&&n.opts.logger.error(R),t(R))},n.opts,e,n);n.addCommand(l,!0),n.addCommand(h,!0);return}}let o=new os(a=>{n.executePromise(e,a,A=>{s(A),a.close()},A=>{n.opts.logger.error&&n.opts.logger.error(A),t(A),a.close()})},a=>{n.opts.logger.error&&n.opts.logger.error(a),t(a)},this.opts,e,n);n.addCommand(o,!0)}importFile(e,s,t){let n=this;if(!e||!e.file)return t(f("SQL file parameter is mandatory",N.ER_MISSING_SQL_PARAMETER,n.info,"HY000",null,!1,e.stack));let o=this.addCommand.bind(n);this.waitingAuthenticationQueue=new mt.default,this.addCommand=this.addCommandQueue;let a=function(u,h,l){let R=new ge(h,I=>{n.opts.logger.error&&n.opts.logger.error(I),l(I)},n.opts,{sql:u,opts:{}});o(R,!0)},A=null;return(e.skipDbCheck?Promise.resolve():new Promise(a.bind(n,"SELECT DATABASE() as db"))).then(u=>(A=u?u[0].db:null,e.skipDbCheck&&!n.opts.database||!e.skipDbCheck&&!e.database&&!A?t(f("Database parameter is not set and no database is selected",N.ER_MISSING_DATABASE_PARAMETER,n.info,"HY000",null,!1,e.stack)):(e.database?new Promise(a.bind(n,`USE \`${e.database.replace(/`/gi,"``")}\``)):Promise.resolve()).then(()=>{let l=()=>{n.status<6&&(n.addCommand=n.addCommandEnable.bind(n),n.status<6&&n.opts.pipelining&&(n.addCommand=n.addCommandEnablePipeline.bind(n)),n.waitingAuthenticationQueue.toArray().forEach(I=>n.addCommand(I,!0)),n.waitingAuthenticationQueue=null)};return k_.promises.open(e.file,"r").then(async R=>{let I={buffer:Buffer.allocUnsafe(16384),offset:0,end:0},S=[],C=null;for(;!C;)try{let d=await R.read(I.buffer,I.end,I.buffer.length-I.end,null);if(d.bytesRead===0){if(R.close().catch(()=>{}),C){l(),t(C);return}await Promise.allSettled(S).then(()=>!e.skipDbCheck&&A&&e.database&&e.database!==A?new Promise(a.bind(n,`USE \`${A.replace(/`/gi,"``")}\``)):Promise.resolve()).then(()=>{l(),C?t(C):s()}).catch(b=>{l(),t(b)});return}else{I.end+=d.bytesRead;let g=n_(I).flatMap(U=>new Promise(a.bind(n,U)).catch(M=>{C=M}));if(S.push(...g),I.offset===I.end)I.offset=0,I.end=0;else if(I.offset>8192)I.buffer.copy(I.buffer,0,I.offset,I.end),I.end-=I.offset,I.offset=0;else if(I.buffer.length-I.end<8192){let U=Buffer.allocUnsafe(I.buffer.length<<1);I.buffer.copy(U,0,I.offset,I.end),I.buffer=U,I.end-=I.offset,I.offset=0}}}catch(d){return R.close().catch(()=>{}),l(),Promise.allSettled(S).catch(()=>{}),t(f(d.message,N.ER_SQL_FILE_ERROR,n.info,"HY000",null,!1,e.stack))}C&&(l(),t(C))}).catch(R=>(l(),R.code==="ENOENT"?t(f(`SQL file parameter '${e.file}' doesn't exists`,N.ER_MISSING_SQL_FILE,n.info,"HY000",null,!1,e.stack)):t(f(R.message,N.ER_SQL_FILE_ERROR,n.info,"HY000",null,!1,e.stack))))})))}clear(){this.sendQueue.clear(),this.opts.removeAllListeners(),this.streamOut=void 0,this.socket=void 0}redirect(e,s){if(this.opts.permitRedirect&&e)if(this.receiveQueue.length<=1&&(this.info.status&1)===0){this.info.redirectRequest=null;let t=e.match(qo);if(!t)return this.opts.logger.error&&this.opts.logger.error(new Error("error parsing redirection string "+e+". format must be 'mariadb/mysql://[<user>[:<password>]@]<host>[:<port>]/[<db>[?<opt1>=<value1>[&<opt2>=<value2>]]]'")),s();let n={host:t[7]?decodeURIComponent(t[7]):t[6],port:t[9]?parseInt(t[9]):3306};if(n.host===this.opts.host&&n.port===this.opts.port)return s();t[3]&&(n.user=t[3]),t[5]&&(n.password=t[5]);let o=fe.parseOptionDataType(n),a=new fe(Object.assign({},this.opts,o)),A=new E(a);A.connect().then(async function(){await new Promise(this.end.bind(this,{})),this.status=5,this.info=A.info,this.opts=A.opts,this.socket=A.socket,this.prepareCache&&this.prepareCache.reset(),this.streamOut=A.streamOut,this.streamIn=A.streamIn,s()}.bind(this)).catch(function(u){if(this.opts.logger.error){let h=new Error(`fail to redirect to '${e}'`);h.cause=u,this.opts.logger.error(h)}s()}.bind(this))}else this.info.redirectRequest=e,s();else this.info.redirectRequest=null,s()}get threadId(){return this.info?this.info.threadId:null}_sendNextCmdImmediate(){this.sendQueue.isEmpty()||this.nextSendCmd()}_closePrepare(e){this.addCommand(new g_({},()=>{},()=>{},e),!1)}_logAndReject(e,s){this.opts.logger.error&&this.opts.logger.error(s),e(s)}},yr=class{#e;#t;constructor(e,s){this.#e=e,this.#t=s}getCollation(){return this.#e}getSocket(){return this.#t}},wt=Hr;var x_=require("node:stream"),xr=class extends ge{constructor(e,s,t){super(()=>{},()=>{},s,e),this.socket=t,this.inStream=new x_.Readable({objectMode:!0,read:()=>{this.socket.resume()}}),this.on("fields",function(n){this.inStream.emit("fields",n)}),this.on("error",function(n){this.inStream.emit("error",n)}),this.on("close",function(n){this.inStream.emit("error",n)}),this.on("end",function(n){n&&this.inStream.emit("error",n),this.socket.resume(),this.inStream.push(null)}),this.inStream.close=function(){this.handleNewRows=()=>{},this.socket.resume()}.bind(this)}handleNewRows(e){this.inStream.push(e)||this.socket.pause()}},V_=xr;var hs=class{#e;#t;constructor(e){this.#e=e,this.#t=e.opts.trace?Error.captureStackTrace:()=>{}}get threadId(){return this.#e.threadId}get info(){return this.#e.info}get prepareCache(){return this.#e.prepareCache}changeUser(e){let s={opts:e};return this.#t(s),new Promise(this.#e.changeUser.bind(this.#e,s))}beginTransaction(){let e={sql:"START TRANSACTION"};return this.#t(e),new Promise(this.#e.query.bind(this.#e,e))}commit(){let e={sql:"COMMIT"};return this.#t(e),new Promise(this.#e.changeTransaction.bind(this.#e,e))}rollback(){let e={sql:"ROLLBACK"};return this.#t(e),new Promise(this.#e.changeTransaction.bind(this.#e,e))}query(e,s){let t=We(e,s);return this.#t(t),new Promise(this.#e.query.bind(this.#e,t))}queryStream(e,s){let t=We(e,s);this.#t(t);let n=new V_(t,this.#e.opts,this.#e.socket);return this.#e.opts.logger.error&&n.on("error",this.#e.opts.logger.error),this.#e.addCommand(n,!0),n.inStream}static _PARAM_DEF(e,s){return typeof e=="object"?{sql:e.sql,values:e.values?e.values:s,opts:e}:{sql:e,values:s}}execute(e,s){let t=We(e,s);return this.#t(t),new Promise(this.#e.prepareExecute.bind(this.#e,t))}static _EXECUTE_CMD(e,s){return e.prepareExecute(s)}prepare(e){let s;return typeof e=="object"?s={sql:e.sql,opts:e}:s={sql:e},this.#t(s),new Promise(this.#e.prepare.bind(this.#e,s))}batch(e,s){let t=We(e,s);return this.#t(t),new Promise(this.#e.batch.bind(this.#e,t))}importFile(e){return!e||!e.file?Promise.reject(f("SQL file parameter is mandatory",N.ER_MISSING_SQL_PARAMETER,this.#e.info,"HY000",null,!1,null)):new Promise(this.#e.importFile.bind(this.#e,{file:e.file,database:e.database}))}ping(e){let s={opts:{timeout:e}};return this.#t(s),new Promise(this.#e.ping.bind(this.#e,s))}reset(){let e={};return this.#t(e),new Promise(this.#e.reset.bind(this.#e,e))}isValid(){return this.#e.isValid()}end(){let e={};return this.#t(e),new Promise(this.#e.end.bind(this.#e,e))}close(){this.destroy()}destroy(){this.#e.destroy()}pause(){this.#e.pause()}resume(){this.#e.resume()}format(e,s){this.#e.format(e,s)}serverVersion(){return this.#e.serverVersion()}debug(e){return this.#e.debug(e)}debugCompress(e){return this.#e.debugCompress(e)}escape(e){return this.#e.escape(e)}escapeId(e){return this.#e.escapeId(e)}on(e,s){return this.#e.on.call(this.#e,e,s),this}off(e,s){return this.#e.off.call(this.#e,e,s),this}once(e,s){return this.#e.once.call(this.#e,e,s),this}listeners(e){return this.#e.listeners.call(this.#e,e)}addListener(e,s){return this.#e.addListener.call(this.#e,e,s),this}eventNames(){return this.#e.eventNames.call(this.#e)}getMaxListeners(){return this.#e.getMaxListeners.call(this.#e)}listenerCount(e,s){return this.#e.listenerCount.call(this.#e,e,s)}prependListener(e,s){return this.#e.prependListener.call(this.#e,e,s),this}prependOnceListener(e,s){return this.#e.prependOnceListener.call(this.#e,e,s),this}removeAllListeners(e,s){return this.#e.removeAllListeners.call(this.#e,e,s),this}removeListener(e,s){return this.#e.removeListener.call(this.#e,e,s),this}setMaxListeners(e){return this.#e.setMaxListeners.call(this.#e,e),this}rawListeners(e){return this.#e.rawListeners.call(this.#e,e)}get __tests(){return this.#e.__tests}};typeof Symbol.asyncDispose=="symbol"&&(hs.prototype[Symbol.asyncDispose]=function(){return this.end()});var gt=hs,We=function(E,e){return typeof E=="object"?{sql:E.sql,values:E.values?E.values:e,opts:E}:{sql:E,values:e}};var Y_=require("node:events");var W_=require("node:events"),Vr=m(require("denque"),1);var Wr=class extends W_.EventEmitter{opts;#e=!1;#t=!1;#s=null;#r;#i={};#_=new Vr.default;#o;#n;#A=0;#u=!1;#a;#E;constructor(e){super(),this.opts=e,this.#r=new Vr.default(null,{capacity:this.opts.connectionLimit}),this.on("_idle",this._processNextPendingRequest),this.on("validateSize",this._managePoolSize),this._managePoolSize()}_managePoolSize(){if(!this._shouldCreateMoreConnections()||this.#a)return;this.#t=!0;let e=Date.now()+this.opts.initializationTimeout;this._initiateConnectionCreation(e)}_initiateConnectionCreation(e){this._createPoolConnection(()=>this._onConnectionCreationSuccess(),s=>this._onConnectionCreationError(s,e),e)}_onConnectionCreationSuccess(){this.#u=!0,this.#s=null,this.#A=0,this.#E=null,this._shouldCreateMoreConnections()&&this.emit("validateSize"),this._startConnectionReaping()}_onConnectionCreationError(e,s){if(this.#t=!1,this.#e)return;this.#s&&(e=this.#s);let t;this.#u?t=f("Pool fails to create connection",N.ER_POOL_NO_CONNECTION,null,null,null,!1,null,null,e):t=f("Error during pool initialization",N.ER_POOL_NOT_INITIALIZED,null,null,null,!1,null,null,e);let n=Math.min(++this.#A*200,1e4);this._scheduleRetryWithBackoff(n),this.emit("error",t)}_scheduleRetryWithBackoff(e){this.#e||(this.#a=setTimeout(()=>{this.#a=null,this.#_.isEmpty()||this._managePoolSize()},e))}_createPoolConnection(e,s,t){if(this.#e){this.#E=null;return}let n=Object.assign({},this.opts.connOptions,{connectTimeout:Math.max(1,Math.min(t-Date.now(),this.opts.connOptions.connectTimeout||Number.MAX_SAFE_INTEGER))}),o=new wt(n);this.#E=null,o.connect().then(a=>this._prepareNewConnection(a,e,s)).catch(a=>this._handleConnectionCreationError(a,e,s,t))}_prepareNewConnection(e,s,t){if(this.#e){this._cleanupConnection(e,"pool_closed"),t(new w("Cannot create new connection to pool, pool closed",N.ER_ADD_CONNECTION_CLOSED_POOL));return}e.lastUse=Date.now(),e.forceEnd=e.end,e.release=n=>this._handleRelease(e,n),e.end=e.release,this._overrideConnectionMethods(e),this._setupConnectionErrorHandler(e),this.#r.push(e),this.#t=!1,this.emit("_idle"),s(e),setImmediate(()=>this._onNewConnection(e))}_onNewConnection(e){}_overrideConnectionMethods(e){let s=e.destroy.bind(e),t=this;e.destroy=function(){t._endLeak(e),delete t.#i[e.threadId],s(),t.emit("validateSize")}}_setupConnectionErrorHandler(e){let s=this;e.on("error",()=>{s._endLeak(e),delete s.#i[e.threadId],s._processIdleConnectionsOnError(e),setImmediate(()=>{s.#_.isEmpty()||s._managePoolSize()})})}_processIdleConnectionsOnError(e){let s=0;for(;s<this.#r.length;){let t=this.#r.peekAt(s);if(t===e){this.#r.removeOne(s);continue}t.lastUse=Math.min(t.lastUse,Date.now()-this.opts.minDelayValidation),s++}}_handleConnectionCreationError(e,s,t,n){if(e instanceof AggregateError&&(e=e.errors[0]),this.#s||(this.#s=e),this.#e||e.errno&&[1524,1045,1698].includes(e.errno)||n<Date.now()){e.message=e.message+this._errorMsgAddon(),this.#E=null,t(e);return}this.#E=setTimeout(()=>this._createPoolConnection(s,t,n),Math.min(500,n-Date.now()))}_checkRequestTimeouts(){this.#n=null;let e=Date.now();for(;this.#_.length>0;){let s=this.#_.peekFront();if(this._hasRequestTimedOut(s,e)){this._rejectTimedOutRequest(s,e);continue}this._scheduleNextTimeoutCheck(s,e);return}}_hasRequestTimedOut(e,s){return e.timeout<=s}_rejectTimedOutRequest(e,s){this.#_.shift();let t=this.activeConnections()===0?this.#s:null,n=Math.abs(s-(e.timeout-this.opts.acquireTimeout)),o;t?o=f(`pool failed to retrieve a connection from pool${this._errorMsgAddon()}`,N.ER_GET_CONNECTION_TIMEOUT,null,"HY000",null,!1,e.stack,null,t):o=f(`pool timeout: failed to retrieve a connection from pool after ${n}ms${this._errorMsgAddon()}`,N.ER_GET_CONNECTION_TIMEOUT,null,"HY000",null,!1,e.stack,null,null),e.reject(o)}_scheduleNextTimeoutCheck(e,s){let t=e.timeout-s;this.#n=setTimeout(()=>this._checkRequestTimeouts(),t)}_destroy(e){this._endLeak(e),delete this.#i[e.threadId],e.lastUse=Date.now(),e.forceEnd(null,()=>{},()=>{}),this.totalConnections()===0&&this._stopConnectionReaping(),this.emit("validateSize")}release(e){if(this.#i[e.threadId]){if(this._endLeak(e),e.lastUse=Date.now(),this.#e){delete this.#i[e.threadId],this._cleanupConnection(e,"pool_closed");return}e.isValid()?(this.emit("release",e),delete this.#i[e.threadId],this.#r.push(e),process.nextTick(this.emit.bind(this,"_idle"))):this._cleanupConnection(e,"validation_failed")}}_endLeak(e){e.leakProcess&&(clearTimeout(e.leakProcess),e.leakProcess=null,e.leaked&&e.opts.logger.warning(`Previous possible leak connection with thread ${e.info.threadId} was returned to pool`))}_startConnectionReaping(){!this.#o&&this.opts.idleTimeout>0&&(this.#o=setInterval(this._removeIdleConnections.bind(this),500))}_stopConnectionReaping(){this.#o&&this.totalConnections()===0&&(clearInterval(this.#o),this.#o=null)}_removeIdleConnections(){let e=Date.now()-this.opts.idleTimeout*1e3,s=Math.max(0,this.#r.length-this.opts.minimumIdle);for(;s>0;){let t=this.#r.peek();if(s--,t&&t.lastUse<e){this.#r.shift(),t.forceEnd(null,()=>{},()=>{});continue}break}this.totalConnections()===0&&this._stopConnectionReaping(),this.emit("validateSize")}_shouldCreateMoreConnections(){let e=this.#_.length>0,s=this.totalConnections()<this.opts.minimumIdle,t=this.totalConnections()<this.opts.connectionLimit,n=e&&this.#r.length===0;return!this.#t&&(s||n)&&t&&!this.#e}_processNextPendingRequest(){clearTimeout(this.#n),this.#n=null;let e=this.#_.shift();if(!e)return;let s=this.#r.shift();s?(this.opts.leakDetectionTimeout>0&&this._startLeakDetection(s),this.#i[s.threadId]=s,this.emit("acquire",s),e.resolver(s)):this.#_.unshift(e),this._checkRequestTimeouts()}_hasIdleConnection(){return!this.#r.isEmpty()}_acquireIdleConnection(e){if(!this._hasIdleConnection()||this.#e){e(new Error("No idle connections available"));return}this._findValidIdleConnection(e,!1)}_searchInfo(){let e=null,s=this.#r.get(0);if(!s){for(let t in Object.keys(this.#i))if(s=this.#i[t],!s)break}return s&&(e=s.info),e}_findValidIdleConnection(e,s){if(this.#r.isEmpty()){s&&setImmediate(()=>this.emit("validateSize")),e(new Error("No valid connections found"));return}let t=this.#r.shift();this.#i[t.threadId]=t,this._validateConnectionHealth(t,n=>{if(n){this.opts.leakDetectionTimeout>0&&this._startLeakDetection(t),s&&setImmediate(()=>this.emit("validateSize")),e(null,t);return}else delete this.#i[t.threadId];this._findValidIdleConnection(e,!0)})}_validateConnectionHealth(e,s){if(!e){s(!1);return}let t=this.opts.minDelayValidation>0&&Date.now()-e.lastUse<=this.opts.minDelayValidation;if(!e.isValid()||t){s(e.isValid());return}let n={opts:{timeout:this.opts.pingTimeout}};e.ping(n,()=>s(!0),()=>s(!1))}_leakedConnections(){let e=0;for(let s of Object.values(this.#i))s&&s.leaked&&e++;return e}_errorMsgAddon(){return this.opts.leakDetectionTimeout>0?`
(pool connections: active=`+this.activeConnections()+" idle="+this.idleConnections()+" leak="+this._leakedConnections()+" limit="+this.opts.connectionLimit+")":`
(pool connections: active=${this.activeConnections()} idle=${this.idleConnections()} limit=${this.opts.connectionLimit})`}toString(){return`active=${this.activeConnections()} idle=${this.idleConnections()} limit=${this.opts.connectionLimit}`}get closed(){return this.#e}totalConnections(){return this.activeConnections()+this.idleConnections()}activeConnections(){return Object.keys(this.#i).length}idleConnections(){return this.#r.length}taskQueueSize(){return this.#_.length}escape(e){return ct(this.opts.connOptions,this._searchInfo(),e)}escapeId(e){return Ht(this.opts.connOptions,this._searchInfo(),e)}getConnection(e,s){if(typeof e=="function"&&(s=e,e={}),this.#e){let t=f("pool is closed",N.ER_POOL_ALREADY_CLOSED,null,"HY000",e===null?null:e.sql,!1,e.stack);s(t);return}this._acquireIdleConnection((t,n)=>{if(!t&&n){this.emit("acquire",n),s(null,n);return}if(this.#e){s(f("Cannot add request to pool, pool is closed",N.ER_POOL_ALREADY_CLOSED,null,"HY000",e===null?null:e.sql,!1,e.stack));return}setImmediate(this.emit.bind(this,"validateSize")),setImmediate(this.emit.bind(this,"enqueue"));let o=new Yr(Date.now()+this.opts.acquireTimeout,e.stack,a=>s(null,a),a=>s(a));this.#_.push(o),this.#n||(this.#n=setTimeout(this._checkRequestTimeouts.bind(this),this.opts.acquireTimeout))})}end(){if(this.#e)return Promise.reject(f("pool is already closed",N.ER_POOL_ALREADY_CLOSED));this.#e=!0,clearInterval(this.#o),clearInterval(this.#a),clearTimeout(this.#E),clearTimeout(this.#n),this.#o=null,this.#a=null,this.#E=null,this.#n=null;let e={};this.opts.trace&&Error.captureStackTrace(e);let s=[],t;for(;t=this.#r.shift();)s.push(new Promise(t.forceEnd.bind(t,e)));if(!this.#_.isEmpty()){let o=f("pool is ending, connection request aborted",N.ER_CLOSING_POOL,null,"HY000",null,!1,e.stack),a;for(;a=this.#_.shift();)a.reject(o)}this.removeAllListeners();let n=this;return Promise.all(s).then(async()=>{if(n.activeConnections()>0){let o=100;for(;o-- >0;)n.activeConnections()>0&&await new Promise(a=>setTimeout(()=>a(),100));for(let a of Object.values(n.#i))a&&a.destroy()}return Promise.resolve()})}_cleanupConnection(e,s=""){if(e){this._endLeak(e),delete this.#i[e.threadId];try{(e.forceEnd?e.forceEnd:e.end).call(e,null,()=>this.emit("connectionClosed",{threadId:e.threadId,reason:s}),()=>{})}catch(t){this.emit("error",new Error(`Failed to cleanup connection: ${t.message}`))}this.totalConnections()===0&&this._stopConnectionReaping(),this.emit("validateSize")}}_handleRelease(e,s){if(s=s||function(){},this.#e||!e.isValid()){this._destroy(e),s();return}if(this.opts.noControlAfterUse){this.release(e),s();return}this._getRevertFunction(e)(n=>{n?this._destroy(e):this.release(e),s()})}_getRevertFunction(e){return this.opts.resetAfterUse&&e.info.isMariaDB()&&(e.info.serverVersion.minor===2&&e.info.hasMinVersion(10,2,22)||e.info.hasMinVersion(10,3,13))?t=>e.reset({},t):t=>e.changeTransaction({sql:"ROLLBACK"},()=>t(null),n=>t(n))}_startLeakDetection(e){e.lastUse=Date.now(),e.leaked=!1,e.leakProcess=setTimeout(()=>{e.leaked=!0;let s=Date.now()-e.lastUse;e.opts.logger.warning(`A possible connection leak on thread ${e.info.threadId} (connection not returned to pool for ${s}ms). Has connection.release() been called?${this._errorMsgAddon()}`)},this.opts.leakDetectionTimeout,e)}},Yr=class{constructor(e,s,t,n){this.timeout=e,this.stack=s,this.resolver=t,this.rejecter=n}reject(e){process.nextTick(this.rejecter,e)}},ls=Wr;var K_=typeof Symbol.asyncDispose=="symbol",cs=class extends Y_.EventEmitter{#e;constructor(e){super(),this.#e=new ls(e);let s=this;this.#e._onNewConnection=t=>{try{s.emit("connection",new gt(t))}catch{}},this.#e.on("acquire",this.emit.bind(this,"acquire")),this.#e.on("enqueue",this.emit.bind(this,"enqueue")),this.#e.on("release",this.emit.bind(this,"release")),this.#e.on("error",this.emit.bind(this,"error"))}get closed(){return this.#e.closed}totalConnections(){return this.#e.totalConnections()}activeConnections(){return this.#e.activeConnections()}idleConnections(){return this.#e.idleConnections()}taskQueueSize(){return this.#e.taskQueueSize()}escape(e){return this.#e.escape(e)}escapeId(e){return this.#e.escapeId(e)}end(){return this.#e.end()}async getConnection(){let e={};return this.#e.opts.connOptions.trace&&Error.captureStackTrace(e),new Promise((s,t)=>{this.#e.getConnection(e,(n,o)=>{if(n)t(n);else{let a=new gt(o);a.release=()=>new Promise(o.release),a.end=a.release,a.close=a.release,K_&&(a[Symbol.asyncDispose]=()=>a.release()),s(a)}})})}query(e,s){let t=We(e,s);return this.#e.opts.connOptions.trace&&Error.captureStackTrace(t),new Promise((n,o)=>this.#e.getConnection(t,(a,A)=>{a?o(a):A.query(t,u=>{this.#e.release(A),n(u)},u=>{this.#e.release(A),o(u)})}))}execute(e,s){let t=We(e,s);return this.#e.opts.connOptions.trace&&Error.captureStackTrace(t),new Promise((n,o)=>this.#e.getConnection(t,(a,A)=>{a?o(a):A.prepareExecute(t,u=>{this.#e.release(A),n(u)},u=>{this.#e.release(A),o(u)})}))}batch(e,s){let t=We(e,s);return this.#e.opts.connOptions.trace&&Error.captureStackTrace(t),new Promise((n,o)=>this.#e.getConnection(t,(a,A)=>{a?o(a):A.batch(t,u=>{this.#e.release(A),n(u)},u=>{this.#e.release(A),o(u)})}))}importFile(e){return e?new Promise((s,t)=>this.#e.getConnection({},(n,o)=>{n?t(n):o.importFile({file:e.file,database:e.database},a=>{this.#e.release(o),s(a)},a=>{this.#e.release(o),t(a)})})):Promise.reject(f("SQL file parameter is mandatory",N.ER_MISSING_SQL_PARAMETER,null,"HY000",null,!1,null))}toString(){return"poolPromise("+this.#e.toString()+")"}};K_&&(cs.prototype[Symbol.asyncDispose]=function(){return this.end()});var Ns=cs;var Kr=class{constructor(e){e?(this.canRetry=e.canRetry===void 0?!0:!!e.canRetry,this.removeNodeErrorCount=e.removeNodeErrorCount===void 0?Number.POSITIVE_INFINITY:Number(e.removeNodeErrorCount),this.restoreNodeTimeout=e.restoreNodeTimeout===void 0?1e3:Number(e.restoreNodeTimeout),this.defaultSelector=e.defaultSelector||"RR"):(this.canRetry=!0,this.removeNodeErrorCount=Number.POSITIVE_INFINITY,this.restoreNodeTimeout=1e3,this.defaultSelector="RR")}},Is=Kr;var vr=class{constructor(e){typeof e=="string"&&(e=fe.parse(e),e.acquireTimeout&&(e.acquireTimeout=parseInt(e.acquireTimeout)),e.connectionLimit&&(e.connectionLimit=parseInt(e.connectionLimit)),e.idleTimeout&&(e.idleTimeout=parseInt(e.idleTimeout)),e.leakDetectionTimeout&&(e.leakDetectionTimeout=parseInt(e.leakDetectionTimeout)),e.initializationTimeout&&(e.initializationTimeout=parseInt(e.initializationTimeout)),e.minDelayValidation&&(e.minDelayValidation=parseInt(e.minDelayValidation)),e.minimumIdle&&(e.minimumIdle=parseInt(e.minimumIdle)),e.noControlAfterUse&&(e.noControlAfterUse=e.noControlAfterUse==="true"),e.resetAfterUse&&(e.resetAfterUse=e.resetAfterUse==="true"),e.pingTimeout&&(e.pingTimeout=parseInt(e.pingTimeout))),this.acquireTimeout=e.acquireTimeout===void 0?1e4:Number(e.acquireTimeout),this.connectionLimit=e.connectionLimit===void 0?10:Number(e.connectionLimit),this.idleTimeout=e.idleTimeout===void 0?1800:Number(e.idleTimeout),this.leakDetectionTimeout=Number(e.leakDetectionTimeout)||0,this.initializationTimeout=e.initializationTimeout===void 0?Math.max(100,this.acquireTimeout-100):Number(e.initializationTimeout),this.minDelayValidation=e.minDelayValidation===void 0?500:Number(e.minDelayValidation),this.minimumIdle=e.minimumIdle===void 0?this.connectionLimit:Math.min(Number(e.minimumIdle),this.connectionLimit),this.noControlAfterUse=!!e.noControlAfterUse||!1,this.resetAfterUse=!!e.resetAfterUse||!1,this.pingTimeout=Number(e.pingTimeout)||250,this.connOptions=new fe(e),this.acquireTimeout>0&&this.connOptions.connectTimeout>this.acquireTimeout&&(this.connOptions.connectTimeout=this.acquireTimeout)}},Rs=vr;var v_=require("node:events");var Qr=class E{#e;constructor(e){this.#e=e}get threadId(){return this.#e.info?this.#e.info.threadId:null}get info(){return this.#e.info}#t=()=>{};release=e=>{this.#e.release(()=>{e&&e()})};changeUser(e,s){let t,n;typeof e=="function"?(n=e,t=void 0):(t=e,n=s);let o={opts:t,callback:n};this.#e.opts.trace&&Error.captureStackTrace(o),new Promise(this.#e.changeUser.bind(this.#e,o)).then(()=>{o.callback&&o.callback(null,null,null)}).catch(o.callback||this.#t)}beginTransaction(e){this.query("START TRANSACTION",null,e)}commit(e){this.#e.changeTransaction({sql:"COMMIT"},()=>{e&&e(null,null,null)},e||this.#t)}rollback(e){this.#e.changeTransaction({sql:"ROLLBACK"},()=>{e&&e(null,null,null)},e||this.#t)}query(e,s,t){let n=E._PARAM(this.#e.opts,e,s,t);return E._QUERY_CMD(this.#e,n)}queryStream(e,s){let t=E._PARAM(this.#e.opts,e,s);return E._QUERY_CMD(this.#e,t).stream()}static _QUERY_CMD(e,s){let t;return s.callback?(s.opts=s.opts?Object.assign(s.opts,{metaAsArray:!0}):{metaAsArray:!0},t=new ge(([n,o])=>{s.callback(null,n,o)},s.callback,e.opts,s)):t=new ge(()=>{},()=>{},e.opts,s),t.handleNewRows=n=>{t._rows[t._responseIndex].push(n),t.emit("data",n)},e.addCommand(t,!0),t.stream=n=>t._stream(e.socket,n),t}execute(e,s,t){let n=E._PARAM(this.#e.opts,e,s,t);n.opts=n.opts?Object.assign(n.opts,{metaAsArray:!0}):{metaAsArray:!0},this.#e.prepareExecute(n,([o,a])=>{n.callback&&n.callback(null,o,a)},o=>{n.callback&&n.callback(o)})}static _PARAM(e,s,t,n){let o,a,A=t,u=n;typeof t=="function"&&(u=t,A=void 0),typeof s=="object"?(o=s,a=o.sql,o.values&&(A=o.values)):a=s;let h={sql:a,values:A,opts:o,callback:u};return e.trace&&Error.captureStackTrace(h,E._PARAM),h}static _EXECUTE_CMD(e,s){new Promise(e.prepare.bind(e,s)).then(t=>{let n=s.opts?Object.assign(s.opts,{metaAsArray:!0}):{metaAsArray:!0};return t.execute(s.values,n,null,s.stack).then(([o,a])=>{s.callback&&s.callback(null,o,a)}).finally(()=>t.close())}).catch(t=>{e.opts.logger.error&&e.opts.logger.error(t),s.callback&&s.callback(t)})}prepare(e,s){let t,n;typeof e=="object"?(t=e,n=t.sql):n=e;let o={sql:n,opts:t,callback:s};return this.#e.opts.trace&&Error.captureStackTrace(o),new Promise(this.#e.prepare.bind(this.#e,o)).then(a=>{try{s&&s(null,a,null)}catch{}}).catch(s||this.#t)}batch(e,s,t){let n=E._PARAM(this.#e.opts,e,s,t);this.#e.batch(n,o=>{n.callback&&n.callback(null,o)},o=>{n.callback&&n.callback(o)})}importFile(e,s){if(!e||!e.file){s&&s(f("SQL file parameter is mandatory",N.ER_MISSING_SQL_PARAMETER,this.#e.info,"HY000",null,!1,null));return}new Promise(this.#e.importFile.bind(this.#e,{file:e.file,database:e.database})).then(()=>{s&&s()}).catch(t=>{s&&s(t)})}ping(e,s){let t={},n;typeof e=="function"?n=e:(t.timeout=e,n=s);let o={opts:t,callback:n};this.#e.opts.trace&&Error.captureStackTrace(o),new Promise(this.#e.ping.bind(this.#e,o)).then(n||this.#t).catch(n||this.#t)}reset(e){let s={};return this.#e.opts.trace&&Error.captureStackTrace(s),new Promise(this.#e.reset.bind(this.#e,s)).then(e||this.#t).catch(e||this.#t)}isValid(){return this.#e.isValid()}end(e){let s={};this.#e.opts.trace&&Error.captureStackTrace(s),new Promise(this.#e.end.bind(this.#e,s)).then(()=>{e&&e()}).catch(e||this.#t)}close(){this.destroy()}destroy(){this.#e.destroy()}pause(){this.#e.pause()}resume(){this.#e.resume()}format(e,s){this.#e.format(e,s)}serverVersion(){return this.#e.serverVersion()}debug(e){return this.#e.debug(e)}debugCompress(e){return this.#e.debugCompress(e)}escape(e){return this.#e.escape(e)}escapeId(e){return this.#e.escapeId(e)}get __tests(){return this.#e.__tests}connect(e){if(!e)throw new f("missing mandatory callback parameter",N.ER_MISSING_PARAMETER,this.#e.info);switch(this.#e.status){case 1:case 2:case 3:case 4:this.once("connect",e);break;case 5:e.call(this);break;case 6:case 7:case 8:e.call(this,f("Connection closed",N.ER_CONNECTION_ALREADY_CLOSED,this.#e.info,"08S01",null,!0));break}}on(e,s){return this.#e.on.call(this.#e,e,s),this}off(e,s){return this.#e.off.call(this.#e,e,s),this}once(e,s){return this.#e.once.call(this.#e,e,s),this}listeners(e){return this.#e.listeners.call(this.#e,e)}addListener(e,s){return this.#e.addListener.call(this.#e,e,s),this}eventNames(){return this.#e.eventNames.call(this.#e)}getMaxListeners(){return this.#e.getMaxListeners.call(this.#e)}listenerCount(e,s){return this.#e.listenerCount.call(this.#e,e,s)}prependListener(e,s){return this.#e.prependListener.call(this.#e,e,s),this}prependOnceListener(e,s){return this.#e.prependOnceListener.call(this.#e,e,s),this}removeAllListeners(e,s){return this.#e.removeAllListeners.call(this.#e,e,s),this}removeListener(e,s){return this.#e.removeListener.call(this.#e,e,s),this}setMaxListeners(e){return this.#e.setMaxListeners.call(this.#e,e),this}rawListeners(e){return this.#e.rawListeners.call(this.#e,e)}},ze=Qr;var qr=class extends v_.EventEmitter{#e;constructor(e){super(),this.#e=new ls(e);let s=this;this.#e._onNewConnection=t=>{try{s.emit("connection",new ze(t))}catch{}},this.#e.on("acquire",this.emit.bind(this,"acquire")),this.#e.on("enqueue",this.emit.bind(this,"enqueue")),this.#e.on("release",this.emit.bind(this,"release")),this.#e.on("error",this.emit.bind(this,"error"))}#t=()=>{};get closed(){return this.#e.closed}totalConnections(){return this.#e.totalConnections()}activeConnections(){return this.#e.activeConnections()}idleConnections(){return this.#e.idleConnections()}taskQueueSize(){return this.#e.taskQueueSize()}escape(e){return this.#e.escape(e)}escapeId(e){return this.#e.escapeId(e)}end(e){this.#e.end().then(()=>{e&&e(null)}).catch(e||this.#t)}getConnection(e){if(!e)throw new f("missing mandatory callback parameter",N.ER_MISSING_PARAMETER);let s={};this.#e.opts.connOptions.trace&&Error.captureStackTrace(s),this.#e.getConnection(s,(t,n)=>{if(t)e(t);else{let o=new ze(n);o.end=a=>o.release(a),o.close=a=>o.release(a),e(null,o)}})}query(e,s,t){let n=ze._PARAM(this.#e.opts.connOptions,e,s,t);this.#e.getConnection(n,(o,a)=>{if(o)n.callback&&n.callback(o);else{let A=n.callback;n.callback=(u,h,l)=>{this.#e.release(a),A&&A(u,h,l)},ze._QUERY_CMD(a,n)}})}execute(e,s,t){let n=ze._PARAM(this.#e.opts.connOptions,e,s,t);this.#e.getConnection(n,(o,a)=>{if(o)n.callback&&n.callback(o);else{let A=n.callback;a.prepareExecute(n,u=>{this.#e.release(a),A&&A(null,u,u.meta)},u=>{this.#e.release(a),A&&A(u)})}})}batch(e,s,t){let n=ze._PARAM(this.#e.opts.connOptions,e,s,t);this.#e.getConnection(n,(o,a)=>{if(o)n.callback&&n.callback(o);else{let A=n.callback;a.batch(n,u=>{this.#e.release(a),A&&A(null,u)},u=>{this.#e.release(a),A&&A(u)})}})}importFile(e,s){if(!e){s&&s(f("SQL file parameter is mandatory",N.ER_MISSING_SQL_PARAMETER,null,"HY000",null,!1,null));return}this.#e.getConnection({},(t,n)=>{t?s&&s(t):n.importFile({file:e.file,database:e.database},o=>{this.#e.release(n),s&&s(null,o)},o=>{this.#e.release(n),s&&s(o)})})}toString(){return"poolCallback("+this.#e.toString()+")"}},Xr=qr;var jr=class{#e;#t;#s;constructor(e,s,t){this.#e=e,this.#t=s,this.#s=t}getConnection(){return this.#e.getConnection(this.#t,this.#s)}query(e,s){return this.#e.getConnection(this.#t,this.#s).then(t=>t.query(e,s).then(n=>(t.release(),n)).catch(n=>(t.release(),Promise.reject(n)))).catch(t=>Promise.reject(t))}execute(e,s){return this.#e.getConnection(this.#t,this.#s).then(t=>t.execute(e,s).then(n=>(t.release(),n)).catch(n=>(t.release(),Promise.reject(n)))).catch(t=>Promise.reject(t))}batch(e,s){return this.#e.getConnection(this.#t,this.#s).then(t=>t.batch(e,s).then(n=>(t.release(),n)).catch(n=>(t.release(),Promise.reject(n)))).catch(t=>Promise.reject(t))}},Q_=jr;var $r=class{#e;#t;#s;constructor(e,s,t){this.#e=e,this.#t=s,this.#s=t}getConnection(e){let s=e||((t,n)=>{});return this.#e.getConnection(this.#t,this.#s,s)}query(e,s,t){let n=e,o=s,a=t;typeof s=="function"&&(o=null,a=s);let A=a||(()=>{});this.getConnection((u,h)=>{u?A(u):h.query(n,o,(l,R,I)=>{h.release(()=>{}),l?A(l):A(null,R,I)})})}execute(e,s,t){let n=e,o=s,a=t;typeof s=="function"&&(o=null,a=s);let A=a||(()=>{});this.getConnection((u,h)=>{u?A(u):h.execute(n,o,(l,R,I)=>{h.release(()=>{}),l?A(l):A(null,R,I)})})}batch(e,s,t){let n=e,o=s,a=t;typeof s=="function"&&(o=null,a=s);let A=a||(()=>{});this.getConnection((u,h)=>{u?A(u):h.batch(n,o,(l,R,I)=>{h.release(()=>{}),l?A(l):A(null,R,I)})})}},q_=$r;var X_=m(require("node:events"),1),Zr=class extends X_.default{#e;#t={};#s={};#r=0;constructor(e){super(),this.#e=new Is(e)}add(e,s){let t;if(typeof e=="string"||e instanceof String){if(t=e,this.#t[t])throw new Error(`Node identifier '${t}' already exist !`)}else t="PoolNode-"+this.#r++,s=e;let n=new Rs(s);this.#t[t]=this._createPool(n)}end(){let e=this;this.#s={};let s=[];return Object.keys(this.#t).forEach(t=>{let n=e.#t[t].end();n&&s.push(n)}),this.#t=null,Promise.all(s)}of(e,s){return new Q_(this,e,s)}_ofCallback(e,s){return new q_(this,e,s)}remove(e){if(!e)throw new Error("pattern parameter in Cluster.remove(pattern) is mandatory");let s=RegExp(e);Object.keys(this.#t).forEach(function(t){s.test(t)&&(this.#t[t].end(),delete this.#t[t],this.#s={})}.bind(this))}getConnection(e,s){return this._getConnection(e,s,void 0,void 0,void 0)}_setCallback(){this.getConnection=this._getConnectionCallback,this._createPool=this._createPoolCallback,this.of=this._ofCallback}_getConnection(e,s,t,n,o){let a=this._matchingNodes(e||/^/);if(a.length===0){if(Object.keys(this.#t).length===0&&!o)return Promise.reject(new Error("No node have been added to cluster or nodes have been removed due to too much connection error"));if(n===void 0)return Promise.reject(new Error(`No node found for pattern '${e}'`));let u=`No Connection available for '${e}'${o?". Last connection error was: "+o.message:""}`;return Promise.reject(new Error(u))}t===void 0&&(t=a.length);let A=--t>=0?this._getConnection.bind(this,e,s,t):null;try{let u=this._selectPool(a,s,n);return this._handleConnectionError(a,u,A)}catch(u){return Promise.reject(u)}}_createPool(e){let s=new Ns(e);return s.on("error",t=>{}),s}_createPoolCallback(e){let s=new Xr(e);return s.on("error",t=>{}),s}_getConnectionCallback(e,s,t,n,o,a){let A=this._matchingNodes(e||/^/);if(A.length===0){if(Object.keys(this.#t).length===0&&!a){t(new Error("No node have been added to cluster or nodes have been removed due to too much connection error"));return}o===void 0&&t(new Error(`No node found for pattern '${e}'`));let h=`No Connection available for '${e}'${a?". Last connection error was: "+a.message:""}`;t(new Error(h));return}n===void 0&&(n=A.length);let u=--n>=0?this._getConnectionCallback.bind(this,e,s,t,n):null;try{let h=this._selectPool(A,s,o);this._handleConnectionCallbackError(A,h,u,t)}catch(h){t(h)}}_matchingNodes(e){if(this.#s[e])return this.#s[e];let s=RegExp(e),t=[];return Object.keys(this.#t).forEach(n=>{s.test(n)&&t.push(n)}),this.#s[e]=t,t}_selectPool(e,s,t){let n=s||this.#e.defaultSelector,o;switch(n){case"RR":o=Xo;break;case"RANDOM":o=jo;break;case"ORDER":o=$o;break;default:throw new Error(`Wrong selector value '${n}'. Possible values are 'RR','RANDOM' or 'ORDER'`)}let a=0,A=o(e,a);for(;(t===A||this.#t[A].blacklistedUntil&&this.#t[A].blacklistedUntil>Date.now())&&a<e.length-1;)a++,A=o(e,a);if(t===A)for(a=0;t===A&&a<e.length-1;)a++,A=o(e,a);return A}_handleNodeFailure(e,s){let t=this.#t[e];if(!t)return;let n=this;t.errorCount=t.errorCount?t.errorCount+1:1,t.blacklistedUntil=Date.now()+n.#e.restoreNodeTimeout,n.#e.removeNodeErrorCount&&t.errorCount>=n.#e.removeNodeErrorCount&&n.#t[e]&&(delete n.#t[e],n.#s={},delete s.lastRrIdx,setImmediate(n.emit.bind(n,"remove",e)),t instanceof Xr?t.end(()=>{}):t.end().catch(o=>{}))}_handleConnectionError(e,s,t){let n=this,o=this.#t[s];return o.getConnection().then(a=>(o.blacklistedUntil=null,o.errorCount=0,a)).catch(a=>(this._handleNodeFailure(s,e),e.length!==0&&n.#e.canRetry&&t?t(s,a):Promise.reject(a)))}_handleConnectionCallbackError(e,s,t,n){let o=this,a=this.#t[s];a.getConnection((A,u)=>{if(A){if(this._handleNodeFailure(s,e),e.length!==0&&o.#e.canRetry&&t)return t(s,A);n(A)}else a.blacklistedUntil=null,a.errorCount=0,n(null,u)})}get __tests(){return new Jr(this.#t)}},Jr=class{#e;constructor(e){this.#e=e}getNodes(){return this.#e}},Xo=E=>{let e=E.lastRrIdx;return e===void 0&&(e=-1),++e>=E.length&&(e=0),E.lastRrIdx=e,E[e]},jo=E=>{let e=Math.floor(Math.random()*E.length);return E[e]},$o=(E,e)=>E[e],j_=Zr;var $_=Me.version;function Z_(E){let e=new fe(E),s={};for(let[t,n]of Object.entries(e))t.startsWith("_")||(s[t]=n);return s}function J_(E){try{let e=new fe(E),s=new wt(e),t=new gt(s);return s.connect().then(()=>Promise.resolve(t))}catch(e){return Promise.reject(e)}}function z_(E){let e=new Rs(E),s=new Ns(e);return s.on("error",t=>{}),s}function en(E){let e=new Is(E);return new j_(e)}function tn(E){try{let e=new fe(E),s=new wt(e);return s.connect().then(()=>new Promise(s.importFile.bind(s,Object.assign({skipDbCheck:!0},E)))).finally(()=>{new Promise(s.end.bind(s,{})).catch(console.log)})}catch(e){return Promise.reject(e)}}var Zo={version:$_,SqlError:L,defaultOptions:Z_,createConnection:J_,createPool:z_,createPoolCluster:en,importFile:tn};0&&(module.exports={SqlError,createConnection,createPool,createPoolCluster,defaultOptions,importFile,version});