From 78b3ae4a19e9de82f0e8c2a4bb959288cdbadfa0 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 9 Aug 2019 21:46:49 -0700 Subject: [PATCH] Add connection string parsing for postgres, run rustfmt over mariadb, use constants for ErrorCode --- Cargo.toml | 3 +- examples/contacts/src/main.rs | 10 +- examples/{todo => todos}/Cargo.toml | 2 +- examples/{todo => todos}/src/main.rs | 20 +- src/connection.rs | 54 +- src/lib.rs | 16 +- src/mariadb/connection/establish.rs | 10 +- src/mariadb/connection/mod.rs | 4 +- src/mariadb/mod.rs | 5 +- src/mariadb/protocol/error_codes.rs | 1953 ++++++++--------- src/mariadb/protocol/mod.rs | 7 +- .../protocol/packets/binary/com_stmt_exec.rs | 3 +- .../protocol/packets/binary/result_row.rs | 2 +- src/mariadb/protocol/packets/err.rs | 4 +- src/mariadb/protocol/packets/mod.rs | 6 +- src/mariadb/protocol/packets/result_row.rs | 5 +- src/mariadb/protocol/packets/result_set.rs | 46 +- src/mariadb/protocol/types.rs | 2 +- src/options.rs | 29 +- src/pool.rs | 69 +- src/postgres/connection/establish.rs | 21 +- src/postgres/connection/mod.rs | 15 +- 22 files changed, 1150 insertions(+), 1136 deletions(-) rename examples/{todo => todos}/Cargo.toml (95%) rename examples/{todo => todos}/src/main.rs (77%) diff --git a/Cargo.toml b/Cargo.toml index d067b9420..5839df8ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ ".", - "examples/todo", + "examples/todos", "examples/contacts" ] @@ -31,6 +31,7 @@ hex = "0.3.2" itoa = "0.4.4" log = "0.4.8" md-5 = "0.8.0" +url = "2.1.0" memchr = "2.2.1" runtime = { version = "=0.3.0-alpha.6", default-features = false } diff --git a/examples/contacts/src/main.rs b/examples/contacts/src/main.rs index 7b6292b07..ee5d69271 100644 --- a/examples/contacts/src/main.rs +++ b/examples/contacts/src/main.rs @@ -10,7 +10,7 @@ use fake::{ Dummy, Fake, Faker, }; use futures::future; -use sqlx::{pool::Pool, postgres::Postgres}; +use sqlx::{Pool, Postgres}; #[derive(Debug, Dummy)] struct Contact { @@ -34,13 +34,7 @@ struct Contact { async fn main() -> Fallible<()> { env_logger::try_init()?; - let options = sqlx::ConnectOptions::new() - .host("127.0.0.1") - .port(5432) - .user("postgres") - .database("sqlx__dev__contacts"); - - let pool = Pool::::new(options); + let pool = Pool::::new("postgres://postgres@localhost/sqlx__dev"); { let mut conn = pool.acquire().await?; diff --git a/examples/todo/Cargo.toml b/examples/todos/Cargo.toml similarity index 95% rename from examples/todo/Cargo.toml rename to examples/todos/Cargo.toml index 422cbde62..6d3875637 100644 --- a/examples/todo/Cargo.toml +++ b/examples/todos/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "todo" +name = "todos" version = "0.1.0" edition = "2018" diff --git a/examples/todo/src/main.rs b/examples/todos/src/main.rs similarity index 77% rename from examples/todo/src/main.rs rename to examples/todos/src/main.rs index cff676d7d..b9ca14383 100644 --- a/examples/todo/src/main.rs +++ b/examples/todos/src/main.rs @@ -2,7 +2,7 @@ use failure::Fallible; use futures::{future, TryStreamExt}; -use sqlx::postgres::Connection; +use sqlx::{Connection, Postgres}; use structopt::StructOpt; #[derive(StructOpt, Debug)] @@ -26,14 +26,8 @@ async fn main() -> Fallible<()> { let opt = Options::from_args(); - let mut conn = Connection::establish( - sqlx::ConnectOptions::new() - .host("127.0.0.1") - .port(5432) - .user("postgres") - .database("sqlx__dev__tasks"), - ) - .await?; + let mut conn = + Connection::::establish("postgres://postgres@localhost/sqlx__dev").await?; ensure_schema(&mut conn).await?; @@ -54,7 +48,7 @@ async fn main() -> Fallible<()> { Ok(()) } -async fn ensure_schema(conn: &mut Connection) -> Fallible<()> { +async fn ensure_schema(conn: &mut Connection) -> Fallible<()> { conn.prepare("BEGIN").execute().await?; // language=sql @@ -76,7 +70,7 @@ CREATE TABLE IF NOT EXISTS tasks ( Ok(()) } -async fn print_all_tasks(conn: &mut Connection) -> Fallible<()> { +async fn print_all_tasks(conn: &mut Connection) -> Fallible<()> { // language=sql conn.prepare( r#" @@ -97,7 +91,7 @@ WHERE done_at IS NULL Ok(()) } -async fn add_task(conn: &mut Connection, text: &str) -> Fallible<()> { +async fn add_task(conn: &mut Connection, text: &str) -> Fallible<()> { // language=sql conn.prepare( r#" @@ -112,7 +106,7 @@ VALUES ( $1 ) Ok(()) } -async fn mark_task_as_done(conn: &mut Connection, id: i64) -> Fallible<()> { +async fn mark_task_as_done(conn: &mut Connection, id: i64) -> Fallible<()> { // language=sql conn.prepare( r#" diff --git a/src/connection.rs b/src/connection.rs index 18cb0f807..e8330580f 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -1,9 +1,57 @@ -use crate::{backend::Backend, ConnectOptions}; +use crate::backend::Backend; use futures::future::BoxFuture; -use std::io; +use std::{ + io, + ops::{Deref, DerefMut}, +}; +use url::Url; + +// TODO: Re-implement and forward to Raw instead of using Deref pub trait RawConnection { - fn establish(options: ConnectOptions<'_>) -> BoxFuture> + fn establish(url: &Url) -> BoxFuture> where Self: Sized; } + +pub struct Connection +where + B: Backend, +{ + pub(crate) inner: B::RawConnection, +} + +impl Connection +where + B: Backend, +{ + #[inline] + pub async fn establish(url: &str) -> io::Result { + // TODO: Handle url parse errors + let url = Url::parse(url).unwrap(); + + Ok(Self { + inner: B::RawConnection::establish(&url).await?, + }) + } +} + +impl Deref for Connection +where + B: Backend, +{ + type Target = B::RawConnection; + + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +impl DerefMut for Connection +where + B: Backend, +{ + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.inner + } +} diff --git a/src/lib.rs b/src/lib.rs index d11d35fa7..de3c79e77 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(non_exhaustive, async_await, async_closure)] +#![feature(async_await)] #![cfg_attr(test, feature(test))] #![allow(clippy::needless_lifetimes)] // FIXME: Remove this once API has matured @@ -12,12 +12,8 @@ extern crate bitflags; #[macro_use] extern crate enum_tryfrom_derive; -mod options; -pub use self::options::ConnectOptions; - -// Helper macro for writing long complex tests #[macro_use] -pub mod macros; +mod macros; pub mod backend; pub mod deserialize; @@ -34,6 +30,12 @@ pub mod mariadb; #[cfg(feature = "postgres")] mod postgres; -// TODO: This module is not intended to be directly public +#[cfg(feature = "postgres")] +pub use self::postgres::Postgres; + pub mod connection; pub mod pool; + +pub use self::{connection::Connection, pool::Pool}; + +mod options; diff --git a/src/mariadb/connection/establish.rs b/src/mariadb/connection/establish.rs index 92d3f1b7e..942c583c0 100644 --- a/src/mariadb/connection/establish.rs +++ b/src/mariadb/connection/establish.rs @@ -2,9 +2,9 @@ use super::Connection; use crate::{ mariadb::{ Capabilities, ComStmtExec, DeContext, Decode, EofPacket, ErrPacket, - HandshakeResponsePacket, InitialHandshakePacket, OkPacket, StmtExecFlag, ProtocolType + HandshakeResponsePacket, InitialHandshakePacket, OkPacket, ProtocolType, StmtExecFlag, }, - ConnectOptions, + options::ConnectOptions, }; use bytes::{BufMut, Bytes}; use failure::{err_msg, Error}; @@ -169,13 +169,13 @@ mod test { match ctx.decoder.peek_tag() { 0xFF => { ErrPacket::decode(&mut ctx)?; - }, + } 0x00 => { OkPacket::decode(&mut ctx)?; - }, + } _ => { ResultSet::deserialize(ctx, ProtocolType::Binary).await?; - }, + } } Ok(()) diff --git a/src/mariadb/connection/mod.rs b/src/mariadb/connection/mod.rs index 834fd7a52..dcbaca737 100644 --- a/src/mariadb/connection/mod.rs +++ b/src/mariadb/connection/mod.rs @@ -2,9 +2,9 @@ use crate::{ mariadb::{ protocol::encode, Capabilities, ComInitDb, ComPing, ComQuery, ComQuit, ComStmtPrepare, ComStmtPrepareResp, DeContext, Decode, Decoder, Encode, ErrPacket, OkPacket, PacketHeader, - ResultSet, ServerStatusFlag, ProtocolType + ProtocolType, ResultSet, ServerStatusFlag, }, - ConnectOptions, + options::ConnectOptions, }; use byteorder::{ByteOrder, LittleEndian}; use bytes::{Bytes, BytesMut}; diff --git a/src/mariadb/mod.rs b/src/mariadb/mod.rs index f2571936a..5b49a01db 100644 --- a/src/mariadb/mod.rs +++ b/src/mariadb/mod.rs @@ -9,6 +9,7 @@ pub use protocol::{ ComSetOption, ComShutdown, ComSleep, ComStatistics, ComStmtClose, ComStmtExec, ComStmtFetch, ComStmtPrepare, ComStmtPrepareOk, ComStmtPrepareResp, DeContext, Decode, Decoder, Encode, EofPacket, ErrPacket, ErrorCode, FieldDetailFlag, FieldType, HandshakeResponsePacket, - InitialHandshakePacket, OkPacket, PacketHeader, ResultRowText, ResultRowBinary, ResultRow, ResultSet, SSLRequestPacket, - ServerStatusFlag, SessionChangeType, SetOptionOptions, ShutdownOptions, StmtExecFlag, ProtocolType + InitialHandshakePacket, OkPacket, PacketHeader, ProtocolType, ResultRow, ResultRowBinary, + ResultRowText, ResultSet, SSLRequestPacket, ServerStatusFlag, SessionChangeType, + SetOptionOptions, ShutdownOptions, StmtExecFlag, }; diff --git a/src/mariadb/protocol/error_codes.rs b/src/mariadb/protocol/error_codes.rs index 819ffd786..b1f3bcd7f 100644 --- a/src/mariadb/protocol/error_codes.rs +++ b/src/mariadb/protocol/error_codes.rs @@ -1,986 +1,975 @@ use std::convert::TryFrom; -#[derive(Clone, Copy, Debug, PartialEq, TryFromPrimitive)] -#[TryFromPrimitiveType = "i16"] -pub enum ErrorCode { - ErDefault = 0, - ErHashchk = 1000, - ErNisamchk = 1001, - ErNo = 1002, - ErYes = 1003, - ErCantCreateFile = 1004, - ErCantCreateTable = 1005, - ErCantCreateDb = 1006, - ErDbCreateExists = 1007, - ErDbDropExists = 1008, - ErDbDropDelete = 1009, - ErDbDropRmdir = 1010, - ErCantDeleteFile = 1011, - ErCantFindSystemRec = 1012, - ErCantGetStat = 1013, - ErCantGetWd = 1014, - ErCantLock = 1015, - ErCantOpenFile = 1016, - ErFileNotFound = 1017, - ErCantReadDir = 1018, - ErCantSetWd = 1019, - ErCheckread = 1020, - ErDiskFull = 1021, - ErDupKey = 1022, - ErErrorOnClose = 1023, - ErErrorOnRead = 1024, - ErErrorOnRename = 1025, - ErErrorOnWrite = 1026, - ErFileUsed = 1027, - ErFilsortAbort = 1028, - ErFormNotFound = 1029, - ErGetErrn = 1030, - ErIllegalHa = 1031, - ErKeyNotFound = 1032, - ErNotFormFile = 1033, - ErNotKeyfile = 1034, - ErOldKeyfile = 1035, - ErOpenAsReadonly = 1036, - ErOutofmemory = 1037, - ErOutOfSortmemory = 1038, - ErUnexpectedEof = 1039, - ErConCountError = 1040, - ErOutOfResources = 1041, - ErBadHostError = 1042, - ErHandshakeError = 1043, - ErDbaccessDeniedError = 1044, - ErAccessDeniedError = 1045, - ErNoDbError = 1046, - ErUnknownComError = 1047, - ErBadNullError = 1048, - ErBadDbError = 1049, - ErTableExistsError = 1050, - ErBadTableError = 1051, - ErNonUniqError = 1052, - ErServerShutdown = 1053, - ErBadFieldError = 1054, - ErWrongFieldWithGroup = 1055, - ErWrongGroupField = 1056, - ErWrongSumSelect = 1057, - ErWrongValueCount = 1058, - ErTooLongIdent = 1059, - ErDupFieldname = 1060, - ErDupKeyname = 1061, - ErDupEntry = 1062, - ErWrongFieldSpec = 1063, - ErParseError = 1064, - ErEmptyQuery = 1065, - ErNonuniqTable = 1066, - ErInvalidDefault = 1067, - ErMultiplePriKey = 1068, - ErTooManyKeys = 1069, - ErTooManyKeyParts = 1070, - ErTooLongKey = 1071, - ErKeyColumnDoesNotExits = 1072, - ErBlobUsedAsKey = 1073, - ErTooBigFieldlength = 1074, - ErWrongAutoKey = 1075, - ErReady = 1076, - ErNormalShutdown = 1077, - ErGotSignal = 1078, - ErShutdownComplete = 1079, - ErForcingClose = 1080, - ErIpsockError = 1081, - ErNoSuchIndex = 1082, - ErWrongFieldTerminators = 1083, - ErBlobsAndNoTerminated = 1084, - ErTextfileNotReadable = 1085, - ErFileExistsError = 1086, - ErLoadInf = 1087, - ErAlterInf = 1088, - ErWrongSubKey = 1089, - ErCantRemoveAllFields = 1090, - ErCantDropFieldOrKey = 1091, - ErInsertInf = 1092, - ErUpdateTableUsed = 1093, - ErNoSuchThread = 1094, - ErKillDeniedError = 1095, - ErNoTablesUsed = 1096, - ErTooBigSet = 1097, - ErNoUniqueLogfile = 1098, - ErTableNotLockedForWrite = 1099, - ErTableNotLocked = 1100, - ErBlobCantHaveDefault = 1101, - ErWrongDbName = 1102, - ErWrongTableName = 1103, - ErTooBigSelect = 1104, - ErUnknownError = 1105, - ErUnknownProcedure = 1106, - ErWrongParamcountToProcedure = 1107, - ErWrongParametersToProcedure = 1108, - ErUnknownTable = 1109, - ErFieldSpecifiedTwice = 1110, - ErInvalidGroupFuncUse = 1111, - ErUnsupportedExtension = 1112, - ErTableMustHaveColumns = 1113, - ErRecordFileFull = 1114, - ErUnknownCharacterSet = 1115, - ErTooManyTables = 1116, - ErTooManyFields = 1117, - ErTooBigRowsize = 1118, - ErStackOverrun = 1119, - ErWrongOuterJoin = 1120, - ErNullColumnInIndex = 1121, - ErCantFindUdf = 1122, - ErCantInitializeUdf = 1123, - ErUdfNoPaths = 1124, - ErUdfExists = 1125, - ErCantOpenLibrary = 1126, - ErCantFindDlEntry = 1127, - ErFunctionNotDefined = 1128, - ErHostIsBlocked = 1129, - ErHostNotPrivileged = 1130, - ErPasswordAnonymousUser = 1131, - ErPasswordNotAllowed = 1132, - ErPasswordNoMatch = 1133, - ErUpdateInf = 1134, - ErCantCreateThread = 1135, - ErWrongValueCountOnRow = 1136, - ErCantReopenTable = 1137, - ErInvalidUseOfNull = 1138, - ErRegexpError = 1139, - ErMixOfGroupFuncAndFields = 1140, - ErNonexistingGrant = 1141, - ErTableaccessDeniedError = 1142, - ErColumnaccessDeniedError = 1143, - ErIllegalGrantForTable = 1144, - ErGrantWrongHostOrUser = 1145, - ErNoSuchTable = 1146, - ErNonexistingTableGrant = 1147, - ErNotAllowedCommand = 1148, - ErSyntaxError = 1149, - ErDelayedCantChangeLock = 1150, - ErTooManyDelayedThreads = 1151, - ErAbortingConnection = 1152, - ErNetPacketTooLarge = 1153, - ErNetReadErrorFromPipe = 1154, - ErNetFcntlError = 1155, - ErNetPacketsOutOfOrder = 1156, - ErNetUncompressError = 1157, - ErNetReadError = 1158, - ErNetReadInterrupted = 1159, - ErNetErrorOnWrite = 1160, - ErNetWriteInterrupted = 1161, - ErTooLongString = 1162, - ErTableCantHandleBlob = 1163, - ErTableCantHandleAutoIncrement = 1164, - ErDelayedInsertTableLocked = 1165, - ErWrongColumnName = 1166, - ErWrongKeyColumn = 1167, - ErWrongMrgTable = 1168, - ErDupUnique = 1169, - ErBlobKeyWithoutLength = 1170, - ErPrimaryCantHaveNull = 1171, - ErTooManyRows = 1172, - ErRequiresPrimaryKey = 1173, - ErNoRaidCompiled = 1174, - ErUpdateWithoutKeyInSafeMode = 1175, - ErKeyDoesNotExits = 1176, - ErCheckNoSuchTable = 1177, - ErCheckNotImplemented = 1178, - ErCantDoThisDuringAnTransaction = 1179, - ErErrorDuringCommit = 1180, - ErErrorDuringRollback = 1181, - ErErrorDuringFlushLogs = 1182, - ErErrorDuringCheckpoint = 1183, - ErNewAbortingConnection = 1184, - ErDumpNotImplemented = 1185, - ErFlushMasterBinlogClosed = 1186, - ErIndexRebuild = 1187, - ErMaster = 1188, - ErMasterNetRead = 1189, - ErMasterNetWrite = 1190, - ErFtMatchingKeyNotFound = 1191, - ErLockOrActiveTransaction = 1192, - ErUnknownSystemVariable = 1193, - ErCrashedOnUsage = 1194, - ErCrashedOnRepair = 1195, - ErWarningNotCompleteRollback = 1196, - ErTransCacheFull = 1197, - ErSlaveMustStop = 1198, - ErSlaveNotRunning = 1199, - ErBadSlave = 1200, - ErMasterInf = 1201, - ErSlaveThread = 1202, - ErTooManyUserConnections = 1203, - ErSetConstantsOnly = 1204, - ErLockWaitTimeout = 1205, - ErLockTableFull = 1206, - ErReadOnlyTransaction = 1207, - ErDropDbWithReadLock = 1208, - ErCreateDbWithReadLock = 1209, - ErWrongArguments = 1210, - ErNoPermissionToCreateUser = 1211, - ErUnionTablesInDifferentDir = 1212, - ErLockDeadlock = 1213, - ErTableCantHandleFt = 1214, - ErCannotAddForeign = 1215, - ErNoReferencedRow = 1216, - ErRowIsReferenced = 1217, - ErConnectToMaster = 1218, - ErQueryOnMaster = 1219, - ErErrorWhenExecutingCommand = 1220, - ErWrongUsage = 1221, - ErWrongNumberOfColumnsInSelect = 1222, - ErCantUpdateWithReadlock = 1223, - ErMixingNotAllowed = 1224, - ErDupArgument = 1225, - ErUserLimitReached = 1226, - ErSpecificAccessDeniedError = 1227, - ErLocalVariable = 1228, - ErGlobalVariable = 1229, - ErNoDefault = 1230, - ErWrongValueForVar = 1231, - ErWrongTypeForVar = 1232, - ErVarCantBeRead = 1233, - ErCantUseOptionHere = 1234, - ErNotSupportedYet = 1235, - ErMasterFatalErrorReadingBinlog = 1236, - ErSlaveIgnoredTable = 1237, - ErIncorrectGlobalLocalVar = 1238, - ErWrongFkDef = 1239, - ErKeyRefDoNotMatchTableRef = 1240, - ErOperandColumns = 1241, - ErSubqueryNo1Row = 1242, - ErUnknownStmtHandler = 1243, - ErCorruptHelpDb = 1244, - ErCyclicReference = 1245, - ErAutoConvert = 1246, - ErIllegalReference = 1247, - ErDerivedMustHaveAlias = 1248, - ErSelectReduced = 1249, - ErTablenameNotAllowedHere = 1250, - ErNotSupportedAuthMode = 1251, - ErSpatialCantHaveNull = 1252, - ErCollationCharsetMismatch = 1253, - ErSlaveWasRunning = 1254, - ErSlaveWasNotRunning = 1255, - ErTooBigForUncompress = 1256, - ErZlibZMemError = 1257, - ErZlibZBufError = 1258, - ErZlibZDataError = 1259, - ErCutValueGroupConcat = 1260, - ErWarnTooFewRecords = 1261, - ErWarnTooManyRecords = 1262, - ErWarnNullToNotnull = 1263, - ErWarnDataOutOfRange = 1264, - WarnDataTruncated = 1265, - ErWarnUsingOtherHandler = 1266, - ErCantAggregate2Collations = 1267, - ErDropUser = 1268, - ErRevokeGrants = 1269, - ErCantAggregate3Collations = 1270, - ErCantAggregateNcollations = 1271, - ErVariableIsNotStruct = 1272, - ErUnknownCollation = 1273, - ErSlaveIgnoredSslParams = 1274, - ErServerIsInSecureAuthMode = 1275, - ErWarnFieldResolved = 1276, - ErBadSlaveUntilCond = 1277, - ErMissingSkipSlave = 1278, - ErUntilCondIgnored = 1279, - ErWrongNameForIndex = 1280, - ErWrongNameForCatalog = 1281, - ErWarnQcResize = 1282, - ErBadFtColumn = 1283, - ErUnknownKeyCache = 1284, - ErWarnHostnameWontWork = 1285, - ErUnknownStorageEngine = 1286, - ErWarnDeprecatedSyntax = 1287, - ErNonUpdatableTable = 1288, - ErFeatureDisabled = 1289, - ErOptionPreventsStatement = 1290, - ErDuplicatedValueInType = 1291, - ErTruncatedWrongValue = 1292, - ErTooMuchAutoTimestampCols = 1293, - ErInvalidOnUpdate = 1294, - ErUnsupportedPs = 1295, - ErGetErrmsg = 1296, - ErGetTemporaryErrmsg = 1297, - ErUnknownTimeZone = 1298, - ErWarnInvalidTimestamp = 1299, - ErInvalidCharacterString = 1300, - ErWarnAllowedPacketOverflowed = 1301, - ErConflictingDeclarations = 1302, - ErSpNoRecursiveCreate = 1303, - ErSpAlreadyExists = 1304, - ErSpDoesNotExist = 1305, - ErSpDropFailed = 1306, - ErSpStoreFailed = 1307, - ErSpLilabelMismatch = 1308, - ErSpLabelRedefine = 1309, - ErSpLabelMismatch = 1310, - ErSpUninitVar = 1311, - ErSpBadselect = 1312, - ErSpBadreturn = 1313, - ErSpBadstatement = 1314, - ErUpdateLogDeprecatedIgnored = 1315, - ErUpdateLogDeprecatedTranslated = 1316, - ErQueryInterrupted = 1317, - ErSpWrongNoOfArgs = 1318, - ErSpCondMismatch = 1319, - ErSpNoreturn = 1320, - ErSpNoreturnend = 1321, - ErSpBadCursorQuery = 1322, - ErSpBadCursorSelect = 1323, - ErSpCursorMismatch = 1324, - ErSpCursorAlreadyOpen = 1325, - ErSpCursorNotOpen = 1326, - ErSpUndeclaredVar = 1327, - ErSpWrongNoOfFetchArgs = 1328, - ErSpFetchNoData = 1329, - ErSpDupParam = 1330, - ErSpDupVar = 1331, - ErSpDupCond = 1332, - ErSpDupCurs = 1333, - ErSpCantAlter = 1334, - ErSpSubselectNyi = 1335, - ErStmtNotAllowedInSfOrTrg = 1336, - ErSpVarcondAfterCurshndlr = 1337, - ErSpCursorAfterHandler = 1338, - ErSpCaseNotFound = 1339, - ErFparserTooBigFile = 1340, - ErFparserBadHeader = 1341, - ErFparserEofInComment = 1342, - ErFparserErrorInParameter = 1343, - ErFparserEofInUnknownParameter = 1344, - ErViewNoExplain = 1345, - ErFrmUnknownType = 1346, - ErWrongObject = 1347, - ErNonupdateableColumn = 1348, - ErViewSelectDerived = 1349, - ErViewSelectClause = 1350, - ErViewSelectVariable = 1351, - ErViewSelectTmptable = 1352, - ErViewWrongList = 1353, - ErWarnViewMerge = 1354, - ErWarnViewWithoutKey = 1355, - ErViewInvalid = 1356, - ErSpNoDropSp = 1357, - ErSpGotoInHndlr = 1358, - ErTrgAlreadyExists = 1359, - ErTrgDoesNotExist = 1360, - ErTrgOnViewOrTempTable = 1361, - ErTrgCantChangeRow = 1362, - ErTrgNoSuchRowInTrg = 1363, - ErNoDefaultForField = 1364, - ErDivisionByZer = 1365, - ErTruncatedWrongValueForField = 1366, - ErIllegalValueForType = 1367, - ErViewNonupdCheck = 1368, - ErViewCheckFailed = 1369, - ErProcaccessDeniedError = 1370, - ErRelayLogFail = 1371, - ErPasswdLength = 1372, - ErUnknownTargetBinlog = 1373, - ErIoErrLogIndexRead = 1374, - ErBinlogPurgeProhibited = 1375, - ErFseekFail = 1376, - ErBinlogPurgeFatalErr = 1377, - ErLogInUse = 1378, - ErLogPurgeUnknownErr = 1379, - ErRelayLogInit = 1380, - ErNoBinaryLogging = 1381, - ErReservedSyntax = 1382, - ErWsasFailed = 1383, - ErDiffGroupsProc = 1384, - ErNoGroupForProc = 1385, - ErOrderWithProc = 1386, - ErLoggingProhibitChangingOf = 1387, - ErNoFileMapping = 1388, - ErWrongMagic = 1389, - ErPsManyParam = 1390, - ErKeyPart0 = 1391, - ErViewChecksum = 1392, - ErViewMultiupdate = 1393, - ErViewNoInsertFieldList = 1394, - ErViewDeleteMergeView = 1395, - ErCannotUser = 1396, - ErXaerNota = 1397, - ErXaerInval = 1398, - ErXaerRmfail = 1399, - ErXaerOutside = 1400, - ErXaerRmerr = 1401, - ErXaRbrollback = 1402, - ErNonexistingProcGrant = 1403, - ErProcAutoGrantFail = 1404, - ErProcAutoRevokeFail = 1405, - ErDataTooLong = 1406, - ErSpBadSqlstate = 1407, - ErStartup = 1408, - ErLoadFromFixedSizeRowsToVar = 1409, - ErCantCreateUserWithGrant = 1410, - ErWrongValueForType = 1411, - ErTableDefChanged = 1412, - ErSpDupHandler = 1413, - ErSpNotVarArg = 1414, - ErSpNoRetset = 1415, - ErCantCreateGeometryObject = 1416, - ErFailedRoutineBreakBinlog = 1417, - ErBinlogUnsafeRoutine = 1418, - ErBinlogCreateRoutineNeedSuper = 1419, - ErExecStmtWithOpenCursor = 1420, - ErStmtHasNoOpenCursor = 1421, - ErCommitNotAllowedInSfOrTrg = 1422, - ErNoDefaultForViewField = 1423, - ErSpNoRecursion = 1424, - ErTooBigScale = 1425, - ErTooBigPrecision = 1426, - ErMBiggerThanD = 1427, - ErWrongLockOfSystemTable = 1428, - ErConnectToForeignDataSource = 1429, - ErQueryOnForeignDataSource = 1430, - ErForeignDataSourceDoesntExist = 1431, - ErForeignDataStringInvalidCantCreate = 1432, - ErForeignDataStringInvalid = 1433, - ErCantCreateFederatedTable = 1434, - ErTrgInWrongSchema = 1435, - ErStackOverrunNeedMore = 1436, - ErTooLongBody = 1437, - ErWarnCantDropDefaultKeycache = 1438, - ErTooBigDisplaywidth = 1439, - ErXaerDupid = 1440, - ErDatetimeFunctionOverflow = 1441, - ErCantUpdateUsedTableInSfOrTrg = 1442, - ErViewPreventUpdate = 1443, - ErPsNoRecursion = 1444, - ErSpCantSetAutocommit = 1445, - ErMalformedDefiner = 1446, - ErViewFrmNoUser = 1447, - ErViewOtherUser = 1448, - ErNoSuchUser = 1449, - ErForbidSchemaChange = 1450, - ErRowIsReferenced2 = 1451, - ErNoReferencedRow2 = 1452, - ErSpBadVarShadow = 1453, - ErTrgNoDefiner = 1454, - ErOldFileFormat = 1455, - ErSpRecursionLimit = 1456, - ErSpProcTableCorrupt = 1457, - ErSpWrongName = 1458, - ErTableNeedsUpgrade = 1459, - ErSpNoAggregate = 1460, - ErMaxPreparedStmtCountReached = 1461, - ErViewRecursive = 1462, - ErNonGroupingFieldUsed = 1463, - ErTableCantHandleSpkeys = 1464, - ErNoTriggersOnSystemSchema = 1465, - ErRemovedSpaces = 1466, - ErAutoincReadFailed = 1467, - ErUsername = 1468, - ErHostname = 1469, - ErWrongStringLength = 1470, - ErNonInsertableTable = 1471, - ErAdminWrongMrgTable = 1472, - ErTooHighLevelOfNestingForSelect = 1473, - ErNameBecomesEmpty = 1474, - ErAmbiguousFieldTerm = 1475, - ErForeignServerExists = 1476, - ErForeignServerDoesntExist = 1477, - ErIllegalHaCreateOption = 1478, - ErPartitionRequiresValuesError = 1479, - ErPartitionWrongValuesError = 1480, - ErPartitionMaxvalueError = 1481, - ErPartitionSubpartitionError = 1482, - ErPartitionSubpartMixError = 1483, - ErPartitionWrongNoPartError = 1484, - ErPartitionWrongNoSubpartError = 1485, - ErConstExprInPartitionFuncError = 1486, - // Duplicate error code - // ErWrongExprInPartitionFuncError = 1486, - ErNoConstExprInRangeOrListError = 1487, - ErFieldNotFoundPartError = 1488, - ErListOfFieldsOnlyInHashError = 1489, - ErInconsistentPartitionInfoError = 1490, - ErPartitionFuncNotAllowedError = 1491, - ErPartitionsMustBeDefinedError = 1492, - ErRangeNotIncreasingError = 1493, - ErInconsistentTypeOfFunctionsError = 1494, - ErMultipleDefConstInListPartError = 1495, - ErPartitionEntryError = 1496, - ErMixHandlerError = 1497, - ErPartitionNotDefinedError = 1498, - ErTooManyPartitionsError = 1499, - ErSubpartitionError = 1500, - ErCantCreateHandlerFile = 1501, - ErBlobFieldInPartFuncError = 1502, - ErUniqueKeyNeedAllFieldsInPf = 1503, - ErNoPartsError = 1504, - ErPartitionMgmtOnNonpartitioned = 1505, - ErForeignKeyOnPartitioned = 1506, - ErDropPartitionNonExistent = 1507, - ErDropLastPartition = 1508, - ErCoalesceOnlyOnHashPartition = 1509, - ErReorgHashOnlyOnSameN = 1510, - ErReorgNoParamError = 1511, - ErOnlyOnRangeListPartition = 1512, - ErAddPartitionSubpartError = 1513, - ErAddPartitionNoNewPartition = 1514, - ErCoalescePartitionNoPartition = 1515, - ErReorgPartitionNotExist = 1516, - ErSameNamePartition = 1517, - ErNoBinlogError = 1518, - ErConsecutiveReorgPartitions = 1519, - ErReorgOutsideRange = 1520, - ErPartitionFunctionFailure = 1521, - ErPartStateError = 1522, - ErLimitedPartRange = 1523, - ErPluginIsNotLoaded = 1524, - ErWrongValue = 1525, - ErNoPartitionForGivenValue = 1526, - ErFilegroupOptionOnlyOnce = 1527, - ErCreateFilegroupFailed = 1528, - ErDropFilegroupFailed = 1529, - ErTablespaceAutoExtendError = 1530, - ErWrongSizeNumber = 1531, - ErSizeOverflowError = 1532, - ErAlterFilegroupFailed = 1533, - ErBinlogRowLoggingFailed = 1534, - ErBinlogRowWrongTableDef = 1535, - ErBinlogRowRbrToSbr = 1536, - ErEventAlreadyExists = 1537, - ErEventStoreFailed = 1538, - ErEventDoesNotExist = 1539, - ErEventCantAlter = 1540, - ErEventDropFailed = 1541, - ErEventIntervalNotPositiveOrTooBig = 1542, - ErEventEndsBeforeStarts = 1543, - ErEventExecTimeInThePast = 1544, - ErEventOpenTableFailed = 1545, - ErEventNeitherMExprNorMAt = 1546, - ErColCountDoesntMatchCorrupted = 1547, - ErCannotLoadFromTable = 1548, - ErEventCannotDelete = 1549, - ErEventCompileError = 1550, - ErEventSameName = 1551, - ErEventDataTooLong = 1552, - ErDropIndexFk = 1553, - ErWarnDeprecatedSyntaxWithVer = 1554, - ErCantWriteLockLogTable = 1555, - ErCantLockLogTable = 1556, - ErForeignDuplicateKey = 1557, - ErColCountDoesntMatchPleaseUpdate = 1558, - ErTempTablePreventsSwitchOutOfRbr = 1559, - ErStoredFunctionPreventsSwitchBinlogFormat = 1560, - ErNdbCantSwitchBinlogFormat = 1561, - ErPartitionNoTemporary = 1562, - ErPartitionConstDomainError = 1563, - ErPartitionFunctionIsNotAllowed = 1564, - ErDdlLogError = 1565, - ErNullInValuesLessThan = 1566, - ErWrongPartitionName = 1567, - ErCantChangeTxIsolation = 1568, - ErDupEntryAutoincrementCase = 1569, - ErEventModifyQueueError = 1570, - ErEventSetVarError = 1571, - ErPartitionMergeError = 1572, - ErCantActivateLog = 1573, - ErRbrNotAvailable = 1574, - ErBase64DecodeError = 1575, - ErEventRecursionForbidden = 1576, - ErEventsDbError = 1577, - ErOnlyIntegersAllowed = 1578, - ErUnsuportedLogEngine = 1579, - ErBadLogStatement = 1580, - ErCantRenameLogTable = 1581, - ErWrongParamcountToNativeFct = 1582, - ErWrongParametersToNativeFct = 1583, - ErWrongParametersToStoredFct = 1584, - ErNativeFctNameCollision = 1585, - ErDupEntryWithKeyName = 1586, - ErBinlogPurgeEmfile = 1587, - ErEventCannotCreateInThePast = 1588, - ErEventCannotAlterInThePast = 1589, - ErSlaveIncident = 1590, - ErNoPartitionForGivenValueSilent = 1591, - ErBinlogUnsafeStatement = 1592, - ErSlaveFatalError = 1593, - ErSlaveRelayLogReadFailure = 1594, - ErSlaveRelayLogWriteFailure = 1595, - ErSlaveCreateEventFailure = 1596, - ErSlaveMasterComFailure = 1597, - ErBinlogLoggingImpossible = 1598, - ErViewNoCreationCtx = 1599, - ErViewInvalidCreationCtx = 1600, - ErSrInvalidCreationCtx = 1601, - ErTrgCorruptedFile = 1602, - ErTrgNoCreationCtx = 1603, - ErTrgInvalidCreationCtx = 1604, - ErEventInvalidCreationCtx = 1605, - ErTrgCantOpenTable = 1606, - ErCantCreateSroutine = 1607, - ErUnused11 = 1608, - ErNoFormatDescriptionEvent = 1609, - ErSlaveCorruptEvent = 1610, - ErLoadDataInvalidColumn = 1611, - ErLogPurgeNoFile = 1612, - ErXaRbtimeout = 1613, - ErXaRbdeadlock = 1614, - ErNeedReprepare = 1615, - ErDelayedNotSupported = 1616, - WarnNoMasterInf = 1617, - WarnOptionIgnored = 1618, - WarnPluginDeleteBuiltin = 1619, - WarnPluginBusy = 1620, - ErVariableIsReadonly = 1621, - ErWarnEngineTransactionRollback = 1622, - ErSlaveHeartbeatFailure = 1623, - ErSlaveHeartbeatValueOutOfRange = 1624, - ErNdbReplicationSchemaError = 1625, - ErConflictFnParseError = 1626, - ErExceptionsWriteError = 1627, - ErTooLongTableComment = 1628, - ErTooLongFieldComment = 1629, - ErFuncInexistentNameCollision = 1630, - ErDatabaseName = 1631, - ErTableName = 1632, - ErPartitionName = 1633, - ErSubpartitionName = 1634, - ErTemporaryName = 1635, - ErRenamedName = 1636, - ErTooManyConcurrentTrxs = 1637, - WarnNonAsciiSeparatorNotImplemented = 1638, - ErDebugSyncTimeout = 1639, - ErDebugSyncHitLimit = 1640, - ErDupSignalSet = 1641, - ErSignalWarn = 1642, - ErSignalNotFound = 1643, - ErSignalException = 1644, - ErResignalWithoutActiveHandler = 1645, - ErSignalBadConditionType = 1646, - WarnCondItemTruncated = 1647, - ErCondItemTooLong = 1648, - ErUnknownLocale = 1649, - ErSlaveIgnoreServerIds = 1650, - ErQueryCacheDisabled = 1651, - ErSameNamePartitionField = 1652, - ErPartitionColumnListError = 1653, - ErWrongTypeColumnValueError = 1654, - ErTooManyPartitionFuncFieldsError = 1655, - ErMaxvalueInValuesIn = 1656, - ErTooManyValuesError = 1657, - ErRowSinglePartitionFieldError = 1658, - ErFieldTypeNotAllowedAsPartitionField = 1659, - ErPartitionFieldsTooLong = 1660, - ErBinlogRowEngineAndStmtEngine = 1661, - ErBinlogRowModeAndStmtEngine = 1662, - ErBinlogUnsafeAndStmtEngine = 1663, - ErBinlogRowInjectionAndStmtEngine = 1664, - ErBinlogStmtModeAndRowEngine = 1665, - ErBinlogRowInjectionAndStmtMode = 1666, - ErBinlogMultipleEngines = 1667, - ErBinlogUnsafeLimit = 1668, - ErBinlogUnsafeInsertDelayed = 1669, - ErBinlogUnsafeSystemTable = 1670, - ErBinlogUnsafeAutoincColumns = 1671, - ErBinlogUnsafeUdf = 1672, - ErBinlogUnsafeSystemVariable = 1673, - ErBinlogUnsafeSystemFunction = 1674, - ErBinlogUnsafeNontransAfterTrans = 1675, - ErMessageAndStatement = 1676, - ErSlaveConversionFailed = 1677, - ErSlaveCantCreateConversion = 1678, - ErInsideTransactionPreventsSwitchBinlogFormat = 1679, - ErPathLength = 1680, - ErWarnDeprecatedSyntaxNoReplacement = 1681, - ErWrongNativeTableStructure = 1682, - ErWrongPerfschemaUsage = 1683, - ErWarnISSkippedTable = 1684, - ErInsideTransactionPreventsSwitchBinlogDirect = 1685, - ErStoredFunctionPreventsSwitchBinlogDirect = 1686, - ErSpatialMustHaveGeomCol = 1687, - ErTooLongIndexComment = 1688, - ErLockAborted = 1689, - ErDataOutOfRange = 1690, - ErWrongSpvarTypeInLimit = 1691, - ErBinlogUnsafeMultipleEngines = 1692, - ErBinlogUnsafeMixedStatement = 1693, - ErInsideTransactionPreventsSwitchSqlLogBin = 1694, - ErStoredFunctionPreventsSwitchSqlLogBin = 1695, - ErFailedReadFromParFile = 1696, - ErValuesIsNotIntTypeError = 1697, - ErAccessDeniedNoPasswordError = 1698, - ErSetPasswordAuthPlugin = 1699, - ErGrantPluginUserExists = 1700, - ErTruncateIllegalFk = 1701, - ErPluginIsPermanent = 1702, - ErSlaveHeartbeatValueOutOfRangeMin = 1703, - ErSlaveHeartbeatValueOutOfRangeMax = 1704, - ErStmtCacheFull = 1705, - ErMultiUpdateKeyConflict = 1706, - ErTableNeedsRebuild = 1707, - WarnOptionBelowLimit = 1708, - ErIndexColumnTooLong = 1709, - ErErrorInTriggerBody = 1710, - ErErrorInUnknownTriggerBody = 1711, - ErIndexCorrupt = 1712, - ErUndoRecordTooBig = 1713, - ErBinlogUnsafeInsertIgnoreSelect = 1714, - ErBinlogUnsafeInsertSelectUpdate = 1715, - ErBinlogUnsafeReplaceSelect = 1716, - ErBinlogUnsafeCreateIgnoreSelect = 1717, - ErBinlogUnsafeCreateReplaceSelect = 1718, - ErBinlogUnsafeUpdateIgnore = 1719, - ErPluginNoUninstall = 1720, - ErPluginNoInstall = 1721, - ErBinlogUnsafeWriteAutoincSelect = 1722, - ErBinlogUnsafeCreateSelectAutoinc = 1723, - ErBinlogUnsafeInsertTwoKeys = 1724, - ErTableInFkCheck = 1725, - ErUnsupportedEngine = 1726, - ErBinlogUnsafeAutoincNotFirst = 1727, - ErCannotLoadFromTableV2 = 1728, - ErMasterDelayValueOutOfRange = 1729, - ErOnlyFdAndRbrEventsAllowedInBinlogStatement = 1730, - ErPartitionExchangeDifferentOption = 1731, - ErPartitionExchangePartTable = 1732, - ErPartitionExchangeTempTable = 1733, - ErPartitionInsteadOfSubpartition = 1734, - ErUnknownPartition = 1735, - ErTablesDifferentMetadata = 1736, - ErRowDoesNotMatchPartition = 1737, - ErBinlogCacheSizeGreaterThanMax = 1738, - ErWarnIndexNotApplicable = 1739, - ErPartitionExchangeForeignKey = 1740, - ErNoSuchKeyValue = 1741, - ErRplInfoDataTooLong = 1742, - ErNetworkReadEventChecksumFailure = 1743, - ErBinlogReadEventChecksumFailure = 1744, - ErBinlogStmtCacheSizeGreaterThanMax = 1745, - ErCantUpdateTableInCreateTableSelect = 1746, - ErPartitionClauseOnNonpartitioned = 1747, - ErRowDoesNotMatchGivenPartitionSet = 1748, - ErNoSuchPartitionUnused = 1749, - ErChangeRplInfoRepositoryFailure = 1750, - ErWarningNotCompleteRollbackWithCreatedTempTable = 1751, - ErWarningNotCompleteRollbackWithDroppedTempTable = 1752, - ErMtsFeatureIsNotSupported = 1753, - ErMtsUpdatedDbsGreaterMax = 1754, - ErMtsCantParallel = 1755, - ErMtsInconsistentData = 1756, - ErFulltextNotSupportedWithPartitioning = 1757, - ErDaInvalidConditionNumber = 1758, - ErInsecurePlainText = 1759, - ErInsecureChangeMaster = 1760, - ErForeignDuplicateKeyWithChildInfo = 1761, - ErForeignDuplicateKeyWithoutChildInfo = 1762, - ErSqlthreadWithSecureSlave = 1763, - ErTableHasNoFt = 1764, - ErVariableNotSettableInSfOrTrigger = 1765, - ErVariableNotSettableInTransaction = 1766, - ErGtidNextIsNotInGtidNextList = 1767, - ErCantChangeGtidNextInTransactionWhenGtidNextListIsNull = 1768, - ErSetStatementCannotInvokeFunction = 1769, - ErGtidNextCantBeAutomaticIfGtidNextListIsNonNull = 1770, - ErSkippingLoggedTransaction = 1771, - ErMalformedGtidSetSpecification = 1772, - ErMalformedGtidSetEncoding = 1773, - ErMalformedGtidSpecification = 1774, - ErGnoExhausted = 1775, - ErBadSlaveAutoPosition = 1776, - ErAutoPositionRequiresGtidModeOn = 1777, - ErCantDoImplicitCommitInTrxWhenGtidNextIsSet = 1778, - ErGtidMode2Or3RequiresDisableGtidUnsafeStatementsOn = 1779, - // https://mariadb.com/kb/en/library/mariadb-error-codes/ duplicate error code - // ErGtidMode_2Or_3RequiresEnforceGtidConsistencyOn = 1779, - ErGtidModeRequiresBinlog = 1780, - ErCantSetGtidNextToGtidWhenGtidModeIsOff = 1781, - ErCantSetGtidNextToAnonymousWhenGtidModeIsOn = 1782, - ErCantSetGtidNextListToNonNullWhenGtidModeIsOff = 1783, - ErFoundGtidEventWhenGtidModeIsOff = 1784, - ErGtidUnsafeNonTransactionalTable = 1785, - ErGtidUnsafeCreateSelect = 1786, - ErGtidUnsafeCreateDropTemporaryTableInTransaction = 1787, - ErGtidModeCanOnlyChangeOneStepAtATime = 1788, - ErMasterHasPurgedRequiredGtids = 1789, - ErCantSetGtidNextWhenOwningGtid = 1790, - ErUnknownExplainFormat = 1791, - ErCantExecuteInReadOnlyTransaction = 1792, - ErTooLongTablePartitionComment = 1793, - ErSlaveConfiguration = 1794, - ErInnodbFtLimit = 1795, - ErInnodbNoFtTempTable = 1796, - ErInnodbFtWrongDocidColumn = 1797, - ErInnodbFtWrongDocidIndex = 1798, - ErInnodbOnlineLogTooBig = 1799, - ErUnknownAlterAlgorithm = 1800, - ErUnknownAlterLock = 1801, - ErMtsChangeMasterCantRunWithGaps = 1802, - ErMtsRecoveryFailure = 1803, - ErMtsResetWorkers = 1804, - ErColCountDoesntMatchCorruptedV2 = 1805, - ErSlaveSilentRetryTransaction = 1806, - ErDiscardFkChecksRunning = 1807, - ErTableSchemaMismatch = 1808, - ErTableInSystemTablespace = 1809, - ErIoReadError = 1810, - ErIoWriteError = 1811, - ErTablespaceMissing = 1812, - ErTablespaceExists = 1813, - ErTablespaceDiscarded = 1814, - ErInternalError = 1815, - ErInnodbImportError = 1816, - ErInnodbIndexCorrupt = 1817, - ErInvalidYearColumnLength = 1818, - ErNotValidPassword = 1819, - ErMustChangePassword = 1820, - ErFkNoIndexChild = 1821, - ErFkNoIndexParent = 1822, - ErFkFailAddSystem = 1823, - ErFkCannotOpenParent = 1824, - ErFkIncorrectOption = 1825, - ErFkDupName = 1826, - ErPasswordFormat = 1827, - ErFkColumnCannotDrop = 1828, - ErFkColumnCannotDropChild = 1829, - ErFkColumnNotNull = 1830, - ErDupIndex = 1831, - ErFkColumnCannotChange = 1832, - ErFkColumnCannotChangeChild = 1833, - ErFkCannotDeleteParent = 1834, - ErMalformedPacket = 1835, - ErReadOnlyMode = 1836, - ErGtidNextTypeUndefinedGroup = 1837, - ErVariableNotSettableInSp = 1838, - ErCantSetGtidPurgedWhenGtidModeIsOff = 1839, - ErCantSetGtidPurgedWhenGtidExecutedIsNotEmpty = 1840, - ErCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty = 1841, - ErGtidPurgedWasChanged = 1842, - ErGtidExecutedWasChanged = 1843, - ErBinlogStmtModeAndNoReplTables = 1844, - ErAlterOperationNotSupported = 1845, - ErAlterOperationNotSupportedReason = 1846, - ErAlterOperationNotSupportedReasonCopy = 1847, - ErAlterOperationNotSupportedReasonPartition = 1848, - ErAlterOperationNotSupportedReasonFkRename = 1849, - ErAlterOperationNotSupportedReasonColumnType = 1850, - ErAlterOperationNotSupportedReasonFkCheck = 1851, - ErAlterOperationNotSupportedReasonIgnore = 1852, - ErAlterOperationNotSupportedReasonNopk = 1853, - ErAlterOperationNotSupportedReasonAutoinc = 1854, - ErAlterOperationNotSupportedReasonHiddenFts = 1855, - ErAlterOperationNotSupportedReasonChangeFts = 1856, - ErAlterOperationNotSupportedReasonFts = 1857, - ErSqlSlaveSkipCounterNotSettableInGtidMode = 1858, - ErDupUnknownInIndex = 1859, - ErIdentCausesTooLongPath = 1860, - ErAlterOperationNotSupportedReasonNotNull = 1861, - ErMustChangePasswordLogin = 1862, - ErRowInWrongPartition = 1863, - ErMtsEventBiggerPendingJobsSizeMax = 1864, - ErInnodbNoFtUsesParser = 1865, - ErBinlogLogicalCorruption = 1866, - ErWarnPurgeLogInUse = 1867, - ErWarnPurgeLogIsActive = 1868, - ErAutoIncrementConflict = 1869, - WarnOnBlockholeInRbr = 1870, - ErSlaveMiInitRepository = 1871, - ErSlaveRliInitRepository = 1872, - ErAccessDeniedChangeUserError = 1873, - ErInnodbReadOnly = 1874, - ErStopSlaveSqlThreadTimeout = 1875, - ErStopSlaveIoThreadTimeout = 1876, - ErTableCorrupt = 1877, - ErTempFileWriteFailure = 1878, - ErInnodbFtAuxNotHexId = 1879, - ErOldTemporalsUpgraded = 1880, - ErInnodbForcedRecovery = 1881, - ErAesInvalidIv = 1882, - ErPluginCannotBeUninstalled = 1883, - ErGtidUnsafeBinlogSplittableStatementAndGtidGroup = 1884, - ErSlaveHasMoreGtidsThanMaster = 1885, - ErVcolBasedOnVcol = 1900, - ErVirtualColumnFunctionIsNotAllowed = 1901, - ErDataConversionErrorForVirtualColumn = 1902, - ErPrimaryKeyBasedOnVirtualColumn = 1903, - ErKeyBasedOnGeneratedVirtualColumn = 1904, - ErWrongFkOptionForVirtualColumn = 1905, - ErWarningNonDefaultValueForVirtualColumn = 1906, - ErUnsupportedActionOnVirtualColumn = 1907, - ErConstExprInVcol = 1908, - ErRowExprForVcol = 1909, - ErUnsupportedEngineForVirtualColumns = 1910, - ErUnknownOption = 1911, - ErBadOptionValue = 1912, - // Duplicate error code - // ErNetworkReadEventChecksumFailure = 1913, - // ErBinlogReadEventChecksumFailure = 1914, - ErCantDoOnline = 1915, - ErDataOverflow = 1916, - ErDataTruncated = 1917, - ErBadData = 1918, - ErDynColWrongFormat = 1919, - ErDynColImplementationLimit = 1920, - ErDynColData = 1921, - ErDynColWrongCharset = 1922, - ErIllegalSubqueryOptimizerSwitches = 1923, - ErQueryCacheIsDisabled = 1924, - ErQueryCacheIsGlobalyDisabled = 1925, - ErViewOrderbyIgnored = 1926, - ErConnectionKilled = 1927, - // ErInternalError = 1928, - ErInsideTransactionPreventsSwitchSkipReplication = 1929, - ErStoredFunctionPreventsSwitchSkipReplication = 1930, - ErQueryExceededRowsExaminedLimit = 1931, - ErNoSuchTableInEngine = 1932, - ErTargetNotExplainable = 1933, - ErConnectionAlreadyExists = 1934, - ErMasterLogPrefix = 1935, - ErCantStartStopSlave = 1936, - ErSlaveStarted = 1937, - ErSlaveStopped = 1938, - ErSqlDiscoverError = 1939, - ErFailedGtidStateInit = 1940, - ErIncorrectGtidState = 1941, - ErCannotUpdateGtidState = 1942, - ErDuplicateGtidDomain = 1943, - ErGtidOpenTableFailed = 1944, - ErGtidPositionNotFoundInBinlog = 1945, - ErCannotLoadSlaveGtidState = 1946, - ErMasterGtidPosConflictsWithBinlog = 1947, - ErMasterGtidPosMissingDomain = 1948, - ErUntilRequiresUsingGtid = 1949, - ErGtidStrictOutOfOrder = 1950, - ErGtidStartFromBinlogHole = 1951, - ErSlaveUnexpectedMasterSwitch = 1952, - ErInsideTransactionPreventsSwitchGtidDomainIdSeqNo = 1953, - ErStoredFunctionPreventsSwitchGtidDomainIdSeqNo = 1954, - ErGtidPositionNotFoundInBinlog2 = 1955, - ErBinlogMustBeEmpty = 1956, - ErNoSuchQuery = 1957, - ErBadBase64Data = 1958, - ErInvalidRole = 1959, - ErInvalidCurrentUser = 1960, - ErCannotGrantRole = 1961, - ErCannotRevokeRole = 1962, - ErChangeSlaveParallelThreadsActive = 1963, - ErPriorCommitFailed = 1964, - ErItIsAView = 1965, - ErSlaveSkipNotInGtid = 1966, - ErTableDefinitionTooBig = 1967, - ErPluginInstalled = 1968, - ErStatementTimeout = 1969, - ErSubqueriesNotSupported = 1970, - ErSetStatementNotSupported = 1971, - ErUnused17 = 1972, - ErUserCreateExists = 1973, - ErUserDropExists = 1974, - ErRoleCreateExists = 1975, - ErRoleDropExists = 1976, - ErCannotConvertCharacter = 1977, - ErInvalidDefaultValueForField = 1978, - ErKillQueryDeniedError = 1979, - ErNoEisForField = 1980, - ErWarnAggfuncDependence = 1981, -} +// FIXME: Remove Default -impl Default for ErrorCode { - fn default() -> Self { - ErrorCode::ErDefault - } +#[derive(Default, Debug)] +pub struct ErrorCode(pub(crate) u16); + +impl ErrorCode { + const ER_ABORTING_CONNECTION: ErrorCode = ErrorCode(1152); + const ER_ACCESS_DENIED_CHANGE_USER_ERROR: ErrorCode = ErrorCode(1873); + const ER_ACCESS_DENIED_ERROR: ErrorCode = ErrorCode(1045); + const ER_ACCESS_DENIED_NO_PASSWORD_ERROR: ErrorCode = ErrorCode(1698); + const ER_ADD_PARTITION_NO_NEW_PARTITION: ErrorCode = ErrorCode(1514); + const ER_ADD_PARTITION_SUBPART_ERROR: ErrorCode = ErrorCode(1513); + const ER_ADMIN_WRONG_MRG_TABLE: ErrorCode = ErrorCode(1472); + const ER_AES_INVALID_IV: ErrorCode = ErrorCode(1882); + const ER_ALTER_FILEGROUP_FAILED: ErrorCode = ErrorCode(1533); + const ER_ALTER_INF: ErrorCode = ErrorCode(1088); + const ER_ALTER_OPERATION_NOT_SUPPORTED: ErrorCode = ErrorCode(1845); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON: ErrorCode = ErrorCode(1846); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC: ErrorCode = ErrorCode(1854); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS: ErrorCode = ErrorCode(1856); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE: ErrorCode = ErrorCode(1850); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY: ErrorCode = ErrorCode(1847); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK: ErrorCode = ErrorCode(1851); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME: ErrorCode = ErrorCode(1849); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS: ErrorCode = ErrorCode(1857); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS: ErrorCode = ErrorCode(1855); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE: ErrorCode = ErrorCode(1852); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK: ErrorCode = ErrorCode(1853); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL: ErrorCode = ErrorCode(1861); + const ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION: ErrorCode = ErrorCode(1848); + const ER_AMBIGUOUS_FIELD_TERM: ErrorCode = ErrorCode(1475); + const ER_AUTOINC_READ_FAILED: ErrorCode = ErrorCode(1467); + const ER_AUTO_CONVERT: ErrorCode = ErrorCode(1246); + const ER_AUTO_INCREMENT_CONFLICT: ErrorCode = ErrorCode(1869); + const ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON: ErrorCode = ErrorCode(1777); + const ER_BAD_BASE64_DATA: ErrorCode = ErrorCode(1958); + const ER_BAD_DATA: ErrorCode = ErrorCode(1918); + const ER_BAD_DB_ERROR: ErrorCode = ErrorCode(1049); + const ER_BAD_FIELD_ERROR: ErrorCode = ErrorCode(1054); + const ER_BAD_FT_COLUMN: ErrorCode = ErrorCode(1283); + const ER_BAD_HOST_ERROR: ErrorCode = ErrorCode(1042); + const ER_BAD_LOG_STATEMENT: ErrorCode = ErrorCode(1580); + const ER_BAD_NULL_ERROR: ErrorCode = ErrorCode(1048); + const ER_BAD_OPTION_VALUE: ErrorCode = ErrorCode(1912); + const ER_BAD_SLAVE: ErrorCode = ErrorCode(1200); + const ER_BAD_SLAVE_AUTO_POSITION: ErrorCode = ErrorCode(1776); + const ER_BAD_SLAVE_UNTIL_COND: ErrorCode = ErrorCode(1277); + const ER_BAD_TABLE_ERROR: ErrorCode = ErrorCode(1051); + const ER_BASE64_DECODE_ERROR: ErrorCode = ErrorCode(1575); + const ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX: ErrorCode = ErrorCode(1738); + const ER_BINLOG_CREATE_ROUTINE_NEED_SUPER: ErrorCode = ErrorCode(1419); + const ER_BINLOG_LOGGING_IMPOSSIBLE: ErrorCode = ErrorCode(1598); + const ER_BINLOG_LOGICAL_CORRUPTION: ErrorCode = ErrorCode(1866); + const ER_BINLOG_MULTIPLE_ENGINES: ErrorCode = ErrorCode(1667); + const ER_BINLOG_MUST_BE_EMPTY: ErrorCode = ErrorCode(1956); + const ER_BINLOG_PURGE_EMFILE: ErrorCode = ErrorCode(1587); + const ER_BINLOG_PURGE_FATAL_ERR: ErrorCode = ErrorCode(1377); + const ER_BINLOG_PURGE_PROHIBITED: ErrorCode = ErrorCode(1375); + const ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE: ErrorCode = ErrorCode(1744); + const ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE: ErrorCode = ErrorCode(1661); + const ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE: ErrorCode = ErrorCode(1664); + const ER_BINLOG_ROW_INJECTION_AND_STMT_MODE: ErrorCode = ErrorCode(1666); + const ER_BINLOG_ROW_LOGGING_FAILED: ErrorCode = ErrorCode(1534); + const ER_BINLOG_ROW_MODE_AND_STMT_ENGINE: ErrorCode = ErrorCode(1662); + const ER_BINLOG_ROW_RBR_TO_SBR: ErrorCode = ErrorCode(1536); + const ER_BINLOG_ROW_WRONG_TABLE_DEF: ErrorCode = ErrorCode(1535); + const ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX: ErrorCode = ErrorCode(1745); + const ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES: ErrorCode = ErrorCode(1844); + const ER_BINLOG_STMT_MODE_AND_ROW_ENGINE: ErrorCode = ErrorCode(1665); + const ER_BINLOG_UNSAFE_AND_STMT_ENGINE: ErrorCode = ErrorCode(1663); + const ER_BINLOG_UNSAFE_AUTOINC_COLUMNS: ErrorCode = ErrorCode(1671); + const ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST: ErrorCode = ErrorCode(1727); + const ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT: ErrorCode = ErrorCode(1717); + const ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT: ErrorCode = ErrorCode(1718); + const ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC: ErrorCode = ErrorCode(1723); + const ER_BINLOG_UNSAFE_INSERT_DELAYED: ErrorCode = ErrorCode(1669); + const ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT: ErrorCode = ErrorCode(1714); + const ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE: ErrorCode = ErrorCode(1715); + const ER_BINLOG_UNSAFE_INSERT_TWO_KEYS: ErrorCode = ErrorCode(1724); + const ER_BINLOG_UNSAFE_LIMIT: ErrorCode = ErrorCode(1668); + const ER_BINLOG_UNSAFE_MIXED_STATEMENT: ErrorCode = ErrorCode(1693); + const ER_BINLOG_UNSAFE_MULTIPLE_ENGINES: ErrorCode = ErrorCode(1692); + const ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS: ErrorCode = ErrorCode(1675); + const ER_BINLOG_UNSAFE_REPLACE_SELECT: ErrorCode = ErrorCode(1716); + const ER_BINLOG_UNSAFE_ROUTINE: ErrorCode = ErrorCode(1418); + const ER_BINLOG_UNSAFE_STATEMENT: ErrorCode = ErrorCode(1592); + const ER_BINLOG_UNSAFE_SYSTEM_FUNCTION: ErrorCode = ErrorCode(1674); + const ER_BINLOG_UNSAFE_SYSTEM_TABLE: ErrorCode = ErrorCode(1670); + const ER_BINLOG_UNSAFE_SYSTEM_VARIABLE: ErrorCode = ErrorCode(1673); + const ER_BINLOG_UNSAFE_UDF: ErrorCode = ErrorCode(1672); + const ER_BINLOG_UNSAFE_UPDATE_IGNORE: ErrorCode = ErrorCode(1719); + const ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT: ErrorCode = ErrorCode(1722); + const ER_BLOBS_AND_NO_TERMINATED: ErrorCode = ErrorCode(1084); + const ER_BLOB_CANT_HAVE_DEFAULT: ErrorCode = ErrorCode(1101); + const ER_BLOB_FIELD_IN_PART_FUNC_ERROR: ErrorCode = ErrorCode(1502); + const ER_BLOB_KEY_WITHOUT_LENGTH: ErrorCode = ErrorCode(1170); + const ER_BLOB_USED_AS_KEY: ErrorCode = ErrorCode(1073); + const ER_CANNOT_ADD_FOREIGN: ErrorCode = ErrorCode(1215); + const ER_CANNOT_CONVERT_CHARACTER: ErrorCode = ErrorCode(1977); + const ER_CANNOT_GRANT_ROLE: ErrorCode = ErrorCode(1961); + const ER_CANNOT_LOAD_FROM_TABLE: ErrorCode = ErrorCode(1548); + const ER_CANNOT_LOAD_FROM_TABLE_V2: ErrorCode = ErrorCode(1728); + const ER_CANNOT_LOAD_SLAVE_GTID_STATE: ErrorCode = ErrorCode(1946); + const ER_CANNOT_REVOKE_ROLE: ErrorCode = ErrorCode(1962); + const ER_CANNOT_UPDATE_GTID_STATE: ErrorCode = ErrorCode(1942); + const ER_CANNOT_USER: ErrorCode = ErrorCode(1396); + const ER_CANT_ACTIVATE_LOG: ErrorCode = ErrorCode(1573); + const ER_CANT_AGGREGATE2_COLLATIONS: ErrorCode = ErrorCode(1267); + const ER_CANT_AGGREGATE3_COLLATIONS: ErrorCode = ErrorCode(1270); + const ER_CANT_AGGREGATE_NCOLLATIONS: ErrorCode = ErrorCode(1271); + const ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL: ErrorCode = + ErrorCode(1768); + const ER_CANT_CHANGE_TX_ISOLATION: ErrorCode = ErrorCode(1568); + const ER_CANT_CREATE_DB: ErrorCode = ErrorCode(1006); + const ER_CANT_CREATE_FEDERATED_TABLE: ErrorCode = ErrorCode(1434); + const ER_CANT_CREATE_FILE: ErrorCode = ErrorCode(1004); + const ER_CANT_CREATE_GEOMETRY_OBJECT: ErrorCode = ErrorCode(1416); + const ER_CANT_CREATE_HANDLER_FILE: ErrorCode = ErrorCode(1501); + const ER_CANT_CREATE_SROUTINE: ErrorCode = ErrorCode(1607); + const ER_CANT_CREATE_TABLE: ErrorCode = ErrorCode(1005); + const ER_CANT_CREATE_THREAD: ErrorCode = ErrorCode(1135); + const ER_CANT_CREATE_USER_WITH_GRANT: ErrorCode = ErrorCode(1410); + const ER_CANT_DELETE_FILE: ErrorCode = ErrorCode(1011); + const ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET: ErrorCode = ErrorCode(1778); + const ER_CANT_DO_ONLINE: ErrorCode = ErrorCode(1915); + const ER_CANT_DO_THIS_DURING_AN_TRANSACTION: ErrorCode = ErrorCode(1179); + const ER_CANT_DROP_FIELD_OR_KEY: ErrorCode = ErrorCode(1091); + const ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION: ErrorCode = ErrorCode(1792); + const ER_CANT_FIND_DL_ENTRY: ErrorCode = ErrorCode(1127); + const ER_CANT_FIND_SYSTEM_REC: ErrorCode = ErrorCode(1012); + const ER_CANT_FIND_UDF: ErrorCode = ErrorCode(1122); + const ER_CANT_GET_STAT: ErrorCode = ErrorCode(1013); + const ER_CANT_GET_WD: ErrorCode = ErrorCode(1014); + const ER_CANT_INITIALIZE_UDF: ErrorCode = ErrorCode(1123); + const ER_CANT_LOCK: ErrorCode = ErrorCode(1015); + const ER_CANT_LOCK_LOG_TABLE: ErrorCode = ErrorCode(1556); + const ER_CANT_OPEN_FILE: ErrorCode = ErrorCode(1016); + const ER_CANT_OPEN_LIBRARY: ErrorCode = ErrorCode(1126); + const ER_CANT_READ_DIR: ErrorCode = ErrorCode(1018); + const ER_CANT_REMOVE_ALL_FIELDS: ErrorCode = ErrorCode(1090); + const ER_CANT_RENAME_LOG_TABLE: ErrorCode = ErrorCode(1581); + const ER_CANT_REOPEN_TABLE: ErrorCode = ErrorCode(1137); + const ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF: ErrorCode = ErrorCode(1783); + const ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON: ErrorCode = ErrorCode(1782); + const ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF: ErrorCode = ErrorCode(1781); + const ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID: ErrorCode = ErrorCode(1790); + const ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY: ErrorCode = ErrorCode(1840); + const ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF: ErrorCode = ErrorCode(1839); + const ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY: ErrorCode = ErrorCode(1841); + const ER_CANT_SET_WD: ErrorCode = ErrorCode(1019); + const ER_CANT_START_STOP_SLAVE: ErrorCode = ErrorCode(1936); + const ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT: ErrorCode = ErrorCode(1746); + const ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG: ErrorCode = ErrorCode(1442); + const ER_CANT_UPDATE_WITH_READLOCK: ErrorCode = ErrorCode(1223); + const ER_CANT_USE_OPTION_HERE: ErrorCode = ErrorCode(1234); + const ER_CANT_WRITE_LOCK_LOG_TABLE: ErrorCode = ErrorCode(1555); + const ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE: ErrorCode = ErrorCode(1750); + const ER_CHANGE_SLAVE_PARALLEL_THREADS_ACTIVE: ErrorCode = ErrorCode(1963); + const ER_CHECKREAD: ErrorCode = ErrorCode(1020); + const ER_CHECK_NOT_IMPLEMENTED: ErrorCode = ErrorCode(1178); + const ER_CHECK_NO_SUCH_TABLE: ErrorCode = ErrorCode(1177); + const ER_COALESCE_ONLY_ON_HASH_PARTITION: ErrorCode = ErrorCode(1509); + const ER_COALESCE_PARTITION_NO_PARTITION: ErrorCode = ErrorCode(1515); + const ER_COLLATION_CHARSET_MISMATCH: ErrorCode = ErrorCode(1253); + const ER_COLUMNACCESS_DENIED_ERROR: ErrorCode = ErrorCode(1143); + const ER_COL_COUNT_DOESNT_MATCH_CORRUPTED: ErrorCode = ErrorCode(1547); + const ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2: ErrorCode = ErrorCode(1805); + const ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE: ErrorCode = ErrorCode(1558); + const ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG: ErrorCode = ErrorCode(1422); + const ER_COND_ITEM_TOO_LONG: ErrorCode = ErrorCode(1648); + const ER_CONFLICTING_DECLARATIONS: ErrorCode = ErrorCode(1302); + const ER_CONFLICT_FN_PARSE_ERROR: ErrorCode = ErrorCode(1626); + const ER_CONNECTION_ALREADY_EXISTS: ErrorCode = ErrorCode(1934); + const ER_CONNECTION_KILLED: ErrorCode = ErrorCode(1927); + const ER_CONNECT_TO_FOREIGN_DATA_SOURCE: ErrorCode = ErrorCode(1429); + const ER_CONNECT_TO_MASTER: ErrorCode = ErrorCode(1218); + const ER_CONSECUTIVE_REORG_PARTITIONS: ErrorCode = ErrorCode(1519); + const ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR: ErrorCode = ErrorCode(1486); + const ER_CONST_EXPR_IN_VCOL: ErrorCode = ErrorCode(1908); + const ER_CON_COUNT_ERROR: ErrorCode = ErrorCode(1040); + const ER_CORRUPT_HELP_DB: ErrorCode = ErrorCode(1244); + const ER_CRASHED_ON_REPAIR: ErrorCode = ErrorCode(1195); + const ER_CRASHED_ON_USAGE: ErrorCode = ErrorCode(1194); + const ER_CREATE_DB_WITH_READ_LOCK: ErrorCode = ErrorCode(1209); + const ER_CREATE_FILEGROUP_FAILED: ErrorCode = ErrorCode(1528); + const ER_CUT_VALUE_GROUP_CONCAT: ErrorCode = ErrorCode(1260); + const ER_CYCLIC_REFERENCE: ErrorCode = ErrorCode(1245); + const ER_DATABASE_NAME: ErrorCode = ErrorCode(1631); + const ER_DATA_CONVERSION_ERROR_FOR_VIRTUAL_COLUMN: ErrorCode = ErrorCode(1902); + const ER_DATA_OUT_OF_RANGE: ErrorCode = ErrorCode(1690); + const ER_DATA_OVERFLOW: ErrorCode = ErrorCode(1916); + const ER_DATA_TOO_LONG: ErrorCode = ErrorCode(1406); + const ER_DATA_TRUNCATED: ErrorCode = ErrorCode(1917); + const ER_DATETIME_FUNCTION_OVERFLOW: ErrorCode = ErrorCode(1441); + const ER_DA_INVALID_CONDITION_NUMBER: ErrorCode = ErrorCode(1758); + const ER_DBACCESS_DENIED_ERROR: ErrorCode = ErrorCode(1044); + const ER_DB_CREATE_EXISTS: ErrorCode = ErrorCode(1007); + const ER_DB_DROP_DELETE: ErrorCode = ErrorCode(1009); + const ER_DB_DROP_EXISTS: ErrorCode = ErrorCode(1008); + const ER_DB_DROP_RMDIR: ErrorCode = ErrorCode(1010); + const ER_DDL_LOG_ERROR: ErrorCode = ErrorCode(1565); + const ER_DEBUG_SYNC_HIT_LIMIT: ErrorCode = ErrorCode(1640); + const ER_DEBUG_SYNC_TIMEOUT: ErrorCode = ErrorCode(1639); + const ER_DELAYED_CANT_CHANGE_LOCK: ErrorCode = ErrorCode(1150); + const ER_DELAYED_INSERT_TABLE_LOCKED: ErrorCode = ErrorCode(1165); + const ER_DELAYED_NOT_SUPPORTED: ErrorCode = ErrorCode(1616); + const ER_DERIVED_MUST_HAVE_ALIAS: ErrorCode = ErrorCode(1248); + const ER_DIFF_GROUPS_PROC: ErrorCode = ErrorCode(1384); + const ER_DISCARD_FK_CHECKS_RUNNING: ErrorCode = ErrorCode(1807); + const ER_DISK_FULL: ErrorCode = ErrorCode(1021); + const ER_DIVISION_BY_ZER: ErrorCode = ErrorCode(1365); + const ER_DROP_DB_WITH_READ_LOCK: ErrorCode = ErrorCode(1208); + const ER_DROP_FILEGROUP_FAILED: ErrorCode = ErrorCode(1529); + const ER_DROP_INDEX_FK: ErrorCode = ErrorCode(1553); + const ER_DROP_LAST_PARTITION: ErrorCode = ErrorCode(1508); + const ER_DROP_PARTITION_NON_EXISTENT: ErrorCode = ErrorCode(1507); + const ER_DROP_USER: ErrorCode = ErrorCode(1268); + const ER_DUMP_NOT_IMPLEMENTED: ErrorCode = ErrorCode(1185); + const ER_DUPLICATED_VALUE_IN_TYPE: ErrorCode = ErrorCode(1291); + const ER_DUPLICATE_GTID_DOMAIN: ErrorCode = ErrorCode(1943); + const ER_DUP_ARGUMENT: ErrorCode = ErrorCode(1225); + const ER_DUP_ENTRY: ErrorCode = ErrorCode(1062); + const ER_DUP_ENTRY_AUTOINCREMENT_CASE: ErrorCode = ErrorCode(1569); + const ER_DUP_ENTRY_WITH_KEY_NAME: ErrorCode = ErrorCode(1586); + const ER_DUP_FIELDNAME: ErrorCode = ErrorCode(1060); + const ER_DUP_INDEX: ErrorCode = ErrorCode(1831); + const ER_DUP_KEY: ErrorCode = ErrorCode(1022); + const ER_DUP_KEYNAME: ErrorCode = ErrorCode(1061); + const ER_DUP_SIGNAL_SET: ErrorCode = ErrorCode(1641); + const ER_DUP_UNIQUE: ErrorCode = ErrorCode(1169); + const ER_DUP_UNKNOWN_IN_INDEX: ErrorCode = ErrorCode(1859); + const ER_DYN_COL_DATA: ErrorCode = ErrorCode(1921); + const ER_DYN_COL_IMPLEMENTATION_LIMIT: ErrorCode = ErrorCode(1920); + const ER_DYN_COL_WRONG_CHARSET: ErrorCode = ErrorCode(1922); + const ER_DYN_COL_WRONG_FORMAT: ErrorCode = ErrorCode(1919); + const ER_EMPTY_QUERY: ErrorCode = ErrorCode(1065); + const ER_ERROR_DURING_CHECKPOINT: ErrorCode = ErrorCode(1183); + const ER_ERROR_DURING_COMMIT: ErrorCode = ErrorCode(1180); + const ER_ERROR_DURING_FLUSH_LOGS: ErrorCode = ErrorCode(1182); + const ER_ERROR_DURING_ROLLBACK: ErrorCode = ErrorCode(1181); + const ER_ERROR_IN_TRIGGER_BODY: ErrorCode = ErrorCode(1710); + const ER_ERROR_IN_UNKNOWN_TRIGGER_BODY: ErrorCode = ErrorCode(1711); + const ER_ERROR_ON_CLOSE: ErrorCode = ErrorCode(1023); + const ER_ERROR_ON_READ: ErrorCode = ErrorCode(1024); + const ER_ERROR_ON_RENAME: ErrorCode = ErrorCode(1025); + const ER_ERROR_ON_WRITE: ErrorCode = ErrorCode(1026); + const ER_ERROR_WHEN_EXECUTING_COMMAND: ErrorCode = ErrorCode(1220); + const ER_EVENTS_DB_ERROR: ErrorCode = ErrorCode(1577); + const ER_EVENT_ALREADY_EXISTS: ErrorCode = ErrorCode(1537); + const ER_EVENT_CANNOT_ALTER_IN_THE_PAST: ErrorCode = ErrorCode(1589); + const ER_EVENT_CANNOT_CREATE_IN_THE_PAST: ErrorCode = ErrorCode(1588); + const ER_EVENT_CANNOT_DELETE: ErrorCode = ErrorCode(1549); + const ER_EVENT_CANT_ALTER: ErrorCode = ErrorCode(1540); + const ER_EVENT_COMPILE_ERROR: ErrorCode = ErrorCode(1550); + const ER_EVENT_DATA_TOO_LONG: ErrorCode = ErrorCode(1552); + const ER_EVENT_DOES_NOT_EXIST: ErrorCode = ErrorCode(1539); + const ER_EVENT_DROP_FAILED: ErrorCode = ErrorCode(1541); + const ER_EVENT_ENDS_BEFORE_STARTS: ErrorCode = ErrorCode(1543); + const ER_EVENT_EXEC_TIME_IN_THE_PAST: ErrorCode = ErrorCode(1544); + const ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG: ErrorCode = ErrorCode(1542); + const ER_EVENT_INVALID_CREATION_CTX: ErrorCode = ErrorCode(1605); + const ER_EVENT_MODIFY_QUEUE_ERROR: ErrorCode = ErrorCode(1570); + const ER_EVENT_NEITHER_M_EXPR_NOR_M_AT: ErrorCode = ErrorCode(1546); + const ER_EVENT_OPEN_TABLE_FAILED: ErrorCode = ErrorCode(1545); + const ER_EVENT_RECURSION_FORBIDDEN: ErrorCode = ErrorCode(1576); + const ER_EVENT_SAME_NAME: ErrorCode = ErrorCode(1551); + const ER_EVENT_SET_VAR_ERROR: ErrorCode = ErrorCode(1571); + const ER_EVENT_STORE_FAILED: ErrorCode = ErrorCode(1538); + const ER_EXCEPTIONS_WRITE_ERROR: ErrorCode = ErrorCode(1627); + const ER_EXEC_STMT_WITH_OPEN_CURSOR: ErrorCode = ErrorCode(1420); + const ER_FAILED_GTID_STATE_INIT: ErrorCode = ErrorCode(1940); + const ER_FAILED_READ_FROM_PAR_FILE: ErrorCode = ErrorCode(1696); + const ER_FAILED_ROUTINE_BREAK_BINLOG: ErrorCode = ErrorCode(1417); + const ER_FEATURE_DISABLED: ErrorCode = ErrorCode(1289); + const ER_FIELD_NOT_FOUND_PART_ERROR: ErrorCode = ErrorCode(1488); + const ER_FIELD_SPECIFIED_TWICE: ErrorCode = ErrorCode(1110); + const ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD: ErrorCode = ErrorCode(1659); + const ER_FILEGROUP_OPTION_ONLY_ONCE: ErrorCode = ErrorCode(1527); + const ER_FILE_EXISTS_ERROR: ErrorCode = ErrorCode(1086); + const ER_FILE_NOT_FOUND: ErrorCode = ErrorCode(1017); + const ER_FILE_USED: ErrorCode = ErrorCode(1027); + const ER_FILSORT_ABORT: ErrorCode = ErrorCode(1028); + const ER_FK_CANNOT_DELETE_PARENT: ErrorCode = ErrorCode(1834); + const ER_FK_CANNOT_OPEN_PARENT: ErrorCode = ErrorCode(1824); + const ER_FK_COLUMN_CANNOT_CHANGE: ErrorCode = ErrorCode(1832); + const ER_FK_COLUMN_CANNOT_CHANGE_CHILD: ErrorCode = ErrorCode(1833); + const ER_FK_COLUMN_CANNOT_DROP: ErrorCode = ErrorCode(1828); + const ER_FK_COLUMN_CANNOT_DROP_CHILD: ErrorCode = ErrorCode(1829); + const ER_FK_COLUMN_NOT_NULL: ErrorCode = ErrorCode(1830); + const ER_FK_DUP_NAME: ErrorCode = ErrorCode(1826); + const ER_FK_FAIL_ADD_SYSTEM: ErrorCode = ErrorCode(1823); + const ER_FK_INCORRECT_OPTION: ErrorCode = ErrorCode(1825); + const ER_FK_NO_INDEX_CHILD: ErrorCode = ErrorCode(1821); + const ER_FK_NO_INDEX_PARENT: ErrorCode = ErrorCode(1822); + const ER_FLUSH_MASTER_BINLOG_CLOSED: ErrorCode = ErrorCode(1186); + const ER_FORBID_SCHEMA_CHANGE: ErrorCode = ErrorCode(1450); + const ER_FORCING_CLOSE: ErrorCode = ErrorCode(1080); + const ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST: ErrorCode = ErrorCode(1431); + const ER_FOREIGN_DATA_STRING_INVALID: ErrorCode = ErrorCode(1433); + const ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE: ErrorCode = ErrorCode(1432); + const ER_FOREIGN_DUPLICATE_KEY: ErrorCode = ErrorCode(1557); + const ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO: ErrorCode = ErrorCode(1762); + const ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO: ErrorCode = ErrorCode(1761); + const ER_FOREIGN_KEY_ON_PARTITIONED: ErrorCode = ErrorCode(1506); + const ER_FOREIGN_SERVER_DOESNT_EXIST: ErrorCode = ErrorCode(1477); + const ER_FOREIGN_SERVER_EXISTS: ErrorCode = ErrorCode(1476); + const ER_FORM_NOT_FOUND: ErrorCode = ErrorCode(1029); + const ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF: ErrorCode = ErrorCode(1784); + const ER_FPARSER_BAD_HEADER: ErrorCode = ErrorCode(1341); + const ER_FPARSER_EOF_IN_COMMENT: ErrorCode = ErrorCode(1342); + const ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER: ErrorCode = ErrorCode(1344); + const ER_FPARSER_ERROR_IN_PARAMETER: ErrorCode = ErrorCode(1343); + const ER_FPARSER_TOO_BIG_FILE: ErrorCode = ErrorCode(1340); + const ER_FRM_UNKNOWN_TYPE: ErrorCode = ErrorCode(1346); + const ER_FSEEK_FAIL: ErrorCode = ErrorCode(1376); + const ER_FT_MATCHING_KEY_NOT_FOUND: ErrorCode = ErrorCode(1191); + const ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING: ErrorCode = ErrorCode(1757); + const ER_FUNCTION_NOT_DEFINED: ErrorCode = ErrorCode(1128); + const ER_FUNC_INEXISTENT_NAME_COLLISION: ErrorCode = ErrorCode(1630); + const ER_GET_ERRMSG: ErrorCode = ErrorCode(1296); + const ER_GET_ERRN: ErrorCode = ErrorCode(1030); + const ER_GET_TEMPORARY_ERRMSG: ErrorCode = ErrorCode(1297); + const ER_GLOBAL_VARIABLE: ErrorCode = ErrorCode(1229); + const ER_GNO_EXHAUSTED: ErrorCode = ErrorCode(1775); + const ER_GOT_SIGNAL: ErrorCode = ErrorCode(1078); + const ER_GRANT_PLUGIN_USER_EXISTS: ErrorCode = ErrorCode(1700); + const ER_GRANT_WRONG_HOST_OR_USER: ErrorCode = ErrorCode(1145); + const ER_GTID_EXECUTED_WAS_CHANGED: ErrorCode = ErrorCode(1843); + const ER_GTID_MODE2_OR3_REQUIRES_DISABLE_GTID_UNSAFE_STATEMENTS_ON: ErrorCode = ErrorCode(1779); + const ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME: ErrorCode = ErrorCode(1788); + const ER_GTID_MODE_REQUIRES_BINLOG: ErrorCode = ErrorCode(1780); + const ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL: ErrorCode = ErrorCode(1770); + const ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST: ErrorCode = ErrorCode(1767); + const ER_GTID_NEXT_TYPE_UNDEFINED_GROUP: ErrorCode = ErrorCode(1837); + const ER_GTID_OPEN_TABLE_FAILED: ErrorCode = ErrorCode(1944); + const ER_GTID_POSITION_NOT_FOUND_IN_BINLOG: ErrorCode = ErrorCode(1945); + const ER_GTID_POSITION_NOT_FOUND_IN_BINLOG2: ErrorCode = ErrorCode(1955); + const ER_GTID_PURGED_WAS_CHANGED: ErrorCode = ErrorCode(1842); + const ER_GTID_START_FROM_BINLOG_HOLE: ErrorCode = ErrorCode(1951); + const ER_GTID_STRICT_OUT_OF_ORDER: ErrorCode = ErrorCode(1950); + const ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP: ErrorCode = ErrorCode(1884); + const ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION: ErrorCode = ErrorCode(1787); + const ER_GTID_UNSAFE_CREATE_SELECT: ErrorCode = ErrorCode(1786); + const ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE: ErrorCode = ErrorCode(1785); + const ER_HANDSHAKE_ERROR: ErrorCode = ErrorCode(1043); + const ER_HASHCHK: ErrorCode = ErrorCode(1000); + const ER_HOSTNAME: ErrorCode = ErrorCode(1469); + const ER_HOST_IS_BLOCKED: ErrorCode = ErrorCode(1129); + const ER_HOST_NOT_PRIVILEGED: ErrorCode = ErrorCode(1130); + const ER_IDENT_CAUSES_TOO_LONG_PATH: ErrorCode = ErrorCode(1860); + const ER_ILLEGAL_GRANT_FOR_TABLE: ErrorCode = ErrorCode(1144); + const ER_ILLEGAL_HA: ErrorCode = ErrorCode(1031); + const ER_ILLEGAL_HA_CREATE_OPTION: ErrorCode = ErrorCode(1478); + const ER_ILLEGAL_REFERENCE: ErrorCode = ErrorCode(1247); + const ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES: ErrorCode = ErrorCode(1923); + const ER_ILLEGAL_VALUE_FOR_TYPE: ErrorCode = ErrorCode(1367); + const ER_INCONSISTENT_PARTITION_INFO_ERROR: ErrorCode = ErrorCode(1490); + const ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR: ErrorCode = ErrorCode(1494); + const ER_INCORRECT_GLOBAL_LOCAL_VAR: ErrorCode = ErrorCode(1238); + const ER_INCORRECT_GTID_STATE: ErrorCode = ErrorCode(1941); + const ER_INDEX_COLUMN_TOO_LONG: ErrorCode = ErrorCode(1709); + const ER_INDEX_CORRUPT: ErrorCode = ErrorCode(1712); + const ER_INDEX_REBUILD: ErrorCode = ErrorCode(1187); + const ER_INNODB_FORCED_RECOVERY: ErrorCode = ErrorCode(1881); + const ER_INNODB_FT_AUX_NOT_HEX_ID: ErrorCode = ErrorCode(1879); + const ER_INNODB_FT_LIMIT: ErrorCode = ErrorCode(1795); + const ER_INNODB_FT_WRONG_DOCID_COLUMN: ErrorCode = ErrorCode(1797); + const ER_INNODB_FT_WRONG_DOCID_INDEX: ErrorCode = ErrorCode(1798); + const ER_INNODB_IMPORT_ERROR: ErrorCode = ErrorCode(1816); + const ER_INNODB_INDEX_CORRUPT: ErrorCode = ErrorCode(1817); + const ER_INNODB_NO_FT_TEMP_TABLE: ErrorCode = ErrorCode(1796); + const ER_INNODB_NO_FT_USES_PARSER: ErrorCode = ErrorCode(1865); + const ER_INNODB_ONLINE_LOG_TOO_BIG: ErrorCode = ErrorCode(1799); + const ER_INNODB_READ_ONLY: ErrorCode = ErrorCode(1874); + const ER_INSECURE_CHANGE_MASTER: ErrorCode = ErrorCode(1760); + const ER_INSECURE_PLAIN_TEXT: ErrorCode = ErrorCode(1759); + const ER_INSERT_INF: ErrorCode = ErrorCode(1092); + const ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT: ErrorCode = ErrorCode(1685); + const ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT: ErrorCode = ErrorCode(1679); + const ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO: ErrorCode = ErrorCode(1953); + const ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION: ErrorCode = ErrorCode(1929); + const ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN: ErrorCode = ErrorCode(1694); + const ER_INTERNAL_ERROR: ErrorCode = ErrorCode(1815); + const ER_INVALID_CHARACTER_STRING: ErrorCode = ErrorCode(1300); + const ER_INVALID_CURRENT_USER: ErrorCode = ErrorCode(1960); + const ER_INVALID_DEFAULT: ErrorCode = ErrorCode(1067); + const ER_INVALID_DEFAULT_VALUE_FOR_FIELD: ErrorCode = ErrorCode(1978); + const ER_INVALID_GROUP_FUNC_USE: ErrorCode = ErrorCode(1111); + const ER_INVALID_ON_UPDATE: ErrorCode = ErrorCode(1294); + const ER_INVALID_ROLE: ErrorCode = ErrorCode(1959); + const ER_INVALID_USE_OF_NULL: ErrorCode = ErrorCode(1138); + const ER_INVALID_YEAR_COLUMN_LENGTH: ErrorCode = ErrorCode(1818); + const ER_IO_ERR_LOG_INDEX_READ: ErrorCode = ErrorCode(1374); + const ER_IO_READ_ERROR: ErrorCode = ErrorCode(1810); + const ER_IO_WRITE_ERROR: ErrorCode = ErrorCode(1811); + const ER_IPSOCK_ERROR: ErrorCode = ErrorCode(1081); + const ER_IT_IS_A_VIEW: ErrorCode = ErrorCode(1965); + const ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN: ErrorCode = ErrorCode(1904); + const ER_KEY_COLUMN_DOES_NOT_EXITS: ErrorCode = ErrorCode(1072); + const ER_KEY_DOES_NOT_EXITS: ErrorCode = ErrorCode(1176); + const ER_KEY_NOT_FOUND: ErrorCode = ErrorCode(1032); + const ER_KEY_PART0: ErrorCode = ErrorCode(1391); + const ER_KEY_REF_DO_NOT_MATCH_TABLE_REF: ErrorCode = ErrorCode(1240); + const ER_KILL_DENIED_ERROR: ErrorCode = ErrorCode(1095); + const ER_KILL_QUERY_DENIED_ERROR: ErrorCode = ErrorCode(1979); + const ER_LIMITED_PART_RANGE: ErrorCode = ErrorCode(1523); + const ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR: ErrorCode = ErrorCode(1489); + const ER_LOAD_DATA_INVALID_COLUMN: ErrorCode = ErrorCode(1611); + const ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR: ErrorCode = ErrorCode(1409); + const ER_LOAD_INF: ErrorCode = ErrorCode(1087); + const ER_LOCAL_VARIABLE: ErrorCode = ErrorCode(1228); + const ER_LOCK_ABORTED: ErrorCode = ErrorCode(1689); + const ER_LOCK_DEADLOCK: ErrorCode = ErrorCode(1213); + const ER_LOCK_OR_ACTIVE_TRANSACTION: ErrorCode = ErrorCode(1192); + const ER_LOCK_TABLE_FULL: ErrorCode = ErrorCode(1206); + const ER_LOCK_WAIT_TIMEOUT: ErrorCode = ErrorCode(1205); + const ER_LOGGING_PROHIBIT_CHANGING_OF: ErrorCode = ErrorCode(1387); + const ER_LOG_IN_USE: ErrorCode = ErrorCode(1378); + const ER_LOG_PURGE_NO_FILE: ErrorCode = ErrorCode(1612); + const ER_LOG_PURGE_UNKNOWN_ERR: ErrorCode = ErrorCode(1379); + const ER_MALFORMED_DEFINER: ErrorCode = ErrorCode(1446); + const ER_MALFORMED_GTID_SET_ENCODING: ErrorCode = ErrorCode(1773); + const ER_MALFORMED_GTID_SET_SPECIFICATION: ErrorCode = ErrorCode(1772); + const ER_MALFORMED_GTID_SPECIFICATION: ErrorCode = ErrorCode(1774); + const ER_MALFORMED_PACKET: ErrorCode = ErrorCode(1835); + const ER_MASTER: ErrorCode = ErrorCode(1188); + const ER_MASTER_DELAY_VALUE_OUT_OF_RANGE: ErrorCode = ErrorCode(1729); + const ER_MASTER_FATAL_ERROR_READING_BINLOG: ErrorCode = ErrorCode(1236); + const ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG: ErrorCode = ErrorCode(1947); + const ER_MASTER_GTID_POS_MISSING_DOMAIN: ErrorCode = ErrorCode(1948); + const ER_MASTER_HAS_PURGED_REQUIRED_GTIDS: ErrorCode = ErrorCode(1789); + const ER_MASTER_INF: ErrorCode = ErrorCode(1201); + const ER_MASTER_LOG_PREFIX: ErrorCode = ErrorCode(1935); + const ER_MASTER_NET_READ: ErrorCode = ErrorCode(1189); + const ER_MASTER_NET_WRITE: ErrorCode = ErrorCode(1190); + const ER_MAXVALUE_IN_VALUES_IN: ErrorCode = ErrorCode(1656); + const ER_MAX_PREPARED_STMT_COUNT_REACHED: ErrorCode = ErrorCode(1461); + const ER_MESSAGE_AND_STATEMENT: ErrorCode = ErrorCode(1676); + const ER_MISSING_SKIP_SLAVE: ErrorCode = ErrorCode(1278); + const ER_MIXING_NOT_ALLOWED: ErrorCode = ErrorCode(1224); + const ER_MIX_HANDLER_ERROR: ErrorCode = ErrorCode(1497); + const ER_MIX_OF_GROUP_FUNC_AND_FIELDS: ErrorCode = ErrorCode(1140); + const ER_MTS_CANT_PARALLEL: ErrorCode = ErrorCode(1755); + const ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS: ErrorCode = ErrorCode(1802); + const ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX: ErrorCode = ErrorCode(1864); + const ER_MTS_FEATURE_IS_NOT_SUPPORTED: ErrorCode = ErrorCode(1753); + const ER_MTS_INCONSISTENT_DATA: ErrorCode = ErrorCode(1756); + const ER_MTS_RECOVERY_FAILURE: ErrorCode = ErrorCode(1803); + const ER_MTS_RESET_WORKERS: ErrorCode = ErrorCode(1804); + const ER_MTS_UPDATED_DBS_GREATER_MAX: ErrorCode = ErrorCode(1754); + const ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR: ErrorCode = ErrorCode(1495); + const ER_MULTIPLE_PRI_KEY: ErrorCode = ErrorCode(1068); + const ER_MULTI_UPDATE_KEY_CONFLICT: ErrorCode = ErrorCode(1706); + const ER_MUST_CHANGE_PASSWORD: ErrorCode = ErrorCode(1820); + const ER_MUST_CHANGE_PASSWORD_LOGIN: ErrorCode = ErrorCode(1862); + const ER_M_BIGGER_THAN_D: ErrorCode = ErrorCode(1427); + const ER_NAME_BECOMES_EMPTY: ErrorCode = ErrorCode(1474); + const ER_NATIVE_FCT_NAME_COLLISION: ErrorCode = ErrorCode(1585); + const ER_NDB_CANT_SWITCH_BINLOG_FORMAT: ErrorCode = ErrorCode(1561); + const ER_NDB_REPLICATION_SCHEMA_ERROR: ErrorCode = ErrorCode(1625); + const ER_NEED_REPREPARE: ErrorCode = ErrorCode(1615); + const ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE: ErrorCode = ErrorCode(1743); + const ER_NET_ERROR_ON_WRITE: ErrorCode = ErrorCode(1160); + const ER_NET_FCNTL_ERROR: ErrorCode = ErrorCode(1155); + const ER_NET_PACKETS_OUT_OF_ORDER: ErrorCode = ErrorCode(1156); + const ER_NET_PACKET_TOO_LARGE: ErrorCode = ErrorCode(1153); + const ER_NET_READ_ERROR: ErrorCode = ErrorCode(1158); + const ER_NET_READ_ERROR_FROM_PIPE: ErrorCode = ErrorCode(1154); + const ER_NET_READ_INTERRUPTED: ErrorCode = ErrorCode(1159); + const ER_NET_UNCOMPRESS_ERROR: ErrorCode = ErrorCode(1157); + const ER_NET_WRITE_INTERRUPTED: ErrorCode = ErrorCode(1161); + const ER_NEW_ABORTING_CONNECTION: ErrorCode = ErrorCode(1184); + const ER_NISAMCHK: ErrorCode = ErrorCode(1001); + const ER_NO: ErrorCode = ErrorCode(1002); + const ER_NONEXISTING_GRANT: ErrorCode = ErrorCode(1141); + const ER_NONEXISTING_PROC_GRANT: ErrorCode = ErrorCode(1403); + const ER_NONEXISTING_TABLE_GRANT: ErrorCode = ErrorCode(1147); + const ER_NONUNIQ_TABLE: ErrorCode = ErrorCode(1066); + const ER_NONUPDATEABLE_COLUMN: ErrorCode = ErrorCode(1348); + const ER_NON_GROUPING_FIELD_USED: ErrorCode = ErrorCode(1463); + const ER_NON_INSERTABLE_TABLE: ErrorCode = ErrorCode(1471); + const ER_NON_UNIQ_ERROR: ErrorCode = ErrorCode(1052); + const ER_NON_UPDATABLE_TABLE: ErrorCode = ErrorCode(1288); + const ER_NORMAL_SHUTDOWN: ErrorCode = ErrorCode(1077); + const ER_NOT_ALLOWED_COMMAND: ErrorCode = ErrorCode(1148); + const ER_NOT_FORM_FILE: ErrorCode = ErrorCode(1033); + const ER_NOT_KEYFILE: ErrorCode = ErrorCode(1034); + const ER_NOT_SUPPORTED_AUTH_MODE: ErrorCode = ErrorCode(1251); + const ER_NOT_SUPPORTED_YET: ErrorCode = ErrorCode(1235); + const ER_NOT_VALID_PASSWORD: ErrorCode = ErrorCode(1819); + const ER_NO_BINARY_LOGGING: ErrorCode = ErrorCode(1381); + const ER_NO_BINLOG_ERROR: ErrorCode = ErrorCode(1518); + const ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR: ErrorCode = ErrorCode(1487); + const ER_NO_DB_ERROR: ErrorCode = ErrorCode(1046); + const ER_NO_DEFAULT: ErrorCode = ErrorCode(1230); + const ER_NO_DEFAULT_FOR_FIELD: ErrorCode = ErrorCode(1364); + const ER_NO_DEFAULT_FOR_VIEW_FIELD: ErrorCode = ErrorCode(1423); + const ER_NO_EIS_FOR_FIELD: ErrorCode = ErrorCode(1980); + const ER_NO_FILE_MAPPING: ErrorCode = ErrorCode(1388); + const ER_NO_FORMAT_DESCRIPTION_EVENT: ErrorCode = ErrorCode(1609); + const ER_NO_GROUP_FOR_PROC: ErrorCode = ErrorCode(1385); + const ER_NO_PARTITION_FOR_GIVEN_VALUE: ErrorCode = ErrorCode(1526); + const ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT: ErrorCode = ErrorCode(1591); + const ER_NO_PARTS_ERROR: ErrorCode = ErrorCode(1504); + const ER_NO_PERMISSION_TO_CREATE_USER: ErrorCode = ErrorCode(1211); + const ER_NO_RAID_COMPILED: ErrorCode = ErrorCode(1174); + const ER_NO_REFERENCED_ROW: ErrorCode = ErrorCode(1216); + const ER_NO_REFERENCED_ROW2: ErrorCode = ErrorCode(1452); + const ER_NO_SUCH_INDEX: ErrorCode = ErrorCode(1082); + const ER_NO_SUCH_KEY_VALUE: ErrorCode = ErrorCode(1741); + const ER_NO_SUCH_PARTITION_UNUSED: ErrorCode = ErrorCode(1749); + const ER_NO_SUCH_QUERY: ErrorCode = ErrorCode(1957); + const ER_NO_SUCH_TABLE: ErrorCode = ErrorCode(1146); + const ER_NO_SUCH_TABLE_IN_ENGINE: ErrorCode = ErrorCode(1932); + const ER_NO_SUCH_THREAD: ErrorCode = ErrorCode(1094); + const ER_NO_SUCH_USER: ErrorCode = ErrorCode(1449); + const ER_NO_TABLES_USED: ErrorCode = ErrorCode(1096); + const ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA: ErrorCode = ErrorCode(1465); + const ER_NO_UNIQUE_LOGFILE: ErrorCode = ErrorCode(1098); + const ER_NULL_COLUMN_IN_INDEX: ErrorCode = ErrorCode(1121); + const ER_NULL_IN_VALUES_LESS_THAN: ErrorCode = ErrorCode(1566); + const ER_OLD_FILE_FORMAT: ErrorCode = ErrorCode(1455); + const ER_OLD_KEYFILE: ErrorCode = ErrorCode(1035); + const ER_OLD_TEMPORALS_UPGRADED: ErrorCode = ErrorCode(1880); + const ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT: ErrorCode = ErrorCode(1730); + const ER_ONLY_INTEGERS_ALLOWED: ErrorCode = ErrorCode(1578); + const ER_ONLY_ON_RANGE_LIST_PARTITION: ErrorCode = ErrorCode(1512); + const ER_OPEN_AS_READONLY: ErrorCode = ErrorCode(1036); + const ER_OPERAND_COLUMNS: ErrorCode = ErrorCode(1241); + const ER_OPTION_PREVENTS_STATEMENT: ErrorCode = ErrorCode(1290); + const ER_ORDER_WITH_PROC: ErrorCode = ErrorCode(1386); + const ER_OUTOFMEMORY: ErrorCode = ErrorCode(1037); + const ER_OUT_OF_RESOURCES: ErrorCode = ErrorCode(1041); + const ER_OUT_OF_SORTMEMORY: ErrorCode = ErrorCode(1038); + const ER_PARSE_ERROR: ErrorCode = ErrorCode(1064); + const ER_PARTITIONS_MUST_BE_DEFINED_ERROR: ErrorCode = ErrorCode(1492); + const ER_PARTITION_CLAUSE_ON_NONPARTITIONED: ErrorCode = ErrorCode(1747); + const ER_PARTITION_COLUMN_LIST_ERROR: ErrorCode = ErrorCode(1653); + const ER_PARTITION_CONST_DOMAIN_ERROR: ErrorCode = ErrorCode(1563); + const ER_PARTITION_ENTRY_ERROR: ErrorCode = ErrorCode(1496); + const ER_PARTITION_EXCHANGE_DIFFERENT_OPTION: ErrorCode = ErrorCode(1731); + const ER_PARTITION_EXCHANGE_FOREIGN_KEY: ErrorCode = ErrorCode(1740); + const ER_PARTITION_EXCHANGE_PART_TABLE: ErrorCode = ErrorCode(1732); + const ER_PARTITION_EXCHANGE_TEMP_TABLE: ErrorCode = ErrorCode(1733); + const ER_PARTITION_FIELDS_TOO_LONG: ErrorCode = ErrorCode(1660); + const ER_PARTITION_FUNCTION_FAILURE: ErrorCode = ErrorCode(1521); + const ER_PARTITION_FUNCTION_IS_NOT_ALLOWED: ErrorCode = ErrorCode(1564); + const ER_PARTITION_FUNC_NOT_ALLOWED_ERROR: ErrorCode = ErrorCode(1491); + const ER_PARTITION_INSTEAD_OF_SUBPARTITION: ErrorCode = ErrorCode(1734); + const ER_PARTITION_MAXVALUE_ERROR: ErrorCode = ErrorCode(1481); + const ER_PARTITION_MERGE_ERROR: ErrorCode = ErrorCode(1572); + const ER_PARTITION_MGMT_ON_NONPARTITIONED: ErrorCode = ErrorCode(1505); + const ER_PARTITION_NAME: ErrorCode = ErrorCode(1633); + const ER_PARTITION_NOT_DEFINED_ERROR: ErrorCode = ErrorCode(1498); + const ER_PARTITION_NO_TEMPORARY: ErrorCode = ErrorCode(1562); + const ER_PARTITION_REQUIRES_VALUES_ERROR: ErrorCode = ErrorCode(1479); + const ER_PARTITION_SUBPARTITION_ERROR: ErrorCode = ErrorCode(1482); + const ER_PARTITION_SUBPART_MIX_ERROR: ErrorCode = ErrorCode(1483); + const ER_PARTITION_WRONG_NO_PART_ERROR: ErrorCode = ErrorCode(1484); + const ER_PARTITION_WRONG_NO_SUBPART_ERROR: ErrorCode = ErrorCode(1485); + const ER_PARTITION_WRONG_VALUES_ERROR: ErrorCode = ErrorCode(1480); + const ER_PART_STATE_ERROR: ErrorCode = ErrorCode(1522); + const ER_PASSWD_LENGTH: ErrorCode = ErrorCode(1372); + const ER_PASSWORD_ANONYMOUS_USER: ErrorCode = ErrorCode(1131); + const ER_PASSWORD_FORMAT: ErrorCode = ErrorCode(1827); + const ER_PASSWORD_NOT_ALLOWED: ErrorCode = ErrorCode(1132); + const ER_PASSWORD_NO_MATCH: ErrorCode = ErrorCode(1133); + const ER_PATH_LENGTH: ErrorCode = ErrorCode(1680); + const ER_PLUGIN_CANNOT_BE_UNINSTALLED: ErrorCode = ErrorCode(1883); + const ER_PLUGIN_INSTALLED: ErrorCode = ErrorCode(1968); + const ER_PLUGIN_IS_NOT_LOADED: ErrorCode = ErrorCode(1524); + const ER_PLUGIN_IS_PERMANENT: ErrorCode = ErrorCode(1702); + const ER_PLUGIN_NO_INSTALL: ErrorCode = ErrorCode(1721); + const ER_PLUGIN_NO_UNINSTALL: ErrorCode = ErrorCode(1720); + const ER_PRIMARY_CANT_HAVE_NULL: ErrorCode = ErrorCode(1171); + const ER_PRIMARY_KEY_BASED_ON_VIRTUAL_COLUMN: ErrorCode = ErrorCode(1903); + const ER_PRIOR_COMMIT_FAILED: ErrorCode = ErrorCode(1964); + const ER_PROCACCESS_DENIED_ERROR: ErrorCode = ErrorCode(1370); + const ER_PROC_AUTO_GRANT_FAIL: ErrorCode = ErrorCode(1404); + const ER_PROC_AUTO_REVOKE_FAIL: ErrorCode = ErrorCode(1405); + const ER_PS_MANY_PARAM: ErrorCode = ErrorCode(1390); + const ER_PS_NO_RECURSION: ErrorCode = ErrorCode(1444); + const ER_QUERY_CACHE_DISABLED: ErrorCode = ErrorCode(1651); + const ER_QUERY_CACHE_IS_DISABLED: ErrorCode = ErrorCode(1924); + const ER_QUERY_CACHE_IS_GLOBALY_DISABLED: ErrorCode = ErrorCode(1925); + const ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT: ErrorCode = ErrorCode(1931); + const ER_QUERY_INTERRUPTED: ErrorCode = ErrorCode(1317); + const ER_QUERY_ON_FOREIGN_DATA_SOURCE: ErrorCode = ErrorCode(1430); + const ER_QUERY_ON_MASTER: ErrorCode = ErrorCode(1219); + const ER_RANGE_NOT_INCREASING_ERROR: ErrorCode = ErrorCode(1493); + const ER_RBR_NOT_AVAILABLE: ErrorCode = ErrorCode(1574); + const ER_READY: ErrorCode = ErrorCode(1076); + const ER_READ_ONLY_MODE: ErrorCode = ErrorCode(1836); + const ER_READ_ONLY_TRANSACTION: ErrorCode = ErrorCode(1207); + const ER_RECORD_FILE_FULL: ErrorCode = ErrorCode(1114); + const ER_REGEXP_ERROR: ErrorCode = ErrorCode(1139); + const ER_RELAY_LOG_FAIL: ErrorCode = ErrorCode(1371); + const ER_RELAY_LOG_INIT: ErrorCode = ErrorCode(1380); + const ER_REMOVED_SPACES: ErrorCode = ErrorCode(1466); + const ER_RENAMED_NAME: ErrorCode = ErrorCode(1636); + const ER_REORG_HASH_ONLY_ON_SAME_N: ErrorCode = ErrorCode(1510); + const ER_REORG_NO_PARAM_ERROR: ErrorCode = ErrorCode(1511); + const ER_REORG_OUTSIDE_RANGE: ErrorCode = ErrorCode(1520); + const ER_REORG_PARTITION_NOT_EXIST: ErrorCode = ErrorCode(1516); + const ER_REQUIRES_PRIMARY_KEY: ErrorCode = ErrorCode(1173); + const ER_RESERVED_SYNTAX: ErrorCode = ErrorCode(1382); + const ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER: ErrorCode = ErrorCode(1645); + const ER_REVOKE_GRANTS: ErrorCode = ErrorCode(1269); + const ER_ROLE_CREATE_EXISTS: ErrorCode = ErrorCode(1975); + const ER_ROLE_DROP_EXISTS: ErrorCode = ErrorCode(1976); + const ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET: ErrorCode = ErrorCode(1748); + const ER_ROW_DOES_NOT_MATCH_PARTITION: ErrorCode = ErrorCode(1737); + const ER_ROW_EXPR_FOR_VCOL: ErrorCode = ErrorCode(1909); + const ER_ROW_IN_WRONG_PARTITION: ErrorCode = ErrorCode(1863); + const ER_ROW_IS_REFERENCED: ErrorCode = ErrorCode(1217); + const ER_ROW_IS_REFERENCED2: ErrorCode = ErrorCode(1451); + const ER_ROW_SINGLE_PARTITION_FIELD_ERROR: ErrorCode = ErrorCode(1658); + const ER_RPL_INFO_DATA_TOO_LONG: ErrorCode = ErrorCode(1742); + const ER_SAME_NAME_PARTITION: ErrorCode = ErrorCode(1517); + const ER_SAME_NAME_PARTITION_FIELD: ErrorCode = ErrorCode(1652); + const ER_SELECT_REDUCED: ErrorCode = ErrorCode(1249); + const ER_SERVER_IS_IN_SECURE_AUTH_MODE: ErrorCode = ErrorCode(1275); + const ER_SERVER_SHUTDOWN: ErrorCode = ErrorCode(1053); + const ER_SET_CONSTANTS_ONLY: ErrorCode = ErrorCode(1204); + const ER_SET_PASSWORD_AUTH_PLUGIN: ErrorCode = ErrorCode(1699); + const ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION: ErrorCode = ErrorCode(1769); + const ER_SET_STATEMENT_NOT_SUPPORTED: ErrorCode = ErrorCode(1971); + const ER_SHUTDOWN_COMPLETE: ErrorCode = ErrorCode(1079); + const ER_SIGNAL_BAD_CONDITION_TYPE: ErrorCode = ErrorCode(1646); + const ER_SIGNAL_EXCEPTION: ErrorCode = ErrorCode(1644); + const ER_SIGNAL_NOT_FOUND: ErrorCode = ErrorCode(1643); + const ER_SIGNAL_WARN: ErrorCode = ErrorCode(1642); + const ER_SIZE_OVERFLOW_ERROR: ErrorCode = ErrorCode(1532); + const ER_SKIPPING_LOGGED_TRANSACTION: ErrorCode = ErrorCode(1771); + const ER_SLAVE_CANT_CREATE_CONVERSION: ErrorCode = ErrorCode(1678); + const ER_SLAVE_CONFIGURATION: ErrorCode = ErrorCode(1794); + const ER_SLAVE_CONVERSION_FAILED: ErrorCode = ErrorCode(1677); + const ER_SLAVE_CORRUPT_EVENT: ErrorCode = ErrorCode(1610); + const ER_SLAVE_CREATE_EVENT_FAILURE: ErrorCode = ErrorCode(1596); + const ER_SLAVE_FATAL_ERROR: ErrorCode = ErrorCode(1593); + const ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER: ErrorCode = ErrorCode(1885); + const ER_SLAVE_HEARTBEAT_FAILURE: ErrorCode = ErrorCode(1623); + const ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE: ErrorCode = ErrorCode(1624); + const ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX: ErrorCode = ErrorCode(1704); + const ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN: ErrorCode = ErrorCode(1703); + const ER_SLAVE_IGNORED_SSL_PARAMS: ErrorCode = ErrorCode(1274); + const ER_SLAVE_IGNORED_TABLE: ErrorCode = ErrorCode(1237); + const ER_SLAVE_IGNORE_SERVER_IDS: ErrorCode = ErrorCode(1650); + const ER_SLAVE_INCIDENT: ErrorCode = ErrorCode(1590); + const ER_SLAVE_MASTER_COM_FAILURE: ErrorCode = ErrorCode(1597); + const ER_SLAVE_MI_INIT_REPOSITORY: ErrorCode = ErrorCode(1871); + const ER_SLAVE_MUST_STOP: ErrorCode = ErrorCode(1198); + const ER_SLAVE_NOT_RUNNING: ErrorCode = ErrorCode(1199); + const ER_SLAVE_RELAY_LOG_READ_FAILURE: ErrorCode = ErrorCode(1594); + const ER_SLAVE_RELAY_LOG_WRITE_FAILURE: ErrorCode = ErrorCode(1595); + const ER_SLAVE_RLI_INIT_REPOSITORY: ErrorCode = ErrorCode(1872); + const ER_SLAVE_SILENT_RETRY_TRANSACTION: ErrorCode = ErrorCode(1806); + const ER_SLAVE_SKIP_NOT_IN_GTID: ErrorCode = ErrorCode(1966); + const ER_SLAVE_STARTED: ErrorCode = ErrorCode(1937); + const ER_SLAVE_STOPPED: ErrorCode = ErrorCode(1938); + const ER_SLAVE_THREAD: ErrorCode = ErrorCode(1202); + const ER_SLAVE_UNEXPECTED_MASTER_SWITCH: ErrorCode = ErrorCode(1952); + const ER_SLAVE_WAS_NOT_RUNNING: ErrorCode = ErrorCode(1255); + const ER_SLAVE_WAS_RUNNING: ErrorCode = ErrorCode(1254); + const ER_SPATIAL_CANT_HAVE_NULL: ErrorCode = ErrorCode(1252); + const ER_SPATIAL_MUST_HAVE_GEOM_COL: ErrorCode = ErrorCode(1687); + const ER_SPECIFIC_ACCESS_DENIED_ERROR: ErrorCode = ErrorCode(1227); + const ER_SP_ALREADY_EXISTS: ErrorCode = ErrorCode(1304); + const ER_SP_BADRETURN: ErrorCode = ErrorCode(1313); + const ER_SP_BADSELECT: ErrorCode = ErrorCode(1312); + const ER_SP_BADSTATEMENT: ErrorCode = ErrorCode(1314); + const ER_SP_BAD_CURSOR_QUERY: ErrorCode = ErrorCode(1322); + const ER_SP_BAD_CURSOR_SELECT: ErrorCode = ErrorCode(1323); + const ER_SP_BAD_SQLSTATE: ErrorCode = ErrorCode(1407); + const ER_SP_BAD_VAR_SHADOW: ErrorCode = ErrorCode(1453); + const ER_SP_CANT_ALTER: ErrorCode = ErrorCode(1334); + const ER_SP_CANT_SET_AUTOCOMMIT: ErrorCode = ErrorCode(1445); + const ER_SP_CASE_NOT_FOUND: ErrorCode = ErrorCode(1339); + const ER_SP_COND_MISMATCH: ErrorCode = ErrorCode(1319); + const ER_SP_CURSOR_AFTER_HANDLER: ErrorCode = ErrorCode(1338); + const ER_SP_CURSOR_ALREADY_OPEN: ErrorCode = ErrorCode(1325); + const ER_SP_CURSOR_MISMATCH: ErrorCode = ErrorCode(1324); + const ER_SP_CURSOR_NOT_OPEN: ErrorCode = ErrorCode(1326); + const ER_SP_DOES_NOT_EXIST: ErrorCode = ErrorCode(1305); + const ER_SP_DROP_FAILED: ErrorCode = ErrorCode(1306); + const ER_SP_DUP_COND: ErrorCode = ErrorCode(1332); + const ER_SP_DUP_CURS: ErrorCode = ErrorCode(1333); + const ER_SP_DUP_HANDLER: ErrorCode = ErrorCode(1413); + const ER_SP_DUP_PARAM: ErrorCode = ErrorCode(1330); + const ER_SP_DUP_VAR: ErrorCode = ErrorCode(1331); + const ER_SP_FETCH_NO_DATA: ErrorCode = ErrorCode(1329); + const ER_SP_GOTO_IN_HNDLR: ErrorCode = ErrorCode(1358); + const ER_SP_LABEL_MISMATCH: ErrorCode = ErrorCode(1310); + const ER_SP_LABEL_REDEFINE: ErrorCode = ErrorCode(1309); + const ER_SP_LILABEL_MISMATCH: ErrorCode = ErrorCode(1308); + const ER_SP_NORETURN: ErrorCode = ErrorCode(1320); + const ER_SP_NORETURNEND: ErrorCode = ErrorCode(1321); + const ER_SP_NOT_VAR_ARG: ErrorCode = ErrorCode(1414); + const ER_SP_NO_AGGREGATE: ErrorCode = ErrorCode(1460); + const ER_SP_NO_DROP_SP: ErrorCode = ErrorCode(1357); + const ER_SP_NO_RECURSION: ErrorCode = ErrorCode(1424); + const ER_SP_NO_RECURSIVE_CREATE: ErrorCode = ErrorCode(1303); + const ER_SP_NO_RETSET: ErrorCode = ErrorCode(1415); + const ER_SP_PROC_TABLE_CORRUPT: ErrorCode = ErrorCode(1457); + const ER_SP_RECURSION_LIMIT: ErrorCode = ErrorCode(1456); + const ER_SP_STORE_FAILED: ErrorCode = ErrorCode(1307); + const ER_SP_SUBSELECT_NYI: ErrorCode = ErrorCode(1335); + const ER_SP_UNDECLARED_VAR: ErrorCode = ErrorCode(1327); + const ER_SP_UNINIT_VAR: ErrorCode = ErrorCode(1311); + const ER_SP_VARCOND_AFTER_CURSHNDLR: ErrorCode = ErrorCode(1337); + const ER_SP_WRONG_NAME: ErrorCode = ErrorCode(1458); + const ER_SP_WRONG_NO_OF_ARGS: ErrorCode = ErrorCode(1318); + const ER_SP_WRONG_NO_OF_FETCH_ARGS: ErrorCode = ErrorCode(1328); + const ER_SQLTHREAD_WITH_SECURE_SLAVE: ErrorCode = ErrorCode(1763); + const ER_SQL_DISCOVER_ERROR: ErrorCode = ErrorCode(1939); + const ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE: ErrorCode = ErrorCode(1858); + const ER_SR_INVALID_CREATION_CTX: ErrorCode = ErrorCode(1601); + const ER_STACK_OVERRUN: ErrorCode = ErrorCode(1119); + const ER_STACK_OVERRUN_NEED_MORE: ErrorCode = ErrorCode(1436); + const ER_STARTUP: ErrorCode = ErrorCode(1408); + const ER_STATEMENT_TIMEOUT: ErrorCode = ErrorCode(1969); + const ER_STMT_CACHE_FULL: ErrorCode = ErrorCode(1705); + const ER_STMT_HAS_NO_OPEN_CURSOR: ErrorCode = ErrorCode(1421); + const ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG: ErrorCode = ErrorCode(1336); + const ER_STOP_SLAVE_IO_THREAD_TIMEOUT: ErrorCode = ErrorCode(1876); + const ER_STOP_SLAVE_SQL_THREAD_TIMEOUT: ErrorCode = ErrorCode(1875); + const ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT: ErrorCode = ErrorCode(1686); + const ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT: ErrorCode = ErrorCode(1560); + const ER_STORED_FUNCTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO: ErrorCode = ErrorCode(1954); + const ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION: ErrorCode = ErrorCode(1930); + const ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN: ErrorCode = ErrorCode(1695); + const ER_SUBPARTITION_ERROR: ErrorCode = ErrorCode(1500); + const ER_SUBPARTITION_NAME: ErrorCode = ErrorCode(1634); + const ER_SUBQUERIES_NOT_SUPPORTED: ErrorCode = ErrorCode(1970); + const ER_SUBQUERY_NO1_ROW: ErrorCode = ErrorCode(1242); + const ER_SYNTAX_ERROR: ErrorCode = ErrorCode(1149); + const ER_TABLEACCESS_DENIED_ERROR: ErrorCode = ErrorCode(1142); + const ER_TABLENAME_NOT_ALLOWED_HERE: ErrorCode = ErrorCode(1250); + const ER_TABLESPACE_AUTO_EXTEND_ERROR: ErrorCode = ErrorCode(1530); + const ER_TABLESPACE_DISCARDED: ErrorCode = ErrorCode(1814); + const ER_TABLESPACE_EXISTS: ErrorCode = ErrorCode(1813); + const ER_TABLESPACE_MISSING: ErrorCode = ErrorCode(1812); + const ER_TABLES_DIFFERENT_METADATA: ErrorCode = ErrorCode(1736); + const ER_TABLE_CANT_HANDLE_AUTO_INCREMENT: ErrorCode = ErrorCode(1164); + const ER_TABLE_CANT_HANDLE_BLOB: ErrorCode = ErrorCode(1163); + const ER_TABLE_CANT_HANDLE_FT: ErrorCode = ErrorCode(1214); + const ER_TABLE_CANT_HANDLE_SPKEYS: ErrorCode = ErrorCode(1464); + const ER_TABLE_CORRUPT: ErrorCode = ErrorCode(1877); + const ER_TABLE_DEFINITION_TOO_BIG: ErrorCode = ErrorCode(1967); + const ER_TABLE_DEF_CHANGED: ErrorCode = ErrorCode(1412); + const ER_TABLE_EXISTS_ERROR: ErrorCode = ErrorCode(1050); + const ER_TABLE_HAS_NO_FT: ErrorCode = ErrorCode(1764); + const ER_TABLE_IN_FK_CHECK: ErrorCode = ErrorCode(1725); + const ER_TABLE_IN_SYSTEM_TABLESPACE: ErrorCode = ErrorCode(1809); + const ER_TABLE_MUST_HAVE_COLUMNS: ErrorCode = ErrorCode(1113); + const ER_TABLE_NAME: ErrorCode = ErrorCode(1632); + const ER_TABLE_NEEDS_REBUILD: ErrorCode = ErrorCode(1707); + const ER_TABLE_NEEDS_UPGRADE: ErrorCode = ErrorCode(1459); + const ER_TABLE_NOT_LOCKED: ErrorCode = ErrorCode(1100); + const ER_TABLE_NOT_LOCKED_FOR_WRITE: ErrorCode = ErrorCode(1099); + const ER_TABLE_SCHEMA_MISMATCH: ErrorCode = ErrorCode(1808); + const ER_TARGET_NOT_EXPLAINABLE: ErrorCode = ErrorCode(1933); + const ER_TEMPORARY_NAME: ErrorCode = ErrorCode(1635); + const ER_TEMP_FILE_WRITE_FAILURE: ErrorCode = ErrorCode(1878); + const ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR: ErrorCode = ErrorCode(1559); + const ER_TEXTFILE_NOT_READABLE: ErrorCode = ErrorCode(1085); + const ER_TOO_BIG_DISPLAYWIDTH: ErrorCode = ErrorCode(1439); + const ER_TOO_BIG_FIELDLENGTH: ErrorCode = ErrorCode(1074); + const ER_TOO_BIG_FOR_UNCOMPRESS: ErrorCode = ErrorCode(1256); + const ER_TOO_BIG_PRECISION: ErrorCode = ErrorCode(1426); + const ER_TOO_BIG_ROWSIZE: ErrorCode = ErrorCode(1118); + const ER_TOO_BIG_SCALE: ErrorCode = ErrorCode(1425); + const ER_TOO_BIG_SELECT: ErrorCode = ErrorCode(1104); + const ER_TOO_BIG_SET: ErrorCode = ErrorCode(1097); + const ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT: ErrorCode = ErrorCode(1473); + const ER_TOO_LONG_BODY: ErrorCode = ErrorCode(1437); + const ER_TOO_LONG_FIELD_COMMENT: ErrorCode = ErrorCode(1629); + const ER_TOO_LONG_IDENT: ErrorCode = ErrorCode(1059); + const ER_TOO_LONG_INDEX_COMMENT: ErrorCode = ErrorCode(1688); + const ER_TOO_LONG_KEY: ErrorCode = ErrorCode(1071); + const ER_TOO_LONG_STRING: ErrorCode = ErrorCode(1162); + const ER_TOO_LONG_TABLE_COMMENT: ErrorCode = ErrorCode(1628); + const ER_TOO_LONG_TABLE_PARTITION_COMMENT: ErrorCode = ErrorCode(1793); + const ER_TOO_MANY_CONCURRENT_TRXS: ErrorCode = ErrorCode(1637); + const ER_TOO_MANY_DELAYED_THREADS: ErrorCode = ErrorCode(1151); + const ER_TOO_MANY_FIELDS: ErrorCode = ErrorCode(1117); + const ER_TOO_MANY_KEYS: ErrorCode = ErrorCode(1069); + const ER_TOO_MANY_KEY_PARTS: ErrorCode = ErrorCode(1070); + const ER_TOO_MANY_PARTITIONS_ERROR: ErrorCode = ErrorCode(1499); + const ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR: ErrorCode = ErrorCode(1655); + const ER_TOO_MANY_ROWS: ErrorCode = ErrorCode(1172); + const ER_TOO_MANY_TABLES: ErrorCode = ErrorCode(1116); + const ER_TOO_MANY_USER_CONNECTIONS: ErrorCode = ErrorCode(1203); + const ER_TOO_MANY_VALUES_ERROR: ErrorCode = ErrorCode(1657); + const ER_TOO_MUCH_AUTO_TIMESTAMP_COLS: ErrorCode = ErrorCode(1293); + const ER_TRANS_CACHE_FULL: ErrorCode = ErrorCode(1197); + const ER_TRG_ALREADY_EXISTS: ErrorCode = ErrorCode(1359); + const ER_TRG_CANT_CHANGE_ROW: ErrorCode = ErrorCode(1362); + const ER_TRG_CANT_OPEN_TABLE: ErrorCode = ErrorCode(1606); + const ER_TRG_CORRUPTED_FILE: ErrorCode = ErrorCode(1602); + const ER_TRG_DOES_NOT_EXIST: ErrorCode = ErrorCode(1360); + const ER_TRG_INVALID_CREATION_CTX: ErrorCode = ErrorCode(1604); + const ER_TRG_IN_WRONG_SCHEMA: ErrorCode = ErrorCode(1435); + const ER_TRG_NO_CREATION_CTX: ErrorCode = ErrorCode(1603); + const ER_TRG_NO_DEFINER: ErrorCode = ErrorCode(1454); + const ER_TRG_NO_SUCH_ROW_IN_TRG: ErrorCode = ErrorCode(1363); + const ER_TRG_ON_VIEW_OR_TEMP_TABLE: ErrorCode = ErrorCode(1361); + const ER_TRUNCATED_WRONG_VALUE: ErrorCode = ErrorCode(1292); + const ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: ErrorCode = ErrorCode(1366); + const ER_TRUNCATE_ILLEGAL_FK: ErrorCode = ErrorCode(1701); + const ER_UDF_EXISTS: ErrorCode = ErrorCode(1125); + const ER_UDF_NO_PATHS: ErrorCode = ErrorCode(1124); + const ER_UNDO_RECORD_TOO_BIG: ErrorCode = ErrorCode(1713); + const ER_UNEXPECTED_EOF: ErrorCode = ErrorCode(1039); + const ER_UNION_TABLES_IN_DIFFERENT_DIR: ErrorCode = ErrorCode(1212); + const ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF: ErrorCode = ErrorCode(1503); + const ER_UNKNOWN_ALTER_ALGORITHM: ErrorCode = ErrorCode(1800); + const ER_UNKNOWN_ALTER_LOCK: ErrorCode = ErrorCode(1801); + const ER_UNKNOWN_CHARACTER_SET: ErrorCode = ErrorCode(1115); + const ER_UNKNOWN_COLLATION: ErrorCode = ErrorCode(1273); + const ER_UNKNOWN_COM_ERROR: ErrorCode = ErrorCode(1047); + const ER_UNKNOWN_ERROR: ErrorCode = ErrorCode(1105); + const ER_UNKNOWN_EXPLAIN_FORMAT: ErrorCode = ErrorCode(1791); + const ER_UNKNOWN_KEY_CACHE: ErrorCode = ErrorCode(1284); + const ER_UNKNOWN_LOCALE: ErrorCode = ErrorCode(1649); + const ER_UNKNOWN_OPTION: ErrorCode = ErrorCode(1911); + const ER_UNKNOWN_PARTITION: ErrorCode = ErrorCode(1735); + const ER_UNKNOWN_PROCEDURE: ErrorCode = ErrorCode(1106); + const ER_UNKNOWN_STMT_HANDLER: ErrorCode = ErrorCode(1243); + const ER_UNKNOWN_STORAGE_ENGINE: ErrorCode = ErrorCode(1286); + const ER_UNKNOWN_SYSTEM_VARIABLE: ErrorCode = ErrorCode(1193); + const ER_UNKNOWN_TABLE: ErrorCode = ErrorCode(1109); + const ER_UNKNOWN_TARGET_BINLOG: ErrorCode = ErrorCode(1373); + const ER_UNKNOWN_TIME_ZONE: ErrorCode = ErrorCode(1298); + const ER_UNSUPORTED_LOG_ENGINE: ErrorCode = ErrorCode(1579); + const ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN: ErrorCode = ErrorCode(1907); + const ER_UNSUPPORTED_ENGINE: ErrorCode = ErrorCode(1726); + const ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS: ErrorCode = ErrorCode(1910); + const ER_UNSUPPORTED_EXTENSION: ErrorCode = ErrorCode(1112); + const ER_UNSUPPORTED_PS: ErrorCode = ErrorCode(1295); + const ER_UNTIL_COND_IGNORED: ErrorCode = ErrorCode(1279); + const ER_UNTIL_REQUIRES_USING_GTID: ErrorCode = ErrorCode(1949); + const ER_UNUSED11: ErrorCode = ErrorCode(1608); + const ER_UNUSED17: ErrorCode = ErrorCode(1972); + const ER_UPDATE_INF: ErrorCode = ErrorCode(1134); + const ER_UPDATE_LOG_DEPRECATED_IGNORED: ErrorCode = ErrorCode(1315); + const ER_UPDATE_LOG_DEPRECATED_TRANSLATED: ErrorCode = ErrorCode(1316); + const ER_UPDATE_TABLE_USED: ErrorCode = ErrorCode(1093); + const ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE: ErrorCode = ErrorCode(1175); + const ER_USERNAME: ErrorCode = ErrorCode(1468); + const ER_USER_CREATE_EXISTS: ErrorCode = ErrorCode(1973); + const ER_USER_DROP_EXISTS: ErrorCode = ErrorCode(1974); + const ER_USER_LIMIT_REACHED: ErrorCode = ErrorCode(1226); + const ER_VALUES_IS_NOT_INT_TYPE_ERROR: ErrorCode = ErrorCode(1697); + const ER_VARIABLE_IS_NOT_STRUCT: ErrorCode = ErrorCode(1272); + const ER_VARIABLE_IS_READONLY: ErrorCode = ErrorCode(1621); + const ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER: ErrorCode = ErrorCode(1765); + const ER_VARIABLE_NOT_SETTABLE_IN_SP: ErrorCode = ErrorCode(1838); + const ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION: ErrorCode = ErrorCode(1766); + const ER_VAR_CANT_BE_READ: ErrorCode = ErrorCode(1233); + const ER_VCOL_BASED_ON_VCOL: ErrorCode = ErrorCode(1900); + const ER_VIEW_CHECKSUM: ErrorCode = ErrorCode(1392); + const ER_VIEW_CHECK_FAILED: ErrorCode = ErrorCode(1369); + const ER_VIEW_DELETE_MERGE_VIEW: ErrorCode = ErrorCode(1395); + const ER_VIEW_FRM_NO_USER: ErrorCode = ErrorCode(1447); + const ER_VIEW_INVALID: ErrorCode = ErrorCode(1356); + const ER_VIEW_INVALID_CREATION_CTX: ErrorCode = ErrorCode(1600); + const ER_VIEW_MULTIUPDATE: ErrorCode = ErrorCode(1393); + const ER_VIEW_NONUPD_CHECK: ErrorCode = ErrorCode(1368); + const ER_VIEW_NO_CREATION_CTX: ErrorCode = ErrorCode(1599); + const ER_VIEW_NO_EXPLAIN: ErrorCode = ErrorCode(1345); + const ER_VIEW_NO_INSERT_FIELD_LIST: ErrorCode = ErrorCode(1394); + const ER_VIEW_ORDERBY_IGNORED: ErrorCode = ErrorCode(1926); + const ER_VIEW_OTHER_USER: ErrorCode = ErrorCode(1448); + const ER_VIEW_PREVENT_UPDATE: ErrorCode = ErrorCode(1443); + const ER_VIEW_RECURSIVE: ErrorCode = ErrorCode(1462); + const ER_VIEW_SELECT_CLAUSE: ErrorCode = ErrorCode(1350); + const ER_VIEW_SELECT_DERIVED: ErrorCode = ErrorCode(1349); + const ER_VIEW_SELECT_TMPTABLE: ErrorCode = ErrorCode(1352); + const ER_VIEW_SELECT_VARIABLE: ErrorCode = ErrorCode(1351); + const ER_VIEW_WRONG_LIST: ErrorCode = ErrorCode(1353); + const ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED: ErrorCode = ErrorCode(1901); + const ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN: ErrorCode = ErrorCode(1906); + const ER_WARNING_NOT_COMPLETE_ROLLBACK: ErrorCode = ErrorCode(1196); + const ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE: ErrorCode = ErrorCode(1751); + const ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE: ErrorCode = ErrorCode(1752); + const ER_WARN_AGGFUNC_DEPENDENCE: ErrorCode = ErrorCode(1981); + const ER_WARN_ALLOWED_PACKET_OVERFLOWED: ErrorCode = ErrorCode(1301); + const ER_WARN_CANT_DROP_DEFAULT_KEYCACHE: ErrorCode = ErrorCode(1438); + const ER_WARN_DATA_OUT_OF_RANGE: ErrorCode = ErrorCode(1264); + const ER_WARN_DEPRECATED_SYNTAX: ErrorCode = ErrorCode(1287); + const ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT: ErrorCode = ErrorCode(1681); + const ER_WARN_DEPRECATED_SYNTAX_WITH_VER: ErrorCode = ErrorCode(1554); + const ER_WARN_ENGINE_TRANSACTION_ROLLBACK: ErrorCode = ErrorCode(1622); + const ER_WARN_FIELD_RESOLVED: ErrorCode = ErrorCode(1276); + const ER_WARN_HOSTNAME_WONT_WORK: ErrorCode = ErrorCode(1285); + const ER_WARN_INDEX_NOT_APPLICABLE: ErrorCode = ErrorCode(1739); + const ER_WARN_INVALID_TIMESTAMP: ErrorCode = ErrorCode(1299); + const ER_WARN_IS_SKIPPED_TABLE: ErrorCode = ErrorCode(1684); + const ER_WARN_NULL_TO_NOTNULL: ErrorCode = ErrorCode(1263); + const ER_WARN_PURGE_LOG_IN_USE: ErrorCode = ErrorCode(1867); + const ER_WARN_PURGE_LOG_IS_ACTIVE: ErrorCode = ErrorCode(1868); + const ER_WARN_QC_RESIZE: ErrorCode = ErrorCode(1282); + const ER_WARN_TOO_FEW_RECORDS: ErrorCode = ErrorCode(1261); + const ER_WARN_TOO_MANY_RECORDS: ErrorCode = ErrorCode(1262); + const ER_WARN_USING_OTHER_HANDLER: ErrorCode = ErrorCode(1266); + const ER_WARN_VIEW_MERGE: ErrorCode = ErrorCode(1354); + const ER_WARN_VIEW_WITHOUT_KEY: ErrorCode = ErrorCode(1355); + const ER_WRONG_ARGUMENTS: ErrorCode = ErrorCode(1210); + const ER_WRONG_AUTO_KEY: ErrorCode = ErrorCode(1075); + const ER_WRONG_COLUMN_NAME: ErrorCode = ErrorCode(1166); + const ER_WRONG_DB_NAME: ErrorCode = ErrorCode(1102); + const ER_WRONG_FIELD_SPEC: ErrorCode = ErrorCode(1063); + const ER_WRONG_FIELD_TERMINATORS: ErrorCode = ErrorCode(1083); + const ER_WRONG_FIELD_WITH_GROUP: ErrorCode = ErrorCode(1055); + const ER_WRONG_FK_DEF: ErrorCode = ErrorCode(1239); + const ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN: ErrorCode = ErrorCode(1905); + const ER_WRONG_GROUP_FIELD: ErrorCode = ErrorCode(1056); + const ER_WRONG_KEY_COLUMN: ErrorCode = ErrorCode(1167); + const ER_WRONG_LOCK_OF_SYSTEM_TABLE: ErrorCode = ErrorCode(1428); + const ER_WRONG_MAGIC: ErrorCode = ErrorCode(1389); + const ER_WRONG_MRG_TABLE: ErrorCode = ErrorCode(1168); + const ER_WRONG_NAME_FOR_CATALOG: ErrorCode = ErrorCode(1281); + const ER_WRONG_NAME_FOR_INDEX: ErrorCode = ErrorCode(1280); + const ER_WRONG_NATIVE_TABLE_STRUCTURE: ErrorCode = ErrorCode(1682); + const ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT: ErrorCode = ErrorCode(1222); + const ER_WRONG_OBJECT: ErrorCode = ErrorCode(1347); + const ER_WRONG_OUTER_JOIN: ErrorCode = ErrorCode(1120); + const ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT: ErrorCode = ErrorCode(1582); + const ER_WRONG_PARAMCOUNT_TO_PROCEDURE: ErrorCode = ErrorCode(1107); + const ER_WRONG_PARAMETERS_TO_NATIVE_FCT: ErrorCode = ErrorCode(1583); + const ER_WRONG_PARAMETERS_TO_PROCEDURE: ErrorCode = ErrorCode(1108); + const ER_WRONG_PARAMETERS_TO_STORED_FCT: ErrorCode = ErrorCode(1584); + const ER_WRONG_PARTITION_NAME: ErrorCode = ErrorCode(1567); + const ER_WRONG_PERFSCHEMA_USAGE: ErrorCode = ErrorCode(1683); + const ER_WRONG_SIZE_NUMBER: ErrorCode = ErrorCode(1531); + const ER_WRONG_SPVAR_TYPE_IN_LIMIT: ErrorCode = ErrorCode(1691); + const ER_WRONG_STRING_LENGTH: ErrorCode = ErrorCode(1470); + const ER_WRONG_SUB_KEY: ErrorCode = ErrorCode(1089); + const ER_WRONG_SUM_SELECT: ErrorCode = ErrorCode(1057); + const ER_WRONG_TABLE_NAME: ErrorCode = ErrorCode(1103); + const ER_WRONG_TYPE_COLUMN_VALUE_ERROR: ErrorCode = ErrorCode(1654); + const ER_WRONG_TYPE_FOR_VAR: ErrorCode = ErrorCode(1232); + const ER_WRONG_USAGE: ErrorCode = ErrorCode(1221); + const ER_WRONG_VALUE: ErrorCode = ErrorCode(1525); + const ER_WRONG_VALUE_COUNT: ErrorCode = ErrorCode(1058); + const ER_WRONG_VALUE_COUNT_ON_ROW: ErrorCode = ErrorCode(1136); + const ER_WRONG_VALUE_FOR_TYPE: ErrorCode = ErrorCode(1411); + const ER_WRONG_VALUE_FOR_VAR: ErrorCode = ErrorCode(1231); + const ER_WSAS_FAILED: ErrorCode = ErrorCode(1383); + const ER_XAER_DUPID: ErrorCode = ErrorCode(1440); + const ER_XAER_INVAL: ErrorCode = ErrorCode(1398); + const ER_XAER_NOTA: ErrorCode = ErrorCode(1397); + const ER_XAER_OUTSIDE: ErrorCode = ErrorCode(1400); + const ER_XAER_RMERR: ErrorCode = ErrorCode(1401); + const ER_XAER_RMFAIL: ErrorCode = ErrorCode(1399); + const ER_XA_RBDEADLOCK: ErrorCode = ErrorCode(1614); + const ER_XA_RBROLLBACK: ErrorCode = ErrorCode(1402); + const ER_XA_RBTIMEOUT: ErrorCode = ErrorCode(1613); + const ER_YES: ErrorCode = ErrorCode(1003); + const ER_ZLIB_Z_BUF_ERROR: ErrorCode = ErrorCode(1258); + const ER_ZLIB_Z_DATA_ERROR: ErrorCode = ErrorCode(1259); + const ER_ZLIB_Z_MEM_ERROR: ErrorCode = ErrorCode(1257); + const WARN_COND_ITEM_TRUNCATED: ErrorCode = ErrorCode(1647); + const WARN_DATA_TRUNCATED: ErrorCode = ErrorCode(1265); + const WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED: ErrorCode = ErrorCode(1638); + const WARN_NO_MASTER_INF: ErrorCode = ErrorCode(1617); + const WARN_ON_BLOCKHOLE_IN_RBR: ErrorCode = ErrorCode(1870); + const WARN_OPTION_BELOW_LIMIT: ErrorCode = ErrorCode(1708); + const WARN_OPTION_IGNORED: ErrorCode = ErrorCode(1618); + const WARN_PLUGIN_BUSY: ErrorCode = ErrorCode(1620); + const WARN_PLUGIN_DELETE_BUILTIN: ErrorCode = ErrorCode(1619); } diff --git a/src/mariadb/protocol/mod.rs b/src/mariadb/protocol/mod.rs index 943dd2936..53a888662 100644 --- a/src/mariadb/protocol/mod.rs +++ b/src/mariadb/protocol/mod.rs @@ -19,8 +19,8 @@ pub use packets::{ ComProcessKill, ComQuery, ComQuit, ComResetConnection, ComSetOption, ComShutdown, ComSleep, ComStatistics, ComStmtClose, ComStmtExec, ComStmtFetch, ComStmtPrepare, ComStmtPrepareOk, ComStmtPrepareResp, ComStmtReset, EofPacket, ErrPacket, HandshakeResponsePacket, - InitialHandshakePacket, OkPacket, PacketHeader, ResultRowText, ResultRowBinary, ResultSet, SSLRequestPacket, - SetOptionOptions, ShutdownOptions, ResultRow + InitialHandshakePacket, OkPacket, PacketHeader, ResultRow, ResultRowBinary, ResultRowText, + ResultSet, SSLRequestPacket, SetOptionOptions, ShutdownOptions, }; pub use decode::{DeContext, Decode, Decoder}; @@ -30,5 +30,6 @@ pub use encode::{BufMut, Encode}; pub use error_codes::ErrorCode; pub use types::{ - ProtocolType, Capabilities, FieldDetailFlag, FieldType, ServerStatusFlag, SessionChangeType, StmtExecFlag, + Capabilities, FieldDetailFlag, FieldType, ProtocolType, ServerStatusFlag, SessionChangeType, + StmtExecFlag, }; diff --git a/src/mariadb/protocol/packets/binary/com_stmt_exec.rs b/src/mariadb/protocol/packets/binary/com_stmt_exec.rs index ef4645fce..f3f261626 100644 --- a/src/mariadb/protocol/packets/binary/com_stmt_exec.rs +++ b/src/mariadb/protocol/packets/binary/com_stmt_exec.rs @@ -1,5 +1,6 @@ use crate::mariadb::{ - BufMut, ColumnDefPacket, ConnContext, Connection, Encode, FieldDetailFlag, StmtExecFlag, FieldType + BufMut, ColumnDefPacket, ConnContext, Connection, Encode, FieldDetailFlag, FieldType, + StmtExecFlag, }; use bytes::Bytes; use failure::Error; diff --git a/src/mariadb/protocol/packets/binary/result_row.rs b/src/mariadb/protocol/packets/binary/result_row.rs index ce75e49cb..0bf40a228 100644 --- a/src/mariadb/protocol/packets/binary/result_row.rs +++ b/src/mariadb/protocol/packets/binary/result_row.rs @@ -110,7 +110,7 @@ impl crate::mariadb::Decode for ResultRow { Ok(ResultRow { length, seq_no, - columns + columns, }) } } diff --git a/src/mariadb/protocol/packets/err.rs b/src/mariadb/protocol/packets/err.rs index ae0999c8e..c24ba27cb 100644 --- a/src/mariadb/protocol/packets/err.rs +++ b/src/mariadb/protocol/packets/err.rs @@ -30,7 +30,7 @@ impl Decode for ErrPacket { panic!("Packet header is not 0xFF for ErrPacket"); } - let error_code = ErrorCode::try_from(decoder.decode_int_i16())?; + let error_code = ErrorCode(decoder.decode_int_u16()); let mut stage = None; let mut max_stage = None; @@ -42,7 +42,7 @@ impl Decode for ErrPacket { let mut error_message = None; // Progress Reporting - if error_code as u16 == 0xFFFF { + if error_code.0 == 0xFFFF { stage = Some(decoder.decode_int_u8()); max_stage = Some(decoder.decode_int_u8()); progress = Some(decoder.decode_int_i24()); diff --git a/src/mariadb/protocol/packets/mod.rs b/src/mariadb/protocol/packets/mod.rs index 4759d3688..fc0729b79 100644 --- a/src/mariadb/protocol/packets/mod.rs +++ b/src/mariadb/protocol/packets/mod.rs @@ -28,11 +28,11 @@ pub use ssl_request::SSLRequestPacket; pub use text::{ ComDebug, ComInitDb, ComPing, ComProcessKill, ComQuery, ComQuit, ComResetConnection, - ComSetOption, ComShutdown, ComSleep, ComStatistics, SetOptionOptions, ShutdownOptions, - ResultRow as ResultRowText + ComSetOption, ComShutdown, ComSleep, ComStatistics, ResultRow as ResultRowText, + SetOptionOptions, ShutdownOptions, }; pub use binary::{ ComStmtClose, ComStmtExec, ComStmtFetch, ComStmtPrepare, ComStmtPrepareOk, ComStmtPrepareResp, - ComStmtReset, ResultRow as ResultRowBinary + ComStmtReset, ResultRow as ResultRowBinary, }; diff --git a/src/mariadb/protocol/packets/result_row.rs b/src/mariadb/protocol/packets/result_row.rs index 4d57e74b8..365e93649 100644 --- a/src/mariadb/protocol/packets/result_row.rs +++ b/src/mariadb/protocol/packets/result_row.rs @@ -1,10 +1,10 @@ -use crate::mariadb::{ResultRowText, ResultRowBinary}; +use crate::mariadb::{ResultRowBinary, ResultRowText}; #[derive(Debug)] pub struct ResultRow { pub length: u32, pub seq_no: u8, - pub columns: Vec> + pub columns: Vec>, } impl From for ResultRow { @@ -17,7 +17,6 @@ impl From for ResultRow { } } - impl From for ResultRow { fn from(row: ResultRowBinary) -> Self { ResultRow { diff --git a/src/mariadb/protocol/packets/result_set.rs b/src/mariadb/protocol/packets/result_set.rs index d94509d89..42001a78a 100644 --- a/src/mariadb/protocol/packets/result_set.rs +++ b/src/mariadb/protocol/packets/result_set.rs @@ -3,7 +3,8 @@ use failure::Error; use crate::mariadb::{ Capabilities, ColumnDefPacket, ColumnPacket, ConnContext, DeContext, Decode, Decoder, - EofPacket, ErrPacket, Framed, OkPacket, ResultRowText, ResultRowBinary, ProtocolType, ResultRow + EofPacket, ErrPacket, Framed, OkPacket, ProtocolType, ResultRow, ResultRowBinary, + ResultRowText, }; #[derive(Debug, Default)] @@ -14,7 +15,10 @@ pub struct ResultSet { } impl ResultSet { - pub async fn deserialize(mut ctx: DeContext<'_>, protocol: ProtocolType) -> Result { + pub async fn deserialize( + mut ctx: DeContext<'_>, + protocol: ProtocolType, + ) -> Result { let column_packet = ColumnPacket::decode(&mut ctx)?; let columns = if let Some(columns) = column_packet.columns { @@ -58,29 +62,25 @@ impl ResultSet { break; } else { let index = ctx.decoder.index; - match protocol { - ProtocolType::Text => { - match ResultRowText::decode(&mut ctx) { - Ok(row) => { - rows.push(ResultRow::from(row)); - ctx.next_packet().await?; - } - Err(_) => { - ctx.decoder.index = index; - break; - } + match protocol { + ProtocolType::Text => match ResultRowText::decode(&mut ctx) { + Ok(row) => { + rows.push(ResultRow::from(row)); + ctx.next_packet().await?; + } + Err(_) => { + ctx.decoder.index = index; + break; } }, - ProtocolType::Binary => { - match ResultRowBinary::decode(&mut ctx) { - Ok(row) => { - rows.push(ResultRow::from(row)); - ctx.next_packet().await?; - } - Err(_) => { - ctx.decoder.index = index; - break; - } + ProtocolType::Binary => match ResultRowBinary::decode(&mut ctx) { + Ok(row) => { + rows.push(ResultRow::from(row)); + ctx.next_packet().await?; + } + Err(_) => { + ctx.decoder.index = index; + break; } }, } diff --git a/src/mariadb/protocol/types.rs b/src/mariadb/protocol/types.rs index d29bdbf52..750cb408e 100644 --- a/src/mariadb/protocol/types.rs +++ b/src/mariadb/protocol/types.rs @@ -2,7 +2,7 @@ use std::convert::TryFrom; pub enum ProtocolType { Text, - Binary + Binary, } bitflags! { diff --git a/src/options.rs b/src/options.rs index 65a706672..58b443af6 100644 --- a/src/options.rs +++ b/src/options.rs @@ -2,18 +2,18 @@ use std::borrow::Cow; #[derive(Debug, Clone, PartialEq)] pub struct ConnectOptions<'a> { - pub host: Cow<'a, str>, + pub host: &'a str, pub port: u16, - pub user: Option>, - pub database: Option>, - pub password: Option>, + pub user: Option<&'a str>, + pub database: Option<&'a str>, + pub password: Option<&'a str>, } impl<'a> Default for ConnectOptions<'a> { #[inline] fn default() -> Self { Self { - host: Cow::Borrowed("localhost"), + host: "localhost", port: 5432, user: None, database: None, @@ -28,20 +28,9 @@ impl<'a> ConnectOptions<'a> { Self::default() } - #[inline] - pub fn into_owned(self) -> ConnectOptions<'static> { - ConnectOptions { - host: self.host.into_owned().into(), - port: self.port, - user: self.user.map(|s| s.into_owned().into()), - database: self.database.map(|s| s.into_owned().into()), - password: self.password.map(|s| s.into_owned().into()), - } - } - #[inline] pub fn host(mut self, host: &'a str) -> Self { - self.host = Cow::Borrowed(host); + self.host = host; self } @@ -53,19 +42,19 @@ impl<'a> ConnectOptions<'a> { #[inline] pub fn user(mut self, user: &'a str) -> Self { - self.user = Some(Cow::Borrowed(user)); + self.user = Some(user); self } #[inline] pub fn database(mut self, database: &'a str) -> Self { - self.database = Some(Cow::Borrowed(database)); + self.database = Some(database); self } #[inline] pub fn password(mut self, password: &'a str) -> Self { - self.password = Some(Cow::Borrowed(password)); + self.password = Some(password); self } } diff --git a/src/pool.rs b/src/pool.rs index 85160e5af..6b341dcb8 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -1,5 +1,5 @@ use super::connection::RawConnection; -use crate::{backend::Backend, ConnectOptions}; +use crate::{backend::Backend, Connection}; use crossbeam_queue::{ArrayQueue, SegQueue}; use futures::{channel::oneshot, TryFutureExt}; use std::{ @@ -11,11 +11,10 @@ use std::{ }, time::Instant, }; +use url::Url; -// TODO: Add a sqlx::Connection type so we don't leak the RawConnection // TODO: Reap old connections // TODO: Clean up (a lot) and document what's going on -// TODO: sqlx::ConnectOptions needs to be removed and replaced with URIs everywhere pub struct Pool where @@ -24,6 +23,24 @@ where inner: Arc>, } +struct InnerPool +where + B: Backend, +{ + url: Url, + idle: ArrayQueue>, + waiters: SegQueue>>, + total: AtomicUsize, +} + +pub struct PooledConnection +where + B: Backend, +{ + connection: Option>, + pool: Arc>, +} + impl Clone for Pool where B: Backend, @@ -35,24 +52,15 @@ where } } -struct InnerPool -where - B: Backend, -{ - options: ConnectOptions<'static>, - idle: ArrayQueue>, - waiters: SegQueue>>, - total: AtomicUsize, -} - impl Pool where B: Backend, { - pub fn new<'a>(options: ConnectOptions<'a>) -> Self { + pub fn new<'a>(url: &str) -> Self { Self { inner: Arc::new(InnerPool { - options: options.into_owned(), + // TODO: Handle errors nicely + url: Url::parse(url).unwrap(), idle: ArrayQueue::new(10), total: AtomicUsize::new(0), waiters: SegQueue::new(), @@ -60,10 +68,10 @@ where } } - pub async fn acquire(&self) -> io::Result> { + pub async fn acquire(&self) -> io::Result> { self.inner .acquire() - .map_ok(|live| Connection::new(live, &self.inner)) + .map_ok(|live| PooledConnection::new(live, &self.inner)) .await } } @@ -101,7 +109,9 @@ where self.total.store(total + 1, Ordering::SeqCst); log::debug!("acquire: no idle connections; establish new connection"); - let connection = B::RawConnection::establish(self.options.clone()).await?; + let connection = B::RawConnection::establish(&self.url).await?; + let connection = Connection { inner: connection }; + let live = Live { connection, since: Instant::now(), @@ -127,18 +137,7 @@ where }); } } - -// TODO: Need a better name here than [pool::Connection] ? - -pub struct Connection -where - B: Backend, -{ - connection: Option>, - pool: Arc>, -} - -impl Connection +impl PooledConnection where B: Backend, { @@ -150,11 +149,11 @@ where } } -impl Deref for Connection +impl Deref for PooledConnection where B: Backend, { - type Target = B::RawConnection; + type Target = Connection; #[inline] fn deref(&self) -> &Self::Target { @@ -163,7 +162,7 @@ where } } -impl DerefMut for Connection +impl DerefMut for PooledConnection where B: Backend, { @@ -174,7 +173,7 @@ where } } -impl Drop for Connection +impl Drop for PooledConnection where B: Backend, { @@ -198,6 +197,6 @@ struct Live where B: Backend, { - connection: B::RawConnection, + connection: Connection, since: Instant, } diff --git a/src/postgres/connection/establish.rs b/src/postgres/connection/establish.rs index 44409cd1a..3a2533c0e 100644 --- a/src/postgres/connection/establish.rs +++ b/src/postgres/connection/establish.rs @@ -1,16 +1,12 @@ use super::RawConnection; -use crate::{ - postgres::protocol::{Authentication, Message, PasswordMessage, StartupMessage}, - ConnectOptions, -}; +use crate::postgres::protocol::{Authentication, Message, PasswordMessage, StartupMessage}; use std::{borrow::Cow, io}; +use url::Url; -pub async fn establish<'a, 'b: 'a>( - conn: &'a mut RawConnection, - options: ConnectOptions<'b>, -) -> io::Result<()> { - let user = &*options.user.expect("user is required"); - let password = &*options.password.unwrap_or(Cow::Borrowed("")); +pub async fn establish<'a, 'b: 'a>(conn: &'a mut RawConnection, url: &'b Url) -> io::Result<()> { + let user = url.username(); + let password = url.password().unwrap_or(""); + let database = url.path().trim_start_matches('/'); // See this doc for more runtime parameters // https://www.postgresql.org/docs/12/runtime-config-client.html @@ -18,10 +14,7 @@ pub async fn establish<'a, 'b: 'a>( // FIXME: ConnectOptions user and database need to be required parameters and error // before they get here ("user", user), - ( - "database", - &*options.database.expect("database is required"), - ), + ("database", database), // Sets the display format for date and time values, // as well as the rules for interpreting ambiguous date input values. ("DateStyle", "ISO, MDY"), diff --git a/src/postgres/connection/mod.rs b/src/postgres/connection/mod.rs index 64ef3500f..9cfd718ba 100644 --- a/src/postgres/connection/mod.rs +++ b/src/postgres/connection/mod.rs @@ -1,5 +1,4 @@ use super::protocol::{Encode, Message, Terminate}; -use crate::ConnectOptions; use bytes::{BufMut, BytesMut}; use futures::{ future::BoxFuture, @@ -10,6 +9,7 @@ use futures::{ }; use runtime::net::TcpStream; use std::{fmt::Debug, io, pin::Pin}; +use url::Url; mod establish; mod execute; @@ -41,8 +41,11 @@ pub struct RawConnection { } impl RawConnection { - pub async fn establish(options: ConnectOptions<'_>) -> io::Result { - let stream = TcpStream::connect((&*options.host, options.port)).await?; + pub async fn establish(url: &Url) -> io::Result { + let host = url.host_str().unwrap_or("localhost"); + let port = url.port().unwrap_or(5432); + + let stream = TcpStream::connect((host, port)).await?; let mut conn = Self { wbuf: Vec::with_capacity(1024), rbuf: BytesMut::with_capacity(1024 * 8), @@ -53,7 +56,7 @@ impl RawConnection { secret_key: 0, }; - establish::establish(&mut conn, options).await?; + establish::establish(&mut conn, &url).await?; Ok(conn) } @@ -139,7 +142,7 @@ impl RawConnection { impl crate::connection::RawConnection for RawConnection { #[inline] - fn establish(options: ConnectOptions<'_>) -> BoxFuture> { - Box::pin(RawConnection::establish(options)) + fn establish(url: &Url) -> BoxFuture> { + Box::pin(RawConnection::establish(url)) } }