38 lines
315 KiB
JavaScript
38 lines
315 KiB
JavaScript
"use strict";var _n=Object.create;var Mt=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var En=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var er=(E,e)=>{for(var s in e)Mt(E,s,{get:e[s],enumerable:!0})},tr=(E,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of on(e))!an.call(E,n)&&n!==s&&Mt(E,n,{get:()=>e[n],enumerable:!(t=nn(e,n))||t.enumerable});return E};var m=(E,e,s)=>(s=E!=null?_n(En(E)):{},tr(e||!E||!E.__esModule?Mt(s,"default",{value:E,enumerable:!0}):s,E)),An=E=>tr(Mt({},"__esModule",{value:!0}),E);var eE={};er(eE,{SqlError:()=>L,createConnection:()=>en,createPool:()=>tn,createPoolCluster:()=>sn,default:()=>zo,defaultOptions:()=>z_,importFile:()=>rn,version:()=>J_});module.exports=An(eE);var Be={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 hn(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 cn=Be.engines.node,sr=cn.replace(">=","").trim(),ln=process.version.replace("v","");hn(ln,sr)||(console.error(`please upgrade node: mariadb requires at least version ${sr}`),process.exit(1));var L={};er(L,{client:()=>N,createError:()=>f,createFatalError:()=>w,default:()=>ve,getClientErrorKey:()=>rr});var i={};i[120]="HA_ERR_KEY_NOT_FOUND";i[121]="HA_ERR_FOUND_DUPP_KEY";i[122]="HA_ERR_INTERNAL_ERROR";i[123]="HA_ERR_RECORD_CHANGED";i[124]="HA_ERR_WRONG_INDEX";i[126]="HA_ERR_CRASHED";i[127]="HA_ERR_WRONG_IN_RECORD";i[128]="HA_ERR_OUT_OF_MEM";i[129]="HA_ERR_RETRY_INIT";i[130]="HA_ERR_NOT_A_TABLE";i[131]="HA_ERR_WRONG_COMMAND";i[132]="HA_ERR_OLD_FILE";i[133]="HA_ERR_NO_ACTIVE_RECORD";i[134]="HA_ERR_RECORD_DELETED";i[135]="HA_ERR_RECORD_FILE_FULL";i[136]="HA_ERR_INDEX_FILE_FULL";i[137]="HA_ERR_END_OF_FILE";i[138]="HA_ERR_UNSUPPORTED";i[139]="HA_ERR_TO_BIG_ROW";i[140]="HA_WRONG_CREATE_OPTION";i[141]="HA_ERR_FOUND_DUPP_UNIQUE";i[142]="HA_ERR_UNKNOWN_CHARSET";i[143]="HA_ERR_WRONG_MRG_TABLE_DEF";i[144]="HA_ERR_CRASHED_ON_REPAIR";i[145]="HA_ERR_CRASHED_ON_USAGE";i[146]="HA_ERR_LOCK_WAIT_TIMEOUT";i[147]="HA_ERR_LOCK_TABLE_FULL";i[148]="HA_ERR_READ_ONLY_TRANSACTION";i[149]="HA_ERR_LOCK_DEADLOCK";i[150]="HA_ERR_CANNOT_ADD_FOREIGN";i[151]="HA_ERR_NO_REFERENCED_ROW";i[152]="HA_ERR_ROW_IS_REFERENCED";i[153]="HA_ERR_NO_SAVEPOINT";i[154]="HA_ERR_NON_UNIQUE_BLOCK_SIZE";i[155]="HA_ERR_NO_SUCH_TABLE";i[156]="HA_ERR_TABLE_EXIST";i[157]="HA_ERR_NO_CONNECTION";i[158]="HA_ERR_NULL_IN_SPATIAL";i[159]="HA_ERR_TABLE_DEF_CHANGED";i[160]="HA_ERR_NO_PARTITION_FOUND";i[161]="HA_ERR_RBR_LOGGING_FAILED";i[162]="HA_ERR_DROP_INDEX_FK";i[163]="HA_ERR_FOREIGN_DUPLICATE_KEY";i[164]="HA_ERR_TABLE_NEEDS_UPGRADE";i[165]="HA_ERR_TABLE_READONLY";i[166]="HA_ERR_AUTOINC_READ_FAILED";i[167]="HA_ERR_AUTOINC_ERANGE";i[168]="HA_ERR_GENERIC";i[169]="HA_ERR_RECORD_IS_THE_SAME";i[170]="HA_ERR_LOGGING_IMPOSSIBLE";i[171]="HA_ERR_CORRUPT_EVENT";i[172]="HA_ERR_NEW_FILE";i[173]="HA_ERR_ROWS_EVENT_APPLY";i[174]="HA_ERR_INITIALIZATION";i[175]="HA_ERR_FILE_TOO_SHORT";i[176]="HA_ERR_WRONG_CRC";i[177]="HA_ERR_TOO_MANY_CONCURRENT_TRXS";i[178]="HA_ERR_NOT_IN_LOCK_PARTITIONS";i[179]="HA_ERR_INDEX_COL_TOO_LONG";i[180]="HA_ERR_INDEX_CORRUPT";i[181]="HA_ERR_UNDO_REC_TOO_BIG";i[182]="HA_FTS_INVALID_DOCID";i[184]="HA_ERR_TABLESPACE_EXISTS";i[185]="HA_ERR_TOO_MANY_FIELDS";i[186]="HA_ERR_ROW_IN_WRONG_PARTITION";i[187]="HA_ERR_ROW_NOT_VISIBLE";i[188]="HA_ERR_ABORTED_BY_USER";i[189]="HA_ERR_DISK_FULL";i[190]="HA_ERR_INCOMPATIBLE_DEFINITION";i[191]="HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE";i[192]="HA_ERR_DECRYPTION_FAILED";i[193]="HA_ERR_FK_DEPTH_EXCEEDED";i[194]="HA_ERR_TABLESPACE_MISSING";i[195]="HA_ERR_SEQUENCE_INVALID_DATA";i[196]="HA_ERR_SEQUENCE_RUN_OUT";i[197]="HA_ERR_COMMIT_ERROR";i[198]="HA_ERR_PARTITION_LIST";i[199]="HA_ERR_NO_ENCRYPTION";i[200]="HA_ERR_ROLLBACK";i[201]="HA_ERR_LOCAL_TMP_SPACE_FULL";i[202]="HA_ERR_GLOBAL_TMP_SPACE_FULL";i[1e3]="ER_HASHCHK";i[1001]="ER_NISAMCHK";i[1002]="ER_NO";i[1003]="ER_YES";i[1004]="ER_CANT_CREATE_FILE";i[1005]="ER_CANT_CREATE_TABLE";i[1006]="ER_CANT_CREATE_DB";i[1007]="ER_DB_CREATE_EXISTS";i[1008]="ER_DB_DROP_EXISTS";i[1009]="ER_DB_DROP_DELETE";i[1010]="ER_DB_DROP_RMDIR";i[1011]="ER_CANT_DELETE_FILE";i[1012]="ER_CANT_FIND_SYSTEM_REC";i[1013]="ER_CANT_GET_STAT";i[1014]="ER_CANT_GET_WD";i[1015]="ER_CANT_LOCK";i[1016]="ER_CANT_OPEN_FILE";i[1017]="ER_FILE_NOT_FOUND";i[1018]="ER_CANT_READ_DIR";i[1019]="ER_CANT_SET_WD";i[1020]="ER_CHECKREAD";i[1021]="ER_DISK_FULL";i[1022]="ER_DUP_KEY";i[1023]="ER_ERROR_ON_CLOSE";i[1024]="ER_ERROR_ON_READ";i[1025]="ER_ERROR_ON_RENAME";i[1026]="ER_ERROR_ON_WRITE";i[1027]="ER_FILE_USED";i[1028]="ER_FILSORT_ABORT";i[1029]="ER_FORM_NOT_FOUND";i[1030]="ER_GET_ERRNO";i[1031]="ER_ILLEGAL_HA";i[1032]="ER_KEY_NOT_FOUND";i[1033]="ER_NOT_FORM_FILE";i[1034]="ER_NOT_KEYFILE";i[1035]="ER_OLD_KEYFILE";i[1036]="ER_OPEN_AS_READONLY";i[1037]="ER_OUTOFMEMORY";i[1038]="ER_OUT_OF_SORTMEMORY";i[1039]="ER_UNEXPECTED_EOF";i[1040]="ER_CON_COUNT_ERROR";i[1041]="ER_OUT_OF_RESOURCES";i[1042]="ER_BAD_HOST_ERROR";i[1043]="ER_HANDSHAKE_ERROR";i[1044]="ER_DBACCESS_DENIED_ERROR";i[1045]="ER_ACCESS_DENIED_ERROR";i[1046]="ER_NO_DB_ERROR";i[1047]="ER_UNKNOWN_COM_ERROR";i[1048]="ER_BAD_NULL_ERROR";i[1049]="ER_BAD_DB_ERROR";i[1050]="ER_TABLE_EXISTS_ERROR";i[1051]="ER_BAD_TABLE_ERROR";i[1052]="ER_NON_UNIQ_ERROR";i[1053]="ER_SERVER_SHUTDOWN";i[1054]="ER_BAD_FIELD_ERROR";i[1055]="ER_WRONG_FIELD_WITH_GROUP";i[1056]="ER_WRONG_GROUP_FIELD";i[1057]="ER_WRONG_SUM_SELECT";i[1058]="ER_WRONG_VALUE_COUNT";i[1059]="ER_TOO_LONG_IDENT";i[1060]="ER_DUP_FIELDNAME";i[1061]="ER_DUP_KEYNAME";i[1062]="ER_DUP_ENTRY";i[1063]="ER_WRONG_FIELD_SPEC";i[1064]="ER_PARSE_ERROR";i[1065]="ER_EMPTY_QUERY";i[1066]="ER_NONUNIQ_TABLE";i[1067]="ER_INVALID_DEFAULT";i[1068]="ER_MULTIPLE_PRI_KEY";i[1069]="ER_TOO_MANY_KEYS";i[1070]="ER_TOO_MANY_KEY_PARTS";i[1071]="ER_TOO_LONG_KEY";i[1072]="ER_KEY_COLUMN_DOES_NOT_EXIST";i[1073]="ER_BLOB_USED_AS_KEY";i[1074]="ER_TOO_BIG_FIELDLENGTH";i[1075]="ER_WRONG_AUTO_KEY";i[1076]="ER_BINLOG_CANT_DELETE_GTID_DOMAIN";i[1077]="ER_NORMAL_SHUTDOWN";i[1078]="ER_GOT_SIGNAL";i[1079]="ER_SHUTDOWN_COMPLETE";i[1080]="ER_FORCING_CLOSE";i[1081]="ER_IPSOCK_ERROR";i[1082]="ER_NO_SUCH_INDEX";i[1083]="ER_WRONG_FIELD_TERMINATORS";i[1084]="ER_BLOBS_AND_NO_TERMINATED";i[1085]="ER_TEXTFILE_NOT_READABLE";i[1086]="ER_FILE_EXISTS_ERROR";i[1087]="ER_LOAD_INFO";i[1088]="ER_ALTER_INFO";i[1089]="ER_WRONG_SUB_KEY";i[1090]="ER_CANT_REMOVE_ALL_FIELDS";i[1091]="ER_CANT_DROP_FIELD_OR_KEY";i[1092]="ER_INSERT_INFO";i[1093]="ER_UPDATE_TABLE_USED";i[1094]="ER_NO_SUCH_THREAD";i[1095]="ER_KILL_DENIED_ERROR";i[1096]="ER_NO_TABLES_USED";i[1097]="ER_TOO_BIG_SET";i[1098]="ER_NO_UNIQUE_LOGFILE";i[1099]="ER_TABLE_NOT_LOCKED_FOR_WRITE";i[1100]="ER_TABLE_NOT_LOCKED";i[1101]="ER_UNUSED_17";i[1102]="ER_WRONG_DB_NAME";i[1103]="ER_WRONG_TABLE_NAME";i[1104]="ER_TOO_BIG_SELECT";i[1105]="ER_UNKNOWN_ERROR";i[1106]="ER_UNKNOWN_PROCEDURE";i[1107]="ER_WRONG_PARAMCOUNT_TO_PROCEDURE";i[1108]="ER_WRONG_PARAMETERS_TO_PROCEDURE";i[1109]="ER_UNKNOWN_TABLE";i[1110]="ER_FIELD_SPECIFIED_TWICE";i[1111]="ER_INVALID_GROUP_FUNC_USE";i[1112]="ER_UNSUPPORTED_EXTENSION";i[1113]="ER_TABLE_MUST_HAVE_COLUMNS";i[1114]="ER_RECORD_FILE_FULL";i[1115]="ER_UNKNOWN_CHARACTER_SET";i[1116]="ER_TOO_MANY_TABLES";i[1117]="ER_TOO_MANY_FIELDS";i[1118]="ER_TOO_BIG_ROWSIZE";i[1119]="ER_STACK_OVERRUN";i[1120]="ER_WRONG_OUTER_JOIN";i[1121]="ER_NULL_COLUMN_IN_INDEX";i[1122]="ER_CANT_FIND_UDF";i[1123]="ER_CANT_INITIALIZE_UDF";i[1124]="ER_UDF_NO_PATHS";i[1125]="ER_UDF_EXISTS";i[1126]="ER_CANT_OPEN_LIBRARY";i[1127]="ER_CANT_FIND_DL_ENTRY";i[1128]="ER_FUNCTION_NOT_DEFINED";i[1129]="ER_HOST_IS_BLOCKED";i[1130]="ER_HOST_NOT_PRIVILEGED";i[1131]="ER_PASSWORD_ANONYMOUS_USER";i[1132]="ER_PASSWORD_NOT_ALLOWED";i[1133]="ER_PASSWORD_NO_MATCH";i[1134]="ER_UPDATE_INFO";i[1135]="ER_CANT_CREATE_THREAD";i[1136]="ER_WRONG_VALUE_COUNT_ON_ROW";i[1137]="ER_CANT_REOPEN_TABLE";i[1138]="ER_INVALID_USE_OF_NULL";i[1139]="ER_REGEXP_ERROR";i[1140]="ER_MIX_OF_GROUP_FUNC_AND_FIELDS";i[1141]="ER_NONEXISTING_GRANT";i[1142]="ER_TABLEACCESS_DENIED_ERROR";i[1143]="ER_COLUMNACCESS_DENIED_ERROR";i[1144]="ER_ILLEGAL_GRANT_FOR_TABLE";i[1145]="ER_GRANT_WRONG_HOST_OR_USER";i[1146]="ER_NO_SUCH_TABLE";i[1147]="ER_NONEXISTING_TABLE_GRANT";i[1148]="ER_NOT_ALLOWED_COMMAND";i[1149]="ER_SYNTAX_ERROR";i[1150]="ER_DELAYED_CANT_CHANGE_LOCK";i[1151]="ER_TOO_MANY_DELAYED_THREADS";i[1152]="ER_ABORTING_CONNECTION";i[1153]="ER_NET_PACKET_TOO_LARGE";i[1154]="ER_NET_READ_ERROR_FROM_PIPE";i[1155]="ER_NET_FCNTL_ERROR";i[1156]="ER_NET_PACKETS_OUT_OF_ORDER";i[1157]="ER_NET_UNCOMPRESS_ERROR";i[1158]="ER_NET_READ_ERROR";i[1159]="ER_NET_READ_INTERRUPTED";i[1160]="ER_NET_ERROR_ON_WRITE";i[1161]="ER_NET_WRITE_INTERRUPTED";i[1162]="ER_TOO_LONG_STRING";i[1163]="ER_TABLE_CANT_HANDLE_BLOB";i[1164]="ER_TABLE_CANT_HANDLE_AUTO_INCREMENT";i[1165]="ER_DELAYED_INSERT_TABLE_LOCKED";i[1166]="ER_WRONG_COLUMN_NAME";i[1167]="ER_WRONG_KEY_COLUMN";i[1168]="ER_WRONG_MRG_TABLE";i[1169]="ER_DUP_UNIQUE";i[1170]="ER_BLOB_KEY_WITHOUT_LENGTH";i[1171]="ER_PRIMARY_CANT_HAVE_NULL";i[1172]="ER_TOO_MANY_ROWS";i[1173]="ER_REQUIRES_PRIMARY_KEY";i[1174]="ER_NO_RAID_COMPILED";i[1175]="ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE";i[1176]="ER_KEY_DOES_NOT_EXISTS";i[1177]="ER_CHECK_NO_SUCH_TABLE";i[1178]="ER_CHECK_NOT_IMPLEMENTED";i[1179]="ER_CANT_DO_THIS_DURING_AN_TRANSACTION";i[1180]="ER_ERROR_DURING_COMMIT";i[1181]="ER_ERROR_DURING_ROLLBACK";i[1182]="ER_ERROR_DURING_FLUSH_LOGS";i[1183]="ER_ERROR_DURING_CHECKPOINT";i[1184]="ER_NEW_ABORTING_CONNECTION";i[1185]="ER_UNUSED_10";i[1186]="ER_FLUSH_MASTER_BINLOG_CLOSED";i[1187]="ER_INDEX_REBUILD";i[1188]="ER_MASTER";i[1189]="ER_MASTER_NET_READ";i[1190]="ER_MASTER_NET_WRITE";i[1191]="ER_FT_MATCHING_KEY_NOT_FOUND";i[1192]="ER_LOCK_OR_ACTIVE_TRANSACTION";i[1193]="ER_UNKNOWN_SYSTEM_VARIABLE";i[1194]="ER_CRASHED_ON_USAGE";i[1195]="ER_CRASHED_ON_REPAIR";i[1196]="ER_WARNING_NOT_COMPLETE_ROLLBACK";i[1197]="ER_TRANS_CACHE_FULL";i[1198]="ER_SLAVE_MUST_STOP";i[1199]="ER_SLAVE_NOT_RUNNING";i[1200]="ER_BAD_SLAVE";i[1201]="ER_MASTER_INFO";i[1202]="ER_SLAVE_THREAD";i[1203]="ER_TOO_MANY_USER_CONNECTIONS";i[1204]="ER_SET_CONSTANTS_ONLY";i[1205]="ER_LOCK_WAIT_TIMEOUT";i[1206]="ER_LOCK_TABLE_FULL";i[1207]="ER_READ_ONLY_TRANSACTION";i[1208]="ER_DROP_DB_WITH_READ_LOCK";i[1209]="ER_CREATE_DB_WITH_READ_LOCK";i[1210]="ER_WRONG_ARGUMENTS";i[1211]="ER_NO_PERMISSION_TO_CREATE_USER";i[1212]="ER_UNION_TABLES_IN_DIFFERENT_DIR";i[1213]="ER_LOCK_DEADLOCK";i[1214]="ER_TABLE_CANT_HANDLE_FT";i[1215]="ER_CANNOT_ADD_FOREIGN";i[1216]="ER_NO_REFERENCED_ROW";i[1217]="ER_ROW_IS_REFERENCED";i[1218]="ER_CONNECT_TO_MASTER";i[1219]="ER_QUERY_ON_MASTER";i[1220]="ER_ERROR_WHEN_EXECUTING_COMMAND";i[1221]="ER_WRONG_USAGE";i[1222]="ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT";i[1223]="ER_CANT_UPDATE_WITH_READLOCK";i[1224]="ER_MIXING_NOT_ALLOWED";i[1225]="ER_DUP_ARGUMENT";i[1226]="ER_USER_LIMIT_REACHED";i[1227]="ER_SPECIFIC_ACCESS_DENIED_ERROR";i[1228]="ER_LOCAL_VARIABLE";i[1229]="ER_GLOBAL_VARIABLE";i[1230]="ER_NO_DEFAULT";i[1231]="ER_WRONG_VALUE_FOR_VAR";i[1232]="ER_WRONG_TYPE_FOR_VAR";i[1233]="ER_VAR_CANT_BE_READ";i[1234]="ER_CANT_USE_OPTION_HERE";i[1235]="ER_NOT_SUPPORTED_YET";i[1236]="ER_MASTER_FATAL_ERROR_READING_BINLOG";i[1237]="ER_SLAVE_IGNORED_TABLE";i[1238]="ER_INCORRECT_GLOBAL_LOCAL_VAR";i[1239]="ER_WRONG_FK_DEF";i[1240]="ER_KEY_REF_DO_NOT_MATCH_TABLE_REF";i[1241]="ER_OPERAND_COLUMNS";i[1242]="ER_SUBQUERY_NO_1_ROW";i[1243]="ER_UNKNOWN_STMT_HANDLER";i[1244]="ER_CORRUPT_HELP_DB";i[1245]="ER_CYCLIC_REFERENCE";i[1246]="ER_AUTO_CONVERT";i[1247]="ER_ILLEGAL_REFERENCE";i[1248]="ER_DERIVED_MUST_HAVE_ALIAS";i[1249]="ER_SELECT_REDUCED";i[1250]="ER_TABLENAME_NOT_ALLOWED_HERE";i[1251]="ER_NOT_SUPPORTED_AUTH_MODE";i[1252]="ER_INDEX_CANNOT_HAVE_NULL";i[1253]="ER_COLLATION_CHARSET_MISMATCH";i[1254]="ER_SLAVE_WAS_RUNNING";i[1255]="ER_SLAVE_WAS_NOT_RUNNING";i[1256]="ER_TOO_BIG_FOR_UNCOMPRESS";i[1257]="ER_ZLIB_Z_MEM_ERROR";i[1258]="ER_ZLIB_Z_BUF_ERROR";i[1259]="ER_ZLIB_Z_DATA_ERROR";i[1260]="ER_CUT_VALUE_GROUP_CONCAT";i[1261]="ER_WARN_TOO_FEW_RECORDS";i[1262]="ER_WARN_TOO_MANY_RECORDS";i[1263]="ER_WARN_NULL_TO_NOTNULL";i[1264]="ER_WARN_DATA_OUT_OF_RANGE";i[1265]="WARN_DATA_TRUNCATED";i[1266]="ER_WARN_USING_OTHER_HANDLER";i[1267]="ER_CANT_AGGREGATE_2COLLATIONS";i[1268]="ER_DROP_USER";i[1269]="ER_REVOKE_GRANTS";i[1270]="ER_CANT_AGGREGATE_3COLLATIONS";i[1271]="ER_CANT_AGGREGATE_NCOLLATIONS";i[1272]="ER_VARIABLE_IS_NOT_STRUCT";i[1273]="ER_UNKNOWN_COLLATION";i[1274]="ER_SLAVE_IGNORED_SSL_PARAMS";i[1275]="ER_SERVER_IS_IN_SECURE_AUTH_MODE";i[1276]="ER_WARN_FIELD_RESOLVED";i[1277]="ER_BAD_SLAVE_UNTIL_COND";i[1278]="ER_MISSING_SKIP_SLAVE";i[1279]="ER_UNTIL_COND_IGNORED";i[1280]="ER_WRONG_NAME_FOR_INDEX";i[1281]="ER_WRONG_NAME_FOR_CATALOG";i[1282]="ER_WARN_QC_RESIZE";i[1283]="ER_BAD_FT_COLUMN";i[1284]="ER_UNKNOWN_KEY_CACHE";i[1285]="ER_WARN_HOSTNAME_WONT_WORK";i[1286]="ER_UNKNOWN_STORAGE_ENGINE";i[1287]="ER_WARN_DEPRECATED_SYNTAX";i[1288]="ER_NON_UPDATABLE_TABLE";i[1289]="ER_FEATURE_DISABLED";i[1290]="ER_OPTION_PREVENTS_STATEMENT";i[1291]="ER_DUPLICATED_VALUE_IN_TYPE";i[1292]="ER_TRUNCATED_WRONG_VALUE";i[1293]="ER_TOO_MUCH_AUTO_TIMESTAMP_COLS";i[1294]="ER_INVALID_ON_UPDATE";i[1295]="ER_UNSUPPORTED_PS";i[1296]="ER_GET_ERRMSG";i[1297]="ER_GET_TEMPORARY_ERRMSG";i[1298]="ER_UNKNOWN_TIME_ZONE";i[1299]="ER_WARN_INVALID_TIMESTAMP";i[1300]="ER_INVALID_CHARACTER_STRING";i[1301]="ER_WARN_ALLOWED_PACKET_OVERFLOWED";i[1302]="ER_CONFLICTING_DECLARATIONS";i[1303]="ER_SP_NO_RECURSIVE_CREATE";i[1304]="ER_SP_ALREADY_EXISTS";i[1305]="ER_SP_DOES_NOT_EXIST";i[1306]="ER_SP_DROP_FAILED";i[1307]="ER_SP_STORE_FAILED";i[1308]="ER_SP_LILABEL_MISMATCH";i[1309]="ER_SP_LABEL_REDEFINE";i[1310]="ER_SP_LABEL_MISMATCH";i[1311]="ER_SP_UNINIT_VAR";i[1312]="ER_SP_BADSELECT";i[1313]="ER_SP_BADRETURN";i[1314]="ER_SP_BADSTATEMENT";i[1315]="ER_UPDATE_LOG_DEPRECATED_IGNORED";i[1316]="ER_UPDATE_LOG_DEPRECATED_TRANSLATED";i[1317]="ER_QUERY_INTERRUPTED";i[1318]="ER_SP_WRONG_NO_OF_ARGS";i[1319]="ER_SP_COND_MISMATCH";i[1320]="ER_SP_NORETURN";i[1321]="ER_SP_NORETURNEND";i[1322]="ER_SP_BAD_CURSOR_QUERY";i[1323]="ER_SP_BAD_CURSOR_SELECT";i[1324]="ER_SP_CURSOR_MISMATCH";i[1325]="ER_SP_CURSOR_ALREADY_OPEN";i[1326]="ER_SP_CURSOR_NOT_OPEN";i[1327]="ER_SP_UNDECLARED_VAR";i[1328]="ER_SP_WRONG_NO_OF_FETCH_ARGS";i[1329]="ER_SP_FETCH_NO_DATA";i[1330]="ER_SP_DUP_PARAM";i[1331]="ER_SP_DUP_VAR";i[1332]="ER_SP_DUP_COND";i[1333]="ER_SP_DUP_CURS";i[1334]="ER_SP_CANT_ALTER";i[1335]="ER_SP_SUBSELECT_NYI";i[1336]="ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG";i[1337]="ER_SP_VARCOND_AFTER_CURSHNDLR";i[1338]="ER_SP_CURSOR_AFTER_HANDLER";i[1339]="ER_SP_CASE_NOT_FOUND";i[1340]="ER_FPARSER_TOO_BIG_FILE";i[1341]="ER_FPARSER_BAD_HEADER";i[1342]="ER_FPARSER_EOF_IN_COMMENT";i[1343]="ER_FPARSER_ERROR_IN_PARAMETER";i[1344]="ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER";i[1345]="ER_VIEW_NO_EXPLAIN";i[1346]="ER_FRM_UNKNOWN_TYPE";i[1347]="ER_WRONG_OBJECT";i[1348]="ER_NONUPDATEABLE_COLUMN";i[1349]="ER_VIEW_SELECT_DERIVED";i[1350]="ER_VIEW_SELECT_CLAUSE";i[1351]="ER_VIEW_SELECT_VARIABLE";i[1352]="ER_VIEW_SELECT_TMPTABLE";i[1353]="ER_VIEW_WRONG_LIST";i[1354]="ER_WARN_VIEW_MERGE";i[1355]="ER_WARN_VIEW_WITHOUT_KEY";i[1356]="ER_VIEW_INVALID";i[1357]="ER_SP_NO_DROP_SP";i[1358]="ER_SP_GOTO_IN_HNDLR";i[1359]="ER_TRG_ALREADY_EXISTS";i[1360]="ER_TRG_DOES_NOT_EXIST";i[1361]="ER_TRG_ON_VIEW_OR_TEMP_TABLE";i[1362]="ER_TRG_CANT_CHANGE_ROW";i[1363]="ER_TRG_NO_SUCH_ROW_IN_TRG";i[1364]="ER_NO_DEFAULT_FOR_FIELD";i[1365]="ER_DIVISION_BY_ZERO";i[1366]="ER_TRUNCATED_WRONG_VALUE_FOR_FIELD";i[1367]="ER_ILLEGAL_VALUE_FOR_TYPE";i[1368]="ER_VIEW_NONUPD_CHECK";i[1369]="ER_VIEW_CHECK_FAILED";i[1370]="ER_PROCACCESS_DENIED_ERROR";i[1371]="ER_RELAY_LOG_FAIL";i[1372]="ER_PASSWD_LENGTH";i[1373]="ER_UNKNOWN_TARGET_BINLOG";i[1374]="ER_IO_ERR_LOG_INDEX_READ";i[1375]="ER_BINLOG_PURGE_PROHIBITED";i[1376]="ER_FSEEK_FAIL";i[1377]="ER_BINLOG_PURGE_FATAL_ERR";i[1378]="ER_LOG_IN_USE";i[1379]="ER_LOG_PURGE_UNKNOWN_ERR";i[1380]="ER_RELAY_LOG_INIT";i[1381]="ER_NO_BINARY_LOGGING";i[1382]="ER_RESERVED_SYNTAX";i[1383]="ER_WSAS_FAILED";i[1384]="ER_DIFF_GROUPS_PROC";i[1385]="ER_NO_GROUP_FOR_PROC";i[1386]="ER_ORDER_WITH_PROC";i[1387]="ER_LOGGING_PROHIBIT_CHANGING_OF";i[1388]="ER_NO_FILE_MAPPING";i[1389]="ER_WRONG_MAGIC";i[1390]="ER_PS_MANY_PARAM";i[1391]="ER_KEY_PART_0";i[1392]="ER_VIEW_CHECKSUM";i[1393]="ER_VIEW_MULTIUPDATE";i[1394]="ER_VIEW_NO_INSERT_FIELD_LIST";i[1395]="ER_VIEW_DELETE_MERGE_VIEW";i[1396]="ER_CANNOT_USER";i[1397]="ER_XAER_NOTA";i[1398]="ER_XAER_INVAL";i[1399]="ER_XAER_RMFAIL";i[1400]="ER_XAER_OUTSIDE";i[1401]="ER_XAER_RMERR";i[1402]="ER_XA_RBROLLBACK";i[1403]="ER_NONEXISTING_PROC_GRANT";i[1404]="ER_PROC_AUTO_GRANT_FAIL";i[1405]="ER_PROC_AUTO_REVOKE_FAIL";i[1406]="ER_DATA_TOO_LONG";i[1407]="ER_SP_BAD_SQLSTATE";i[1408]="ER_STARTUP";i[1409]="ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR";i[1410]="ER_CANT_CREATE_USER_WITH_GRANT";i[1411]="ER_WRONG_VALUE_FOR_TYPE";i[1412]="ER_TABLE_DEF_CHANGED";i[1413]="ER_SP_DUP_HANDLER";i[1414]="ER_SP_NOT_VAR_ARG";i[1415]="ER_SP_NO_RETSET";i[1416]="ER_CANT_CREATE_GEOMETRY_OBJECT";i[1417]="ER_FAILED_ROUTINE_BREAK_BINLOG";i[1418]="ER_BINLOG_UNSAFE_ROUTINE";i[1419]="ER_BINLOG_CREATE_ROUTINE_NEED_SUPER";i[1420]="ER_EXEC_STMT_WITH_OPEN_CURSOR";i[1421]="ER_STMT_HAS_NO_OPEN_CURSOR";i[1422]="ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG";i[1423]="ER_NO_DEFAULT_FOR_VIEW_FIELD";i[1424]="ER_SP_NO_RECURSION";i[1425]="ER_TOO_BIG_SCALE";i[1426]="ER_TOO_BIG_PRECISION";i[1427]="ER_M_BIGGER_THAN_D";i[1428]="ER_WRONG_LOCK_OF_SYSTEM_TABLE";i[1429]="ER_CONNECT_TO_FOREIGN_DATA_SOURCE";i[1430]="ER_QUERY_ON_FOREIGN_DATA_SOURCE";i[1431]="ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST";i[1432]="ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE";i[1433]="ER_FOREIGN_DATA_STRING_INVALID";i[1434]="ER_CANT_CREATE_FEDERATED_TABLE";i[1435]="ER_TRG_IN_WRONG_SCHEMA";i[1436]="ER_STACK_OVERRUN_NEED_MORE";i[1437]="ER_TOO_LONG_BODY";i[1438]="ER_WARN_CANT_DROP_DEFAULT_KEYCACHE";i[1439]="ER_TOO_BIG_DISPLAYWIDTH";i[1440]="ER_XAER_DUPID";i[1441]="ER_DATETIME_FUNCTION_OVERFLOW";i[1442]="ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG";i[1443]="ER_VIEW_PREVENT_UPDATE";i[1444]="ER_PS_NO_RECURSION";i[1445]="ER_SP_CANT_SET_AUTOCOMMIT";i[1446]="ER_MALFORMED_DEFINER";i[1447]="ER_VIEW_FRM_NO_USER";i[1448]="ER_UNUSED_30";i[1449]="ER_NO_SUCH_USER";i[1450]="ER_FORBID_SCHEMA_CHANGE";i[1451]="ER_ROW_IS_REFERENCED_2";i[1452]="ER_NO_REFERENCED_ROW_2";i[1453]="ER_SP_BAD_VAR_SHADOW";i[1454]="ER_TRG_NO_DEFINER";i[1455]="ER_OLD_FILE_FORMAT";i[1456]="ER_SP_RECURSION_LIMIT";i[1457]="ER_SP_PROC_TABLE_CORRUPT";i[1458]="ER_SP_WRONG_NAME";i[1459]="ER_TABLE_NEEDS_UPGRADE";i[1460]="ER_SP_NO_AGGREGATE";i[1461]="ER_MAX_PREPARED_STMT_COUNT_REACHED";i[1462]="ER_VIEW_RECURSIVE";i[1463]="ER_NON_GROUPING_FIELD_USED";i[1464]="ER_TABLE_CANT_HANDLE_SPKEYS";i[1465]="ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA";i[1466]="ER_REMOVED_SPACES";i[1467]="ER_AUTOINC_READ_FAILED";i[1468]="ER_USERNAME";i[1469]="ER_HOSTNAME";i[1470]="ER_WRONG_STRING_LENGTH";i[1471]="ER_NON_INSERTABLE_TABLE";i[1472]="ER_ADMIN_WRONG_MRG_TABLE";i[1473]="ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT";i[1474]="ER_NAME_BECOMES_EMPTY";i[1475]="ER_AMBIGUOUS_FIELD_TERM";i[1476]="ER_FOREIGN_SERVER_EXISTS";i[1477]="ER_FOREIGN_SERVER_DOESNT_EXIST";i[1478]="ER_ILLEGAL_HA_CREATE_OPTION";i[1479]="ER_PARTITION_REQUIRES_VALUES_ERROR";i[1480]="ER_PARTITION_WRONG_VALUES_ERROR";i[1481]="ER_PARTITION_MAXVALUE_ERROR";i[1482]="ER_PARTITION_SUBPARTITION_ERROR";i[1483]="ER_PARTITION_SUBPART_MIX_ERROR";i[1484]="ER_PARTITION_WRONG_NO_PART_ERROR";i[1485]="ER_PARTITION_WRONG_NO_SUBPART_ERROR";i[1486]="ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR";i[1487]="ER_NOT_CONSTANT_EXPRESSION";i[1488]="ER_FIELD_NOT_FOUND_PART_ERROR";i[1489]="ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR";i[1490]="ER_INCONSISTENT_PARTITION_INFO_ERROR";i[1491]="ER_PARTITION_FUNC_NOT_ALLOWED_ERROR";i[1492]="ER_PARTITIONS_MUST_BE_DEFINED_ERROR";i[1493]="ER_RANGE_NOT_INCREASING_ERROR";i[1494]="ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR";i[1495]="ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR";i[1496]="ER_PARTITION_ENTRY_ERROR";i[1497]="ER_MIX_HANDLER_ERROR";i[1498]="ER_PARTITION_NOT_DEFINED_ERROR";i[1499]="ER_TOO_MANY_PARTITIONS_ERROR";i[1500]="ER_SUBPARTITION_ERROR";i[1501]="ER_CANT_CREATE_HANDLER_FILE";i[1502]="ER_BLOB_FIELD_IN_PART_FUNC_ERROR";i[1503]="ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF";i[1504]="ER_NO_PARTS_ERROR";i[1505]="ER_PARTITION_MGMT_ON_NONPARTITIONED";i[1506]="ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING";i[1507]="ER_PARTITION_DOES_NOT_EXIST";i[1508]="ER_DROP_LAST_PARTITION";i[1509]="ER_COALESCE_ONLY_ON_HASH_PARTITION";i[1510]="ER_REORG_HASH_ONLY_ON_SAME_NO";i[1511]="ER_REORG_NO_PARAM_ERROR";i[1512]="ER_ONLY_ON_RANGE_LIST_PARTITION";i[1513]="ER_ADD_PARTITION_SUBPART_ERROR";i[1514]="ER_ADD_PARTITION_NO_NEW_PARTITION";i[1515]="ER_COALESCE_PARTITION_NO_PARTITION";i[1516]="ER_REORG_PARTITION_NOT_EXIST";i[1517]="ER_SAME_NAME_PARTITION";i[1518]="ER_NO_BINLOG_ERROR";i[1519]="ER_CONSECUTIVE_REORG_PARTITIONS";i[1520]="ER_REORG_OUTSIDE_RANGE";i[1521]="ER_PARTITION_FUNCTION_FAILURE";i[1522]="ER_PART_STATE_ERROR";i[1523]="ER_LIMITED_PART_RANGE";i[1524]="ER_PLUGIN_IS_NOT_LOADED";i[1525]="ER_WRONG_VALUE";i[1526]="ER_NO_PARTITION_FOR_GIVEN_VALUE";i[1527]="ER_FILEGROUP_OPTION_ONLY_ONCE";i[1528]="ER_CREATE_FILEGROUP_FAILED";i[1529]="ER_DROP_FILEGROUP_FAILED";i[1530]="ER_TABLESPACE_AUTO_EXTEND_ERROR";i[1531]="ER_WRONG_SIZE_NUMBER";i[1532]="ER_SIZE_OVERFLOW_ERROR";i[1533]="ER_ALTER_FILEGROUP_FAILED";i[1534]="ER_BINLOG_ROW_LOGGING_FAILED";i[1535]="ER_BINLOG_ROW_WRONG_TABLE_DEF";i[1536]="ER_BINLOG_ROW_RBR_TO_SBR";i[1537]="ER_EVENT_ALREADY_EXISTS";i[1538]="ER_EVENT_STORE_FAILED";i[1539]="ER_EVENT_DOES_NOT_EXIST";i[1540]="ER_EVENT_CANT_ALTER";i[1541]="ER_EVENT_DROP_FAILED";i[1542]="ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG";i[1543]="ER_EVENT_ENDS_BEFORE_STARTS";i[1544]="ER_EVENT_EXEC_TIME_IN_THE_PAST";i[1545]="ER_EVENT_OPEN_TABLE_FAILED";i[1546]="ER_EVENT_NEITHER_M_EXPR_NOR_M_AT";i[1547]="ER_UNUSED_2";i[1548]="ER_UNUSED_3";i[1549]="ER_EVENT_CANNOT_DELETE";i[1550]="ER_EVENT_COMPILE_ERROR";i[1551]="ER_EVENT_SAME_NAME";i[1552]="ER_EVENT_DATA_TOO_LONG";i[1553]="ER_DROP_INDEX_FK";i[1554]="ER_WARN_DEPRECATED_SYNTAX_WITH_VER";i[1555]="ER_CANT_WRITE_LOCK_LOG_TABLE";i[1556]="ER_CANT_LOCK_LOG_TABLE";i[1557]="ER_UNUSED_4";i[1558]="ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE";i[1559]="ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR";i[1560]="ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT";i[1561]="ER_UNUSED_13";i[1562]="ER_PARTITION_NO_TEMPORARY";i[1563]="ER_PARTITION_CONST_DOMAIN_ERROR";i[1564]="ER_PARTITION_FUNCTION_IS_NOT_ALLOWED";i[1565]="ER_DDL_LOG_ERROR";i[1566]="ER_NULL_IN_VALUES_LESS_THAN";i[1567]="ER_WRONG_PARTITION_NAME";i[1568]="ER_CANT_SET_IN_TRANSACTION";i[1569]="ER_DUP_ENTRY_AUTOINCREMENT_CASE";i[1570]="ER_EVENT_MODIFY_QUEUE_ERROR";i[1571]="ER_EVENT_SET_VAR_ERROR";i[1572]="ER_PARTITION_MERGE_ERROR";i[1573]="ER_CANT_ACTIVATE_LOG";i[1574]="ER_RBR_NOT_AVAILABLE";i[1575]="ER_BASE64_DECODE_ERROR";i[1576]="ER_EVENT_RECURSION_FORBIDDEN";i[1577]="ER_EVENTS_DB_ERROR";i[1578]="ER_ONLY_INTEGERS_ALLOWED";i[1579]="ER_UNSUPORTED_LOG_ENGINE";i[1580]="ER_BAD_LOG_STATEMENT";i[1581]="ER_CANT_RENAME_LOG_TABLE";i[1582]="ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT";i[1583]="ER_WRONG_PARAMETERS_TO_NATIVE_FCT";i[1584]="ER_WRONG_PARAMETERS_TO_STORED_FCT";i[1585]="ER_NATIVE_FCT_NAME_COLLISION";i[1586]="ER_DUP_ENTRY_WITH_KEY_NAME";i[1587]="ER_BINLOG_PURGE_EMFILE";i[1588]="ER_EVENT_CANNOT_CREATE_IN_THE_PAST";i[1589]="ER_EVENT_CANNOT_ALTER_IN_THE_PAST";i[1590]="ER_SLAVE_INCIDENT";i[1591]="ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT";i[1592]="ER_BINLOG_UNSAFE_STATEMENT";i[1593]="ER_SLAVE_FATAL_ERROR";i[1594]="ER_SLAVE_RELAY_LOG_READ_FAILURE";i[1595]="ER_SLAVE_RELAY_LOG_WRITE_FAILURE";i[1596]="ER_SLAVE_CREATE_EVENT_FAILURE";i[1597]="ER_SLAVE_MASTER_COM_FAILURE";i[1598]="ER_BINLOG_LOGGING_IMPOSSIBLE";i[1599]="ER_VIEW_NO_CREATION_CTX";i[1600]="ER_VIEW_INVALID_CREATION_CTX";i[1601]="ER_SR_INVALID_CREATION_CTX";i[1602]="ER_TRG_CORRUPTED_FILE";i[1603]="ER_TRG_NO_CREATION_CTX";i[1604]="ER_TRG_INVALID_CREATION_CTX";i[1605]="ER_EVENT_INVALID_CREATION_CTX";i[1606]="ER_TRG_CANT_OPEN_TABLE";i[1607]="ER_CANT_CREATE_SROUTINE";i[1608]="ER_UNUSED_11";i[1609]="ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT";i[1610]="ER_SLAVE_CORRUPT_EVENT";i[1611]="ER_LOAD_DATA_INVALID_COLUMN";i[1612]="ER_LOG_PURGE_NO_FILE";i[1613]="ER_XA_RBTIMEOUT";i[1614]="ER_XA_RBDEADLOCK";i[1615]="ER_NEED_REPREPARE";i[1616]="ER_DELAYED_NOT_SUPPORTED";i[1617]="WARN_NO_MASTER_INFO";i[1618]="WARN_OPTION_IGNORED";i[1619]="ER_PLUGIN_DELETE_BUILTIN";i[1620]="WARN_PLUGIN_BUSY";i[1621]="ER_VARIABLE_IS_READONLY";i[1622]="ER_WARN_ENGINE_TRANSACTION_ROLLBACK";i[1623]="ER_SLAVE_HEARTBEAT_FAILURE";i[1624]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE";i[1625]="ER_UNUSED_14";i[1626]="ER_CONFLICT_FN_PARSE_ERROR";i[1627]="ER_EXCEPTIONS_WRITE_ERROR";i[1628]="ER_TOO_LONG_TABLE_COMMENT";i[1629]="ER_TOO_LONG_FIELD_COMMENT";i[1630]="ER_FUNC_INEXISTENT_NAME_COLLISION";i[1631]="ER_DATABASE_NAME";i[1632]="ER_TABLE_NAME";i[1633]="ER_PARTITION_NAME";i[1634]="ER_SUBPARTITION_NAME";i[1635]="ER_TEMPORARY_NAME";i[1636]="ER_RENAMED_NAME";i[1637]="ER_TOO_MANY_CONCURRENT_TRXS";i[1638]="WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED";i[1639]="ER_DEBUG_SYNC_TIMEOUT";i[1640]="ER_DEBUG_SYNC_HIT_LIMIT";i[1641]="ER_DUP_SIGNAL_SET";i[1642]="ER_SIGNAL_WARN";i[1643]="ER_SIGNAL_NOT_FOUND";i[1644]="ER_SIGNAL_EXCEPTION";i[1645]="ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER";i[1646]="ER_SIGNAL_BAD_CONDITION_TYPE";i[1647]="WARN_COND_ITEM_TRUNCATED";i[1648]="ER_COND_ITEM_TOO_LONG";i[1649]="ER_UNKNOWN_LOCALE";i[1650]="ER_SLAVE_IGNORE_SERVER_IDS";i[1651]="ER_QUERY_CACHE_DISABLED";i[1652]="ER_SAME_NAME_PARTITION_FIELD";i[1653]="ER_PARTITION_COLUMN_LIST_ERROR";i[1654]="ER_WRONG_TYPE_COLUMN_VALUE_ERROR";i[1655]="ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR";i[1656]="ER_MAXVALUE_IN_VALUES_IN";i[1657]="ER_TOO_MANY_VALUES_ERROR";i[1658]="ER_ROW_SINGLE_PARTITION_FIELD_ERROR";i[1659]="ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD";i[1660]="ER_PARTITION_FIELDS_TOO_LONG";i[1661]="ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE";i[1662]="ER_BINLOG_ROW_MODE_AND_STMT_ENGINE";i[1663]="ER_BINLOG_UNSAFE_AND_STMT_ENGINE";i[1664]="ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE";i[1665]="ER_BINLOG_STMT_MODE_AND_ROW_ENGINE";i[1666]="ER_BINLOG_ROW_INJECTION_AND_STMT_MODE";i[1667]="ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE";i[1668]="ER_BINLOG_UNSAFE_LIMIT";i[1669]="ER_BINLOG_UNSAFE_INSERT_DELAYED";i[1670]="ER_BINLOG_UNSAFE_SYSTEM_TABLE";i[1671]="ER_BINLOG_UNSAFE_AUTOINC_COLUMNS";i[1672]="ER_BINLOG_UNSAFE_UDF";i[1673]="ER_BINLOG_UNSAFE_SYSTEM_VARIABLE";i[1674]="ER_BINLOG_UNSAFE_SYSTEM_FUNCTION";i[1675]="ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS";i[1676]="ER_MESSAGE_AND_STATEMENT";i[1677]="ER_SLAVE_CONVERSION_FAILED";i[1678]="ER_SLAVE_CANT_CREATE_CONVERSION";i[1679]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT";i[1680]="ER_PATH_LENGTH";i[1681]="ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT";i[1682]="ER_WRONG_NATIVE_TABLE_STRUCTURE";i[1683]="ER_WRONG_PERFSCHEMA_USAGE";i[1684]="ER_WARN_I_S_SKIPPED_TABLE";i[1685]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT";i[1686]="ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT";i[1687]="ER_SPATIAL_MUST_HAVE_GEOM_COL";i[1688]="ER_TOO_LONG_INDEX_COMMENT";i[1689]="ER_LOCK_ABORTED";i[1690]="ER_DATA_OUT_OF_RANGE";i[1691]="ER_WRONG_SPVAR_TYPE_IN_LIMIT";i[1692]="ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE";i[1693]="ER_BINLOG_UNSAFE_MIXED_STATEMENT";i[1694]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN";i[1695]="ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN";i[1696]="ER_FAILED_READ_FROM_PAR_FILE";i[1697]="ER_VALUES_IS_NOT_INT_TYPE_ERROR";i[1698]="ER_ACCESS_DENIED_NO_PASSWORD_ERROR";i[1699]="ER_SET_PASSWORD_AUTH_PLUGIN";i[1700]="ER_GRANT_PLUGIN_USER_EXISTS";i[1701]="ER_TRUNCATE_ILLEGAL_FK";i[1702]="ER_PLUGIN_IS_PERMANENT";i[1703]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN";i[1704]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX";i[1705]="ER_STMT_CACHE_FULL";i[1706]="ER_MULTI_UPDATE_KEY_CONFLICT";i[1707]="ER_TABLE_NEEDS_REBUILD";i[1708]="WARN_OPTION_BELOW_LIMIT";i[1709]="ER_INDEX_COLUMN_TOO_LONG";i[1710]="ER_ERROR_IN_TRIGGER_BODY";i[1711]="ER_ERROR_IN_UNKNOWN_TRIGGER_BODY";i[1712]="ER_INDEX_CORRUPT";i[1713]="ER_UNDO_RECORD_TOO_BIG";i[1714]="ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT";i[1715]="ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE";i[1716]="ER_BINLOG_UNSAFE_REPLACE_SELECT";i[1717]="ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT";i[1718]="ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT";i[1719]="ER_BINLOG_UNSAFE_UPDATE_IGNORE";i[1720]="ER_UNUSED_15";i[1721]="ER_UNUSED_16";i[1722]="ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT";i[1723]="ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC";i[1724]="ER_BINLOG_UNSAFE_INSERT_TWO_KEYS";i[1725]="ER_UNUSED_28";i[1726]="ER_VERS_NOT_ALLOWED";i[1727]="ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST";i[1728]="ER_CANNOT_LOAD_FROM_TABLE_V2";i[1729]="ER_MASTER_DELAY_VALUE_OUT_OF_RANGE";i[1730]="ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT";i[1731]="ER_PARTITION_EXCHANGE_DIFFERENT_OPTION";i[1732]="ER_PARTITION_EXCHANGE_PART_TABLE";i[1733]="ER_PARTITION_EXCHANGE_TEMP_TABLE";i[1734]="ER_PARTITION_INSTEAD_OF_SUBPARTITION";i[1735]="ER_UNKNOWN_PARTITION";i[1736]="ER_TABLES_DIFFERENT_METADATA";i[1737]="ER_ROW_DOES_NOT_MATCH_PARTITION";i[1738]="ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX";i[1739]="ER_WARN_INDEX_NOT_APPLICABLE";i[1740]="ER_PARTITION_EXCHANGE_FOREIGN_KEY";i[1741]="ER_NO_SUCH_KEY_VALUE";i[1742]="ER_VALUE_TOO_LONG";i[1743]="ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE";i[1744]="ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE";i[1745]="ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX";i[1746]="ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT";i[1747]="ER_PARTITION_CLAUSE_ON_NONPARTITIONED";i[1748]="ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET";i[1749]="ER_UNUSED_5";i[1750]="ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE";i[1751]="ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE";i[1752]="ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE";i[1753]="ER_MTS_FEATURE_IS_NOT_SUPPORTED";i[1754]="ER_MTS_UPDATED_DBS_GREATER_MAX";i[1755]="ER_MTS_CANT_PARALLEL";i[1756]="ER_MTS_INCONSISTENT_DATA";i[1757]="ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING";i[1758]="ER_DA_INVALID_CONDITION_NUMBER";i[1759]="ER_INSECURE_PLAIN_TEXT";i[1760]="ER_INSECURE_CHANGE_MASTER";i[1761]="ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO";i[1762]="ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO";i[1763]="ER_SQLTHREAD_WITH_SECURE_SLAVE";i[1764]="ER_TABLE_HAS_NO_FT";i[1765]="ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER";i[1766]="ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION";i[1767]="ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST";i[1768]="ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL";i[1769]="ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION";i[1770]="ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL";i[1771]="ER_SKIPPING_LOGGED_TRANSACTION";i[1772]="ER_MALFORMED_GTID_SET_SPECIFICATION";i[1773]="ER_MALFORMED_GTID_SET_ENCODING";i[1774]="ER_MALFORMED_GTID_SPECIFICATION";i[1775]="ER_GNO_EXHAUSTED";i[1776]="ER_BAD_SLAVE_AUTO_POSITION";i[1777]="ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON";i[1778]="ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET";i[1779]="ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON";i[1780]="ER_GTID_MODE_REQUIRES_BINLOG";i[1781]="ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF";i[1782]="ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON";i[1783]="ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF";i[1784]="ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF";i[1785]="ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE";i[1786]="ER_GTID_UNSAFE_CREATE_SELECT";i[1787]="ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION";i[1788]="ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME";i[1789]="ER_MASTER_HAS_PURGED_REQUIRED_GTIDS";i[1790]="ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID";i[1791]="ER_UNKNOWN_EXPLAIN_FORMAT";i[1792]="ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION";i[1793]="ER_TOO_LONG_TABLE_PARTITION_COMMENT";i[1794]="ER_SLAVE_CONFIGURATION";i[1795]="ER_INNODB_FT_LIMIT";i[1796]="ER_NO_INDEX_ON_TEMPORARY";i[1797]="ER_INNODB_FT_WRONG_DOCID_COLUMN";i[1798]="ER_INNODB_FT_WRONG_DOCID_INDEX";i[1799]="ER_INNODB_ONLINE_LOG_TOO_BIG";i[1800]="ER_UNKNOWN_ALTER_ALGORITHM";i[1801]="ER_UNKNOWN_ALTER_LOCK";i[1802]="ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS";i[1803]="ER_MTS_RECOVERY_FAILURE";i[1804]="ER_MTS_RESET_WORKERS";i[1805]="ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2";i[1806]="ER_SLAVE_SILENT_RETRY_TRANSACTION";i[1807]="ER_UNUSED_22";i[1808]="ER_TABLE_SCHEMA_MISMATCH";i[1809]="ER_TABLE_IN_SYSTEM_TABLESPACE";i[1810]="ER_IO_READ_ERROR";i[1811]="ER_IO_WRITE_ERROR";i[1812]="ER_TABLESPACE_MISSING";i[1813]="ER_TABLESPACE_EXISTS";i[1814]="ER_TABLESPACE_DISCARDED";i[1815]="ER_INTERNAL_ERROR";i[1816]="ER_INNODB_IMPORT_ERROR";i[1817]="ER_INNODB_INDEX_CORRUPT";i[1818]="ER_INVALID_YEAR_COLUMN_LENGTH";i[1819]="ER_NOT_VALID_PASSWORD";i[1820]="ER_MUST_CHANGE_PASSWORD";i[1821]="ER_FK_NO_INDEX_CHILD";i[1822]="ER_FK_NO_INDEX_PARENT";i[1823]="ER_FK_FAIL_ADD_SYSTEM";i[1824]="ER_FK_CANNOT_OPEN_PARENT";i[1825]="ER_FK_INCORRECT_OPTION";i[1826]="ER_DUP_CONSTRAINT_NAME";i[1827]="ER_PASSWORD_FORMAT";i[1828]="ER_FK_COLUMN_CANNOT_DROP";i[1829]="ER_FK_COLUMN_CANNOT_DROP_CHILD";i[1830]="ER_FK_COLUMN_NOT_NULL";i[1831]="ER_DUP_INDEX";i[1832]="ER_FK_COLUMN_CANNOT_CHANGE";i[1833]="ER_FK_COLUMN_CANNOT_CHANGE_CHILD";i[1834]="ER_FK_CANNOT_DELETE_PARENT";i[1835]="ER_MALFORMED_PACKET";i[1836]="ER_READ_ONLY_MODE";i[1837]="ER_GTID_NEXT_TYPE_UNDEFINED_GROUP";i[1838]="ER_VARIABLE_NOT_SETTABLE_IN_SP";i[1839]="ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF";i[1840]="ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY";i[1841]="ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY";i[1842]="ER_GTID_PURGED_WAS_CHANGED";i[1843]="ER_GTID_EXECUTED_WAS_CHANGED";i[1844]="ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES";i[1845]="ER_ALTER_OPERATION_NOT_SUPPORTED";i[1846]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON";i[1847]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY";i[1848]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION";i[1849]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME";i[1850]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE";i[1851]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK";i[1852]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE";i[1853]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK";i[1854]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC";i[1855]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS";i[1856]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS";i[1857]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS";i[1858]="ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE";i[1859]="ER_DUP_UNKNOWN_IN_INDEX";i[1860]="ER_IDENT_CAUSES_TOO_LONG_PATH";i[1861]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL";i[1862]="ER_MUST_CHANGE_PASSWORD_LOGIN";i[1863]="ER_ROW_IN_WRONG_PARTITION";i[1864]="ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX";i[1865]="ER_INNODB_NO_FT_USES_PARSER";i[1866]="ER_BINLOG_LOGICAL_CORRUPTION";i[1867]="ER_WARN_PURGE_LOG_IN_USE";i[1868]="ER_WARN_PURGE_LOG_IS_ACTIVE";i[1869]="ER_AUTO_INCREMENT_CONFLICT";i[1870]="WARN_ON_BLOCKHOLE_IN_RBR";i[1871]="ER_SLAVE_MI_INIT_REPOSITORY";i[1872]="ER_SLAVE_RLI_INIT_REPOSITORY";i[1873]="ER_ACCESS_DENIED_CHANGE_USER_ERROR";i[1874]="ER_INNODB_READ_ONLY";i[1875]="ER_STOP_SLAVE_SQL_THREAD_TIMEOUT";i[1876]="ER_STOP_SLAVE_IO_THREAD_TIMEOUT";i[1877]="ER_TABLE_CORRUPT";i[1878]="ER_TEMP_FILE_WRITE_FAILURE";i[1879]="ER_INNODB_FT_AUX_NOT_HEX_ID";i[1880]="ER_LAST_MYSQL_ERROR_MESSAGE";i[1900]="ER_UNUSED_18";i[1901]="ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED";i[1902]="ER_UNUSED_19";i[1903]="ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN";i[1904]="ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN";i[1905]="ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN";i[1906]="ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN";i[1907]="ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN";i[1908]="ER_UNUSED_20";i[1909]="ER_UNUSED_21";i[1910]="ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS";i[1911]="ER_UNKNOWN_OPTION";i[1912]="ER_BAD_OPTION_VALUE";i[1913]="ER_UNUSED_6";i[1914]="ER_UNUSED_7";i[1915]="ER_UNUSED_8";i[1916]="ER_DATA_OVERFLOW";i[1917]="ER_DATA_TRUNCATED";i[1918]="ER_BAD_DATA";i[1919]="ER_DYN_COL_WRONG_FORMAT";i[1920]="ER_DYN_COL_IMPLEMENTATION_LIMIT";i[1921]="ER_DYN_COL_DATA";i[1922]="ER_DYN_COL_WRONG_CHARSET";i[1923]="ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES";i[1924]="ER_QUERY_CACHE_IS_DISABLED";i[1925]="ER_QUERY_CACHE_IS_GLOBALY_DISABLED";i[1926]="ER_VIEW_ORDERBY_IGNORED";i[1927]="ER_CONNECTION_KILLED";i[1928]="ER_UNUSED_12";i[1929]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION";i[1930]="ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION";i[1931]="ER_QUERY_RESULT_INCOMPLETE";i[1932]="ER_NO_SUCH_TABLE_IN_ENGINE";i[1933]="ER_TARGET_NOT_EXPLAINABLE";i[1934]="ER_CONNECTION_ALREADY_EXISTS";i[1935]="ER_MASTER_LOG_PREFIX";i[1936]="ER_CANT_START_STOP_SLAVE";i[1937]="ER_SLAVE_STARTED";i[1938]="ER_SLAVE_STOPPED";i[1939]="ER_SQL_DISCOVER_ERROR";i[1940]="ER_FAILED_GTID_STATE_INIT";i[1941]="ER_INCORRECT_GTID_STATE";i[1942]="ER_CANNOT_UPDATE_GTID_STATE";i[1943]="ER_DUPLICATE_GTID_DOMAIN";i[1944]="ER_GTID_OPEN_TABLE_FAILED";i[1945]="ER_GTID_POSITION_NOT_FOUND_IN_BINLOG";i[1946]="ER_CANNOT_LOAD_SLAVE_GTID_STATE";i[1947]="ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG";i[1948]="ER_MASTER_GTID_POS_MISSING_DOMAIN";i[1949]="ER_UNTIL_REQUIRES_USING_GTID";i[1950]="ER_GTID_STRICT_OUT_OF_ORDER";i[1951]="ER_GTID_START_FROM_BINLOG_HOLE";i[1952]="ER_SLAVE_UNEXPECTED_MASTER_SWITCH";i[1953]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO";i[1954]="ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO";i[1955]="ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2";i[1956]="ER_BINLOG_MUST_BE_EMPTY";i[1957]="ER_NO_SUCH_QUERY";i[1958]="ER_BAD_BASE64_DATA";i[1959]="ER_INVALID_ROLE";i[1960]="ER_INVALID_CURRENT_USER";i[1961]="ER_CANNOT_GRANT_ROLE";i[1962]="ER_CANNOT_REVOKE_ROLE";i[1963]="ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE";i[1964]="ER_PRIOR_COMMIT_FAILED";i[1965]="ER_IT_IS_A_VIEW";i[1966]="ER_SLAVE_SKIP_NOT_IN_GTID";i[1967]="ER_TABLE_DEFINITION_TOO_BIG";i[1968]="ER_PLUGIN_INSTALLED";i[1969]="ER_STATEMENT_TIMEOUT";i[1970]="ER_SUBQUERIES_NOT_SUPPORTED";i[1971]="ER_SET_STATEMENT_NOT_SUPPORTED";i[1972]="ER_UNUSED_9";i[1973]="ER_USER_CREATE_EXISTS";i[1974]="ER_USER_DROP_EXISTS";i[1975]="ER_ROLE_CREATE_EXISTS";i[1976]="ER_ROLE_DROP_EXISTS";i[1977]="ER_CANNOT_CONVERT_CHARACTER";i[1978]="ER_INVALID_DEFAULT_VALUE_FOR_FIELD";i[1979]="ER_KILL_QUERY_DENIED_ERROR";i[1980]="ER_NO_EIS_FOR_FIELD";i[1981]="ER_WARN_AGGFUNC_DEPENDENCE";i[1982]="WARN_INNODB_PARTITION_OPTION_IGNORED";i[3e3]="ER_FILE_CORRUPT";i[3001]="ER_ERROR_ON_MASTER";i[3002]="ER_INCONSISTENT_ERROR";i[3003]="ER_STORAGE_ENGINE_NOT_LOADED";i[3004]="ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER";i[3005]="ER_WARN_LEGACY_SYNTAX_CONVERTED";i[3006]="ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN";i[3007]="ER_CANNOT_DISCARD_TEMPORARY_TABLE";i[3008]="ER_FK_DEPTH_EXCEEDED";i[3009]="ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2";i[3010]="ER_WARN_TRIGGER_DOESNT_HAVE_CREATED";i[3011]="ER_REFERENCED_TRG_DOES_NOT_EXIST_MYSQL";i[3012]="ER_EXPLAIN_NOT_SUPPORTED";i[3013]="ER_INVALID_FIELD_SIZE";i[3014]="ER_MISSING_HA_CREATE_OPTION";i[3015]="ER_ENGINE_OUT_OF_MEMORY";i[3016]="ER_PASSWORD_EXPIRE_ANONYMOUS_USER";i[3017]="ER_SLAVE_SQL_THREAD_MUST_STOP";i[3018]="ER_NO_FT_MATERIALIZED_SUBQUERY";i[3019]="ER_INNODB_UNDO_LOG_FULL";i[3020]="ER_INVALID_ARGUMENT_FOR_LOGARITHM";i[3021]="ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP";i[3022]="ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO";i[3023]="ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS";i[3024]="ER_UNUSED_1";i[3025]="ER_NON_RO_SELECT_DISABLE_TIMER";i[3026]="ER_DUP_LIST_ENTRY";i[3027]="ER_SQL_MODE_NO_EFFECT";i[3028]="ER_AGGREGATE_ORDER_FOR_UNION";i[3029]="ER_AGGREGATE_ORDER_NON_AGG_QUERY";i[3030]="ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR";i[3031]="ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER";i[3032]="ER_SERVER_OFFLINE_MODE";i[3033]="ER_GIS_DIFFERENT_SRIDS";i[3034]="ER_GIS_UNSUPPORTED_ARGUMENT";i[3035]="ER_GIS_UNKNOWN_ERROR";i[3036]="ER_GIS_UNKNOWN_EXCEPTION";i[3037]="ER_GIS_INVALID_DATA";i[3038]="ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION";i[3039]="ER_BOOST_GEOMETRY_CENTROID_EXCEPTION";i[3040]="ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION";i[3041]="ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION";i[3042]="ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION";i[3043]="ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION";i[3044]="ER_STD_BAD_ALLOC_ERROR";i[3045]="ER_STD_DOMAIN_ERROR";i[3046]="ER_STD_LENGTH_ERROR";i[3047]="ER_STD_INVALID_ARGUMENT";i[3048]="ER_STD_OUT_OF_RANGE_ERROR";i[3049]="ER_STD_OVERFLOW_ERROR";i[3050]="ER_STD_RANGE_ERROR";i[3051]="ER_STD_UNDERFLOW_ERROR";i[3052]="ER_STD_LOGIC_ERROR";i[3053]="ER_STD_RUNTIME_ERROR";i[3054]="ER_STD_UNKNOWN_EXCEPTION";i[3055]="ER_GIS_DATA_WRONG_ENDIANESS";i[3056]="ER_CHANGE_MASTER_PASSWORD_LENGTH";i[3057]="ER_USER_LOCK_WRONG_NAME";i[3058]="ER_USER_LOCK_DEADLOCK";i[3059]="ER_REPLACE_INACCESSIBLE_ROWS";i[3060]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS";i[3061]="ER_MYSQL_3061";i[3062]="ER_MYSQL_3062";i[3063]="ER_MYSQL_3063";i[3064]="ER_MYSQL_3064";i[3065]="ER_MYSQL_3065";i[3066]="ER_MYSQL_3066";i[3067]="ER_MYSQL_3067";i[3068]="ER_MYSQL_3068";i[3069]="ER_MYSQL_3069";i[3070]="ER_MYSQL_3070";i[3071]="ER_MYSQL_3071";i[3072]="ER_MYSQL_3072";i[3073]="ER_MYSQL_3073";i[3074]="ER_MYSQL_3074";i[3075]="ER_MYSQL_3075";i[3076]="ER_MYSQL_3076";i[3077]="ER_MYSQL_3077";i[3078]="ER_MYSQL_3078";i[3079]="ER_MYSQL_3079";i[3080]="ER_MYSQL_3080";i[3081]="ER_MYSQL_3081";i[3082]="ER_MYSQL_3082";i[3083]="ER_MYSQL_3083";i[3084]="ER_MYSQL_3084";i[3085]="ER_MYSQL_3085";i[3086]="ER_MYSQL_3086";i[3087]="ER_MYSQL_3087";i[3088]="ER_MYSQL_3088";i[3089]="ER_MYSQL_3089";i[3090]="ER_MYSQL_3090";i[3091]="ER_MYSQL_3091";i[3092]="ER_MYSQL_3092";i[3093]="ER_MYSQL_3093";i[3094]="ER_MYSQL_3094";i[3095]="ER_MYSQL_3095";i[3096]="ER_MYSQL_3096";i[3097]="ER_MYSQL_3097";i[3098]="ER_MYSQL_3098";i[3099]="ER_MYSQL_3099";i[3100]="ER_MYSQL_3100";i[3101]="ER_MYSQL_3101";i[3102]="ER_MYSQL_3102";i[3103]="ER_MYSQL_3103";i[3104]="ER_MYSQL_3104";i[3105]="ER_MYSQL_3105";i[3106]="ER_MYSQL_3106";i[3107]="ER_MYSQL_3107";i[3108]="ER_MYSQL_3108";i[3109]="ER_MYSQL_3109";i[3110]="ER_MYSQL_3110";i[3111]="ER_MYSQL_3111";i[3112]="ER_MYSQL_3112";i[3113]="ER_MYSQL_3113";i[3114]="ER_MYSQL_3114";i[3115]="ER_MYSQL_3115";i[3116]="ER_MYSQL_3116";i[3117]="ER_MYSQL_3117";i[3118]="ER_MYSQL_3118";i[3119]="ER_MYSQL_3119";i[3120]="ER_MYSQL_3120";i[3121]="ER_MYSQL_3121";i[3122]="ER_MYSQL_3122";i[3123]="ER_MYSQL_3123";i[3124]="ER_MYSQL_3124";i[3125]="ER_MYSQL_3125";i[3126]="ER_MYSQL_3126";i[3127]="ER_MYSQL_3127";i[3128]="ER_MYSQL_3128";i[3129]="ER_MYSQL_3129";i[3130]="ER_MYSQL_3130";i[3131]="ER_MYSQL_3131";i[3132]="ER_MYSQL_3132";i[3133]="ER_MYSQL_3133";i[3134]="ER_MYSQL_3134";i[3135]="ER_MYSQL_3135";i[3136]="ER_MYSQL_3136";i[3137]="ER_MYSQL_3137";i[3138]="ER_MYSQL_3138";i[3139]="ER_MYSQL_3139";i[3140]="ER_MYSQL_3140";i[3141]="ER_MYSQL_3141";i[3142]="ER_MYSQL_3142";i[3143]="ER_MYSQL_3143";i[3144]="ER_MYSQL_3144";i[3145]="ER_MYSQL_3145";i[3146]="ER_MYSQL_3146";i[3147]="ER_MYSQL_3147";i[3148]="ER_MYSQL_3148";i[3149]="ER_MYSQL_3149";i[3150]="ER_MYSQL_3150";i[3151]="ER_MYSQL_3151";i[3152]="ER_MYSQL_3152";i[3153]="ER_MYSQL_3153";i[3154]="ER_MYSQL_3154";i[3155]="ER_MYSQL_3155";i[3156]="ER_MYSQL_3156";i[3157]="ER_MYSQL_3157";i[3158]="ER_MYSQL_3158";i[3159]="ER_SECURE_TRANSPORT_REQUIRED";i[4e3]="ER_UNUSED_26";i[4001]="ER_UNUSED_27";i[4002]="ER_WITH_COL_WRONG_LIST";i[4003]="ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE";i[4004]="ER_DUP_QUERY_NAME";i[4005]="ER_RECURSIVE_WITHOUT_ANCHORS";i[4006]="ER_UNACCEPTABLE_MUTUAL_RECURSION";i[4007]="ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED";i[4008]="ER_NOT_STANDARD_COMPLIANT_RECURSIVE";i[4009]="ER_WRONG_WINDOW_SPEC_NAME";i[4010]="ER_DUP_WINDOW_NAME";i[4011]="ER_PARTITION_LIST_IN_REFERENCING_WINDOW_SPEC";i[4012]="ER_ORDER_LIST_IN_REFERENCING_WINDOW_SPEC";i[4013]="ER_WINDOW_FRAME_IN_REFERENCED_WINDOW_SPEC";i[4014]="ER_BAD_COMBINATION_OF_WINDOW_FRAME_BOUND_SPECS";i[4015]="ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION";i[4016]="ER_WINDOW_FUNCTION_IN_WINDOW_SPEC";i[4017]="ER_NOT_ALLOWED_WINDOW_FRAME";i[4018]="ER_NO_ORDER_LIST_IN_WINDOW_SPEC";i[4019]="ER_RANGE_FRAME_NEEDS_SIMPLE_ORDERBY";i[4020]="ER_WRONG_TYPE_FOR_ROWS_FRAME";i[4021]="ER_WRONG_TYPE_FOR_RANGE_FRAME";i[4022]="ER_FRAME_EXCLUSION_NOT_SUPPORTED";i[4023]="ER_WINDOW_FUNCTION_DONT_HAVE_FRAME";i[4024]="ER_INVALID_NTILE_ARGUMENT";i[4025]="ER_CONSTRAINT_FAILED";i[4026]="ER_EXPRESSION_IS_TOO_BIG";i[4027]="ER_ERROR_EVALUATING_EXPRESSION";i[4028]="ER_CALCULATING_DEFAULT_VALUE";i[4029]="ER_EXPRESSION_REFERS_TO_UNINIT_FIELD";i[4030]="ER_PARTITION_DEFAULT_ERROR";i[4031]="ER_REFERENCED_TRG_DOES_NOT_EXIST";i[4032]="ER_INVALID_DEFAULT_PARAM";i[4033]="ER_BINLOG_NON_SUPPORTED_BULK";i[4034]="ER_BINLOG_UNCOMPRESS_ERROR";i[4035]="ER_JSON_BAD_CHR";i[4036]="ER_JSON_NOT_JSON_CHR";i[4037]="ER_JSON_EOS";i[4038]="ER_JSON_SYNTAX";i[4039]="ER_JSON_ESCAPING";i[4040]="ER_JSON_DEPTH";i[4041]="ER_JSON_PATH_EOS";i[4042]="ER_JSON_PATH_SYNTAX";i[4043]="ER_JSON_PATH_DEPTH";i[4044]="ER_JSON_PATH_NO_WILDCARD";i[4045]="ER_JSON_PATH_ARRAY";i[4046]="ER_JSON_ONE_OR_ALL";i[4047]="ER_UNSUPPORTED_COMPRESSED_TABLE";i[4048]="ER_GEOJSON_INCORRECT";i[4049]="ER_GEOJSON_TOO_FEW_POINTS";i[4050]="ER_GEOJSON_NOT_CLOSED";i[4051]="ER_JSON_PATH_EMPTY";i[4052]="ER_SLAVE_SAME_ID";i[4053]="ER_FLASHBACK_NOT_SUPPORTED";i[4054]="ER_KEYS_OUT_OF_ORDER";i[4055]="ER_OVERLAPPING_KEYS";i[4056]="ER_REQUIRE_ROW_BINLOG_FORMAT";i[4057]="ER_ISOLATION_MODE_NOT_SUPPORTED";i[4058]="ER_ON_DUPLICATE_DISABLED";i[4059]="ER_UPDATES_WITH_CONSISTENT_SNAPSHOT";i[4060]="ER_ROLLBACK_ONLY";i[4061]="ER_ROLLBACK_TO_SAVEPOINT";i[4062]="ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT";i[4063]="ER_UNSUPPORTED_COLLATION";i[4064]="ER_METADATA_INCONSISTENCY";i[4065]="ER_CF_DIFFERENT";i[4066]="ER_RDB_TTL_DURATION_FORMAT";i[4067]="ER_RDB_STATUS_GENERAL";i[4068]="ER_RDB_STATUS_MSG";i[4069]="ER_RDB_TTL_UNSUPPORTED";i[4070]="ER_RDB_TTL_COL_FORMAT";i[4071]="ER_PER_INDEX_CF_DEPRECATED";i[4072]="ER_KEY_CREATE_DURING_ALTER";i[4073]="ER_SK_POPULATE_DURING_ALTER";i[4074]="ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG";i[4075]="ER_NET_OK_PACKET_TOO_LARGE";i[4076]="ER_GEOJSON_EMPTY_COORDINATES";i[4077]="ER_MYROCKS_CANT_NOPAD_COLLATION";i[4078]="ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION";i[4079]="ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION";i[4080]="ER_WRONG_PARAMCOUNT_TO_CURSOR";i[4081]="ER_UNKNOWN_STRUCTURED_VARIABLE";i[4082]="ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD";i[4083]="ER_END_IDENTIFIER_DOES_NOT_MATCH";i[4084]="ER_SEQUENCE_RUN_OUT";i[4085]="ER_SEQUENCE_INVALID_DATA";i[4086]="ER_SEQUENCE_INVALID_TABLE_STRUCTURE";i[4087]="ER_SEQUENCE_ACCESS_ERROR";i[4088]="ER_SEQUENCE_BINLOG_FORMAT";i[4089]="ER_NOT_SEQUENCE";i[4090]="ER_NOT_SEQUENCE2";i[4091]="ER_UNKNOWN_SEQUENCES";i[4092]="ER_UNKNOWN_VIEW";i[4093]="ER_WRONG_INSERT_INTO_SEQUENCE";i[4094]="ER_SP_STACK_TRACE";i[4095]="ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY";i[4096]="ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED";i[4097]="ER_COMPRESSED_COLUMN_USED_AS_KEY";i[4098]="ER_UNKNOWN_COMPRESSION_METHOD";i[4099]="ER_WRONG_NUMBER_OF_VALUES_IN_TVC";i[4100]="ER_FIELD_REFERENCE_IN_TVC";i[4101]="ER_WRONG_TYPE_FOR_PERCENTILE_FUNC";i[4102]="ER_ARGUMENT_NOT_CONSTANT";i[4103]="ER_ARGUMENT_OUT_OF_RANGE";i[4104]="ER_WRONG_TYPE_OF_ARGUMENT";i[4105]="ER_NOT_AGGREGATE_FUNCTION";i[4106]="ER_INVALID_AGGREGATE_FUNCTION";i[4107]="ER_INVALID_VALUE_TO_LIMIT";i[4108]="ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT";i[4109]="ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING";i[4110]="ER_VERS_FIELD_WRONG_TYPE";i[4111]="ER_VERS_ENGINE_UNSUPPORTED";i[4112]="ER_WRONG_VERSIONING_RANGE";i[4113]="ER_PARTITION_WRONG_TYPE";i[4114]="WARN_VERS_PART_FULL";i[4115]="WARN_VERS_PARAMETERS";i[4116]="ER_VERS_DROP_PARTITION_INTERVAL";i[4117]="ER_UNUSED_25";i[4118]="WARN_VERS_PART_NON_HISTORICAL";i[4119]="ER_VERS_ALTER_NOT_ALLOWED";i[4120]="ER_VERS_ALTER_ENGINE_PROHIBITED";i[4121]="ER_VERS_RANGE_PROHIBITED";i[4122]="ER_CONFLICTING_FOR_SYSTEM_TIME";i[4123]="ER_VERS_TABLE_MUST_HAVE_COLUMNS";i[4124]="ER_VERS_NOT_VERSIONED";i[4125]="ER_MISSING";i[4126]="ER_VERS_PERIOD_COLUMNS";i[4127]="ER_PART_WRONG_VALUE";i[4128]="ER_VERS_WRONG_PARTS";i[4129]="ER_VERS_NO_TRX_ID";i[4130]="ER_VERS_ALTER_SYSTEM_FIELD";i[4131]="ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION";i[4132]="ER_VERS_DB_NOT_SUPPORTED";i[4133]="ER_VERS_TRT_IS_DISABLED";i[4134]="ER_VERS_DUPLICATE_ROW_START_END";i[4135]="ER_VERS_ALREADY_VERSIONED";i[4136]="ER_UNUSED_24";i[4137]="ER_VERS_NOT_SUPPORTED";i[4138]="ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED";i[4139]="ER_INDEX_FILE_FULL";i[4140]="ER_UPDATED_COLUMN_ONLY_ONCE";i[4141]="ER_EMPTY_ROW_IN_TVC";i[4142]="ER_VERS_QUERY_IN_PARTITION";i[4143]="ER_KEY_DOESNT_SUPPORT";i[4144]="ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD";i[4145]="ER_BACKUP_LOCK_IS_ACTIVE";i[4146]="ER_BACKUP_NOT_RUNNING";i[4147]="ER_BACKUP_WRONG_STAGE";i[4148]="ER_BACKUP_STAGE_FAILED";i[4149]="ER_BACKUP_UNKNOWN_STAGE";i[4150]="ER_USER_IS_BLOCKED";i[4151]="ER_ACCOUNT_HAS_BEEN_LOCKED";i[4152]="ER_PERIOD_TEMPORARY_NOT_ALLOWED";i[4153]="ER_PERIOD_TYPES_MISMATCH";i[4154]="ER_MORE_THAN_ONE_PERIOD";i[4155]="ER_PERIOD_FIELD_WRONG_ATTRIBUTES";i[4156]="ER_PERIOD_NOT_FOUND";i[4157]="ER_PERIOD_COLUMNS_UPDATED";i[4158]="ER_PERIOD_CONSTRAINT_DROP";i[4159]="ER_TOO_LONG_KEYPART";i[4160]="ER_TOO_LONG_DATABASE_COMMENT";i[4161]="ER_UNKNOWN_DATA_TYPE";i[4162]="ER_UNKNOWN_OPERATOR";i[4163]="ER_SP_DUP_DECL";i[4164]="ER_PART_STARTS_BEYOND_INTERVAL";i[4165]="ER_GALERA_REPLICATION_NOT_SUPPORTED";i[4166]="ER_LOAD_INFILE_CAPABILITY_DISABLED";i[4167]="ER_NO_SECURE_TRANSPORTS_CONFIGURED";i[4168]="ER_SLAVE_IGNORED_SHARED_TABLE";i[4169]="ER_NO_AUTOINCREMENT_WITH_UNIQUE";i[4170]="ER_KEY_CONTAINS_PERIOD_FIELDS";i[4171]="ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS";i[4172]="ER_NOT_ALLOWED_IN_THIS_CONTEXT";i[4173]="ER_DATA_WAS_COMMITED_UNDER_ROLLBACK";i[4174]="ER_PK_INDEX_CANT_BE_IGNORED";i[4175]="ER_BINLOG_UNSAFE_SKIP_LOCKED";i[4176]="ER_JSON_TABLE_ERROR_ON_FIELD";i[4177]="ER_JSON_TABLE_ALIAS_REQUIRED";i[4178]="ER_JSON_TABLE_SCALAR_EXPECTED";i[4179]="ER_JSON_TABLE_MULTIPLE_MATCHES";i[4180]="ER_WITH_TIES_NEEDS_ORDER";i[4181]="ER_REMOVED_ORPHAN_TRIGGER";i[4182]="ER_STORAGE_ENGINE_DISABLED";i[4183]="WARN_SFORMAT_ERROR";i[4184]="ER_PARTITION_CONVERT_SUBPARTITIONED";i[4185]="ER_PROVIDER_NOT_LOADED";i[4186]="ER_JSON_HISTOGRAM_PARSE_FAILED";i[4187]="ER_SF_OUT_INOUT_ARG_NOT_ALLOWED";i[4188]="ER_INCONSISTENT_SLAVE_TEMP_TABLE";i[4189]="ER_VERS_HIST_PART_FAILED";i[4190]="WARN_OPTION_CHANGING";i[4191]="ER_CM_OPTION_MISSING_REQUIREMENT";i[4192]="ER_SLAVE_STATEMENT_TIMEOUT";i[4193]="ER_JSON_INVALID_VALUE_FOR_KEYWORD";i[4194]="ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED";i[4195]="ER_JSON_NO_VARIABLE_SCHEMA";i[4196]="ER_SEQUENCE_TABLE_HAS_WRONG_NUMBER_OF_COLUMNS";i[4197]="ER_SEQUENCE_TABLE_CANNOT_HAVE_ANY_KEYS";i[4198]="ER_SEQUENCE_TABLE_CANNOT_HAVE_ANY_CONSTRAINTS";i[4199]="ER_SEQUENCE_TABLE_ORDER_BY";i[4200]="ER_VARIABLE_IGNORED";i[4201]="ER_INCORRECT_COLUMN_NAME_COUNT";i[4202]="WARN_SORTING_ON_TRUNCATED_LENGTH";i[4203]="ER_VECTOR_BINARY_FORMAT_INVALID";i[4204]="ER_VECTOR_FORMAT_INVALID";i[4205]="ER_PSEUDO_THREAD_ID_OVERWRITE";i[4206]="ER_VEC_DISTANCE_TYPE";i[4207]="WARN_INDEX_HINTS_IGNORED";i[4208]="ER_SIGNAL_SKIP_ROW_FROM_TRIGGER";i[4209]="ER_TEMPORARY_TABLES_PREVENT_SWITCH_GTID_DOMAIN_ID";i[4210]="ER_TOO_MANY_OPEN_CURSORS";i[4211]="ER_INCOMPATIBLE_EVENT_FLAG";i[4212]="ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS";i[4213]="ER_LONGITUDE_OUT_OF_RANGE";i[4214]="ER_LATITUDE_OUT_OF_RANGE";i[4215]="ER_GIS_DIFFERENT_SRIDS_AGGREGATION";i[4216]="ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS";i[4217]="ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS";i[4218]="ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR";i[4219]="ER_WARN_CONFLICTING_HINT";i[4220]="ER_WARN_UNKNOWN_QB_NAME";i[4221]="ER_UNRESOLVED_TABLE_HINT_NAME";i[4222]="ER_UNRESOLVED_INDEX_HINT_NAME";i[4223]="ER_HINTS_INSIDE_VIEWS_NOT_SUPPORTED";i[4224]="ER_WARN_MALFORMED_HINT";i[4225]="ER_WARN_HINTS_ON_INSERT_PART_OF_INSERT_SELECT";i[4226]="ER_INIT_SLAVE_ERROR";i[4227]="ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP";var ir=i;var ve=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=rr(a)||"UNKNOWN":this.code=ir[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 ve(E,n,o,s,t,e,a,A,{cause:u}):new ve(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 ve(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 rr(E){for(let[e,s]of Object.entries(N))if(s===E)return e}var nr=m(require("node:events"),1);var Ss=class extends nr.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")}},re=Ss;var r=[],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>=r.length))return r[e]}static fromCharsetAndName(e,s){for(let n=0;n<r.length;n++){let o=r[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<r.length;n++){let o=r[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<r.length;n++){let o=r[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<r.length;n++){let o=r[n];if(o&&o.name===t){if(o.charset==="utf8"&&o.maxLength===4)return o;s||(s=o)}}return s}};r[1]=new _(1,"BIG5_CHINESE_CI","big5",2);r[2]=new _(2,"LATIN2_CZECH_CS","latin2",1);r[3]=new _(3,"DEC8_SWEDISH_CI","dec8",1);r[4]=new _(4,"CP850_GENERAL_CI","cp850",1);r[5]=new _(5,"LATIN1_GERMAN1_CI","latin1",1);r[6]=new _(6,"HP8_ENGLISH_CI","hp8",1);r[7]=new _(7,"KOI8R_GENERAL_CI","koi8r",1);r[8]=new _(8,"LATIN1_SWEDISH_CI","latin1",1);r[9]=new _(9,"LATIN2_GENERAL_CI","latin2",1);r[10]=new _(10,"SWE7_SWEDISH_CI","swe7",1);r[11]=new _(11,"ASCII_GENERAL_CI","ascii",1);r[12]=new _(12,"UJIS_JAPANESE_CI","ujis",3);r[13]=new _(13,"SJIS_JAPANESE_CI","sjis",2);r[14]=new _(14,"CP1251_BULGARIAN_CI","cp1251",1);r[15]=new _(15,"LATIN1_DANISH_CI","latin1",1);r[16]=new _(16,"HEBREW_GENERAL_CI","hebrew",1);r[18]=new _(18,"TIS620_THAI_CI","tis620",1);r[19]=new _(19,"EUCKR_KOREAN_CI","euckr",2);r[20]=new _(20,"LATIN7_ESTONIAN_CS","latin7",1);r[21]=new _(21,"LATIN2_HUNGARIAN_CI","latin2",1);r[22]=new _(22,"KOI8U_GENERAL_CI","koi8u",1);r[23]=new _(23,"CP1251_UKRAINIAN_CI","cp1251",1);r[24]=new _(24,"GB2312_CHINESE_CI","gb2312",2);r[25]=new _(25,"GREEK_GENERAL_CI","greek",1);r[26]=new _(26,"CP1250_GENERAL_CI","cp1250",1);r[27]=new _(27,"LATIN2_CROATIAN_CI","latin2",1);r[28]=new _(28,"GBK_CHINESE_CI","gbk",2);r[29]=new _(29,"CP1257_LITHUANIAN_CI","cp1257",1);r[30]=new _(30,"LATIN5_TURKISH_CI","latin5",1);r[31]=new _(31,"LATIN1_GERMAN2_CI","latin1",1);r[32]=new _(32,"ARMSCII8_GENERAL_CI","armscii8",1);r[33]=new _(33,"UTF8MB3_GENERAL_CI","utf8",3);r[34]=new _(34,"CP1250_CZECH_CS","cp1250",1);r[35]=new _(35,"UCS2_GENERAL_CI","ucs2",2);r[36]=new _(36,"CP866_GENERAL_CI","cp866",1);r[37]=new _(37,"KEYBCS2_GENERAL_CI","keybcs2",1);r[38]=new _(38,"MACCE_GENERAL_CI","macce",1);r[39]=new _(39,"MACROMAN_GENERAL_CI","macroman",1);r[40]=new _(40,"CP852_GENERAL_CI","cp852",1);r[41]=new _(41,"LATIN7_GENERAL_CI","latin7",1);r[42]=new _(42,"LATIN7_GENERAL_CS","latin7",1);r[43]=new _(43,"MACCE_BIN","macce",1);r[44]=new _(44,"CP1250_CROATIAN_CI","cp1250",1);r[45]=new _(45,"UTF8MB4_GENERAL_CI","utf8",4);r[46]=new _(46,"UTF8MB4_BIN","utf8",4);r[47]=new _(47,"LATIN1_BIN","latin1",1);r[48]=new _(48,"LATIN1_GENERAL_CI","latin1",1);r[49]=new _(49,"LATIN1_GENERAL_CS","latin1",1);r[50]=new _(50,"CP1251_BIN","cp1251",1);r[51]=new _(51,"CP1251_GENERAL_CI","cp1251",1);r[52]=new _(52,"CP1251_GENERAL_CS","cp1251",1);r[53]=new _(53,"MACROMAN_BIN","macroman",1);r[54]=new _(54,"UTF16_GENERAL_CI","utf16",4);r[55]=new _(55,"UTF16_BIN","utf16",4);r[56]=new _(56,"UTF16LE_GENERAL_CI","utf16le",4);r[57]=new _(57,"CP1256_GENERAL_CI","cp1256",1);r[58]=new _(58,"CP1257_BIN","cp1257",1);r[59]=new _(59,"CP1257_GENERAL_CI","cp1257",1);r[60]=new _(60,"UTF32_GENERAL_CI","utf32",4);r[61]=new _(61,"UTF32_BIN","utf32",4);r[62]=new _(62,"UTF16LE_BIN","utf16le",4);r[63]=new _(63,"BINARY","binary",1);r[64]=new _(64,"ARMSCII8_BIN","armscii8",1);r[65]=new _(65,"ASCII_BIN","ascii",1);r[66]=new _(66,"CP1250_BIN","cp1250",1);r[67]=new _(67,"CP1256_BIN","cp1256",1);r[68]=new _(68,"CP866_BIN","cp866",1);r[69]=new _(69,"DEC8_BIN","dec8",1);r[70]=new _(70,"GREEK_BIN","greek",1);r[71]=new _(71,"HEBREW_BIN","hebrew",1);r[72]=new _(72,"HP8_BIN","hp8",1);r[73]=new _(73,"KEYBCS2_BIN","keybcs2",1);r[74]=new _(74,"KOI8R_BIN","koi8r",1);r[75]=new _(75,"KOI8U_BIN","koi8u",1);r[76]=new _(76,"UTF8_TOLOWER_CI","utf8",3);r[77]=new _(77,"LATIN2_BIN","latin2",1);r[78]=new _(78,"LATIN5_BIN","latin5",1);r[79]=new _(79,"LATIN7_BIN","latin7",1);r[80]=new _(80,"CP850_BIN","cp850",1);r[81]=new _(81,"CP852_BIN","cp852",1);r[82]=new _(82,"SWE7_BIN","swe7",1);r[83]=new _(83,"UTF8MB3_BIN","utf8",3);r[84]=new _(84,"BIG5_BIN","big5",2);r[85]=new _(85,"EUCKR_BIN","euckr",2);r[86]=new _(86,"GB2312_BIN","gb2312",2);r[87]=new _(87,"GBK_BIN","gbk",2);r[88]=new _(88,"SJIS_BIN","sjis",2);r[89]=new _(89,"TIS620_BIN","tis620",1);r[90]=new _(90,"UCS2_BIN","ucs2",2);r[91]=new _(91,"UJIS_BIN","ujis",3);r[92]=new _(92,"GEOSTD8_GENERAL_CI","geostd8",1);r[93]=new _(93,"GEOSTD8_BIN","geostd8",1);r[94]=new _(94,"LATIN1_SPANISH_CI","latin1",1);r[95]=new _(95,"CP932_JAPANESE_CI","cp932",2);r[96]=new _(96,"CP932_BIN","cp932",2);r[97]=new _(97,"EUCJPMS_JAPANESE_CI","eucjpms",3);r[98]=new _(98,"EUCJPMS_BIN","eucjpms",3);r[99]=new _(99,"CP1250_POLISH_CI","cp1250",1);r[101]=new _(101,"UTF16_UNICODE_CI","utf16",4);r[102]=new _(102,"UTF16_ICELANDIC_CI","utf16",4);r[103]=new _(103,"UTF16_LATVIAN_CI","utf16",4);r[104]=new _(104,"UTF16_ROMANIAN_CI","utf16",4);r[105]=new _(105,"UTF16_SLOVENIAN_CI","utf16",4);r[106]=new _(106,"UTF16_POLISH_CI","utf16",4);r[107]=new _(107,"UTF16_ESTONIAN_CI","utf16",4);r[108]=new _(108,"UTF16_SPANISH_CI","utf16",4);r[109]=new _(109,"UTF16_SWEDISH_CI","utf16",4);r[110]=new _(110,"UTF16_TURKISH_CI","utf16",4);r[111]=new _(111,"UTF16_CZECH_CI","utf16",4);r[112]=new _(112,"UTF16_DANISH_CI","utf16",4);r[113]=new _(113,"UTF16_LITHUANIAN_CI","utf16",4);r[114]=new _(114,"UTF16_SLOVAK_CI","utf16",4);r[115]=new _(115,"UTF16_SPANISH2_CI","utf16",4);r[116]=new _(116,"UTF16_ROMAN_CI","utf16",4);r[117]=new _(117,"UTF16_PERSIAN_CI","utf16",4);r[118]=new _(118,"UTF16_ESPERANTO_CI","utf16",4);r[119]=new _(119,"UTF16_HUNGARIAN_CI","utf16",4);r[120]=new _(120,"UTF16_SINHALA_CI","utf16",4);r[121]=new _(121,"UTF16_GERMAN2_CI","utf16",4);r[122]=new _(122,"UTF16_CROATIAN_MYSQL561_CI","utf16",4);r[123]=new _(123,"UTF16_UNICODE_520_CI","utf16",4);r[124]=new _(124,"UTF16_VIETNAMESE_CI","utf16",4);r[128]=new _(128,"UCS2_UNICODE_CI","ucs2",2);r[129]=new _(129,"UCS2_ICELANDIC_CI","ucs2",2);r[130]=new _(130,"UCS2_LATVIAN_CI","ucs2",2);r[131]=new _(131,"UCS2_ROMANIAN_CI","ucs2",2);r[132]=new _(132,"UCS2_SLOVENIAN_CI","ucs2",2);r[133]=new _(133,"UCS2_POLISH_CI","ucs2",2);r[134]=new _(134,"UCS2_ESTONIAN_CI","ucs2",2);r[135]=new _(135,"UCS2_SPANISH_CI","ucs2",2);r[136]=new _(136,"UCS2_SWEDISH_CI","ucs2",2);r[137]=new _(137,"UCS2_TURKISH_CI","ucs2",2);r[138]=new _(138,"UCS2_CZECH_CI","ucs2",2);r[139]=new _(139,"UCS2_DANISH_CI","ucs2",2);r[140]=new _(140,"UCS2_LITHUANIAN_CI","ucs2",2);r[141]=new _(141,"UCS2_SLOVAK_CI","ucs2",2);r[142]=new _(142,"UCS2_SPANISH2_CI","ucs2",2);r[143]=new _(143,"UCS2_ROMAN_CI","ucs2",2);r[144]=new _(144,"UCS2_PERSIAN_CI","ucs2",2);r[145]=new _(145,"UCS2_ESPERANTO_CI","ucs2",2);r[146]=new _(146,"UCS2_HUNGARIAN_CI","ucs2",2);r[147]=new _(147,"UCS2_SINHALA_CI","ucs2",2);r[148]=new _(148,"UCS2_GERMAN2_CI","ucs2",2);r[149]=new _(149,"UCS2_CROATIAN_MYSQL561_CI","ucs2",2);r[150]=new _(150,"UCS2_UNICODE_520_CI","ucs2",2);r[151]=new _(151,"UCS2_VIETNAMESE_CI","ucs2",2);r[159]=new _(159,"UCS2_GENERAL_MYSQL500_CI","ucs2",2);r[160]=new _(160,"UTF32_UNICODE_CI","utf32",4);r[161]=new _(161,"UTF32_ICELANDIC_CI","utf32",4);r[162]=new _(162,"UTF32_LATVIAN_CI","utf32",4);r[163]=new _(163,"UTF32_ROMANIAN_CI","utf32",4);r[164]=new _(164,"UTF32_SLOVENIAN_CI","utf32",4);r[165]=new _(165,"UTF32_POLISH_CI","utf32",4);r[166]=new _(166,"UTF32_ESTONIAN_CI","utf32",4);r[167]=new _(167,"UTF32_SPANISH_CI","utf32",4);r[168]=new _(168,"UTF32_SWEDISH_CI","utf32",4);r[169]=new _(169,"UTF32_TURKISH_CI","utf32",4);r[170]=new _(170,"UTF32_CZECH_CI","utf32",4);r[171]=new _(171,"UTF32_DANISH_CI","utf32",4);r[172]=new _(172,"UTF32_LITHUANIAN_CI","utf32",4);r[173]=new _(173,"UTF32_SLOVAK_CI","utf32",4);r[174]=new _(174,"UTF32_SPANISH2_CI","utf32",4);r[175]=new _(175,"UTF32_ROMAN_CI","utf32",4);r[176]=new _(176,"UTF32_PERSIAN_CI","utf32",4);r[177]=new _(177,"UTF32_ESPERANTO_CI","utf32",4);r[178]=new _(178,"UTF32_HUNGARIAN_CI","utf32",4);r[179]=new _(179,"UTF32_SINHALA_CI","utf32",4);r[180]=new _(180,"UTF32_GERMAN2_CI","utf32",4);r[181]=new _(181,"UTF32_CROATIAN_MYSQL561_CI","utf32",4);r[182]=new _(182,"UTF32_UNICODE_520_CI","utf32",4);r[183]=new _(183,"UTF32_VIETNAMESE_CI","utf32",4);r[192]=new _(192,"UTF8MB3_UNICODE_CI","utf8",3);r[193]=new _(193,"UTF8MB3_ICELANDIC_CI","utf8",3);r[194]=new _(194,"UTF8MB3_LATVIAN_CI","utf8",3);r[195]=new _(195,"UTF8MB3_ROMANIAN_CI","utf8",3);r[196]=new _(196,"UTF8MB3_SLOVENIAN_CI","utf8",3);r[197]=new _(197,"UTF8MB3_POLISH_CI","utf8",3);r[198]=new _(198,"UTF8MB3_ESTONIAN_CI","utf8",3);r[199]=new _(199,"UTF8MB3_SPANISH_CI","utf8",3);r[200]=new _(200,"UTF8MB3_SWEDISH_CI","utf8",3);r[201]=new _(201,"UTF8MB3_TURKISH_CI","utf8",3);r[202]=new _(202,"UTF8MB3_CZECH_CI","utf8",3);r[203]=new _(203,"UTF8MB3_DANISH_CI","utf8",3);r[204]=new _(204,"UTF8MB3_LITHUANIAN_CI","utf8",3);r[205]=new _(205,"UTF8MB3_SLOVAK_CI","utf8",3);r[206]=new _(206,"UTF8MB3_SPANISH2_CI","utf8",3);r[207]=new _(207,"UTF8MB3_ROMAN_CI","utf8",3);r[208]=new _(208,"UTF8MB3_PERSIAN_CI","utf8",3);r[209]=new _(209,"UTF8MB3_ESPERANTO_CI","utf8",3);r[210]=new _(210,"UTF8MB3_HUNGARIAN_CI","utf8",3);r[211]=new _(211,"UTF8MB3_SINHALA_CI","utf8",3);r[212]=new _(212,"UTF8MB3_GERMAN2_CI","utf8",3);r[213]=new _(213,"UTF8MB3_CROATIAN_MYSQL561_CI","utf8",3);r[214]=new _(214,"UTF8MB3_UNICODE_520_CI","utf8",3);r[215]=new _(215,"UTF8MB3_VIETNAMESE_CI","utf8",3);r[223]=new _(223,"UTF8MB3_GENERAL_MYSQL500_CI","utf8",3);r[224]=new _(224,"UTF8MB4_UNICODE_CI","utf8",4);r[225]=new _(225,"UTF8MB4_ICELANDIC_CI","utf8",4);r[226]=new _(226,"UTF8MB4_LATVIAN_CI","utf8",4);r[227]=new _(227,"UTF8MB4_ROMANIAN_CI","utf8",4);r[228]=new _(228,"UTF8MB4_SLOVENIAN_CI","utf8",4);r[229]=new _(229,"UTF8MB4_POLISH_CI","utf8",4);r[230]=new _(230,"UTF8MB4_ESTONIAN_CI","utf8",4);r[231]=new _(231,"UTF8MB4_SPANISH_CI","utf8",4);r[232]=new _(232,"UTF8MB4_SWEDISH_CI","utf8",4);r[233]=new _(233,"UTF8MB4_TURKISH_CI","utf8",4);r[234]=new _(234,"UTF8MB4_CZECH_CI","utf8",4);r[235]=new _(235,"UTF8MB4_DANISH_CI","utf8",4);r[236]=new _(236,"UTF8MB4_LITHUANIAN_CI","utf8",4);r[237]=new _(237,"UTF8MB4_SLOVAK_CI","utf8",4);r[238]=new _(238,"UTF8MB4_SPANISH2_CI","utf8",4);r[239]=new _(239,"UTF8MB4_ROMAN_CI","utf8",4);r[240]=new _(240,"UTF8MB4_PERSIAN_CI","utf8",4);r[241]=new _(241,"UTF8MB4_ESPERANTO_CI","utf8",4);r[242]=new _(242,"UTF8MB4_HUNGARIAN_CI","utf8",4);r[243]=new _(243,"UTF8MB4_SINHALA_CI","utf8",4);r[244]=new _(244,"UTF8MB4_GERMAN2_CI","utf8",4);r[245]=new _(245,"UTF8MB4_CROATIAN_MYSQL561_CI","utf8",4);r[246]=new _(246,"UTF8MB4_UNICODE_520_CI","utf8",4);r[247]=new _(247,"UTF8MB4_VIETNAMESE_CI","utf8",4);r[248]=new _(248,"GB18030_CHINESE_CI","gb18030",4);r[249]=new _(249,"GB18030_BIN","gb18030",4);r[250]=new _(250,"GB18030_UNICODE_520_CI","gb18030",4);r[255]=new _(255,"UTF8MB4_0900_AI_CI","utf8",4);r[256]=new _(256,"UTF8MB4_DE_PB_0900_AI_CI","utf8",4);r[257]=new _(257,"UTF8MB4_IS_0900_AI_CI","utf8",4);r[258]=new _(258,"UTF8MB4_LV_0900_AI_CI","utf8",4);r[259]=new _(259,"UTF8MB4_RO_0900_AI_CI","utf8",4);r[260]=new _(260,"UTF8MB4_SL_0900_AI_CI","utf8",4);r[261]=new _(261,"UTF8MB4_PL_0900_AI_CI","utf8",4);r[262]=new _(262,"UTF8MB4_ET_0900_AI_CI","utf8",4);r[263]=new _(263,"UTF8MB4_ES_0900_AI_CI","utf8",4);r[264]=new _(264,"UTF8MB4_SV_0900_AI_CI","utf8",4);r[265]=new _(265,"UTF8MB4_TR_0900_AI_CI","utf8",4);r[266]=new _(266,"UTF8MB4_CS_0900_AI_CI","utf8",4);r[267]=new _(267,"UTF8MB4_DA_0900_AI_CI","utf8",4);r[268]=new _(268,"UTF8MB4_LT_0900_AI_CI","utf8",4);r[269]=new _(269,"UTF8MB4_SK_0900_AI_CI","utf8",4);r[270]=new _(270,"UTF8MB4_ES_TRAD_0900_AI_CI","utf8",4);r[271]=new _(271,"UTF8MB4_LA_0900_AI_CI","utf8",4);r[273]=new _(273,"UTF8MB4_EO_0900_AI_CI","utf8",4);r[274]=new _(274,"UTF8MB4_HU_0900_AI_CI","utf8",4);r[275]=new _(275,"UTF8MB4_HR_0900_AI_CI","utf8",4);r[277]=new _(277,"UTF8MB4_VI_0900_AI_CI","utf8",4);r[278]=new _(278,"UTF8MB4_0900_AS_CS","utf8",4);r[279]=new _(279,"UTF8MB4_DE_PB_0900_AS_CS","utf8",4);r[280]=new _(280,"UTF8MB4_IS_0900_AS_CS","utf8",4);r[281]=new _(281,"UTF8MB4_LV_0900_AS_CS","utf8",4);r[282]=new _(282,"UTF8MB4_RO_0900_AS_CS","utf8",4);r[283]=new _(283,"UTF8MB4_SL_0900_AS_CS","utf8",4);r[284]=new _(284,"UTF8MB4_PL_0900_AS_CS","utf8",4);r[285]=new _(285,"UTF8MB4_ET_0900_AS_CS","utf8",4);r[286]=new _(286,"UTF8MB4_ES_0900_AS_CS","utf8",4);r[287]=new _(287,"UTF8MB4_SV_0900_AS_CS","utf8",4);r[288]=new _(288,"UTF8MB4_TR_0900_AS_CS","utf8",4);r[289]=new _(289,"UTF8MB4_CS_0900_AS_CS","utf8",4);r[290]=new _(290,"UTF8MB4_DA_0900_AS_CS","utf8",4);r[291]=new _(291,"UTF8MB4_LT_0900_AS_CS","utf8",4);r[292]=new _(292,"UTF8MB4_SK_0900_AS_CS","utf8",4);r[293]=new _(293,"UTF8MB4_ES_TRAD_0900_AS_CS","utf8",4);r[294]=new _(294,"UTF8MB4_LA_0900_AS_CS","utf8",4);r[296]=new _(296,"UTF8MB4_EO_0900_AS_CS","utf8",4);r[297]=new _(297,"UTF8MB4_HU_0900_AS_CS","utf8",4);r[298]=new _(298,"UTF8MB4_HR_0900_AS_CS","utf8",4);r[300]=new _(300,"UTF8MB4_VI_0900_AS_CS","utf8",4);r[303]=new _(303,"UTF8MB4_JA_0900_AS_CS","utf8",4);r[304]=new _(304,"UTF8MB4_JA_0900_AS_CS_KS","utf8",4);r[305]=new _(305,"UTF8MB4_0900_AS_CI","utf8",4);r[306]=new _(306,"UTF8MB4_RU_0900_AI_CI","utf8",4);r[307]=new _(307,"UTF8MB4_RU_0900_AS_CS","utf8",4);r[308]=new _(308,"UTF8MB4_ZH_0900_AS_CS","utf8",4);r[309]=new _(309,"UTF8MB4_0900_BIN","utf8",4);r[576]=new _(576,"UTF8MB3_CROATIAN_CI","utf8",3);r[577]=new _(577,"UTF8MB3_MYANMAR_CI","utf8",3);r[578]=new _(578,"UTF8MB3_THAI_520_W2","utf8",3);r[608]=new _(608,"UTF8MB4_CROATIAN_CI","utf8",4);r[609]=new _(609,"UTF8MB4_MYANMAR_CI","utf8",4);r[610]=new _(610,"UTF8MB4_THAI_520_W2","utf8",4);r[640]=new _(640,"UCS2_CROATIAN_CI","ucs2",2);r[641]=new _(641,"UCS2_MYANMAR_CI","ucs2",2);r[642]=new _(642,"UCS2_THAI_520_W2","ucs2",2);r[672]=new _(672,"UTF16_CROATIAN_CI","utf16",4);r[673]=new _(673,"UTF16_MYANMAR_CI","utf16",4);r[674]=new _(674,"UTF16_THAI_520_W2","utf16",4);r[736]=new _(736,"UTF32_CROATIAN_CI","utf32",4);r[737]=new _(737,"UTF32_MYANMAR_CI","utf32",4);r[738]=new _(738,"UTF32_THAI_520_W2","utf32",4);r[1025]=new _(1025,"BIG5_CHINESE_NOPAD_CI","big5",2);r[1027]=new _(1027,"DEC8_SWEDISH_NOPAD_CI","dec8",1);r[1028]=new _(1028,"CP850_GENERAL_NOPAD_CI","cp850",1);r[1030]=new _(1030,"HP8_ENGLISH_NOPAD_CI","hp8",1);r[1031]=new _(1031,"KOI8R_GENERAL_NOPAD_CI","koi8r",1);r[1032]=new _(1032,"LATIN1_SWEDISH_NOPAD_CI","latin1",1);r[1033]=new _(1033,"LATIN2_GENERAL_NOPAD_CI","latin2",1);r[1034]=new _(1034,"SWE7_SWEDISH_NOPAD_CI","swe7",1);r[1035]=new _(1035,"ASCII_GENERAL_NOPAD_CI","ascii",1);r[1036]=new _(1036,"UJIS_JAPANESE_NOPAD_CI","ujis",3);r[1037]=new _(1037,"SJIS_JAPANESE_NOPAD_CI","sjis",2);r[1040]=new _(1040,"HEBREW_GENERAL_NOPAD_CI","hebrew",1);r[1042]=new _(1042,"TIS620_THAI_NOPAD_CI","tis620",1);r[1043]=new _(1043,"EUCKR_KOREAN_NOPAD_CI","euckr",2);r[1046]=new _(1046,"KOI8U_GENERAL_NOPAD_CI","koi8u",1);r[1048]=new _(1048,"GB2312_CHINESE_NOPAD_CI","gb2312",2);r[1049]=new _(1049,"GREEK_GENERAL_NOPAD_CI","greek",1);r[1050]=new _(1050,"CP1250_GENERAL_NOPAD_CI","cp1250",1);r[1052]=new _(1052,"GBK_CHINESE_NOPAD_CI","gbk",2);r[1054]=new _(1054,"LATIN5_TURKISH_NOPAD_CI","latin5",1);r[1056]=new _(1056,"ARMSCII8_GENERAL_NOPAD_CI","armscii8",1);r[1057]=new _(1057,"UTF8MB3_GENERAL_NOPAD_CI","utf8",3);r[1059]=new _(1059,"UCS2_GENERAL_NOPAD_CI","ucs2",2);r[1060]=new _(1060,"CP866_GENERAL_NOPAD_CI","cp866",1);r[1061]=new _(1061,"KEYBCS2_GENERAL_NOPAD_CI","keybcs2",1);r[1062]=new _(1062,"MACCE_GENERAL_NOPAD_CI","macce",1);r[1063]=new _(1063,"MACROMAN_GENERAL_NOPAD_CI","macroman",1);r[1064]=new _(1064,"CP852_GENERAL_NOPAD_CI","cp852",1);r[1065]=new _(1065,"LATIN7_GENERAL_NOPAD_CI","latin7",1);r[1067]=new _(1067,"MACCE_NOPAD_BIN","macce",1);r[1069]=new _(1069,"UTF8MB4_GENERAL_NOPAD_CI","utf8",4);r[1070]=new _(1070,"UTF8MB4_NOPAD_BIN","utf8",4);r[1071]=new _(1071,"LATIN1_NOPAD_BIN","latin1",1);r[1074]=new _(1074,"CP1251_NOPAD_BIN","cp1251",1);r[1075]=new _(1075,"CP1251_GENERAL_NOPAD_CI","cp1251",1);r[1077]=new _(1077,"MACROMAN_NOPAD_BIN","macroman",1);r[1078]=new _(1078,"UTF16_GENERAL_NOPAD_CI","utf16",4);r[1079]=new _(1079,"UTF16_NOPAD_BIN","utf16",4);r[1080]=new _(1080,"UTF16LE_GENERAL_NOPAD_CI","utf16le",4);r[1081]=new _(1081,"CP1256_GENERAL_NOPAD_CI","cp1256",1);r[1082]=new _(1082,"CP1257_NOPAD_BIN","cp1257",1);r[1083]=new _(1083,"CP1257_GENERAL_NOPAD_CI","cp1257",1);r[1084]=new _(1084,"UTF32_GENERAL_NOPAD_CI","utf32",4);r[1085]=new _(1085,"UTF32_NOPAD_BIN","utf32",4);r[1086]=new _(1086,"UTF16LE_NOPAD_BIN","utf16le",4);r[1088]=new _(1088,"ARMSCII8_NOPAD_BIN","armscii8",1);r[1089]=new _(1089,"ASCII_NOPAD_BIN","ascii",1);r[1090]=new _(1090,"CP1250_NOPAD_BIN","cp1250",1);r[1091]=new _(1091,"CP1256_NOPAD_BIN","cp1256",1);r[1092]=new _(1092,"CP866_NOPAD_BIN","cp866",1);r[1093]=new _(1093,"DEC8_NOPAD_BIN","dec8",1);r[1094]=new _(1094,"GREEK_NOPAD_BIN","greek",1);r[1095]=new _(1095,"HEBREW_NOPAD_BIN","hebrew",1);r[1096]=new _(1096,"HP8_NOPAD_BIN","hp8",1);r[1097]=new _(1097,"KEYBCS2_NOPAD_BIN","keybcs2",1);r[1098]=new _(1098,"KOI8R_NOPAD_BIN","koi8r",1);r[1099]=new _(1099,"KOI8U_NOPAD_BIN","koi8u",1);r[1101]=new _(1101,"LATIN2_NOPAD_BIN","latin2",1);r[1102]=new _(1102,"LATIN5_NOPAD_BIN","latin5",1);r[1103]=new _(1103,"LATIN7_NOPAD_BIN","latin7",1);r[1104]=new _(1104,"CP850_NOPAD_BIN","cp850",1);r[1105]=new _(1105,"CP852_NOPAD_BIN","cp852",1);r[1106]=new _(1106,"SWE7_NOPAD_BIN","swe7",1);r[1107]=new _(1107,"UTF8MB3_NOPAD_BIN","utf8",3);r[1108]=new _(1108,"BIG5_NOPAD_BIN","big5",2);r[1109]=new _(1109,"EUCKR_NOPAD_BIN","euckr",2);r[1110]=new _(1110,"GB2312_NOPAD_BIN","gb2312",2);r[1111]=new _(1111,"GBK_NOPAD_BIN","gbk",2);r[1112]=new _(1112,"SJIS_NOPAD_BIN","sjis",2);r[1113]=new _(1113,"TIS620_NOPAD_BIN","tis620",1);r[1114]=new _(1114,"UCS2_NOPAD_BIN","ucs2",2);r[1115]=new _(1115,"UJIS_NOPAD_BIN","ujis",3);r[1116]=new _(1116,"GEOSTD8_GENERAL_NOPAD_CI","geostd8",1);r[1117]=new _(1117,"GEOSTD8_NOPAD_BIN","geostd8",1);r[1119]=new _(1119,"CP932_JAPANESE_NOPAD_CI","cp932",2);r[1120]=new _(1120,"CP932_NOPAD_BIN","cp932",2);r[1121]=new _(1121,"EUCJPMS_JAPANESE_NOPAD_CI","eucjpms",3);r[1122]=new _(1122,"EUCJPMS_NOPAD_BIN","eucjpms",3);r[1125]=new _(1125,"UTF16_UNICODE_NOPAD_CI","utf16",4);r[1147]=new _(1147,"UTF16_UNICODE_520_NOPAD_CI","utf16",4);r[1152]=new _(1152,"UCS2_UNICODE_NOPAD_CI","ucs2",2);r[1174]=new _(1174,"UCS2_UNICODE_520_NOPAD_CI","ucs2",2);r[1184]=new _(1184,"UTF32_UNICODE_NOPAD_CI","utf32",4);r[1206]=new _(1206,"UTF32_UNICODE_520_NOPAD_CI","utf32",4);r[1216]=new _(1216,"UTF8MB3_UNICODE_NOPAD_CI","utf8",3);r[1238]=new _(1238,"UTF8MB3_UNICODE_520_NOPAD_CI","utf8",3);r[1248]=new _(1248,"UTF8MB4_UNICODE_NOPAD_CI","utf8",4);r[1270]=new _(1270,"UTF8MB4_UNICODE_520_NOPAD_CI","utf8",4);r[2048]=new _(2048,"UCA1400_AI_CI","utf8",3);r[2049]=new _(2049,"UCA1400_AI_CS","utf8",3);r[2050]=new _(2050,"UCA1400_AS_CI","utf8",3);r[2051]=new _(2051,"UCA1400_AS_CS","utf8",3);r[2052]=new _(2052,"UCA1400_NOPAD_AI_CI","utf8",3);r[2053]=new _(2053,"UCA1400_NOPAD_AI_CS","utf8",3);r[2054]=new _(2054,"UCA1400_NOPAD_AS_CI","utf8",3);r[2055]=new _(2055,"UCA1400_NOPAD_AS_CS","utf8",3);r[2056]=new _(2056,"UCA1400_ICELANDIC_AI_CI","utf8",3);r[2057]=new _(2057,"UCA1400_ICELANDIC_AI_CS","utf8",3);r[2058]=new _(2058,"UCA1400_ICELANDIC_AS_CI","utf8",3);r[2059]=new _(2059,"UCA1400_ICELANDIC_AS_CS","utf8",3);r[2060]=new _(2060,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf8",3);r[2061]=new _(2061,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf8",3);r[2062]=new _(2062,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf8",3);r[2063]=new _(2063,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf8",3);r[2064]=new _(2064,"UCA1400_LATVIAN_AI_CI","utf8",3);r[2065]=new _(2065,"UCA1400_LATVIAN_AI_CS","utf8",3);r[2066]=new _(2066,"UCA1400_LATVIAN_AS_CI","utf8",3);r[2067]=new _(2067,"UCA1400_LATVIAN_AS_CS","utf8",3);r[2068]=new _(2068,"UCA1400_LATVIAN_NOPAD_AI_CI","utf8",3);r[2069]=new _(2069,"UCA1400_LATVIAN_NOPAD_AI_CS","utf8",3);r[2070]=new _(2070,"UCA1400_LATVIAN_NOPAD_AS_CI","utf8",3);r[2071]=new _(2071,"UCA1400_LATVIAN_NOPAD_AS_CS","utf8",3);r[2072]=new _(2072,"UCA1400_ROMANIAN_AI_CI","utf8",3);r[2073]=new _(2073,"UCA1400_ROMANIAN_AI_CS","utf8",3);r[2074]=new _(2074,"UCA1400_ROMANIAN_AS_CI","utf8",3);r[2075]=new _(2075,"UCA1400_ROMANIAN_AS_CS","utf8",3);r[2076]=new _(2076,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf8",3);r[2077]=new _(2077,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf8",3);r[2078]=new _(2078,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf8",3);r[2079]=new _(2079,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf8",3);r[2080]=new _(2080,"UCA1400_SLOVENIAN_AI_CI","utf8",3);r[2081]=new _(2081,"UCA1400_SLOVENIAN_AI_CS","utf8",3);r[2082]=new _(2082,"UCA1400_SLOVENIAN_AS_CI","utf8",3);r[2083]=new _(2083,"UCA1400_SLOVENIAN_AS_CS","utf8",3);r[2084]=new _(2084,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf8",3);r[2085]=new _(2085,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf8",3);r[2086]=new _(2086,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf8",3);r[2087]=new _(2087,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf8",3);r[2088]=new _(2088,"UCA1400_POLISH_AI_CI","utf8",3);r[2089]=new _(2089,"UCA1400_POLISH_AI_CS","utf8",3);r[2090]=new _(2090,"UCA1400_POLISH_AS_CI","utf8",3);r[2091]=new _(2091,"UCA1400_POLISH_AS_CS","utf8",3);r[2092]=new _(2092,"UCA1400_POLISH_NOPAD_AI_CI","utf8",3);r[2093]=new _(2093,"UCA1400_POLISH_NOPAD_AI_CS","utf8",3);r[2094]=new _(2094,"UCA1400_POLISH_NOPAD_AS_CI","utf8",3);r[2095]=new _(2095,"UCA1400_POLISH_NOPAD_AS_CS","utf8",3);r[2096]=new _(2096,"UCA1400_ESTONIAN_AI_CI","utf8",3);r[2097]=new _(2097,"UCA1400_ESTONIAN_AI_CS","utf8",3);r[2098]=new _(2098,"UCA1400_ESTONIAN_AS_CI","utf8",3);r[2099]=new _(2099,"UCA1400_ESTONIAN_AS_CS","utf8",3);r[2100]=new _(2100,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf8",3);r[2101]=new _(2101,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf8",3);r[2102]=new _(2102,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf8",3);r[2103]=new _(2103,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf8",3);r[2104]=new _(2104,"UCA1400_SPANISH_AI_CI","utf8",3);r[2105]=new _(2105,"UCA1400_SPANISH_AI_CS","utf8",3);r[2106]=new _(2106,"UCA1400_SPANISH_AS_CI","utf8",3);r[2107]=new _(2107,"UCA1400_SPANISH_AS_CS","utf8",3);r[2108]=new _(2108,"UCA1400_SPANISH_NOPAD_AI_CI","utf8",3);r[2109]=new _(2109,"UCA1400_SPANISH_NOPAD_AI_CS","utf8",3);r[2110]=new _(2110,"UCA1400_SPANISH_NOPAD_AS_CI","utf8",3);r[2111]=new _(2111,"UCA1400_SPANISH_NOPAD_AS_CS","utf8",3);r[2112]=new _(2112,"UCA1400_SWEDISH_AI_CI","utf8",3);r[2113]=new _(2113,"UCA1400_SWEDISH_AI_CS","utf8",3);r[2114]=new _(2114,"UCA1400_SWEDISH_AS_CI","utf8",3);r[2115]=new _(2115,"UCA1400_SWEDISH_AS_CS","utf8",3);r[2116]=new _(2116,"UCA1400_SWEDISH_NOPAD_AI_CI","utf8",3);r[2117]=new _(2117,"UCA1400_SWEDISH_NOPAD_AI_CS","utf8",3);r[2118]=new _(2118,"UCA1400_SWEDISH_NOPAD_AS_CI","utf8",3);r[2119]=new _(2119,"UCA1400_SWEDISH_NOPAD_AS_CS","utf8",3);r[2120]=new _(2120,"UCA1400_TURKISH_AI_CI","utf8",3);r[2121]=new _(2121,"UCA1400_TURKISH_AI_CS","utf8",3);r[2122]=new _(2122,"UCA1400_TURKISH_AS_CI","utf8",3);r[2123]=new _(2123,"UCA1400_TURKISH_AS_CS","utf8",3);r[2124]=new _(2124,"UCA1400_TURKISH_NOPAD_AI_CI","utf8",3);r[2125]=new _(2125,"UCA1400_TURKISH_NOPAD_AI_CS","utf8",3);r[2126]=new _(2126,"UCA1400_TURKISH_NOPAD_AS_CI","utf8",3);r[2127]=new _(2127,"UCA1400_TURKISH_NOPAD_AS_CS","utf8",3);r[2128]=new _(2128,"UCA1400_CZECH_AI_CI","utf8",3);r[2129]=new _(2129,"UCA1400_CZECH_AI_CS","utf8",3);r[2130]=new _(2130,"UCA1400_CZECH_AS_CI","utf8",3);r[2131]=new _(2131,"UCA1400_CZECH_AS_CS","utf8",3);r[2132]=new _(2132,"UCA1400_CZECH_NOPAD_AI_CI","utf8",3);r[2133]=new _(2133,"UCA1400_CZECH_NOPAD_AI_CS","utf8",3);r[2134]=new _(2134,"UCA1400_CZECH_NOPAD_AS_CI","utf8",3);r[2135]=new _(2135,"UCA1400_CZECH_NOPAD_AS_CS","utf8",3);r[2136]=new _(2136,"UCA1400_DANISH_AI_CI","utf8",3);r[2137]=new _(2137,"UCA1400_DANISH_AI_CS","utf8",3);r[2138]=new _(2138,"UCA1400_DANISH_AS_CI","utf8",3);r[2139]=new _(2139,"UCA1400_DANISH_AS_CS","utf8",3);r[2140]=new _(2140,"UCA1400_DANISH_NOPAD_AI_CI","utf8",3);r[2141]=new _(2141,"UCA1400_DANISH_NOPAD_AI_CS","utf8",3);r[2142]=new _(2142,"UCA1400_DANISH_NOPAD_AS_CI","utf8",3);r[2143]=new _(2143,"UCA1400_DANISH_NOPAD_AS_CS","utf8",3);r[2144]=new _(2144,"UCA1400_LITHUANIAN_AI_CI","utf8",3);r[2145]=new _(2145,"UCA1400_LITHUANIAN_AI_CS","utf8",3);r[2146]=new _(2146,"UCA1400_LITHUANIAN_AS_CI","utf8",3);r[2147]=new _(2147,"UCA1400_LITHUANIAN_AS_CS","utf8",3);r[2148]=new _(2148,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf8",3);r[2149]=new _(2149,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf8",3);r[2150]=new _(2150,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf8",3);r[2151]=new _(2151,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf8",3);r[2152]=new _(2152,"UCA1400_SLOVAK_AI_CI","utf8",3);r[2153]=new _(2153,"UCA1400_SLOVAK_AI_CS","utf8",3);r[2154]=new _(2154,"UCA1400_SLOVAK_AS_CI","utf8",3);r[2155]=new _(2155,"UCA1400_SLOVAK_AS_CS","utf8",3);r[2156]=new _(2156,"UCA1400_SLOVAK_NOPAD_AI_CI","utf8",3);r[2157]=new _(2157,"UCA1400_SLOVAK_NOPAD_AI_CS","utf8",3);r[2158]=new _(2158,"UCA1400_SLOVAK_NOPAD_AS_CI","utf8",3);r[2159]=new _(2159,"UCA1400_SLOVAK_NOPAD_AS_CS","utf8",3);r[2160]=new _(2160,"UCA1400_SPANISH2_AI_CI","utf8",3);r[2161]=new _(2161,"UCA1400_SPANISH2_AI_CS","utf8",3);r[2162]=new _(2162,"UCA1400_SPANISH2_AS_CI","utf8",3);r[2163]=new _(2163,"UCA1400_SPANISH2_AS_CS","utf8",3);r[2164]=new _(2164,"UCA1400_SPANISH2_NOPAD_AI_CI","utf8",3);r[2165]=new _(2165,"UCA1400_SPANISH2_NOPAD_AI_CS","utf8",3);r[2166]=new _(2166,"UCA1400_SPANISH2_NOPAD_AS_CI","utf8",3);r[2167]=new _(2167,"UCA1400_SPANISH2_NOPAD_AS_CS","utf8",3);r[2168]=new _(2168,"UCA1400_ROMAN_AI_CI","utf8",3);r[2169]=new _(2169,"UCA1400_ROMAN_AI_CS","utf8",3);r[2170]=new _(2170,"UCA1400_ROMAN_AS_CI","utf8",3);r[2171]=new _(2171,"UCA1400_ROMAN_AS_CS","utf8",3);r[2172]=new _(2172,"UCA1400_ROMAN_NOPAD_AI_CI","utf8",3);r[2173]=new _(2173,"UCA1400_ROMAN_NOPAD_AI_CS","utf8",3);r[2174]=new _(2174,"UCA1400_ROMAN_NOPAD_AS_CI","utf8",3);r[2175]=new _(2175,"UCA1400_ROMAN_NOPAD_AS_CS","utf8",3);r[2176]=new _(2176,"UCA1400_PERSIAN_AI_CI","utf8",3);r[2177]=new _(2177,"UCA1400_PERSIAN_AI_CS","utf8",3);r[2178]=new _(2178,"UCA1400_PERSIAN_AS_CI","utf8",3);r[2179]=new _(2179,"UCA1400_PERSIAN_AS_CS","utf8",3);r[2180]=new _(2180,"UCA1400_PERSIAN_NOPAD_AI_CI","utf8",3);r[2181]=new _(2181,"UCA1400_PERSIAN_NOPAD_AI_CS","utf8",3);r[2182]=new _(2182,"UCA1400_PERSIAN_NOPAD_AS_CI","utf8",3);r[2183]=new _(2183,"UCA1400_PERSIAN_NOPAD_AS_CS","utf8",3);r[2184]=new _(2184,"UCA1400_ESPERANTO_AI_CI","utf8",3);r[2185]=new _(2185,"UCA1400_ESPERANTO_AI_CS","utf8",3);r[2186]=new _(2186,"UCA1400_ESPERANTO_AS_CI","utf8",3);r[2187]=new _(2187,"UCA1400_ESPERANTO_AS_CS","utf8",3);r[2188]=new _(2188,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf8",3);r[2189]=new _(2189,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf8",3);r[2190]=new _(2190,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf8",3);r[2191]=new _(2191,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf8",3);r[2192]=new _(2192,"UCA1400_HUNGARIAN_AI_CI","utf8",3);r[2193]=new _(2193,"UCA1400_HUNGARIAN_AI_CS","utf8",3);r[2194]=new _(2194,"UCA1400_HUNGARIAN_AS_CI","utf8",3);r[2195]=new _(2195,"UCA1400_HUNGARIAN_AS_CS","utf8",3);r[2196]=new _(2196,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf8",3);r[2197]=new _(2197,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf8",3);r[2198]=new _(2198,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf8",3);r[2199]=new _(2199,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf8",3);r[2200]=new _(2200,"UCA1400_SINHALA_AI_CI","utf8",3);r[2201]=new _(2201,"UCA1400_SINHALA_AI_CS","utf8",3);r[2202]=new _(2202,"UCA1400_SINHALA_AS_CI","utf8",3);r[2203]=new _(2203,"UCA1400_SINHALA_AS_CS","utf8",3);r[2204]=new _(2204,"UCA1400_SINHALA_NOPAD_AI_CI","utf8",3);r[2205]=new _(2205,"UCA1400_SINHALA_NOPAD_AI_CS","utf8",3);r[2206]=new _(2206,"UCA1400_SINHALA_NOPAD_AS_CI","utf8",3);r[2207]=new _(2207,"UCA1400_SINHALA_NOPAD_AS_CS","utf8",3);r[2208]=new _(2208,"UCA1400_GERMAN2_AI_CI","utf8",3);r[2209]=new _(2209,"UCA1400_GERMAN2_AI_CS","utf8",3);r[2210]=new _(2210,"UCA1400_GERMAN2_AS_CI","utf8",3);r[2211]=new _(2211,"UCA1400_GERMAN2_AS_CS","utf8",3);r[2212]=new _(2212,"UCA1400_GERMAN2_NOPAD_AI_CI","utf8",3);r[2213]=new _(2213,"UCA1400_GERMAN2_NOPAD_AI_CS","utf8",3);r[2214]=new _(2214,"UCA1400_GERMAN2_NOPAD_AS_CI","utf8",3);r[2215]=new _(2215,"UCA1400_GERMAN2_NOPAD_AS_CS","utf8",3);r[2232]=new _(2232,"UCA1400_VIETNAMESE_AI_CI","utf8",3);r[2233]=new _(2233,"UCA1400_VIETNAMESE_AI_CS","utf8",3);r[2234]=new _(2234,"UCA1400_VIETNAMESE_AS_CI","utf8",3);r[2235]=new _(2235,"UCA1400_VIETNAMESE_AS_CS","utf8",3);r[2236]=new _(2236,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf8",3);r[2237]=new _(2237,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf8",3);r[2238]=new _(2238,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf8",3);r[2239]=new _(2239,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf8",3);r[2240]=new _(2240,"UCA1400_CROATIAN_AI_CI","utf8",3);r[2241]=new _(2241,"UCA1400_CROATIAN_AI_CS","utf8",3);r[2242]=new _(2242,"UCA1400_CROATIAN_AS_CI","utf8",3);r[2243]=new _(2243,"UCA1400_CROATIAN_AS_CS","utf8",3);r[2244]=new _(2244,"UCA1400_CROATIAN_NOPAD_AI_CI","utf8",3);r[2245]=new _(2245,"UCA1400_CROATIAN_NOPAD_AI_CS","utf8",3);r[2246]=new _(2246,"UCA1400_CROATIAN_NOPAD_AS_CI","utf8",3);r[2247]=new _(2247,"UCA1400_CROATIAN_NOPAD_AS_CS","utf8",3);r[2304]=new _(2304,"UCA1400_AI_CI","utf8",4);r[2305]=new _(2305,"UCA1400_AI_CS","utf8",4);r[2306]=new _(2306,"UCA1400_AS_CI","utf8",4);r[2307]=new _(2307,"UCA1400_AS_CS","utf8",4);r[2308]=new _(2308,"UCA1400_NOPAD_AI_CI","utf8",4);r[2309]=new _(2309,"UCA1400_NOPAD_AI_CS","utf8",4);r[2310]=new _(2310,"UCA1400_NOPAD_AS_CI","utf8",4);r[2311]=new _(2311,"UCA1400_NOPAD_AS_CS","utf8",4);r[2312]=new _(2312,"UCA1400_ICELANDIC_AI_CI","utf8",4);r[2313]=new _(2313,"UCA1400_ICELANDIC_AI_CS","utf8",4);r[2314]=new _(2314,"UCA1400_ICELANDIC_AS_CI","utf8",4);r[2315]=new _(2315,"UCA1400_ICELANDIC_AS_CS","utf8",4);r[2316]=new _(2316,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf8",4);r[2317]=new _(2317,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf8",4);r[2318]=new _(2318,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf8",4);r[2319]=new _(2319,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf8",4);r[2320]=new _(2320,"UCA1400_LATVIAN_AI_CI","utf8",4);r[2321]=new _(2321,"UCA1400_LATVIAN_AI_CS","utf8",4);r[2322]=new _(2322,"UCA1400_LATVIAN_AS_CI","utf8",4);r[2323]=new _(2323,"UCA1400_LATVIAN_AS_CS","utf8",4);r[2324]=new _(2324,"UCA1400_LATVIAN_NOPAD_AI_CI","utf8",4);r[2325]=new _(2325,"UCA1400_LATVIAN_NOPAD_AI_CS","utf8",4);r[2326]=new _(2326,"UCA1400_LATVIAN_NOPAD_AS_CI","utf8",4);r[2327]=new _(2327,"UCA1400_LATVIAN_NOPAD_AS_CS","utf8",4);r[2328]=new _(2328,"UCA1400_ROMANIAN_AI_CI","utf8",4);r[2329]=new _(2329,"UCA1400_ROMANIAN_AI_CS","utf8",4);r[2330]=new _(2330,"UCA1400_ROMANIAN_AS_CI","utf8",4);r[2331]=new _(2331,"UCA1400_ROMANIAN_AS_CS","utf8",4);r[2332]=new _(2332,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf8",4);r[2333]=new _(2333,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf8",4);r[2334]=new _(2334,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf8",4);r[2335]=new _(2335,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf8",4);r[2336]=new _(2336,"UCA1400_SLOVENIAN_AI_CI","utf8",4);r[2337]=new _(2337,"UCA1400_SLOVENIAN_AI_CS","utf8",4);r[2338]=new _(2338,"UCA1400_SLOVENIAN_AS_CI","utf8",4);r[2339]=new _(2339,"UCA1400_SLOVENIAN_AS_CS","utf8",4);r[2340]=new _(2340,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf8",4);r[2341]=new _(2341,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf8",4);r[2342]=new _(2342,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf8",4);r[2343]=new _(2343,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf8",4);r[2344]=new _(2344,"UCA1400_POLISH_AI_CI","utf8",4);r[2345]=new _(2345,"UCA1400_POLISH_AI_CS","utf8",4);r[2346]=new _(2346,"UCA1400_POLISH_AS_CI","utf8",4);r[2347]=new _(2347,"UCA1400_POLISH_AS_CS","utf8",4);r[2348]=new _(2348,"UCA1400_POLISH_NOPAD_AI_CI","utf8",4);r[2349]=new _(2349,"UCA1400_POLISH_NOPAD_AI_CS","utf8",4);r[2350]=new _(2350,"UCA1400_POLISH_NOPAD_AS_CI","utf8",4);r[2351]=new _(2351,"UCA1400_POLISH_NOPAD_AS_CS","utf8",4);r[2352]=new _(2352,"UCA1400_ESTONIAN_AI_CI","utf8",4);r[2353]=new _(2353,"UCA1400_ESTONIAN_AI_CS","utf8",4);r[2354]=new _(2354,"UCA1400_ESTONIAN_AS_CI","utf8",4);r[2355]=new _(2355,"UCA1400_ESTONIAN_AS_CS","utf8",4);r[2356]=new _(2356,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf8",4);r[2357]=new _(2357,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf8",4);r[2358]=new _(2358,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf8",4);r[2359]=new _(2359,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf8",4);r[2360]=new _(2360,"UCA1400_SPANISH_AI_CI","utf8",4);r[2361]=new _(2361,"UCA1400_SPANISH_AI_CS","utf8",4);r[2362]=new _(2362,"UCA1400_SPANISH_AS_CI","utf8",4);r[2363]=new _(2363,"UCA1400_SPANISH_AS_CS","utf8",4);r[2364]=new _(2364,"UCA1400_SPANISH_NOPAD_AI_CI","utf8",4);r[2365]=new _(2365,"UCA1400_SPANISH_NOPAD_AI_CS","utf8",4);r[2366]=new _(2366,"UCA1400_SPANISH_NOPAD_AS_CI","utf8",4);r[2367]=new _(2367,"UCA1400_SPANISH_NOPAD_AS_CS","utf8",4);r[2368]=new _(2368,"UCA1400_SWEDISH_AI_CI","utf8",4);r[2369]=new _(2369,"UCA1400_SWEDISH_AI_CS","utf8",4);r[2370]=new _(2370,"UCA1400_SWEDISH_AS_CI","utf8",4);r[2371]=new _(2371,"UCA1400_SWEDISH_AS_CS","utf8",4);r[2372]=new _(2372,"UCA1400_SWEDISH_NOPAD_AI_CI","utf8",4);r[2373]=new _(2373,"UCA1400_SWEDISH_NOPAD_AI_CS","utf8",4);r[2374]=new _(2374,"UCA1400_SWEDISH_NOPAD_AS_CI","utf8",4);r[2375]=new _(2375,"UCA1400_SWEDISH_NOPAD_AS_CS","utf8",4);r[2376]=new _(2376,"UCA1400_TURKISH_AI_CI","utf8",4);r[2377]=new _(2377,"UCA1400_TURKISH_AI_CS","utf8",4);r[2378]=new _(2378,"UCA1400_TURKISH_AS_CI","utf8",4);r[2379]=new _(2379,"UCA1400_TURKISH_AS_CS","utf8",4);r[2380]=new _(2380,"UCA1400_TURKISH_NOPAD_AI_CI","utf8",4);r[2381]=new _(2381,"UCA1400_TURKISH_NOPAD_AI_CS","utf8",4);r[2382]=new _(2382,"UCA1400_TURKISH_NOPAD_AS_CI","utf8",4);r[2383]=new _(2383,"UCA1400_TURKISH_NOPAD_AS_CS","utf8",4);r[2384]=new _(2384,"UCA1400_CZECH_AI_CI","utf8",4);r[2385]=new _(2385,"UCA1400_CZECH_AI_CS","utf8",4);r[2386]=new _(2386,"UCA1400_CZECH_AS_CI","utf8",4);r[2387]=new _(2387,"UCA1400_CZECH_AS_CS","utf8",4);r[2388]=new _(2388,"UCA1400_CZECH_NOPAD_AI_CI","utf8",4);r[2389]=new _(2389,"UCA1400_CZECH_NOPAD_AI_CS","utf8",4);r[2390]=new _(2390,"UCA1400_CZECH_NOPAD_AS_CI","utf8",4);r[2391]=new _(2391,"UCA1400_CZECH_NOPAD_AS_CS","utf8",4);r[2392]=new _(2392,"UCA1400_DANISH_AI_CI","utf8",4);r[2393]=new _(2393,"UCA1400_DANISH_AI_CS","utf8",4);r[2394]=new _(2394,"UCA1400_DANISH_AS_CI","utf8",4);r[2395]=new _(2395,"UCA1400_DANISH_AS_CS","utf8",4);r[2396]=new _(2396,"UCA1400_DANISH_NOPAD_AI_CI","utf8",4);r[2397]=new _(2397,"UCA1400_DANISH_NOPAD_AI_CS","utf8",4);r[2398]=new _(2398,"UCA1400_DANISH_NOPAD_AS_CI","utf8",4);r[2399]=new _(2399,"UCA1400_DANISH_NOPAD_AS_CS","utf8",4);r[2400]=new _(2400,"UCA1400_LITHUANIAN_AI_CI","utf8",4);r[2401]=new _(2401,"UCA1400_LITHUANIAN_AI_CS","utf8",4);r[2402]=new _(2402,"UCA1400_LITHUANIAN_AS_CI","utf8",4);r[2403]=new _(2403,"UCA1400_LITHUANIAN_AS_CS","utf8",4);r[2404]=new _(2404,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf8",4);r[2405]=new _(2405,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf8",4);r[2406]=new _(2406,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf8",4);r[2407]=new _(2407,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf8",4);r[2408]=new _(2408,"UCA1400_SLOVAK_AI_CI","utf8",4);r[2409]=new _(2409,"UCA1400_SLOVAK_AI_CS","utf8",4);r[2410]=new _(2410,"UCA1400_SLOVAK_AS_CI","utf8",4);r[2411]=new _(2411,"UCA1400_SLOVAK_AS_CS","utf8",4);r[2412]=new _(2412,"UCA1400_SLOVAK_NOPAD_AI_CI","utf8",4);r[2413]=new _(2413,"UCA1400_SLOVAK_NOPAD_AI_CS","utf8",4);r[2414]=new _(2414,"UCA1400_SLOVAK_NOPAD_AS_CI","utf8",4);r[2415]=new _(2415,"UCA1400_SLOVAK_NOPAD_AS_CS","utf8",4);r[2416]=new _(2416,"UCA1400_SPANISH2_AI_CI","utf8",4);r[2417]=new _(2417,"UCA1400_SPANISH2_AI_CS","utf8",4);r[2418]=new _(2418,"UCA1400_SPANISH2_AS_CI","utf8",4);r[2419]=new _(2419,"UCA1400_SPANISH2_AS_CS","utf8",4);r[2420]=new _(2420,"UCA1400_SPANISH2_NOPAD_AI_CI","utf8",4);r[2421]=new _(2421,"UCA1400_SPANISH2_NOPAD_AI_CS","utf8",4);r[2422]=new _(2422,"UCA1400_SPANISH2_NOPAD_AS_CI","utf8",4);r[2423]=new _(2423,"UCA1400_SPANISH2_NOPAD_AS_CS","utf8",4);r[2424]=new _(2424,"UCA1400_ROMAN_AI_CI","utf8",4);r[2425]=new _(2425,"UCA1400_ROMAN_AI_CS","utf8",4);r[2426]=new _(2426,"UCA1400_ROMAN_AS_CI","utf8",4);r[2427]=new _(2427,"UCA1400_ROMAN_AS_CS","utf8",4);r[2428]=new _(2428,"UCA1400_ROMAN_NOPAD_AI_CI","utf8",4);r[2429]=new _(2429,"UCA1400_ROMAN_NOPAD_AI_CS","utf8",4);r[2430]=new _(2430,"UCA1400_ROMAN_NOPAD_AS_CI","utf8",4);r[2431]=new _(2431,"UCA1400_ROMAN_NOPAD_AS_CS","utf8",4);r[2432]=new _(2432,"UCA1400_PERSIAN_AI_CI","utf8",4);r[2433]=new _(2433,"UCA1400_PERSIAN_AI_CS","utf8",4);r[2434]=new _(2434,"UCA1400_PERSIAN_AS_CI","utf8",4);r[2435]=new _(2435,"UCA1400_PERSIAN_AS_CS","utf8",4);r[2436]=new _(2436,"UCA1400_PERSIAN_NOPAD_AI_CI","utf8",4);r[2437]=new _(2437,"UCA1400_PERSIAN_NOPAD_AI_CS","utf8",4);r[2438]=new _(2438,"UCA1400_PERSIAN_NOPAD_AS_CI","utf8",4);r[2439]=new _(2439,"UCA1400_PERSIAN_NOPAD_AS_CS","utf8",4);r[2440]=new _(2440,"UCA1400_ESPERANTO_AI_CI","utf8",4);r[2441]=new _(2441,"UCA1400_ESPERANTO_AI_CS","utf8",4);r[2442]=new _(2442,"UCA1400_ESPERANTO_AS_CI","utf8",4);r[2443]=new _(2443,"UCA1400_ESPERANTO_AS_CS","utf8",4);r[2444]=new _(2444,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf8",4);r[2445]=new _(2445,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf8",4);r[2446]=new _(2446,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf8",4);r[2447]=new _(2447,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf8",4);r[2448]=new _(2448,"UCA1400_HUNGARIAN_AI_CI","utf8",4);r[2449]=new _(2449,"UCA1400_HUNGARIAN_AI_CS","utf8",4);r[2450]=new _(2450,"UCA1400_HUNGARIAN_AS_CI","utf8",4);r[2451]=new _(2451,"UCA1400_HUNGARIAN_AS_CS","utf8",4);r[2452]=new _(2452,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf8",4);r[2453]=new _(2453,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf8",4);r[2454]=new _(2454,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf8",4);r[2455]=new _(2455,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf8",4);r[2456]=new _(2456,"UCA1400_SINHALA_AI_CI","utf8",4);r[2457]=new _(2457,"UCA1400_SINHALA_AI_CS","utf8",4);r[2458]=new _(2458,"UCA1400_SINHALA_AS_CI","utf8",4);r[2459]=new _(2459,"UCA1400_SINHALA_AS_CS","utf8",4);r[2460]=new _(2460,"UCA1400_SINHALA_NOPAD_AI_CI","utf8",4);r[2461]=new _(2461,"UCA1400_SINHALA_NOPAD_AI_CS","utf8",4);r[2462]=new _(2462,"UCA1400_SINHALA_NOPAD_AS_CI","utf8",4);r[2463]=new _(2463,"UCA1400_SINHALA_NOPAD_AS_CS","utf8",4);r[2464]=new _(2464,"UCA1400_GERMAN2_AI_CI","utf8",4);r[2465]=new _(2465,"UCA1400_GERMAN2_AI_CS","utf8",4);r[2466]=new _(2466,"UCA1400_GERMAN2_AS_CI","utf8",4);r[2467]=new _(2467,"UCA1400_GERMAN2_AS_CS","utf8",4);r[2468]=new _(2468,"UCA1400_GERMAN2_NOPAD_AI_CI","utf8",4);r[2469]=new _(2469,"UCA1400_GERMAN2_NOPAD_AI_CS","utf8",4);r[2470]=new _(2470,"UCA1400_GERMAN2_NOPAD_AS_CI","utf8",4);r[2471]=new _(2471,"UCA1400_GERMAN2_NOPAD_AS_CS","utf8",4);r[2488]=new _(2488,"UCA1400_VIETNAMESE_AI_CI","utf8",4);r[2489]=new _(2489,"UCA1400_VIETNAMESE_AI_CS","utf8",4);r[2490]=new _(2490,"UCA1400_VIETNAMESE_AS_CI","utf8",4);r[2491]=new _(2491,"UCA1400_VIETNAMESE_AS_CS","utf8",4);r[2492]=new _(2492,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf8",4);r[2493]=new _(2493,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf8",4);r[2494]=new _(2494,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf8",4);r[2495]=new _(2495,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf8",4);r[2496]=new _(2496,"UCA1400_CROATIAN_AI_CI","utf8",4);r[2497]=new _(2497,"UCA1400_CROATIAN_AI_CS","utf8",4);r[2498]=new _(2498,"UCA1400_CROATIAN_AS_CI","utf8",4);r[2499]=new _(2499,"UCA1400_CROATIAN_AS_CS","utf8",4);r[2500]=new _(2500,"UCA1400_CROATIAN_NOPAD_AI_CI","utf8",4);r[2501]=new _(2501,"UCA1400_CROATIAN_NOPAD_AI_CS","utf8",4);r[2502]=new _(2502,"UCA1400_CROATIAN_NOPAD_AS_CI","utf8",4);r[2503]=new _(2503,"UCA1400_CROATIAN_NOPAD_AS_CS","utf8",4);r[2560]=new _(2560,"UCA1400_AI_CI","ucs2",2);r[2561]=new _(2561,"UCA1400_AI_CS","ucs2",2);r[2562]=new _(2562,"UCA1400_AS_CI","ucs2",2);r[2563]=new _(2563,"UCA1400_AS_CS","ucs2",2);r[2564]=new _(2564,"UCA1400_NOPAD_AI_CI","ucs2",2);r[2565]=new _(2565,"UCA1400_NOPAD_AI_CS","ucs2",2);r[2566]=new _(2566,"UCA1400_NOPAD_AS_CI","ucs2",2);r[2567]=new _(2567,"UCA1400_NOPAD_AS_CS","ucs2",2);r[2568]=new _(2568,"UCA1400_ICELANDIC_AI_CI","ucs2",2);r[2569]=new _(2569,"UCA1400_ICELANDIC_AI_CS","ucs2",2);r[2570]=new _(2570,"UCA1400_ICELANDIC_AS_CI","ucs2",2);r[2571]=new _(2571,"UCA1400_ICELANDIC_AS_CS","ucs2",2);r[2572]=new _(2572,"UCA1400_ICELANDIC_NOPAD_AI_CI","ucs2",2);r[2573]=new _(2573,"UCA1400_ICELANDIC_NOPAD_AI_CS","ucs2",2);r[2574]=new _(2574,"UCA1400_ICELANDIC_NOPAD_AS_CI","ucs2",2);r[2575]=new _(2575,"UCA1400_ICELANDIC_NOPAD_AS_CS","ucs2",2);r[2576]=new _(2576,"UCA1400_LATVIAN_AI_CI","ucs2",2);r[2577]=new _(2577,"UCA1400_LATVIAN_AI_CS","ucs2",2);r[2578]=new _(2578,"UCA1400_LATVIAN_AS_CI","ucs2",2);r[2579]=new _(2579,"UCA1400_LATVIAN_AS_CS","ucs2",2);r[2580]=new _(2580,"UCA1400_LATVIAN_NOPAD_AI_CI","ucs2",2);r[2581]=new _(2581,"UCA1400_LATVIAN_NOPAD_AI_CS","ucs2",2);r[2582]=new _(2582,"UCA1400_LATVIAN_NOPAD_AS_CI","ucs2",2);r[2583]=new _(2583,"UCA1400_LATVIAN_NOPAD_AS_CS","ucs2",2);r[2584]=new _(2584,"UCA1400_ROMANIAN_AI_CI","ucs2",2);r[2585]=new _(2585,"UCA1400_ROMANIAN_AI_CS","ucs2",2);r[2586]=new _(2586,"UCA1400_ROMANIAN_AS_CI","ucs2",2);r[2587]=new _(2587,"UCA1400_ROMANIAN_AS_CS","ucs2",2);r[2588]=new _(2588,"UCA1400_ROMANIAN_NOPAD_AI_CI","ucs2",2);r[2589]=new _(2589,"UCA1400_ROMANIAN_NOPAD_AI_CS","ucs2",2);r[2590]=new _(2590,"UCA1400_ROMANIAN_NOPAD_AS_CI","ucs2",2);r[2591]=new _(2591,"UCA1400_ROMANIAN_NOPAD_AS_CS","ucs2",2);r[2592]=new _(2592,"UCA1400_SLOVENIAN_AI_CI","ucs2",2);r[2593]=new _(2593,"UCA1400_SLOVENIAN_AI_CS","ucs2",2);r[2594]=new _(2594,"UCA1400_SLOVENIAN_AS_CI","ucs2",2);r[2595]=new _(2595,"UCA1400_SLOVENIAN_AS_CS","ucs2",2);r[2596]=new _(2596,"UCA1400_SLOVENIAN_NOPAD_AI_CI","ucs2",2);r[2597]=new _(2597,"UCA1400_SLOVENIAN_NOPAD_AI_CS","ucs2",2);r[2598]=new _(2598,"UCA1400_SLOVENIAN_NOPAD_AS_CI","ucs2",2);r[2599]=new _(2599,"UCA1400_SLOVENIAN_NOPAD_AS_CS","ucs2",2);r[2600]=new _(2600,"UCA1400_POLISH_AI_CI","ucs2",2);r[2601]=new _(2601,"UCA1400_POLISH_AI_CS","ucs2",2);r[2602]=new _(2602,"UCA1400_POLISH_AS_CI","ucs2",2);r[2603]=new _(2603,"UCA1400_POLISH_AS_CS","ucs2",2);r[2604]=new _(2604,"UCA1400_POLISH_NOPAD_AI_CI","ucs2",2);r[2605]=new _(2605,"UCA1400_POLISH_NOPAD_AI_CS","ucs2",2);r[2606]=new _(2606,"UCA1400_POLISH_NOPAD_AS_CI","ucs2",2);r[2607]=new _(2607,"UCA1400_POLISH_NOPAD_AS_CS","ucs2",2);r[2608]=new _(2608,"UCA1400_ESTONIAN_AI_CI","ucs2",2);r[2609]=new _(2609,"UCA1400_ESTONIAN_AI_CS","ucs2",2);r[2610]=new _(2610,"UCA1400_ESTONIAN_AS_CI","ucs2",2);r[2611]=new _(2611,"UCA1400_ESTONIAN_AS_CS","ucs2",2);r[2612]=new _(2612,"UCA1400_ESTONIAN_NOPAD_AI_CI","ucs2",2);r[2613]=new _(2613,"UCA1400_ESTONIAN_NOPAD_AI_CS","ucs2",2);r[2614]=new _(2614,"UCA1400_ESTONIAN_NOPAD_AS_CI","ucs2",2);r[2615]=new _(2615,"UCA1400_ESTONIAN_NOPAD_AS_CS","ucs2",2);r[2616]=new _(2616,"UCA1400_SPANISH_AI_CI","ucs2",2);r[2617]=new _(2617,"UCA1400_SPANISH_AI_CS","ucs2",2);r[2618]=new _(2618,"UCA1400_SPANISH_AS_CI","ucs2",2);r[2619]=new _(2619,"UCA1400_SPANISH_AS_CS","ucs2",2);r[2620]=new _(2620,"UCA1400_SPANISH_NOPAD_AI_CI","ucs2",2);r[2621]=new _(2621,"UCA1400_SPANISH_NOPAD_AI_CS","ucs2",2);r[2622]=new _(2622,"UCA1400_SPANISH_NOPAD_AS_CI","ucs2",2);r[2623]=new _(2623,"UCA1400_SPANISH_NOPAD_AS_CS","ucs2",2);r[2624]=new _(2624,"UCA1400_SWEDISH_AI_CI","ucs2",2);r[2625]=new _(2625,"UCA1400_SWEDISH_AI_CS","ucs2",2);r[2626]=new _(2626,"UCA1400_SWEDISH_AS_CI","ucs2",2);r[2627]=new _(2627,"UCA1400_SWEDISH_AS_CS","ucs2",2);r[2628]=new _(2628,"UCA1400_SWEDISH_NOPAD_AI_CI","ucs2",2);r[2629]=new _(2629,"UCA1400_SWEDISH_NOPAD_AI_CS","ucs2",2);r[2630]=new _(2630,"UCA1400_SWEDISH_NOPAD_AS_CI","ucs2",2);r[2631]=new _(2631,"UCA1400_SWEDISH_NOPAD_AS_CS","ucs2",2);r[2632]=new _(2632,"UCA1400_TURKISH_AI_CI","ucs2",2);r[2633]=new _(2633,"UCA1400_TURKISH_AI_CS","ucs2",2);r[2634]=new _(2634,"UCA1400_TURKISH_AS_CI","ucs2",2);r[2635]=new _(2635,"UCA1400_TURKISH_AS_CS","ucs2",2);r[2636]=new _(2636,"UCA1400_TURKISH_NOPAD_AI_CI","ucs2",2);r[2637]=new _(2637,"UCA1400_TURKISH_NOPAD_AI_CS","ucs2",2);r[2638]=new _(2638,"UCA1400_TURKISH_NOPAD_AS_CI","ucs2",2);r[2639]=new _(2639,"UCA1400_TURKISH_NOPAD_AS_CS","ucs2",2);r[2640]=new _(2640,"UCA1400_CZECH_AI_CI","ucs2",2);r[2641]=new _(2641,"UCA1400_CZECH_AI_CS","ucs2",2);r[2642]=new _(2642,"UCA1400_CZECH_AS_CI","ucs2",2);r[2643]=new _(2643,"UCA1400_CZECH_AS_CS","ucs2",2);r[2644]=new _(2644,"UCA1400_CZECH_NOPAD_AI_CI","ucs2",2);r[2645]=new _(2645,"UCA1400_CZECH_NOPAD_AI_CS","ucs2",2);r[2646]=new _(2646,"UCA1400_CZECH_NOPAD_AS_CI","ucs2",2);r[2647]=new _(2647,"UCA1400_CZECH_NOPAD_AS_CS","ucs2",2);r[2648]=new _(2648,"UCA1400_DANISH_AI_CI","ucs2",2);r[2649]=new _(2649,"UCA1400_DANISH_AI_CS","ucs2",2);r[2650]=new _(2650,"UCA1400_DANISH_AS_CI","ucs2",2);r[2651]=new _(2651,"UCA1400_DANISH_AS_CS","ucs2",2);r[2652]=new _(2652,"UCA1400_DANISH_NOPAD_AI_CI","ucs2",2);r[2653]=new _(2653,"UCA1400_DANISH_NOPAD_AI_CS","ucs2",2);r[2654]=new _(2654,"UCA1400_DANISH_NOPAD_AS_CI","ucs2",2);r[2655]=new _(2655,"UCA1400_DANISH_NOPAD_AS_CS","ucs2",2);r[2656]=new _(2656,"UCA1400_LITHUANIAN_AI_CI","ucs2",2);r[2657]=new _(2657,"UCA1400_LITHUANIAN_AI_CS","ucs2",2);r[2658]=new _(2658,"UCA1400_LITHUANIAN_AS_CI","ucs2",2);r[2659]=new _(2659,"UCA1400_LITHUANIAN_AS_CS","ucs2",2);r[2660]=new _(2660,"UCA1400_LITHUANIAN_NOPAD_AI_CI","ucs2",2);r[2661]=new _(2661,"UCA1400_LITHUANIAN_NOPAD_AI_CS","ucs2",2);r[2662]=new _(2662,"UCA1400_LITHUANIAN_NOPAD_AS_CI","ucs2",2);r[2663]=new _(2663,"UCA1400_LITHUANIAN_NOPAD_AS_CS","ucs2",2);r[2664]=new _(2664,"UCA1400_SLOVAK_AI_CI","ucs2",2);r[2665]=new _(2665,"UCA1400_SLOVAK_AI_CS","ucs2",2);r[2666]=new _(2666,"UCA1400_SLOVAK_AS_CI","ucs2",2);r[2667]=new _(2667,"UCA1400_SLOVAK_AS_CS","ucs2",2);r[2668]=new _(2668,"UCA1400_SLOVAK_NOPAD_AI_CI","ucs2",2);r[2669]=new _(2669,"UCA1400_SLOVAK_NOPAD_AI_CS","ucs2",2);r[2670]=new _(2670,"UCA1400_SLOVAK_NOPAD_AS_CI","ucs2",2);r[2671]=new _(2671,"UCA1400_SLOVAK_NOPAD_AS_CS","ucs2",2);r[2672]=new _(2672,"UCA1400_SPANISH2_AI_CI","ucs2",2);r[2673]=new _(2673,"UCA1400_SPANISH2_AI_CS","ucs2",2);r[2674]=new _(2674,"UCA1400_SPANISH2_AS_CI","ucs2",2);r[2675]=new _(2675,"UCA1400_SPANISH2_AS_CS","ucs2",2);r[2676]=new _(2676,"UCA1400_SPANISH2_NOPAD_AI_CI","ucs2",2);r[2677]=new _(2677,"UCA1400_SPANISH2_NOPAD_AI_CS","ucs2",2);r[2678]=new _(2678,"UCA1400_SPANISH2_NOPAD_AS_CI","ucs2",2);r[2679]=new _(2679,"UCA1400_SPANISH2_NOPAD_AS_CS","ucs2",2);r[2680]=new _(2680,"UCA1400_ROMAN_AI_CI","ucs2",2);r[2681]=new _(2681,"UCA1400_ROMAN_AI_CS","ucs2",2);r[2682]=new _(2682,"UCA1400_ROMAN_AS_CI","ucs2",2);r[2683]=new _(2683,"UCA1400_ROMAN_AS_CS","ucs2",2);r[2684]=new _(2684,"UCA1400_ROMAN_NOPAD_AI_CI","ucs2",2);r[2685]=new _(2685,"UCA1400_ROMAN_NOPAD_AI_CS","ucs2",2);r[2686]=new _(2686,"UCA1400_ROMAN_NOPAD_AS_CI","ucs2",2);r[2687]=new _(2687,"UCA1400_ROMAN_NOPAD_AS_CS","ucs2",2);r[2688]=new _(2688,"UCA1400_PERSIAN_AI_CI","ucs2",2);r[2689]=new _(2689,"UCA1400_PERSIAN_AI_CS","ucs2",2);r[2690]=new _(2690,"UCA1400_PERSIAN_AS_CI","ucs2",2);r[2691]=new _(2691,"UCA1400_PERSIAN_AS_CS","ucs2",2);r[2692]=new _(2692,"UCA1400_PERSIAN_NOPAD_AI_CI","ucs2",2);r[2693]=new _(2693,"UCA1400_PERSIAN_NOPAD_AI_CS","ucs2",2);r[2694]=new _(2694,"UCA1400_PERSIAN_NOPAD_AS_CI","ucs2",2);r[2695]=new _(2695,"UCA1400_PERSIAN_NOPAD_AS_CS","ucs2",2);r[2696]=new _(2696,"UCA1400_ESPERANTO_AI_CI","ucs2",2);r[2697]=new _(2697,"UCA1400_ESPERANTO_AI_CS","ucs2",2);r[2698]=new _(2698,"UCA1400_ESPERANTO_AS_CI","ucs2",2);r[2699]=new _(2699,"UCA1400_ESPERANTO_AS_CS","ucs2",2);r[2700]=new _(2700,"UCA1400_ESPERANTO_NOPAD_AI_CI","ucs2",2);r[2701]=new _(2701,"UCA1400_ESPERANTO_NOPAD_AI_CS","ucs2",2);r[2702]=new _(2702,"UCA1400_ESPERANTO_NOPAD_AS_CI","ucs2",2);r[2703]=new _(2703,"UCA1400_ESPERANTO_NOPAD_AS_CS","ucs2",2);r[2704]=new _(2704,"UCA1400_HUNGARIAN_AI_CI","ucs2",2);r[2705]=new _(2705,"UCA1400_HUNGARIAN_AI_CS","ucs2",2);r[2706]=new _(2706,"UCA1400_HUNGARIAN_AS_CI","ucs2",2);r[2707]=new _(2707,"UCA1400_HUNGARIAN_AS_CS","ucs2",2);r[2708]=new _(2708,"UCA1400_HUNGARIAN_NOPAD_AI_CI","ucs2",2);r[2709]=new _(2709,"UCA1400_HUNGARIAN_NOPAD_AI_CS","ucs2",2);r[2710]=new _(2710,"UCA1400_HUNGARIAN_NOPAD_AS_CI","ucs2",2);r[2711]=new _(2711,"UCA1400_HUNGARIAN_NOPAD_AS_CS","ucs2",2);r[2712]=new _(2712,"UCA1400_SINHALA_AI_CI","ucs2",2);r[2713]=new _(2713,"UCA1400_SINHALA_AI_CS","ucs2",2);r[2714]=new _(2714,"UCA1400_SINHALA_AS_CI","ucs2",2);r[2715]=new _(2715,"UCA1400_SINHALA_AS_CS","ucs2",2);r[2716]=new _(2716,"UCA1400_SINHALA_NOPAD_AI_CI","ucs2",2);r[2717]=new _(2717,"UCA1400_SINHALA_NOPAD_AI_CS","ucs2",2);r[2718]=new _(2718,"UCA1400_SINHALA_NOPAD_AS_CI","ucs2",2);r[2719]=new _(2719,"UCA1400_SINHALA_NOPAD_AS_CS","ucs2",2);r[2720]=new _(2720,"UCA1400_GERMAN2_AI_CI","ucs2",2);r[2721]=new _(2721,"UCA1400_GERMAN2_AI_CS","ucs2",2);r[2722]=new _(2722,"UCA1400_GERMAN2_AS_CI","ucs2",2);r[2723]=new _(2723,"UCA1400_GERMAN2_AS_CS","ucs2",2);r[2724]=new _(2724,"UCA1400_GERMAN2_NOPAD_AI_CI","ucs2",2);r[2725]=new _(2725,"UCA1400_GERMAN2_NOPAD_AI_CS","ucs2",2);r[2726]=new _(2726,"UCA1400_GERMAN2_NOPAD_AS_CI","ucs2",2);r[2727]=new _(2727,"UCA1400_GERMAN2_NOPAD_AS_CS","ucs2",2);r[2744]=new _(2744,"UCA1400_VIETNAMESE_AI_CI","ucs2",2);r[2745]=new _(2745,"UCA1400_VIETNAMESE_AI_CS","ucs2",2);r[2746]=new _(2746,"UCA1400_VIETNAMESE_AS_CI","ucs2",2);r[2747]=new _(2747,"UCA1400_VIETNAMESE_AS_CS","ucs2",2);r[2748]=new _(2748,"UCA1400_VIETNAMESE_NOPAD_AI_CI","ucs2",2);r[2749]=new _(2749,"UCA1400_VIETNAMESE_NOPAD_AI_CS","ucs2",2);r[2750]=new _(2750,"UCA1400_VIETNAMESE_NOPAD_AS_CI","ucs2",2);r[2751]=new _(2751,"UCA1400_VIETNAMESE_NOPAD_AS_CS","ucs2",2);r[2752]=new _(2752,"UCA1400_CROATIAN_AI_CI","ucs2",2);r[2753]=new _(2753,"UCA1400_CROATIAN_AI_CS","ucs2",2);r[2754]=new _(2754,"UCA1400_CROATIAN_AS_CI","ucs2",2);r[2755]=new _(2755,"UCA1400_CROATIAN_AS_CS","ucs2",2);r[2756]=new _(2756,"UCA1400_CROATIAN_NOPAD_AI_CI","ucs2",2);r[2757]=new _(2757,"UCA1400_CROATIAN_NOPAD_AI_CS","ucs2",2);r[2758]=new _(2758,"UCA1400_CROATIAN_NOPAD_AS_CI","ucs2",2);r[2759]=new _(2759,"UCA1400_CROATIAN_NOPAD_AS_CS","ucs2",2);r[2816]=new _(2816,"UCA1400_AI_CI","utf16",4);r[2817]=new _(2817,"UCA1400_AI_CS","utf16",4);r[2818]=new _(2818,"UCA1400_AS_CI","utf16",4);r[2819]=new _(2819,"UCA1400_AS_CS","utf16",4);r[2820]=new _(2820,"UCA1400_NOPAD_AI_CI","utf16",4);r[2821]=new _(2821,"UCA1400_NOPAD_AI_CS","utf16",4);r[2822]=new _(2822,"UCA1400_NOPAD_AS_CI","utf16",4);r[2823]=new _(2823,"UCA1400_NOPAD_AS_CS","utf16",4);r[2824]=new _(2824,"UCA1400_ICELANDIC_AI_CI","utf16",4);r[2825]=new _(2825,"UCA1400_ICELANDIC_AI_CS","utf16",4);r[2826]=new _(2826,"UCA1400_ICELANDIC_AS_CI","utf16",4);r[2827]=new _(2827,"UCA1400_ICELANDIC_AS_CS","utf16",4);r[2828]=new _(2828,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf16",4);r[2829]=new _(2829,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf16",4);r[2830]=new _(2830,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf16",4);r[2831]=new _(2831,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf16",4);r[2832]=new _(2832,"UCA1400_LATVIAN_AI_CI","utf16",4);r[2833]=new _(2833,"UCA1400_LATVIAN_AI_CS","utf16",4);r[2834]=new _(2834,"UCA1400_LATVIAN_AS_CI","utf16",4);r[2835]=new _(2835,"UCA1400_LATVIAN_AS_CS","utf16",4);r[2836]=new _(2836,"UCA1400_LATVIAN_NOPAD_AI_CI","utf16",4);r[2837]=new _(2837,"UCA1400_LATVIAN_NOPAD_AI_CS","utf16",4);r[2838]=new _(2838,"UCA1400_LATVIAN_NOPAD_AS_CI","utf16",4);r[2839]=new _(2839,"UCA1400_LATVIAN_NOPAD_AS_CS","utf16",4);r[2840]=new _(2840,"UCA1400_ROMANIAN_AI_CI","utf16",4);r[2841]=new _(2841,"UCA1400_ROMANIAN_AI_CS","utf16",4);r[2842]=new _(2842,"UCA1400_ROMANIAN_AS_CI","utf16",4);r[2843]=new _(2843,"UCA1400_ROMANIAN_AS_CS","utf16",4);r[2844]=new _(2844,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf16",4);r[2845]=new _(2845,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf16",4);r[2846]=new _(2846,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf16",4);r[2847]=new _(2847,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf16",4);r[2848]=new _(2848,"UCA1400_SLOVENIAN_AI_CI","utf16",4);r[2849]=new _(2849,"UCA1400_SLOVENIAN_AI_CS","utf16",4);r[2850]=new _(2850,"UCA1400_SLOVENIAN_AS_CI","utf16",4);r[2851]=new _(2851,"UCA1400_SLOVENIAN_AS_CS","utf16",4);r[2852]=new _(2852,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf16",4);r[2853]=new _(2853,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf16",4);r[2854]=new _(2854,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf16",4);r[2855]=new _(2855,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf16",4);r[2856]=new _(2856,"UCA1400_POLISH_AI_CI","utf16",4);r[2857]=new _(2857,"UCA1400_POLISH_AI_CS","utf16",4);r[2858]=new _(2858,"UCA1400_POLISH_AS_CI","utf16",4);r[2859]=new _(2859,"UCA1400_POLISH_AS_CS","utf16",4);r[2860]=new _(2860,"UCA1400_POLISH_NOPAD_AI_CI","utf16",4);r[2861]=new _(2861,"UCA1400_POLISH_NOPAD_AI_CS","utf16",4);r[2862]=new _(2862,"UCA1400_POLISH_NOPAD_AS_CI","utf16",4);r[2863]=new _(2863,"UCA1400_POLISH_NOPAD_AS_CS","utf16",4);r[2864]=new _(2864,"UCA1400_ESTONIAN_AI_CI","utf16",4);r[2865]=new _(2865,"UCA1400_ESTONIAN_AI_CS","utf16",4);r[2866]=new _(2866,"UCA1400_ESTONIAN_AS_CI","utf16",4);r[2867]=new _(2867,"UCA1400_ESTONIAN_AS_CS","utf16",4);r[2868]=new _(2868,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf16",4);r[2869]=new _(2869,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf16",4);r[2870]=new _(2870,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf16",4);r[2871]=new _(2871,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf16",4);r[2872]=new _(2872,"UCA1400_SPANISH_AI_CI","utf16",4);r[2873]=new _(2873,"UCA1400_SPANISH_AI_CS","utf16",4);r[2874]=new _(2874,"UCA1400_SPANISH_AS_CI","utf16",4);r[2875]=new _(2875,"UCA1400_SPANISH_AS_CS","utf16",4);r[2876]=new _(2876,"UCA1400_SPANISH_NOPAD_AI_CI","utf16",4);r[2877]=new _(2877,"UCA1400_SPANISH_NOPAD_AI_CS","utf16",4);r[2878]=new _(2878,"UCA1400_SPANISH_NOPAD_AS_CI","utf16",4);r[2879]=new _(2879,"UCA1400_SPANISH_NOPAD_AS_CS","utf16",4);r[2880]=new _(2880,"UCA1400_SWEDISH_AI_CI","utf16",4);r[2881]=new _(2881,"UCA1400_SWEDISH_AI_CS","utf16",4);r[2882]=new _(2882,"UCA1400_SWEDISH_AS_CI","utf16",4);r[2883]=new _(2883,"UCA1400_SWEDISH_AS_CS","utf16",4);r[2884]=new _(2884,"UCA1400_SWEDISH_NOPAD_AI_CI","utf16",4);r[2885]=new _(2885,"UCA1400_SWEDISH_NOPAD_AI_CS","utf16",4);r[2886]=new _(2886,"UCA1400_SWEDISH_NOPAD_AS_CI","utf16",4);r[2887]=new _(2887,"UCA1400_SWEDISH_NOPAD_AS_CS","utf16",4);r[2888]=new _(2888,"UCA1400_TURKISH_AI_CI","utf16",4);r[2889]=new _(2889,"UCA1400_TURKISH_AI_CS","utf16",4);r[2890]=new _(2890,"UCA1400_TURKISH_AS_CI","utf16",4);r[2891]=new _(2891,"UCA1400_TURKISH_AS_CS","utf16",4);r[2892]=new _(2892,"UCA1400_TURKISH_NOPAD_AI_CI","utf16",4);r[2893]=new _(2893,"UCA1400_TURKISH_NOPAD_AI_CS","utf16",4);r[2894]=new _(2894,"UCA1400_TURKISH_NOPAD_AS_CI","utf16",4);r[2895]=new _(2895,"UCA1400_TURKISH_NOPAD_AS_CS","utf16",4);r[2896]=new _(2896,"UCA1400_CZECH_AI_CI","utf16",4);r[2897]=new _(2897,"UCA1400_CZECH_AI_CS","utf16",4);r[2898]=new _(2898,"UCA1400_CZECH_AS_CI","utf16",4);r[2899]=new _(2899,"UCA1400_CZECH_AS_CS","utf16",4);r[2900]=new _(2900,"UCA1400_CZECH_NOPAD_AI_CI","utf16",4);r[2901]=new _(2901,"UCA1400_CZECH_NOPAD_AI_CS","utf16",4);r[2902]=new _(2902,"UCA1400_CZECH_NOPAD_AS_CI","utf16",4);r[2903]=new _(2903,"UCA1400_CZECH_NOPAD_AS_CS","utf16",4);r[2904]=new _(2904,"UCA1400_DANISH_AI_CI","utf16",4);r[2905]=new _(2905,"UCA1400_DANISH_AI_CS","utf16",4);r[2906]=new _(2906,"UCA1400_DANISH_AS_CI","utf16",4);r[2907]=new _(2907,"UCA1400_DANISH_AS_CS","utf16",4);r[2908]=new _(2908,"UCA1400_DANISH_NOPAD_AI_CI","utf16",4);r[2909]=new _(2909,"UCA1400_DANISH_NOPAD_AI_CS","utf16",4);r[2910]=new _(2910,"UCA1400_DANISH_NOPAD_AS_CI","utf16",4);r[2911]=new _(2911,"UCA1400_DANISH_NOPAD_AS_CS","utf16",4);r[2912]=new _(2912,"UCA1400_LITHUANIAN_AI_CI","utf16",4);r[2913]=new _(2913,"UCA1400_LITHUANIAN_AI_CS","utf16",4);r[2914]=new _(2914,"UCA1400_LITHUANIAN_AS_CI","utf16",4);r[2915]=new _(2915,"UCA1400_LITHUANIAN_AS_CS","utf16",4);r[2916]=new _(2916,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf16",4);r[2917]=new _(2917,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf16",4);r[2918]=new _(2918,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf16",4);r[2919]=new _(2919,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf16",4);r[2920]=new _(2920,"UCA1400_SLOVAK_AI_CI","utf16",4);r[2921]=new _(2921,"UCA1400_SLOVAK_AI_CS","utf16",4);r[2922]=new _(2922,"UCA1400_SLOVAK_AS_CI","utf16",4);r[2923]=new _(2923,"UCA1400_SLOVAK_AS_CS","utf16",4);r[2924]=new _(2924,"UCA1400_SLOVAK_NOPAD_AI_CI","utf16",4);r[2925]=new _(2925,"UCA1400_SLOVAK_NOPAD_AI_CS","utf16",4);r[2926]=new _(2926,"UCA1400_SLOVAK_NOPAD_AS_CI","utf16",4);r[2927]=new _(2927,"UCA1400_SLOVAK_NOPAD_AS_CS","utf16",4);r[2928]=new _(2928,"UCA1400_SPANISH2_AI_CI","utf16",4);r[2929]=new _(2929,"UCA1400_SPANISH2_AI_CS","utf16",4);r[2930]=new _(2930,"UCA1400_SPANISH2_AS_CI","utf16",4);r[2931]=new _(2931,"UCA1400_SPANISH2_AS_CS","utf16",4);r[2932]=new _(2932,"UCA1400_SPANISH2_NOPAD_AI_CI","utf16",4);r[2933]=new _(2933,"UCA1400_SPANISH2_NOPAD_AI_CS","utf16",4);r[2934]=new _(2934,"UCA1400_SPANISH2_NOPAD_AS_CI","utf16",4);r[2935]=new _(2935,"UCA1400_SPANISH2_NOPAD_AS_CS","utf16",4);r[2936]=new _(2936,"UCA1400_ROMAN_AI_CI","utf16",4);r[2937]=new _(2937,"UCA1400_ROMAN_AI_CS","utf16",4);r[2938]=new _(2938,"UCA1400_ROMAN_AS_CI","utf16",4);r[2939]=new _(2939,"UCA1400_ROMAN_AS_CS","utf16",4);r[2940]=new _(2940,"UCA1400_ROMAN_NOPAD_AI_CI","utf16",4);r[2941]=new _(2941,"UCA1400_ROMAN_NOPAD_AI_CS","utf16",4);r[2942]=new _(2942,"UCA1400_ROMAN_NOPAD_AS_CI","utf16",4);r[2943]=new _(2943,"UCA1400_ROMAN_NOPAD_AS_CS","utf16",4);r[2944]=new _(2944,"UCA1400_PERSIAN_AI_CI","utf16",4);r[2945]=new _(2945,"UCA1400_PERSIAN_AI_CS","utf16",4);r[2946]=new _(2946,"UCA1400_PERSIAN_AS_CI","utf16",4);r[2947]=new _(2947,"UCA1400_PERSIAN_AS_CS","utf16",4);r[2948]=new _(2948,"UCA1400_PERSIAN_NOPAD_AI_CI","utf16",4);r[2949]=new _(2949,"UCA1400_PERSIAN_NOPAD_AI_CS","utf16",4);r[2950]=new _(2950,"UCA1400_PERSIAN_NOPAD_AS_CI","utf16",4);r[2951]=new _(2951,"UCA1400_PERSIAN_NOPAD_AS_CS","utf16",4);r[2952]=new _(2952,"UCA1400_ESPERANTO_AI_CI","utf16",4);r[2953]=new _(2953,"UCA1400_ESPERANTO_AI_CS","utf16",4);r[2954]=new _(2954,"UCA1400_ESPERANTO_AS_CI","utf16",4);r[2955]=new _(2955,"UCA1400_ESPERANTO_AS_CS","utf16",4);r[2956]=new _(2956,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf16",4);r[2957]=new _(2957,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf16",4);r[2958]=new _(2958,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf16",4);r[2959]=new _(2959,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf16",4);r[2960]=new _(2960,"UCA1400_HUNGARIAN_AI_CI","utf16",4);r[2961]=new _(2961,"UCA1400_HUNGARIAN_AI_CS","utf16",4);r[2962]=new _(2962,"UCA1400_HUNGARIAN_AS_CI","utf16",4);r[2963]=new _(2963,"UCA1400_HUNGARIAN_AS_CS","utf16",4);r[2964]=new _(2964,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf16",4);r[2965]=new _(2965,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf16",4);r[2966]=new _(2966,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf16",4);r[2967]=new _(2967,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf16",4);r[2968]=new _(2968,"UCA1400_SINHALA_AI_CI","utf16",4);r[2969]=new _(2969,"UCA1400_SINHALA_AI_CS","utf16",4);r[2970]=new _(2970,"UCA1400_SINHALA_AS_CI","utf16",4);r[2971]=new _(2971,"UCA1400_SINHALA_AS_CS","utf16",4);r[2972]=new _(2972,"UCA1400_SINHALA_NOPAD_AI_CI","utf16",4);r[2973]=new _(2973,"UCA1400_SINHALA_NOPAD_AI_CS","utf16",4);r[2974]=new _(2974,"UCA1400_SINHALA_NOPAD_AS_CI","utf16",4);r[2975]=new _(2975,"UCA1400_SINHALA_NOPAD_AS_CS","utf16",4);r[2976]=new _(2976,"UCA1400_GERMAN2_AI_CI","utf16",4);r[2977]=new _(2977,"UCA1400_GERMAN2_AI_CS","utf16",4);r[2978]=new _(2978,"UCA1400_GERMAN2_AS_CI","utf16",4);r[2979]=new _(2979,"UCA1400_GERMAN2_AS_CS","utf16",4);r[2980]=new _(2980,"UCA1400_GERMAN2_NOPAD_AI_CI","utf16",4);r[2981]=new _(2981,"UCA1400_GERMAN2_NOPAD_AI_CS","utf16",4);r[2982]=new _(2982,"UCA1400_GERMAN2_NOPAD_AS_CI","utf16",4);r[2983]=new _(2983,"UCA1400_GERMAN2_NOPAD_AS_CS","utf16",4);r[3e3]=new _(3e3,"UCA1400_VIETNAMESE_AI_CI","utf16",4);r[3001]=new _(3001,"UCA1400_VIETNAMESE_AI_CS","utf16",4);r[3002]=new _(3002,"UCA1400_VIETNAMESE_AS_CI","utf16",4);r[3003]=new _(3003,"UCA1400_VIETNAMESE_AS_CS","utf16",4);r[3004]=new _(3004,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf16",4);r[3005]=new _(3005,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf16",4);r[3006]=new _(3006,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf16",4);r[3007]=new _(3007,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf16",4);r[3008]=new _(3008,"UCA1400_CROATIAN_AI_CI","utf16",4);r[3009]=new _(3009,"UCA1400_CROATIAN_AI_CS","utf16",4);r[3010]=new _(3010,"UCA1400_CROATIAN_AS_CI","utf16",4);r[3011]=new _(3011,"UCA1400_CROATIAN_AS_CS","utf16",4);r[3012]=new _(3012,"UCA1400_CROATIAN_NOPAD_AI_CI","utf16",4);r[3013]=new _(3013,"UCA1400_CROATIAN_NOPAD_AI_CS","utf16",4);r[3014]=new _(3014,"UCA1400_CROATIAN_NOPAD_AS_CI","utf16",4);r[3015]=new _(3015,"UCA1400_CROATIAN_NOPAD_AS_CS","utf16",4);r[3072]=new _(3072,"UCA1400_AI_CI","utf32",4);r[3073]=new _(3073,"UCA1400_AI_CS","utf32",4);r[3074]=new _(3074,"UCA1400_AS_CI","utf32",4);r[3075]=new _(3075,"UCA1400_AS_CS","utf32",4);r[3076]=new _(3076,"UCA1400_NOPAD_AI_CI","utf32",4);r[3077]=new _(3077,"UCA1400_NOPAD_AI_CS","utf32",4);r[3078]=new _(3078,"UCA1400_NOPAD_AS_CI","utf32",4);r[3079]=new _(3079,"UCA1400_NOPAD_AS_CS","utf32",4);r[3080]=new _(3080,"UCA1400_ICELANDIC_AI_CI","utf32",4);r[3081]=new _(3081,"UCA1400_ICELANDIC_AI_CS","utf32",4);r[3082]=new _(3082,"UCA1400_ICELANDIC_AS_CI","utf32",4);r[3083]=new _(3083,"UCA1400_ICELANDIC_AS_CS","utf32",4);r[3084]=new _(3084,"UCA1400_ICELANDIC_NOPAD_AI_CI","utf32",4);r[3085]=new _(3085,"UCA1400_ICELANDIC_NOPAD_AI_CS","utf32",4);r[3086]=new _(3086,"UCA1400_ICELANDIC_NOPAD_AS_CI","utf32",4);r[3087]=new _(3087,"UCA1400_ICELANDIC_NOPAD_AS_CS","utf32",4);r[3088]=new _(3088,"UCA1400_LATVIAN_AI_CI","utf32",4);r[3089]=new _(3089,"UCA1400_LATVIAN_AI_CS","utf32",4);r[3090]=new _(3090,"UCA1400_LATVIAN_AS_CI","utf32",4);r[3091]=new _(3091,"UCA1400_LATVIAN_AS_CS","utf32",4);r[3092]=new _(3092,"UCA1400_LATVIAN_NOPAD_AI_CI","utf32",4);r[3093]=new _(3093,"UCA1400_LATVIAN_NOPAD_AI_CS","utf32",4);r[3094]=new _(3094,"UCA1400_LATVIAN_NOPAD_AS_CI","utf32",4);r[3095]=new _(3095,"UCA1400_LATVIAN_NOPAD_AS_CS","utf32",4);r[3096]=new _(3096,"UCA1400_ROMANIAN_AI_CI","utf32",4);r[3097]=new _(3097,"UCA1400_ROMANIAN_AI_CS","utf32",4);r[3098]=new _(3098,"UCA1400_ROMANIAN_AS_CI","utf32",4);r[3099]=new _(3099,"UCA1400_ROMANIAN_AS_CS","utf32",4);r[3100]=new _(3100,"UCA1400_ROMANIAN_NOPAD_AI_CI","utf32",4);r[3101]=new _(3101,"UCA1400_ROMANIAN_NOPAD_AI_CS","utf32",4);r[3102]=new _(3102,"UCA1400_ROMANIAN_NOPAD_AS_CI","utf32",4);r[3103]=new _(3103,"UCA1400_ROMANIAN_NOPAD_AS_CS","utf32",4);r[3104]=new _(3104,"UCA1400_SLOVENIAN_AI_CI","utf32",4);r[3105]=new _(3105,"UCA1400_SLOVENIAN_AI_CS","utf32",4);r[3106]=new _(3106,"UCA1400_SLOVENIAN_AS_CI","utf32",4);r[3107]=new _(3107,"UCA1400_SLOVENIAN_AS_CS","utf32",4);r[3108]=new _(3108,"UCA1400_SLOVENIAN_NOPAD_AI_CI","utf32",4);r[3109]=new _(3109,"UCA1400_SLOVENIAN_NOPAD_AI_CS","utf32",4);r[3110]=new _(3110,"UCA1400_SLOVENIAN_NOPAD_AS_CI","utf32",4);r[3111]=new _(3111,"UCA1400_SLOVENIAN_NOPAD_AS_CS","utf32",4);r[3112]=new _(3112,"UCA1400_POLISH_AI_CI","utf32",4);r[3113]=new _(3113,"UCA1400_POLISH_AI_CS","utf32",4);r[3114]=new _(3114,"UCA1400_POLISH_AS_CI","utf32",4);r[3115]=new _(3115,"UCA1400_POLISH_AS_CS","utf32",4);r[3116]=new _(3116,"UCA1400_POLISH_NOPAD_AI_CI","utf32",4);r[3117]=new _(3117,"UCA1400_POLISH_NOPAD_AI_CS","utf32",4);r[3118]=new _(3118,"UCA1400_POLISH_NOPAD_AS_CI","utf32",4);r[3119]=new _(3119,"UCA1400_POLISH_NOPAD_AS_CS","utf32",4);r[3120]=new _(3120,"UCA1400_ESTONIAN_AI_CI","utf32",4);r[3121]=new _(3121,"UCA1400_ESTONIAN_AI_CS","utf32",4);r[3122]=new _(3122,"UCA1400_ESTONIAN_AS_CI","utf32",4);r[3123]=new _(3123,"UCA1400_ESTONIAN_AS_CS","utf32",4);r[3124]=new _(3124,"UCA1400_ESTONIAN_NOPAD_AI_CI","utf32",4);r[3125]=new _(3125,"UCA1400_ESTONIAN_NOPAD_AI_CS","utf32",4);r[3126]=new _(3126,"UCA1400_ESTONIAN_NOPAD_AS_CI","utf32",4);r[3127]=new _(3127,"UCA1400_ESTONIAN_NOPAD_AS_CS","utf32",4);r[3128]=new _(3128,"UCA1400_SPANISH_AI_CI","utf32",4);r[3129]=new _(3129,"UCA1400_SPANISH_AI_CS","utf32",4);r[3130]=new _(3130,"UCA1400_SPANISH_AS_CI","utf32",4);r[3131]=new _(3131,"UCA1400_SPANISH_AS_CS","utf32",4);r[3132]=new _(3132,"UCA1400_SPANISH_NOPAD_AI_CI","utf32",4);r[3133]=new _(3133,"UCA1400_SPANISH_NOPAD_AI_CS","utf32",4);r[3134]=new _(3134,"UCA1400_SPANISH_NOPAD_AS_CI","utf32",4);r[3135]=new _(3135,"UCA1400_SPANISH_NOPAD_AS_CS","utf32",4);r[3136]=new _(3136,"UCA1400_SWEDISH_AI_CI","utf32",4);r[3137]=new _(3137,"UCA1400_SWEDISH_AI_CS","utf32",4);r[3138]=new _(3138,"UCA1400_SWEDISH_AS_CI","utf32",4);r[3139]=new _(3139,"UCA1400_SWEDISH_AS_CS","utf32",4);r[3140]=new _(3140,"UCA1400_SWEDISH_NOPAD_AI_CI","utf32",4);r[3141]=new _(3141,"UCA1400_SWEDISH_NOPAD_AI_CS","utf32",4);r[3142]=new _(3142,"UCA1400_SWEDISH_NOPAD_AS_CI","utf32",4);r[3143]=new _(3143,"UCA1400_SWEDISH_NOPAD_AS_CS","utf32",4);r[3144]=new _(3144,"UCA1400_TURKISH_AI_CI","utf32",4);r[3145]=new _(3145,"UCA1400_TURKISH_AI_CS","utf32",4);r[3146]=new _(3146,"UCA1400_TURKISH_AS_CI","utf32",4);r[3147]=new _(3147,"UCA1400_TURKISH_AS_CS","utf32",4);r[3148]=new _(3148,"UCA1400_TURKISH_NOPAD_AI_CI","utf32",4);r[3149]=new _(3149,"UCA1400_TURKISH_NOPAD_AI_CS","utf32",4);r[3150]=new _(3150,"UCA1400_TURKISH_NOPAD_AS_CI","utf32",4);r[3151]=new _(3151,"UCA1400_TURKISH_NOPAD_AS_CS","utf32",4);r[3152]=new _(3152,"UCA1400_CZECH_AI_CI","utf32",4);r[3153]=new _(3153,"UCA1400_CZECH_AI_CS","utf32",4);r[3154]=new _(3154,"UCA1400_CZECH_AS_CI","utf32",4);r[3155]=new _(3155,"UCA1400_CZECH_AS_CS","utf32",4);r[3156]=new _(3156,"UCA1400_CZECH_NOPAD_AI_CI","utf32",4);r[3157]=new _(3157,"UCA1400_CZECH_NOPAD_AI_CS","utf32",4);r[3158]=new _(3158,"UCA1400_CZECH_NOPAD_AS_CI","utf32",4);r[3159]=new _(3159,"UCA1400_CZECH_NOPAD_AS_CS","utf32",4);r[3160]=new _(3160,"UCA1400_DANISH_AI_CI","utf32",4);r[3161]=new _(3161,"UCA1400_DANISH_AI_CS","utf32",4);r[3162]=new _(3162,"UCA1400_DANISH_AS_CI","utf32",4);r[3163]=new _(3163,"UCA1400_DANISH_AS_CS","utf32",4);r[3164]=new _(3164,"UCA1400_DANISH_NOPAD_AI_CI","utf32",4);r[3165]=new _(3165,"UCA1400_DANISH_NOPAD_AI_CS","utf32",4);r[3166]=new _(3166,"UCA1400_DANISH_NOPAD_AS_CI","utf32",4);r[3167]=new _(3167,"UCA1400_DANISH_NOPAD_AS_CS","utf32",4);r[3168]=new _(3168,"UCA1400_LITHUANIAN_AI_CI","utf32",4);r[3169]=new _(3169,"UCA1400_LITHUANIAN_AI_CS","utf32",4);r[3170]=new _(3170,"UCA1400_LITHUANIAN_AS_CI","utf32",4);r[3171]=new _(3171,"UCA1400_LITHUANIAN_AS_CS","utf32",4);r[3172]=new _(3172,"UCA1400_LITHUANIAN_NOPAD_AI_CI","utf32",4);r[3173]=new _(3173,"UCA1400_LITHUANIAN_NOPAD_AI_CS","utf32",4);r[3174]=new _(3174,"UCA1400_LITHUANIAN_NOPAD_AS_CI","utf32",4);r[3175]=new _(3175,"UCA1400_LITHUANIAN_NOPAD_AS_CS","utf32",4);r[3176]=new _(3176,"UCA1400_SLOVAK_AI_CI","utf32",4);r[3177]=new _(3177,"UCA1400_SLOVAK_AI_CS","utf32",4);r[3178]=new _(3178,"UCA1400_SLOVAK_AS_CI","utf32",4);r[3179]=new _(3179,"UCA1400_SLOVAK_AS_CS","utf32",4);r[3180]=new _(3180,"UCA1400_SLOVAK_NOPAD_AI_CI","utf32",4);r[3181]=new _(3181,"UCA1400_SLOVAK_NOPAD_AI_CS","utf32",4);r[3182]=new _(3182,"UCA1400_SLOVAK_NOPAD_AS_CI","utf32",4);r[3183]=new _(3183,"UCA1400_SLOVAK_NOPAD_AS_CS","utf32",4);r[3184]=new _(3184,"UCA1400_SPANISH2_AI_CI","utf32",4);r[3185]=new _(3185,"UCA1400_SPANISH2_AI_CS","utf32",4);r[3186]=new _(3186,"UCA1400_SPANISH2_AS_CI","utf32",4);r[3187]=new _(3187,"UCA1400_SPANISH2_AS_CS","utf32",4);r[3188]=new _(3188,"UCA1400_SPANISH2_NOPAD_AI_CI","utf32",4);r[3189]=new _(3189,"UCA1400_SPANISH2_NOPAD_AI_CS","utf32",4);r[3190]=new _(3190,"UCA1400_SPANISH2_NOPAD_AS_CI","utf32",4);r[3191]=new _(3191,"UCA1400_SPANISH2_NOPAD_AS_CS","utf32",4);r[3192]=new _(3192,"UCA1400_ROMAN_AI_CI","utf32",4);r[3193]=new _(3193,"UCA1400_ROMAN_AI_CS","utf32",4);r[3194]=new _(3194,"UCA1400_ROMAN_AS_CI","utf32",4);r[3195]=new _(3195,"UCA1400_ROMAN_AS_CS","utf32",4);r[3196]=new _(3196,"UCA1400_ROMAN_NOPAD_AI_CI","utf32",4);r[3197]=new _(3197,"UCA1400_ROMAN_NOPAD_AI_CS","utf32",4);r[3198]=new _(3198,"UCA1400_ROMAN_NOPAD_AS_CI","utf32",4);r[3199]=new _(3199,"UCA1400_ROMAN_NOPAD_AS_CS","utf32",4);r[3200]=new _(3200,"UCA1400_PERSIAN_AI_CI","utf32",4);r[3201]=new _(3201,"UCA1400_PERSIAN_AI_CS","utf32",4);r[3202]=new _(3202,"UCA1400_PERSIAN_AS_CI","utf32",4);r[3203]=new _(3203,"UCA1400_PERSIAN_AS_CS","utf32",4);r[3204]=new _(3204,"UCA1400_PERSIAN_NOPAD_AI_CI","utf32",4);r[3205]=new _(3205,"UCA1400_PERSIAN_NOPAD_AI_CS","utf32",4);r[3206]=new _(3206,"UCA1400_PERSIAN_NOPAD_AS_CI","utf32",4);r[3207]=new _(3207,"UCA1400_PERSIAN_NOPAD_AS_CS","utf32",4);r[3208]=new _(3208,"UCA1400_ESPERANTO_AI_CI","utf32",4);r[3209]=new _(3209,"UCA1400_ESPERANTO_AI_CS","utf32",4);r[3210]=new _(3210,"UCA1400_ESPERANTO_AS_CI","utf32",4);r[3211]=new _(3211,"UCA1400_ESPERANTO_AS_CS","utf32",4);r[3212]=new _(3212,"UCA1400_ESPERANTO_NOPAD_AI_CI","utf32",4);r[3213]=new _(3213,"UCA1400_ESPERANTO_NOPAD_AI_CS","utf32",4);r[3214]=new _(3214,"UCA1400_ESPERANTO_NOPAD_AS_CI","utf32",4);r[3215]=new _(3215,"UCA1400_ESPERANTO_NOPAD_AS_CS","utf32",4);r[3216]=new _(3216,"UCA1400_HUNGARIAN_AI_CI","utf32",4);r[3217]=new _(3217,"UCA1400_HUNGARIAN_AI_CS","utf32",4);r[3218]=new _(3218,"UCA1400_HUNGARIAN_AS_CI","utf32",4);r[3219]=new _(3219,"UCA1400_HUNGARIAN_AS_CS","utf32",4);r[3220]=new _(3220,"UCA1400_HUNGARIAN_NOPAD_AI_CI","utf32",4);r[3221]=new _(3221,"UCA1400_HUNGARIAN_NOPAD_AI_CS","utf32",4);r[3222]=new _(3222,"UCA1400_HUNGARIAN_NOPAD_AS_CI","utf32",4);r[3223]=new _(3223,"UCA1400_HUNGARIAN_NOPAD_AS_CS","utf32",4);r[3224]=new _(3224,"UCA1400_SINHALA_AI_CI","utf32",4);r[3225]=new _(3225,"UCA1400_SINHALA_AI_CS","utf32",4);r[3226]=new _(3226,"UCA1400_SINHALA_AS_CI","utf32",4);r[3227]=new _(3227,"UCA1400_SINHALA_AS_CS","utf32",4);r[3228]=new _(3228,"UCA1400_SINHALA_NOPAD_AI_CI","utf32",4);r[3229]=new _(3229,"UCA1400_SINHALA_NOPAD_AI_CS","utf32",4);r[3230]=new _(3230,"UCA1400_SINHALA_NOPAD_AS_CI","utf32",4);r[3231]=new _(3231,"UCA1400_SINHALA_NOPAD_AS_CS","utf32",4);r[3232]=new _(3232,"UCA1400_GERMAN2_AI_CI","utf32",4);r[3233]=new _(3233,"UCA1400_GERMAN2_AI_CS","utf32",4);r[3234]=new _(3234,"UCA1400_GERMAN2_AS_CI","utf32",4);r[3235]=new _(3235,"UCA1400_GERMAN2_AS_CS","utf32",4);r[3236]=new _(3236,"UCA1400_GERMAN2_NOPAD_AI_CI","utf32",4);r[3237]=new _(3237,"UCA1400_GERMAN2_NOPAD_AI_CS","utf32",4);r[3238]=new _(3238,"UCA1400_GERMAN2_NOPAD_AS_CI","utf32",4);r[3239]=new _(3239,"UCA1400_GERMAN2_NOPAD_AS_CS","utf32",4);r[3256]=new _(3256,"UCA1400_VIETNAMESE_AI_CI","utf32",4);r[3257]=new _(3257,"UCA1400_VIETNAMESE_AI_CS","utf32",4);r[3258]=new _(3258,"UCA1400_VIETNAMESE_AS_CI","utf32",4);r[3259]=new _(3259,"UCA1400_VIETNAMESE_AS_CS","utf32",4);r[3260]=new _(3260,"UCA1400_VIETNAMESE_NOPAD_AI_CI","utf32",4);r[3261]=new _(3261,"UCA1400_VIETNAMESE_NOPAD_AI_CS","utf32",4);r[3262]=new _(3262,"UCA1400_VIETNAMESE_NOPAD_AS_CI","utf32",4);r[3263]=new _(3263,"UCA1400_VIETNAMESE_NOPAD_AS_CS","utf32",4);r[3264]=new _(3264,"UCA1400_CROATIAN_AI_CI","utf32",4);r[3265]=new _(3265,"UCA1400_CROATIAN_AI_CS","utf32",4);r[3266]=new _(3266,"UCA1400_CROATIAN_AS_CI","utf32",4);r[3267]=new _(3267,"UCA1400_CROATIAN_AS_CS","utf32",4);r[3268]=new _(3268,"UCA1400_CROATIAN_NOPAD_AI_CI","utf32",4);r[3269]=new _(3269,"UCA1400_CROATIAN_NOPAD_AI_CS","utf32",4);r[3270]=new _(3270,"UCA1400_CROATIAN_NOPAD_AS_CI","utf32",4);r[3271]=new _(3271,"UCA1400_CROATIAN_NOPAD_AS_CS","utf32",4);for(let E=0;E<r.length;E++){let e=r[E];e&&(_.prototype[e.name]=e)}T.big5=r[1];T.dec8=r[3];T.cp850=r[4];T.hp8=r[6];T.koi8r=r[7];T.latin1=r[8];T.latin2=r[9];T.swe7=r[10];T.ascii=r[11];T.ujis=r[12];T.sjis=r[13];T.hebrew=r[16];T.tis620=r[18];T.euckr=r[19];T.koi8u=r[22];T.gb2312=r[24];T.greek=r[25];T.cp1250=r[26];T.gbk=r[28];T.latin5=r[30];T.armscii8=r[32];T.utf8=r[33];T.ucs2=r[35];T.cp866=r[36];T.keybcs2=r[37];T.macce=r[38];T.macroman=r[39];T.cp852=r[40];T.latin7=r[41];T.utf8mb4=r[45];T.cp1251=r[51];T.utf16=r[54];T.utf16le=r[56];T.cp1256=r[57];T.cp1257=r[59];T.utf32=r[60];T.binary=r[63];T.geostd8=r[92];T.cp932=r[95];T.eucjpms=r[97];T.gb18030=r[248];var P=_;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 or=p;var lt=1n,Er=2n;var qe=8n,aE=1n<<4n,Nt=1n<<5n,AE=1n<<6n,ar=1n<<7n,Ar=1n<<8n,ur=1n<<9n,uE=1n<<10n,fs=1n<<11n,hE=1n<<12n,hr=1n<<13n,cE=1n<<14n,Ge=1n<<15n,cr=1n<<16n,lr=1n<<17n,Nr=1n<<18n,Re=1n<<19n,tt=1n<<20n,Bt=1n<<21n,Ir=1n<<22n,Rr=1n<<23n,Cs=1n<<24n,lE=1n<<30n,It=1n<<34n,Gt=1n<<35n,Ts=1n<<36n,st=1n<<37n;var Sn=Buffer.from("point"),fn=Buffer.from("linestring"),Cn=Buffer.from("polygon"),Tn=Buffer.from("multipoint"),On=Buffer.from("multilinestring"),dn=Buffer.from("multipolygon"),pn=Buffer.from("json"),Un={type:"Point"},Ln={type:"LineString"},Pn={type:"Polygon"},mn={type:"MultiPoint"},Dn={type:"MultiLineString"},wn={type:"MultiPolygon"},Os=class{#e;constructor(e,s,t){if(this.#e=t?new ds(e):new ps(e),s.clientCapabilities&Gt){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=or[this.columnType]}__getDefaultGeomVal(){let e=this._dataTypeName;return e?Buffer.compare(e,Sn)===0?Un:Buffer.compare(e,fn)===0?Ln:Buffer.compare(e,Cn)===0?Pn:Buffer.compare(e,Tn)===0?mn:Buffer.compare(e,On)===0?Dn:Buffer.compare(e,dn)===0?wn:{type:e.toString("ascii")}:null}isDataTypeFormatJson(){return this._dataTypeFormat!=null&&Buffer.compare(this._dataTypeFormat,pn)===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}},Ft=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)}},ds=class extends Ft{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)}},ps=class extends Ft{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}},Ht=Os;var Vr=m(require("node:fs"),1);var l={Normal:1,String:2,SlashStarComment:3,Escape:4,EOLComment:5,Backtick:6,Placeholder:7},Fe=47,it=42,Us=92,Ls=35,rt=45,Ps=10,_t=34,nt=39,ms=96,Sr=63,gn=58,bn=59;function fr(E){let e=[],s=l.Normal,t=0,n=!1,o,a=E.length;for(let A=0;A<a;A++){if(o=E[A],s===l.Escape&&!(o===nt&&n||o===_t&&!n)){s=l.String,t=o;continue}switch(o){case it:s===l.Normal&&t===Fe&&(s=l.SlashStarComment);break;case Fe:if(s===l.SlashStarComment&&t===it){s=l.Normal,t=0;continue}break;case Ls:s===l.Normal&&(s=l.EOLComment);break;case rt:s===l.Normal&&t===rt&&(A+1<a?E[A+1]:0)<=32&&(s=l.EOLComment);break;case Ps:s===l.EOLComment&&(s=l.Normal);break;case _t:s===l.Normal?(s=l.String,n=!1):s===l.String&&!n?s=l.Normal:s===l.Escape&&(s=l.String);break;case nt:s===l.Normal?(s=l.String,n=!0):s===l.String&&n?s=l.Normal:s===l.Escape&&(s=l.String);break;case Us:s===l.String&&(s=l.Escape);break;case Sr:s===l.Normal&&e.push(A,++A);break;case ms:s===l.Backtick?s=l.Normal:s===l.Normal&&(s=l.Backtick);break}t=o}return e}function Cr(E,e,s,t){let n=Object.assign({},s),o=[],a=[],A=l.Normal,u=0,h=!1,c,R=E.length;for(let I=0;I<R;I++){if(c=E[I],A===l.Escape&&!(c===nt&&h||c===_t&&!h)){A=l.String,u=c;continue}switch(c){case it:A===l.Normal&&u===Fe&&(A=l.SlashStarComment);break;case Fe:if(A===l.SlashStarComment&&u===it){A=l.Normal,u=0;continue}else A===l.Normal&&u===Fe&&(A=l.EOLComment);break;case Ls:A===l.Normal&&(A=l.EOLComment);break;case rt:A===l.Normal&&u===rt&&(I+1<R?E[I+1]:0)<=32&&(A=l.EOLComment);break;case Ps:A===l.EOLComment&&(A=l.Normal);break;case _t:A===l.Normal?(A=l.String,h=!1):A===l.String&&!h?A=l.Normal:A===l.Escape&&(A=l.String);break;case nt:A===l.Normal?(A=l.String,h=!0):A===l.String&&h?A=l.Normal:A===l.Escape&&(A=l.String);break;case Us:A===l.String&&(A=l.Escape);break;case Sr:if(A===l.Normal){let S=Object.keys(n)[0];a.push(n[S]),delete n[S],o.push(I),o.push(++I)}break;case gn:if(A===l.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 ms:A===l.Backtick?A=l.Normal:A===l.Normal&&(A=l.Backtick);break}u=c}return{paramPositions:o,values:a}}function yt(E){let e="",s=[],t=l.Normal,n="\0",o=!1,a=0,A=0,u=E.charAt(A++),h;for(;u!=="";){if(t===l.Escape&&!(u==="'"&&o||u==='"'&&!o)){t=l.String,n=u,u=E.charAt(A++);continue}switch(u){case"*":t===l.Normal&&n==="/"&&(t=l.SlashStarComment);break;case"/":if(t===l.SlashStarComment&&n==="*"){t=l.Normal,n="\0",u=E.charAt(A++);continue}break;case"#":t===l.Normal&&(t=l.EOLComment);break;case"-":if(t===l.Normal&&n==="-"){let c=E.charAt(A);(c===""||c<=" ")&&(t=l.EOLComment)}break;case`
|
|
`:t===l.EOLComment&&(t=l.Normal);break;case'"':t===l.Normal?(t=l.String,o=!1):t===l.String&&!o?t=l.Normal:t===l.Escape&&!o&&(t=l.String);break;case"'":t===l.Normal?(t=l.String,o=!0):t===l.String&&o?(t=l.Normal,o=!1):t===l.Escape&&o&&(t=l.String);break;case"\\":t===l.String&&(t=l.Escape);break;case":":if(t===l.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===l.Backtick?t=l.Normal:t===l.Normal&&(t=l.Backtick)}n=u,u=E.charAt(A++)}return a===0?e=E:e+=E.substring(a),{sql:e,placeHolderIndex:s}}function Tr(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 Or(E){let e=l.Normal,s=0,t,n=[],o=!1;for(let a=E.offset;a<E.end;a++){if(t=E.buffer[a],e===l.Escape&&!(t===nt&&o||t===_t&&!o)){e=l.String,s=t;continue}switch(t){case it:e===l.Normal&&s===Fe&&(e=l.SlashStarComment);break;case Fe:e===l.SlashStarComment&&s===it?e=l.Normal:e===l.Normal&&s===Fe&&(e=l.EOLComment);break;case Ls:e===l.Normal&&(e=l.EOLComment);break;case rt:e===l.Normal&&s===rt&&(e=l.EOLComment);break;case Ps:e===l.EOLComment&&(e=l.Normal);break;case _t:e===l.Normal?(e=l.String,o=!1):e===l.String&&!o?e=l.Normal:e===l.Escape&&(e=l.String);break;case nt:e===l.Normal?(e=l.String,o=!0):e===l.String&&o?e=l.Normal:e===l.Escape&&(e=l.String);break;case Us:e===l.String&&(e=l.Escape);break;case bn:e===l.Normal&&(n.push(E.buffer.toString("utf8",E.offset,a)),E.offset=a+1);break;case ms:e===l.Backtick?e=l.Normal:e===l.Normal&&(e=l.Backtick);break}s=t}return n}function vt(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 Lr(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 Ms(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?Yn:Vn:e.bigIntAsNumber||e.supportBigNumbers?Wn:xn;case 12:case 7:return e.dateStrings?Qn.bind(null,E.scale):vn;case 0:case 246:return E.scale===0?qn:Xn;case 255:let t=E.__getDefaultGeomVal();return Kn.bind(null,t);case 16:return E.columnLength===1&&e.bitOneIsBoolean?jn:pr;case 245:return e.jsonStrings?Ur:dr;default:return E.isDataTypeFormatJson()&&e.autoJsonMap?dr:E.collation.index===63?pr:E.isSet()?$n:Ur}}var D=(E,e)=>(e[E+2>>3]&1<<(E+2&7))>0,Bn=(E,e,s,t,n)=>D(n,t)?null:E.readInt8(),Gn=(E,e,s,t,n)=>D(n,t)?null:E.readUInt8(),Pr=(E,e,s,t,n)=>D(n,t)?null:E.readInt16(),mr=(E,e,s,t,n)=>D(n,t)?null:E.readUInt16(),Fn=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readInt24();return E.skip(1),o},Hn=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readUInt24();return E.skip(1),o},yn=(E,e,s,t,n)=>D(n,t)?null:E.readInt32(),kn=(E,e,s,t,n)=>D(n,t)?null:E.readUInt32(),Dr=(E,e,s,t,n)=>D(n,t)?null:E.readFloat(),wr=(E,e,s,t,n)=>D(n,t)?null:E.readDouble(),xn=function(E,e,s,t,n){return D(n,t)?null:E.readBigUInt64()},Vn=function(E,e,s,t,n){return D(n,t)?null:E.readBigInt64()},Wn=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)},Yn=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)},Kn=(E,e,s,t,n,o)=>D(o,n)?E:e.readGeometry(E),gr=(E,e,s,t,n)=>D(n,t)?null:E.readBinaryDate(e),vn=(E,e,s,t,n)=>D(n,t)?null:E.readBinaryDateTime(),Qn=(E,e,s,t,n,o)=>D(o,n)?null:e.readBinaryDateTimeAsString(E),br=(E,e,s,t,n)=>D(n,t)?null:E.readBinaryTime(),qn=(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},Xn=(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},dr=(E,e,s,t,n)=>D(n,t)?null:JSON.parse(E.readStringLengthEncoded()),jn=(E,e,s,t,n)=>D(n,t)?null:E.readBufferLengthEncoded()[0]===1,pr=(E,e,s,t,n)=>D(n,t)?null:E.readBufferLengthEncoded(),$n=(E,e,s,t,n)=>{if(D(n,t))return null;let o=E.readStringLengthEncoded();return o==null?null:o===""?[]:o.split(",")},Ur=(E,e,s,t,n)=>D(n,t)?null:E.readStringLengthEncoded(),Oe=Array(256);Oe[1]=Bn;Oe[13]=Pr;Oe[2]=Pr;Oe[9]=Fn;Oe[3]=yn;Oe[4]=Dr;Oe[5]=wr;Oe[10]=gr;Oe[11]=br;var de=Array(256);de[1]=Gn;de[13]=mr;de[2]=mr;de[9]=Hn;de[3]=kn;de[4]=Dr;de[5]=wr;de[10]=gr;de[11]=br;var Mr=1024;function Bs(E,e){let s=he[E.columnType];if(s)return s;switch(E.columnType){case 0:case 246:return E.scale===0?ro:_o;case 8:return e.bigIntAsNumber||e.supportBigNumbers?io:Jn;case 255:let t=E.__getDefaultGeomVal();return function(n,o,a){return n.readGeometry(t)};case 16:return E.columnLength===1&&e.bitOneIsBoolean?eo:Gr;case 245:return e.jsonStrings?Br:Fr;default:return E.isDataTypeFormatJson()&&e.autoJsonMap?Fr:E.collation.index===63?Gr:E.isSet()?to:Br}}function Hr(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 St=(E,e,s)=>E.readIntLengthEncoded(),Br=(E,e,s)=>E.readStringLengthEncoded(),yr=(E,e,s)=>E.readFloatLengthCoded(),Jn=(E,e,s)=>E.readBigIntLengthEncoded(),zn=(E,e,s)=>E.readAsciiStringLengthEncoded(),eo=(E,e,s)=>{let t=E.readBufferLengthEncoded();return t==null?null:t[0]===1},Gr=(E,e,s)=>E.readBufferLengthEncoded(),Fr=(E,e,s)=>{let t=E.readStringLengthEncoded();return t===null?null:JSON.parse(t)},to=(E,e,s)=>{let t=E.readStringLengthEncoded();return t==null?null:t===""?[]:t.split(",")},so=(E,e,s)=>e.dateStrings?E.readAsciiStringLengthEncoded():E.readDate(),kr=(E,e,s)=>e.dateStrings?E.readAsciiStringLengthEncoded():E.readDateTime(),he=new Array(256);he[1]=St;he[2]=St;he[3]=St;he[9]=St;he[13]=St;he[4]=yr;he[5]=yr;he[10]=so;he[12]=kr;he[7]=kr;he[11]=zn;var io=(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>Mr)return E.skip(t),s(`numeric value length (${t}) exceeds maximum of ${Mr} 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},ro=(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},_o=(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 Gs=class{constructor(e,s,t){this.affectedRows=e,this.insertId=s,this.warningStatus=t}},ce=Gs;var Eo=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__"]),Fs=class E extends re{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 ce(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 Ht(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?Ms:Bs;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++)Eo.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?vt(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?vt(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=vt(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?Lr(e,s,t,o,a):Hr(e,s,t,o,a);let A=this.binary?Ms:Bs;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(!Tr(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):Vr.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+=ao(s);break;case"Object":e+=JSON.stringify(s);break;default:e+=s.toString()}return e}};function ao(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 Se=Fs;var Ao=new Set(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),$e=function(E,e){let s=`${E}`;return s.length<e?"0".repeat(e-s.length)+s:s},xs=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&&Ao.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="'"+$e(s,4)+"-"+$e(t,2)+"-"+$e(n,2)+" "+$e(o,2)+":"+$e(a,2)+":"+$e(A,2);return u>0&&(h+="."+$e(u,3)),h+"'"}},G=xs;var Wr=require("node:stream"),ft=39,Vs=class extends Se{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=Cr(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=fr(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(ft),o.on("data",e.writeBufferEscape.bind(e)),o.on("end",function(){e.writeInt8(ft),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(ft);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(ft),t.once("end",function(){e.writeInt8(ft),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 Wr.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=Vs;var Ws=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)}},be=Ws;var Ks=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")}},Xt=Ks;var uo=/mariadb:\/\/(([^/@:]+)?(:([^/]+))?@)?(([^/:]+)(:([0-9]+))?)\/([^?]+)(\?(.*))?$/,vs=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(uo);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=vs;var Qs=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)}},jt=Qs;var V_=require("node:events");var x_=require("node:events"),Wi=m(require("denque"),1);var Kr=m(require("iconv-lite"),1);var $t="0123456789ABCDEF".split("");function ne(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),c=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($t[R>>>4],$t[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($t[R>>>4],$t[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(""),c?` |...
|
|
`:` |
|
|
`)}else c&&(o[o.length-1]=` |...
|
|
`);return o.push(`+--------------------------------------------------+------------------+
|
|
`),o.join("")}function vr(E){return Array.from(E,e=>("0"+(e&255).toString(16)).slice(-2)).join("")}function Zt(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 Ot(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=Kr.default.decode(s,e.collation.charset),"_binary'"+Tt(t)+"'"}else{if(typeof s.toSqlString=="function")return"'"+Tt(String(s.toSqlString()))+"'";if(Array.isArray(s)){let t=E.arrayParenthesis?"(":"";for(let n=0;n<s.length;n++)n!==0&&(t+=","),t+=Ot(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===""?"'"+Tt(JSON.stringify(s))+"'":t}else return"'"+Tt(JSON.stringify(s))+"'"}default:return"'"+Tt(s)+"'"}}var ho={"\0":"\\0","'":"\\'",'"':'\\"',"\b":"\\b","\n":"\\n","\r":"\\r"," ":"\\t","":"\\Z","\\":"\\\\"},Yr=/[\000\032"'\\\b\n\r\t]/g,Tt=E=>{let e=0,s="",t;for(;t=Yr.exec(E);)s+=E.substring(e,t.index),s+=ho[t[0]],e=Yr.lastIndex;return e===0?E:(e<E.length&&(s+=E.substring(e)),s)};var ki=m(require("node:events"),1),Dt=m(require("denque"),1),cs=m(require("node:net"),1);var qs=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 c=n(u);return A?c:{type:"Point",coordinates:c};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=[],c=A?s.readInt32LE(t):s.readInt32BE(t);t+=4;for(let R=0;R<c;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},Jt=qs;var Xs=class E extends Jt{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}},qr=Xs;var zt=m(require("iconv-lite"),1),js=class E extends Jt{constructor(e){super(),this.encoding=e}readStringLengthEncoded(){let e=this.readUnsignedLength();return e===null?null:(this.pos+=e,zt.default.decode(this.buf.subarray(this.pos-e,this.pos),this.encoding))}static readString(e,s,t,n){return zt.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=zt.default.decode(this.buf.subarray(this.pos,this.end),this.encoding);return this.pos=this.end,e}},Xr=js;var $s=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 qr(this.encoding):new Xr(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})
|
|
${ne(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)}},jr=$s;var is=m(require("iconv-lite"),1);var co={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}},lo={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}},Jr={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}},No=Jr,$r=E=>E>=129&&E<=254,Io=E=>E>=64&&E<=126||E>=128&&E<=254,Zr=E=>E>=48&&E<=57,Ro={isHead:$r,length:(E,e,s)=>e+1>=s?0:Io(E[e+1])?2:e+3<s&&Zr(E[e+1])&&$r(E[e+2])&&Zr(E[e+3])?4:0},So={big5:co,gbk:lo,sjis:Jr,cp932:No,gb18030:Ro},zr=E=>So[E]||null;var le=39,dt=34,pt=0,Ne=92,Et=256,es=16384,ts=131072,ss=1048576,Ce=16777219,e_=/[\000\032"'\\\n\r\t]/g,Zs=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(Et),this.maxAllowedPacket=e.maxAllowedPacket||16777216,this.maxPacketLength=Math.min(Ce,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=zr(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<es?s=es:e+this.pos<ts?s=ts:e+this.pos<ss?s=ss:this.bufContainDataAfterMark?s=e+this.pos:s=Ce,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(Et),this.cmd.sequenceNo=-1,this.cmd.compressSequenceNo=-1,this.cmdLength=0,this.markPos=-1}flushPacket(){this.flushBuffer(!1,0),this.buf=Buffer.allocUnsafe(Et),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!==Ce&&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(Ce-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(le),this.writeBufferEscape(o),this.writeInt8(le);return}let t=0,n;for(this.buf[this.pos++]=le;t<s&&(n=e.charCodeAt(t))<128;t++)(n===Ne||n===le||n===pt||n===dt)&&(this.buf[this.pos++]=Ne),this.buf[this.pos++]=n;for(;t<s;)if(n=e.charCodeAt(t++),n<128)(n===Ne||n===le||n===pt||n===dt)&&(this.buf[this.pos++]=Ne),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++]=le}encodeIconvString(e){return is.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<Ce&&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<Ce&&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=is.default.encode(e,this.encoding);this.writeBuffer(s,0,s.length)}writeDefaultIconvLengthEncodedString(e){let s=is.default.encode(e,this.encoding);this.writeLengthCoded(s.length),this.writeBuffer(s,0,s.length)}writeDefaultStringEscapeQuote(e){this.writeInt8(le);let s,t=0;for(;(s=e_.exec(e))!==null;)this.writeString(e.slice(t,s.index)),this.writeInt8(Ne),this.writeInt8(s[0].charCodeAt(0)),t=e_.lastIndex;if(t===0){this.writeString(e),this.writeInt8(le);return}t<e.length&&this.writeString(e.slice(t)),this.writeInt8(le)}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 c=Buffer.allocUnsafe(h+1);if(c[0]=h,c[1]=s,c[2]=s>>>8,c[3]=t,c[4]=n,c[5]=o,c[6]=a,c[7]=A,u!==0){let R=u*1e3;c[8]=R,c[9]=R>>>8,c[10]=R>>>16,c[11]=R>>>24}this.writeBuffer(c,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 c=u*1e3;this.buf[this.pos+8]=c,this.buf[this.pos+9]=c>>>8,this.buf[this.pos+10]=c>>>16,this.buf[this.pos+11]=c>>>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!==Ce&&this.growBuffer(s*2),s*2>this.buf.length-this.pos)){for(let t=0;t<s;t++){switch(e[t]){case le:case Ne:case dt:case pt:this.pos>=this.buf.length&&this.flushBuffer(!1,(s-t)*2),this.buf[this.pos++]=Ne}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 le:case Ne:case dt:case pt:this.buf[this.pos++]=Ne}this.buf[this.pos++]=e[t]}}writeBufferEscapeMb(e,s){let t=s.length;t*2>this.buf.length-this.pos&&this.buf.length!==Ce&&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++]=Ne,this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=o,n++;continue}(o===le||o===Ne||o===dt||o===pt)&&(this.pos>=this.buf.length&&this.flushBuffer(!1,(t-n)*2),this.buf[this.pos++]=Ne),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+")"}
|
|
${ne(this.opts,this.buf,0,this.pos)}`),e&&this.pos===Ce&&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(Et,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===Ce&&this.writeEmptyPacket(),this.buf=this.createBufferWithMinSize(s),this.pos=4}createBufferWithMinSize(e){let s;return e+4<Et?s=Et:e+4<es?s=es:e+4<ts?s=ts:e+4<ss?s=ss:s=Ce,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+")"}
|
|
${ne(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)
|
|
${ne(this.opts,e,0,4)}`),this.stream.writeBuf(e,this.cmd),this.stream.flush(!0,this.cmd),this.cmdLength=0}},t_=Zs;var s_=m(require("node:zlib"),1);var Js=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)
|
|
${ne(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=s_.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)}},i_=Js;var r_=m(require("node:zlib"),1),rs=2048,_s=131072,ns=1048576,Ut=16777222,zs=class E{constructor(e,s,t){this.info=t,this.opts=s,this.pos=7,this.header=Buffer.allocUnsafe(7),this.buf=Buffer.allocUnsafe(rs),this.writer=n=>{e.write(n)}}growBuffer(e){let s;e+this.pos<_s?s=_s:e+this.pos<ns?s=ns:s=Ut;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!==Ut&&this.growBuffer(n),n>this.buf.length-this.pos)){let o=n;for(;;){let a=Math.min(Ut-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)
|
|
${ne(this.opts,this.buf,0,this.pos)}`),this.writer(this.buf.subarray(0,this.pos));else{let n=r_.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)
|
|
${ne(this.opts,n,0,o,this.header)}`),this.writer(this.header),this.writer(n),e&&o===Ut&&this.writeEmptyPacket(s),this.header=Buffer.allocUnsafe(7)}this.buf=t?E.allocateBuffer(t):Buffer.allocUnsafe(rs),this.pos=7}static allocateBuffer(e){return e+4<rs?Buffer.allocUnsafe(rs):e+4<_s?Buffer.allocUnsafe(_s):e+4<ns?Buffer.allocUnsafe(ns):Buffer.allocUnsafe(Ut)}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)
|
|
${ne(this.opts,s,0,7)}`),this.writer(s)}},__=zs;var ei=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)}},Lt=ei;var y_=m(require("node:tls"),1);var ti=class extends re{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=ti;var si=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&Re?o=Math.max(12,e.readUInt8()-9):e.skip(1),n<?e.skip(10):(e.skip(6),n+=BigInt(e.readUInt32())<<32n),n&Ge){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<)===0n,n&Re?this.pluginName=e.readStringNullEnded():this.pluginName="",Lt.parseVersionString(s)}},n_=si;function ii(E,e){let s=Ar|ur|hr|Ge|lr|Nr|Rr|tt|Bt|Gt|Re;E.foundRows&&(s|=Er),E.permitLocalInfile&&(s|=ar),E.multipleStatements&&(s|=cr),e.eofDeprecated=!E.keepEof&&(e.serverCapabilities&Cs)>0,e.eofDeprecated&&(s|=Cs),E.database&&e.serverCapabilities&qe&&(s|=qe),e.serverPermitSkipMeta=(e.serverCapabilities&Ts)>0,e.serverPermitSkipMeta&&(s|=Ts),E.compress&&(e.serverCapabilities&Nt?s|=Nt:E.compress=!1),E.bulk&&e.serverCapabilities&It&&(s|=It,s|=st),E.permitConnectionWhenExpired&&(s|=Ir),e.clientCapabilities=s&e.serverCapabilities}function ri(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<?e.writeInt32(0):e.writeInt32(Number(s.clientCapabilities>>32n)),e.flushPacket()}var at=m(require("node:crypto"),1),_i=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=at.default.createHash("sha1"),n=t.update(e,"utf8").digest();t=at.default.createHash("sha1");let o=t.update(n).digest();t=at.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=at.default.createHash("sha1"),t=s.update(e.password,"utf8").digest();return s=at.default.createHash("sha1"),s.update(t).digest()}},At=_i;var o_=m(require("iconv-lite"),1),ni=m(require("node:crypto"),1),E_=m(require("node:os"),1);var fo=Be.version,oi=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 n_(e,n);if(ii(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&fs)n.clientCapabilities|=fs,ri(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=ni.default.createHash("sha1"),t=s.update(e.password,"utf8").digest();return s=ni.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=At.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&Bt?(s.writeLengthCoded(A.length),s.writeBuffer(A,0,A.length)):o.serverCapabilities&Ge?(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&Re&&(s.writeString(u),s.writeInt8(0)),o.clientCapabilities&tt){s.writeInt8(252);let h=s.pos;s.writeInt16(0);let c=o.collation?o.collation.charset:"utf8";if(E.writeAttribute(s,"_client_name",c),E.writeAttribute(s,"MariaDB connector/Node",c),E.writeAttribute(s,"_client_version",c),E.writeAttribute(s,fo,c),this.host&&(E.writeAttribute(s,"_server_host",c),E.writeAttribute(s,this.host,c)),E.writeAttribute(s,"_os",c),E.writeAttribute(s,process.platform,c),E.writeAttribute(s,"_client_host",c),E.writeAttribute(s,E_.default.hostname(),c),E.writeAttribute(s,"_node_version",c),E.writeAttribute(s,process.versions.node,c),t.connectAttributes!==!0){let R=Object.keys(t.connectAttributes);for(let I=0;I<R.length;++I)E.writeAttribute(s,R[I],c),E.writeAttribute(s,t.connectAttributes[R[I]],c)}s.writeInt16AtPos(h)}s.flushPacket()}static writeAttribute(e,s,t){let n=Buffer.isEncoding(t)?Buffer.from(s,t):o_.encode(s,t);e.writeLengthCoded(n.length),e.writeBuffer(n,0,n.length)}},a_=oi;var Ci=m(require("node:crypto"),1);var U_=m(require("node:tls"),1);var Ei=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()}}},A_=Ei;var ut=m(require("node:crypto"),1),ci=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=ut.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=ut.default.createHash("sha512");let c=u.update(a.subarray(32,96)).digest();Ai(c),ui(o,c),l_(a,o),o=[O(),O(),O(),O()],ui(o,h);let R=Buffer.alloc(32);for(l_(R,o),t=32;t<64;t++)a[t]=R[t-32];u=ut.default.createHash("sha512");let I=u.update(a).digest();Ai(I);let S=new Float64Array(64);for(t=0;t<64;t++)S[t]=0;for(t=0;t<32;t++)S[t]=c[t];for(t=0;t<32;t++)for(n=0;n<32;n++)S[t+n]+=I[t]*h[n];return R_(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=ut.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=ut.default.createHash("sha512");let u=a.update(n.subarray(32,96)).digest();return Ai(u),ui(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},u_=O(),li=O([1]),Co=O([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h_=O([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),c_=O([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ai=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 Ai(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;R_(E,e)}function R_(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]*ai[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)*ai[n],s=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=s*ai[n];for(t=0;t<32;t++)e[t+1]+=e[t]>>8,E[t]=e[t]&255}function ui(E,e){let s=[O(),O(),O(),O()];Ze(s[0],h_),Ze(s[1],c_),Ze(s[2],li),oe(s[3],h_,c_),To(E,s,e)}function Ze(E,e){for(let s=0;s<16;s++)E[s]=e[s]|0}function oe(E,e,s){let t,n,o=0,a=0,A=0,u=0,h=0,c=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,ie=0,ae=0,ue=0,Ie=0,Te=0,Ue=0,Me=0,Ke=0,et=0,ht=0,bt=0,Rs=0,zi=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,c+=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,c+=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,c+=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,c+=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,ie+=t*J,t=e[4],h+=t*H,c+=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*$,ie+=t*Z,ae+=t*J,t=e[5],c+=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,ie+=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,ie+=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,ie+=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,ie+=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,ie+=t*Q,ae+=t*q,ue+=t*X,Ie+=t*j,Te+=t*$,Ue+=t*Z,Me+=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,ie+=t*v,ae+=t*Q,ue+=t*q,Ie+=t*X,Te+=t*j,Ue+=t*$,Me+=t*Z,Ke+=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,ie+=t*K,ae+=t*v,ue+=t*Q,Ie+=t*q,Te+=t*X,Ue+=t*j,Me+=t*$,Ke+=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,ie+=t*Y,ae+=t*K,ue+=t*v,Ie+=t*Q,Te+=t*q,Ue+=t*X,Me+=t*j,Ke+=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,ie+=t*W,ae+=t*Y,ue+=t*K,Ie+=t*v,Te+=t*Q,Ue+=t*q,Me+=t*X,Ke+=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,ie+=t*V,ae+=t*W,ue+=t*Y,Ie+=t*K,Te+=t*v,Ue+=t*Q,Me+=t*q,Ke+=t*X,et+=t*j,ht+=t*$,bt+=t*Z,Rs+=t*J,t=e[15],B+=t*H,F+=t*y,se+=t*k,ie+=t*x,ae+=t*V,ue+=t*W,Ie+=t*Y,Te+=t*K,Ue+=t*v,Me+=t*Q,Ke+=t*q,et+=t*X,ht+=t*j,bt+=t*$,Rs+=t*Z,zi+=t*J,o+=38*F,a+=38*se,A+=38*ie,u+=38*ae,h+=38*ue,c+=38*Ie,R+=38*Te,I+=38*Ue,S+=38*Me,C+=38*Ke,d+=38*et,b+=38*ht,g+=38*bt,U+=38*Rs,M+=38*zi,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=c+n+65535,n=Math.floor(t/65536),c=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=c+n+65535,n=Math.floor(t/65536),c=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]=c,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 To(E,e,s){let t,n;for(Ze(E[0],u_),Ze(E[1],li),Ze(E[2],li),Ze(E[3],u_),n=255;n>=0;--n)t=s[n/8|0]>>(n&7)&1,N_(E,e,t),I_(e,E),I_(E,E),N_(E,e,t)}function l_(E,e){let s=O(),t=O(),n=O();Oo(n,e[2]),oe(s,e[0],n),oe(t,e[1],n),S_(E,t),E[31]^=Uo(s)<<7}function Oo(E,e){let s=O(),t;for(t=0;t<16;t++)s[t]=e[t];for(t=253;t>=0;t--)po(s,s),t!==2&&t!==4&&oe(s,s,e);for(t=0;t<16;t++)E[t]=s[t]}function po(E,e){oe(E,e,e)}function Uo(E){let e=new Uint8Array(32);return S_(e,E),e[0]&1}function hi(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 S_(E,e){let s,t,n,o=O(),a=O();for(s=0;s<16;s++)a[s]=e[s];for(hi(a),hi(a),hi(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,f_(a,o,1-n)}for(s=0;s<16;s++)E[2*s]=a[s]&255,E[2*s+1]=a[s]>>8}function N_(E,e,s){for(let t=0;t<4;t++)f_(E[t],e[t],s)}function Pt(E,e,s){for(let t=0;t<16;t++)E[t]=e[t]+s[t]}function os(E,e,s){for(let t=0;t<16;t++)E[t]=e[t]-s[t]}function I_(E,e){let s=O(),t=O(),n=O(),o=O(),a=O(),A=O(),u=O(),h=O(),c=O();os(s,E[1],E[0]),os(c,e[1],e[0]),oe(s,s,c),Pt(t,E[0],E[1]),Pt(c,e[0],e[1]),oe(t,t,c),oe(n,E[3],e[3]),oe(n,n,Co),oe(o,E[2],e[2]),Pt(o,o,o),os(a,t,s),os(A,o,n),Pt(u,o,n),Pt(h,t,s),oe(E[0],a,A),oe(E[1],h,u),oe(E[2],u,A),oe(E[3],a,h)}function f_(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 Es=ci;var Je=m(require("node:crypto"),1);var Lo=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),Ni=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=Po(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([Lo,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}},Po=E=>{let e=Buffer.from("302e020100300506032b657004220420","hex"),s=Buffer.concat([e,E]);return Je.default.createPrivateKey({key:s,format:"der",type:"pkcs8"})},C_=Ni;var Ii=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}}},T_=Ii;var O_=m(require("node:fs"),1),Ri=m(require("node:crypto"),1);var as=m(require("node:crypto"),1),Si=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=O_.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=as.default.createHash("sha256"),n=t.update(e,"utf8").digest();t=as.default.createHash("sha256");let o=t.update(n).digest();t=as.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 Ri.default.publicEncrypt({key:t,padding:Ri.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}}},xe=Si;var d_=m(require("node:fs"),1);var ze={INIT:"INIT",FAST_AUTH_RESULT:"FAST_AUTH_RESULT",REQUEST_SERVER_KEY:"REQUEST_SERVER_KEY",SEND_AUTH:"SEND_AUTH"},fi=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=ze.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 ze.INIT:let o=this.pluginData.slice(0,this.pluginData.length-1),a=xe.encryptSha256Password(t.password,o);s.startPacket(this),a.length>0?(s.writeBuffer(a,0,a.length),s.flushPacket()):s.writeEmptyPacket(!0),this.state=ze.FAST_AUTH_RESULT;return;case ze.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=d_.default.readFileSync(u,"utf8")),this.publicKey=xe.retrievePublicKey(u)}catch(u){return this.throwError(u,n)}xe.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=ze.REQUEST_SERVER_KEY,s.startPacket(this),s.writeInt8(2),s.flushPacket()}}return;case ze.REQUEST_SERVER_KEY:this.publicKey=xe.retrievePublicKey(e.toString(void 0,1)),this.state=ze.SEND_AUTH,xe.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}}},p_=fi;var mo={mysql_native_password:At,mysql_clear_password:A_,client_ed25519:Es,parsec:C_,dialog:T_,sha256_password:xe,caching_sha2_password:p_},Ti=class E extends re{constructor(e,s,t,n,o,a){super(e,t,n),this.cmdParam=e,this._createSecureContext=o,this.getSocket=a,this.plugin=new a_(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"?U_.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 c=w("Unexpected hash format for fingerprint hash encoding",N.ER_UNEXPECTED_PACKET,this.info);return this.opts.logger.error&&this.opts.logger.error(c),!1}let t=this.plugin.hash(this.cmdParam.opts),o=Ci.default.createHash("sha256").update(t).update(s.seed).update(Buffer.from(s.tlsFingerprint,"hex")).digest(),a=vr(o),A=e.toString("ascii",1,e.length).toLowerCase(),u=Buffer.from(a,"ascii"),h=Buffer.from(A,"ascii");return u.length===h.length&&Ci.default.timingSafeEqual(u,h)}dispatchAuthSwitchRequest(e,s,t,n){let o,a;if(n.clientCapabilities&Re?(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,c){let R=mo[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,c)}},As=Ti;var Do=new Uint8Array([1,0,0,0,1]),Oi=class extends re{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,Do),this.emit("send_end"),this.successEnd()}skipResults(e,s,t,n){}},di=Oi;var wo=new Uint8Array([1,0,0,0,14]),pi=class extends re{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,wo),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)}},Ui=pi;var go=new Uint8Array([1,0,0,0,31]),Li=class extends re{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,go),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()}},L_=Li;var Pi=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 c=0;c<h.length;c++)if(h[c]&&Array.isArray(h[c])&&h[c].length>=2&&!isNaN(h[c][0])&&!isNaN(h[c][1]))t.writeDoubleLE(h[c][0],n),t.writeDoubleLE(h[c][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 c=0;c<h.length;c++)if(h[c]&&Array.isArray(h[c])&&h[c].length>=2&&!isNaN(h[c][0])&&!isNaN(h[c][1]))t.writeDoubleLE(h[c][0],n),t.writeDoubleLE(h[c][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}}},Ve=Pi;var mi=class{#e=!1;#t;#s;#i;constructor(e,s){this.#t=e,this.#s=s,this.#i=s.conn,this.execute=this.#s.execute,this.executeStream=this.#s.executeStream}get conn(){return this.#i}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+"}"}},P_=mi;var Di=class{#e=0;#t;#s;constructor(e){this.#s=e,this.#t=!0}incrementUse(){return this.#e+=1,new P_(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+"}"}},m_=Di;var bo=new Set(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),Mo=2n**63n,Bo=Buffer.from([0,0,0,0]),wi=class extends Se{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=yt(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&&bo.has(o.type)){let A=Ve.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]=Go;else switch(typeof o){case"boolean":this.parametersType[a]=Fo;break;case"bigint":o>=Mo?this.parametersType[a]=Ho:this.parametersType[a]=yo;break;case"number":if(Number.isInteger(o)&&o>=-2147483648&&o<2147483647){this.parametersType[a]=ko;break}this.parametersType[a]=xo;break;case"string":this.parametersType[a]=Vo;break;case"object":o instanceof Date?this.parametersType[a]=Yo:Buffer.isBuffer(o)?o.length<16384||!this.prepare?this.parametersType[a]=Ko:(this.parametersType[a]=vo,n=!0):typeof o.toSqlString=="function"?this.parametersType[a]=Qo:typeof o.pipe=="function"&&typeof o.read=="function"?(n=!0,this.parametersType[a]=qo):String===o.constructor?this.parametersType[a]=Wo:this.parametersType[a]=Xo;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}},Go=new te(253,null,!0),Fo=new te(1,(E,e)=>E.writeInt8(e?1:0)),Ho=new te(246,(E,e)=>E.writeLengthEncodedString(e.toString())),yo=new te(8,(E,e)=>E.writeBigInt(e)),ko=new te(3,(E,e)=>E.writeInt32(e)),xo=new te(5,(E,e)=>E.writeDouble(e)),Vo=new te(253,(E,e)=>E.writeLengthEncodedString(e)),Wo=new te(253,(E,e)=>E.writeLengthEncodedString(e.toString())),Yo=new te(12,(E,e)=>E.writeBinaryDate(e)),Ko=new te(252,(E,e)=>E.writeLengthEncodedBuffer(e)),vo=new te(252,null),Qo=new te(253,(E,e)=>E.writeLengthEncodedString(String(e.toSqlString()))),qo=new te(252,null),Xo=new te(253,(E,e)=>E.writeLengthEncodedString(JSON.stringify(e))),mt=wi;var D_=require("node:stream"),gi=class extends mt{constructor(e,s,t,n){super(()=>{},()=>{},s,e,t),this.socket=n,this.inStream=new D_.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()}},w_=gi;var bi=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 c=this.query;if(this.conn.opts.logParam)if(this.query.length>this.conn.opts.debugLen)c=this.query.substring(0,this.conn.opts.debugLen)+"...";else{let I=this.query+" - parameters:";c=Se.logParameters(this.conn.opts,I,e)}let R=f("Execute fails, prepare command as already been closed",N.ER_PREPARE_CLOSED,null,"22000",c);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((c,R)=>u.executePromise.call(u,A,this,c,R));if(a)h.then(c=>{a&&a(null,c,null)}).catch(a||function(c){});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 w_(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+"}"}},g_=bi;var Mi=class extends Se{constructor(e,s,t,n,o){super(e,s,t,n),this.encoder=new Ve(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=yt(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 g_(this.statementId,this.parameterCount,this._columns,e.database,this.sql,this.placeHolderIndex,this.conn);if(this.conn.prepareCache){let n=new m_(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 Ht(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}},us=Mi;var Bi=class extends re{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")}},b_=Bi;var Gi=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],Fi=class extends Se{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&&Gi.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&&Gi.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&st)>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&&Gi.includes(u.type)?this.writeGeoJSONParam(e,u,t):(e.writeInt8(0),Ve.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=Ve.getBufferFromGeometryValue(s);if(n==null)e.writeInt8(1);else{e.writeInt8(0);let o=Buffer.concat([Buffer.from([0,0,0,0]),n]);Ve.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=Se.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 ce(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 ce(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 ce(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}},M_=Fi;var B_=m(require("iconv-lite"),1);var Hi=class extends As{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=At.encryptSha1Password(o,t.seed);break;case"client_ed25519":n=Es.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&Ge?(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&Re&&(e.writeString(t.defaultPluginName),e.writeInt8(0)),t.clientCapabilities&tt){e.writeInt8(252);let a=e.pos;e.writeInt16(0);let A=t.collation.charset;if(We(e,"_client_name",A),We(e,"MariaDB connector/Node",A),We(e,"_client_version",A),We(e,Be.version,A),We(e,"_node_version",A),We(e,process.versions.node,A),s.connectAttributes!==!0){let u=Object.keys(this.opts.connectAttributes);for(let h=0;h<u.length;++h)We(e,u[h],A),We(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 We(E,e,s){let t=Buffer.isEncoding(s)?Buffer.from(e,s):B_.default.encode(e,s);E.writeLengthCoded(t.length),E.writeBuffer(t,0,t.length)}var G_=Hi;var F_=require("lru-cache"),yi=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_=yi;var k_=require("node:fs");var hs=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},jo=/(mariadb|mysql):\/\/(([^/@:]+)?(:([^/]+))?@)?(([^/:]+)(:([0-9]+))?)(\/([^?]+)(\?(.*))?)?$/,xi=class E extends ki.default{opts;sendQueue=new Dt.default;receiveQueue=new Dt.default;waitingAuthenticationQueue=new Dt.default;status=1;socket=null;timeout=null;addCommand;streamOut;streamIn;info;prepareCache;constructor(e){super(),this.opts=Object.assign(new ki.default,e),this.info=new Lt(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 t_(this.opts,this.info),this.streamIn=new jr(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=Ot.bind(this,this.opts,this.info),this.escapeId=Zt.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 As(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 mt(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 M_(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,c=t*n,R=Math.min(c+n,h.length),I=[];for(let S=c;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,c)=>(Array.isArray(c[0])?h.push(...c[0]):c[0]instanceof ce?h.push(c[0]):h.push([c[0]]),h),[]),u=e[0][1];n([A,u])}else{let A=e.reduce((h,c)=>(c instanceof ce?h.push(c):!s.rowsAsArray&&Array.isArray(c[0])?h.push(...c[0]):h.push(c[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 ce?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 ce(a,n,o),[]])):(a=e.reduce((A,u)=>A+u.affectedRows,0),t(new ce(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 Ui(e,()=>{n&&(clearTimeout(n),s())},o=>{n&&(clearTimeout(n),this._logAndReject(t,o))}),!0);return}this.addCommand(new Ui(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 L_(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 di(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 di(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 Vi(this.info.collation,this.socket)}_canUseBulk(e,s){if(s&&s.fullResult&&(this.info.clientCapabilities&st)===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&It)>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||hs(t,e)===hs(n,e)?(this.opts.timezone=n,Promise.resolve()):this._setSessionTimezone(hs(n,e))}):this.opts.timezone?this._setSessionTimezone(hs(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"),Lt.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=cs.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||cs.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=cs.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&Nt?(this.streamOut.setStream(new __(this.socket,this.opts,this.info)),this.streamIn=new i_(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})
|
|
${ne(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 G_(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 us(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 mt(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 c=new us(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(c,!0),n.addCommand(h,!0);return}}let o=new us(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 Dt.default,this.addCommand=this.addCommandQueue;let a=function(u,h,c){let R=new ge(h,I=>{n.opts.logger.error&&n.opts.logger.error(I),c(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 c=()=>{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){c(),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(()=>{c(),C?t(C):s()}).catch(b=>{c(),t(b)});return}else{I.end+=d.bytesRead;let g=Or(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(()=>{}),c(),Promise.allSettled(S).catch(()=>{}),t(f(d.message,N.ER_SQL_FILE_ERROR,n.info,"HY000",null,!1,e.stack))}C&&(c(),t(C))}).catch(R=>(c(),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(jo);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 b_({},()=>{},()=>{},e),!1)}_logAndReject(e,s){this.opts.logger.error&&this.opts.logger.error(s),e(s)}},Vi=class{#e;#t;constructor(e,s){this.#e=e,this.#t=s}getCollation(){return this.#e}getSocket(){return this.#t}},wt=xi;var Yi=class extends x_.EventEmitter{opts;#e=!1;#t=!1;#s=null;#i;#r={};#_=new Wi.default;#o;#n;#A=0;#u=!1;#a;#E;constructor(e){super(),this.opts=e,this.#i=new Wi.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.#i.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.#r[e.threadId],s(),t.emit("validateSize")}}_setupConnectionErrorHandler(e){let s=this;e.on("error",()=>{s._endLeak(e),delete s.#r[e.threadId],s._processIdleConnectionsOnError(e),setImmediate(()=>{s.#_.isEmpty()||s._managePoolSize()})})}_processIdleConnectionsOnError(e){let s=0;for(;s<this.#i.length;){let t=this.#i.peekAt(s);if(t===e){this.#i.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.#r[e.threadId],e.lastUse=Date.now(),e.forceEnd(null,()=>{},()=>{}),this.totalConnections()===0&&this._stopConnectionReaping(),this.emit("validateSize")}release(e){if(this.#r[e.threadId]){if(this._endLeak(e),e.lastUse=Date.now(),this.#e){delete this.#r[e.threadId],this._cleanupConnection(e,"pool_closed");return}e.isValid()?(this.emit("release",e),delete this.#r[e.threadId],this.#i.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.#i.length-this.opts.minimumIdle);for(;s>0;){let t=this.#i.peek();if(s--,t&&t.lastUse<e){this.#i.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.#i.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.#i.shift();s?(this.opts.leakDetectionTimeout>0&&this._startLeakDetection(s),this.#r[s.threadId]=s,this.emit("acquire",s),e.resolver(s)):this.#_.unshift(e),this._checkRequestTimeouts()}_hasIdleConnection(){return!this.#i.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.#i.get(0);if(!s){for(let t in Object.keys(this.#r))if(s=this.#r[t],!s)break}return s&&(e=s.info),e}_findValidIdleConnection(e,s){if(this.#i.isEmpty()){s&&setImmediate(()=>this.emit("validateSize")),e(new Error("No valid connections found"));return}let t=this.#i.shift();this.#r[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.#r[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.#r))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.#r).length}idleConnections(){return this.#i.length}taskQueueSize(){return this.#_.length}escape(e){return Ot(this.opts.connOptions,this._searchInfo(),e)}escapeId(e){return Zt(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 Ki(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.#i.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.#r))a&&a.destroy()}return Promise.resolve()})}_cleanupConnection(e,s=""){if(e){this._endLeak(e),delete this.#r[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)}},Ki=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=Yi;var vi=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 be(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 be(n);o.end=a=>o.release(a),o.close=a=>o.release(a),e(null,o)}})}query(e,s,t){let n=be._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,c)=>{this.#e.release(a),A&&A(u,h,c)},be._QUERY_CMD(a,n)}})}execute(e,s,t){let n=be._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=be._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()+")"}},gt=vi;var K_=require("node:events");var W_=require("node:stream"),Qi=class extends ge{constructor(e,s,t){super(()=>{},()=>{},s,e),this.socket=t,this.inStream=new W_.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()}},Y_=Qi;var Ns=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=Ye(e,s);return this.#t(t),new Promise(this.#e.query.bind(this.#e,t))}queryStream(e,s){let t=Ye(e,s);this.#t(t);let n=new Y_(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=Ye(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=Ye(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"&&(Ns.prototype[Symbol.asyncDispose]=function(){return this.end()});var qi=Ns,Ye=function(E,e){return typeof E=="object"?{sql:E.sql,values:E.values?E.values:e,opts:E}:{sql:E,values:e}};var v_=typeof Symbol.asyncDispose=="symbol",Is=class extends K_.EventEmitter{#e;constructor(e){super(),this.#e=new ls(e);let s=this;this.#e._onNewConnection=t=>{try{s.emit("connection",new qi(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 qi(o);a.release=()=>new Promise(o.release),a.end=a.release,a.close=a.release,v_&&(a[Symbol.asyncDispose]=()=>a.release()),s(a)}})})}query(e,s){let t=Ye(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=Ye(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=Ye(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()+")"}};v_&&(Is.prototype[Symbol.asyncDispose]=function(){return this.end()});var Q_=Is;var Xi=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_=Xi;var ji=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,(c,R,I)=>{h.release(()=>{}),c?A(c):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,(c,R,I)=>{h.release(()=>{}),c?A(c):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,(c,R,I)=>{h.release(()=>{}),c?A(c):A(null,R,I)})})}},X_=ji;var j_=m(require("node:events"),1),$i=class extends j_.default{#e;#t={};#s={};#i=0;constructor(e){super(),this.#e=new Xt(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.#i++,s=e;let n=new jt(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 X_(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 Q_(e);return s.on("error",t=>{}),s}_createPoolCallback(e){let s=new gt(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=$o;break;case"RANDOM":o=Zo;break;case"ORDER":o=Jo;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 gt?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 Zi(this.#t)}},Zi=class{#e;constructor(e){this.#e=e}getNodes(){return this.#e}},$o=E=>{let e=E.lastRrIdx;return e===void 0&&(e=-1),++e>=E.length&&(e=0),E.lastRrIdx=e,E[e]},Zo=E=>{let e=Math.floor(Math.random()*E.length);return E[e]},Jo=(E,e)=>E[e],$_=$i;var Ji=class{#e;constructor(e){this.#e=new $_(e),this.#e._setCallback(),this.on=this.#e.on.bind(this.#e),this.once=this.#e.once.bind(this.#e)}end(e){if(e&&typeof e!="function")throw new Error("callback parameter must be a function");let s=e||(()=>{});this.#e.end().then(()=>{s()}).catch(s)}getConnection(e,s,t){let n=e,o=s,a=t;typeof e=="function"?(n=null,o=null,a=e):typeof s=="function"&&(o=null,a=s);let A=a||((u,h)=>{});this.#e.getConnection(n,o,A)}add(e,s){this.#e.add(e,s)}of(e,s){return this.#e.of(e,s)}remove(e){this.#e.remove(e)}get __tests(){return this.#e.__tests}},Z_=Ji;var J_=Be.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 en(E){let e=new wt(new fe(E)),s=new be(e);return e.connect().then(function(){e.emit("connect")}.bind(e)).catch(e.emit.bind(e,"connect")),s}function tn(E){let e=new jt(E),s=new gt(e);return s.on("error",t=>{}),s}function sn(E){let e=new Xt(E);return new Z_(e)}function rn(E,e){let s=e||(()=>{});try{let t=new fe(E),n=new wt(t);n.connect().then(()=>new Promise(n.importFile.bind(n,Object.assign({skipDbCheck:!0},E)))).then(()=>s()).catch(o=>s(o)).finally(()=>{new Promise(n.end.bind(n,{})).catch(console.log)})}catch(t){s(t)}}var zo={version:J_,SqlError:L,defaultOptions:z_,createConnection:en,createPool:tn,createPoolCluster:sn,importFile:rn};0&&(module.exports={SqlError,createConnection,createPool,createPoolCluster,defaultOptions,importFile,version});
|