//! Wire protocol constants

#![allow(dead_code)]

use num_enum::TryFromPrimitive;

#[derive(Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq, TryFromPrimitive)]
#[repr(u32)]
pub enum ProtocolVersion {
    V10 = 0x0000000A,
    V11 = 0xFFFF800B,
    V12 = 0xFFFF800C,
    V13 = 0xFFFF800D,
}

#[derive(Debug, TryFromPrimitive)]
#[repr(u8)]
/// Wire protocol operation
pub enum WireOp {
    /// Connect to remote server
    Connect = 1,
    /// Remote end has exitted
    Exit = 2,
    /// Server accepts connection
    Accept = 3,
    /// Server rejects connection
    Reject = 4,
    /// Connect is going away
    Disconnect = 6,
    /// Generic response block
    Response = 9,

    /// Attach database
    Attach = 19,
    /// Create database
    Create = 20,
    /// Detach database
    Detach = 21,

    /// Transaction operations
    Transaction = 29,
    /// Commit transaction
    Commit = 30,
    /// Rollback transaction
    Rollback = 31,

    /// Create a blob
    CreateBlob = 34,
    /// Open a blob
    OpenBlob = 35,
    /// Get blob segment
    GetSegment = 36,
    /// Put blob segment
    PutSegment = 37,
    /// Cancel a blob
    CancelBlob = 38,
    /// Close a blob
    CloseBlob = 39,

    /// Get informations of the database
    InfoDatabase = 40,
    /// Get informations of the transaction
    InfoTransaction = 42,

    /// Put multiple blob segments
    BatchSegments = 44,
    /// Que event notification request
    QueEvents = 48,
    /// Cancel event notification request
    CancelEvents = 49,
    /// Commit transaction, allowing to reuse it
    CommitRetaining = 50,
    /// Completed event request (asynchronous)
    Event = 52,
    /// Request to establish connection
    ConnectRequest = 53,
    /// Open blob v2
    OpenBlob2 = 56,
    /// Create blob v2
    CreateBlob2 = 57,

    /// Allocate a statment handle
    AllocateStatement = 62,
    /// Execute a prepared statement
    Execute = 63,
    /// Execute a statement
    ExecImmediate = 64,
    /// Fetch a record
    Fetch = 65,
    /// Response for record fetch
    FetchResponse = 66,
    /// Free a statement
    FreeStatement = 67,
    /// Prepare a statement
    PrepareStatement = 68,
    /// Statement info
    InfoSql = 70,

    /// Dummy packet to detect loss of client
    Dummy = 71,

    /// Execute a prepared statement, enables data coercion
    Execute2 = 76,

    /// Response from execute, exec immed, insert
    SqlResponse = 78,
    /// Drop database request
    DropDatabase = 81,
    ServiceAttach = 82,
    ServiceDetach = 83,
    ServiceInfo = 84,
    ServiceStart = 85,
    /// Rollback transaction, allowing to reuse it
    RollbackRetaining = 86,

    /// packet is not complete - delay processing
    Partial = 89,
    TrustedAuth = 90,
    Cancel = 91,

    /// Continue authentication
    ContAuth = 92,

    Ping = 93,

    /// Server accepts connection and returns some data to client
    AcceptData = 94,

    /// Async operation - stop waiting for async connection to arrive
    AbortAuxConnection = 95,
    Crypt = 96,
    CryptKeyCallback = 97,

    /// Server accepts connection, returns some data to client
    /// and asks client to continue authentication before attach call
    CondAccept = 98,
}

#[derive(Debug)]
#[repr(u8)]
/// User identification data
///
/// Format: `type` `length` 'data'
///
/// * `type`      is a u8 (this enum)
/// * `length`    is an u8 containing length of data
/// * `data`      is 'type' specific
pub enum Cnct {
    /// User name
    User = 1,
    Passwd = 2,
    Host = 4,
    /// Effective Unix group id
    Group = 5,
    /// Attach / Create using this connection
    UserVerification = 6,
    /// Some data, needed for user verification on server
    SpecificData = 7,
    /// Name of plugin, which generated that data
    PluginName = 8,
    /// Database user name
    Login = 9,
    /// List of plugins available on client
    PluginList = 10,
    /// Client encyption level (DISABLED / ENABLED / REQUIRED)
    ClientCrypt = 11,
}

#[derive(Debug)]
pub enum AuthPluginType {
    Srp256,
    Srp,
}

impl AuthPluginType {
    /// Plugin name
    pub fn name(&self) -> &'static str {
        match self {
            Self::Srp256 => "Srp256",
            Self::Srp => "Srp",
        }
    }

    /// List with the plugins
    pub fn plugin_list() -> String {
        [AuthPluginType::Srp.name(), AuthPluginType::Srp256.name()].join(",")
    }

    pub fn parse(name: &[u8]) -> Result<Self, rsfbclient_core::FbError> {
        match name {
            b"Srp256" => Ok(Self::Srp256),
            b"Srp" => Ok(Self::Srp),

            name => Err(format!("Invalid auth plugin: {}", String::from_utf8_lossy(name)).into()),
        }
    }
}

#[cfg(not(tarpaulin_include))]
/// Converts a gds_code to a error message
pub fn gds_to_msg(gds_code: u32) -> &'static str {
    match gds_code {
        335544321 => "arithmetic exception, numeric overflow, or string truncation\n",
        335544322 => "invalid database key\n",
        335544323 => "file @1 is not a valid database\n",
        335544324 => "invalid database handle (no active connection)\n",
        335544325 => "bad parameters on attach or create database\n",
        335544326 => "unrecognized database parameter block\n",
        335544327 => "invalid request handle\n",
        335544328 => "invalid BLOB handle\n",
        335544329 => "invalid BLOB ID\n",
        335544330 => "invalid parameter in transaction parameter block\n",
        335544331 => "invalid format for transaction parameter block\n",
        335544332 => "invalid transaction handle (expecting explicit transaction start)\n",
        335544333 => "internal Firebird consistency check (@1)\n",
        335544334 => "conversion error from string '@1'\n",
        335544335 => "database file appears corrupt (@1)\n",
        335544336 => "deadlock\n",
        335544337 => "attempt to start more than @1 transactions\n",
        335544338 => "no match for first value expression\n",
        335544339 => "information type inappropriate for object specified\n",
        335544340 => "no information of this type available for object specified\n",
        335544341 => "unknown information item\n",
        335544342 => "action cancelled by trigger (@1) to preserve data integrity\n",
        335544343 => "invalid request BLR at offset @1\n",
        335544344 => "I/O error during '@1' operation for file '@2'\n",
        335544345 => "lock conflict on no wait transaction\n",
        335544346 => "corrupt system table\n",
        335544347 => "validation error for column @1, value '@2'\n",
        335544348 => "no current record for fetch operation\n",
        335544349 => "attempt to store duplicate value (visible to active transactions) in unique index '@1'\n",
        335544350 => "program attempted to exit without finishing database\n",
        335544351 => "unsuccessful metadata update\n",
        335544352 => "no permission for @1 access to @2 @3\n",
        335544353 => "transaction is not in limbo\n",
        335544354 => "invalid database key\n",
        335544355 => "BLOB was not closed\n",
        335544356 => "metadata is obsolete\n",
        335544357 => "cannot disconnect database with open transactions (@1 active)\n",
        335544358 => "message length error (encountered @1, expected @2)\n",
        335544359 => "attempted update of read-only column @1\n",
        335544360 => "attempted update of read-only table\n",
        335544361 => "attempted update during read-only transaction\n",
        335544362 => "cannot update read-only view @1\n",
        335544363 => "no transaction for request\n",
        335544364 => "request synchronization error\n",
        335544365 => "request referenced an unavailable database\n",
        335544366 => "segment buffer length shorter than expected\n",
        335544367 => "attempted retrieval of more segments than exist\n",
        335544368 => "attempted invalid operation on a BLOB\n",
        335544369 => "attempted read of a new, open BLOB\n",
        335544370 => "attempted action on BLOB outside transaction\n",
        335544371 => "attempted write to read-only BLOB\n",
        335544372 => "attempted reference to BLOB in unavailable database\n",
        335544373 => "operating system directive @1 failed\n",
        335544374 => "attempt to fetch past the last record in a record stream\n",
        335544375 => "unavailable database\n",
        335544376 => "table @1 was omitted from the transaction reserving list\n",
        335544377 => "request includes a DSRI extension not supported in this implementation\n",
        335544378 => "feature is not supported\n",
        335544379 => "unsupported on-disk structure for file @1; found @2.@3, support @4.@5\n",
        335544380 => "wrong number of arguments on call\n",
        335544381 => "Implementation limit exceeded\n",
        335544382 => "@1\n",
        335544383 => "unrecoverable conflict with limbo transaction @1\n",
        335544384 => "internal error\n",
        335544385 => "internal error\n",
        335544386 => "too many requests\n",
        335544387 => "internal error\n",
        335544388 => "block size exceeds implementation restriction\n",
        335544389 => "buffer exhausted\n",
        335544390 => "BLR syntax error: expected @1 at offset @2, encountered @3\n",
        335544391 => "buffer in use\n",
        335544392 => "internal error\n",
        335544393 => "request in use\n",
        335544394 => "incompatible version of on-disk structure\n",
        335544395 => "table @1 is not defined\n",
        335544396 => "column @1 is not defined in table @2\n",
        335544397 => "internal error\n",
        335544398 => "internal error\n",
        335544399 => "internal error\n",
        335544400 => "internal error\n",
        335544401 => "internal error\n",
        335544402 => "internal error\n",
        335544403 => "page @1 is of wrong type (expected @2, found @3)\n",
        335544404 => "database corrupted\n",
        335544405 => "checksum error on database page @1\n",
        335544406 => "index is broken\n",
        335544407 => "database handle not zero\n",
        335544408 => "transaction handle not zero\n",
        335544409 => "transaction--request mismatch (synchronization error)\n",
        335544410 => "bad handle count\n",
        335544411 => "wrong version of transaction parameter block\n",
        335544412 => "unsupported BLR version (expected @1, encountered @2)\n",
        335544413 => "wrong version of database parameter block\n",
        335544414 => "BLOB and array data types are not supported for @1 operation\n",
        335544415 => "database corrupted\n",
        335544416 => "internal error\n",
        335544417 => "internal error\n",
        335544418 => "transaction in limbo\n",
        335544419 => "transaction not in limbo\n",
        335544420 => "transaction outstanding\n",
        335544421 => "connection rejected by remote interface\n",
        335544422 => "internal error\n",
        335544423 => "internal error\n",
        335544424 => "no lock manager available\n",
        335544425 => "context already in use (BLR error)\n",
        335544426 => "context not defined (BLR error)\n",
        335544427 => "data operation not supported\n",
        335544428 => "undefined message number\n",
        335544429 => "undefined parameter number\n",
        335544430 => "unable to allocate memory from operating system\n",
        335544431 => "blocking signal has been received\n",
        335544432 => "lock manager error\n",
        335544433 => "communication error with journal '@1'\n",
        335544434 => "key size exceeds implementation restriction for index '@1'\n",
        335544435 => "null segment of UNIQUE KEY\n",
        335544436 => "SQL error code = @1\n",
        335544437 => "wrong DYN version\n",
        335544438 => "function @1 is not defined\n",
        335544439 => "function @1 could not be matched\n",
        335544440 => "\n",
        335544441 => "database detach completed with errors\n",
        335544442 => "database system cannot read argument @1\n",
        335544443 => "database system cannot write argument @1\n",
        335544444 => "operation not supported\n",
        335544445 => "@1 extension error\n",
        335544446 => "not updatable\n",
        335544447 => "no rollback performed\n",
        335544448 => "\n",
        335544449 => "\n",
        335544450 => "@1\n",
        335544451 => "update conflicts with concurrent update\n",
        335544452 => "product @1 is not licensed\n",
        335544453 => "object @1 is in use\n",
        335544454 => "filter not found to convert type @1 to type @2\n",
        335544455 => "cannot attach active shadow file\n",
        335544456 => "invalid slice description language at offset @1\n",
        335544457 => "subscript out of bounds\n",
        335544458 => "column not array or invalid dimensions (expected @1, encountered @2)\n",
        335544459 => "record from transaction @1 is stuck in limbo\n",
        335544460 => "a file in manual shadow @1 is unavailable\n",
        335544461 => "secondary server attachments cannot validate databases\n",
        335544462 => "secondary server attachments cannot start journaling\n",
        335544463 => "generator @1 is not defined\n",
        335544464 => "secondary server attachments cannot start logging\n",
        335544465 => "invalid BLOB type for operation\n",
        335544466 => "violation of FOREIGN KEY constraint '@1' on table '@2'\n",
        335544467 => "minor version too high found @1 expected @2\n",
        335544468 => "transaction @1 is @2\n",
        335544469 => "transaction marked invalid and cannot be committed\n",
        335544470 => "cache buffer for page @1 invalid\n",
        335544471 => "there is no index in table @1 with id @2\n",
        335544472 => "Your user name and password are not defined. Ask your database administrator to set up a Firebird login.\n",
        335544473 => "invalid bookmark handle\n",
        335544474 => "invalid lock level @1\n",
        335544475 => "lock on table @1 conflicts with existing lock\n",
        335544476 => "requested record lock conflicts with existing lock\n",
        335544477 => "maximum indexes per table (@1) exceeded\n",
        335544478 => "enable journal for database before starting online dump\n",
        335544479 => "online dump failure. Retry dump\n",
        335544480 => "an online dump is already in progress\n",
        335544481 => "no more disk/tape space.  Cannot continue online dump\n",
        335544482 => "journaling allowed only if database has Write-ahead Log\n",
        335544483 => "maximum number of online dump files that can be specified is 16\n",
        335544484 => "error in opening Write-ahead Log file during recovery\n",
        335544485 => "invalid statement handle\n",
        335544486 => "Write-ahead log subsystem failure\n",
        335544487 => "WAL Writer error\n",
        335544488 => "Log file header of @1 too small\n",
        335544489 => "Invalid version of log file @1\n",
        335544490 => "Log file @1 not latest in the chain but open flag still set\n",
        335544491 => "Log file @1 not closed properly; database recovery may be required\n",
        335544492 => "Database name in the log file @1 is different\n",
        335544493 => "Unexpected end of log file @1 at offset @2\n",
        335544494 => "Incomplete log record at offset @1 in log file @2\n",
        335544495 => "Log record header too small at offset @1 in log file @2\n",
        335544496 => "Log block too small at offset @1 in log file @2\n",
        335544497 => "Illegal attempt to attach to an uninitialized WAL segment for @1\n",
        335544498 => "Invalid WAL parameter block option @1\n",
        335544499 => "Cannot roll over to the next log file @1\n",
        335544500 => "database does not use Write-ahead Log\n",
        335544501 => "cannot drop log file when journaling is enabled\n",
        335544502 => "reference to invalid stream number\n",
        335544503 => "WAL subsystem encountered error\n",
        335544504 => "WAL subsystem corrupted\n",
        335544505 => "must specify archive file when enabling long term journal for databases with round-robin log files\n",
        335544506 => "database @1 shutdown in progress\n",
        335544507 => "refresh range number @1 already in use\n",
        335544508 => "refresh range number @1 not found\n",
        335544509 => "CHARACTER SET @1 is not defined\n",
        335544510 => "lock time-out on wait transaction\n",
        335544511 => "procedure @1 is not defined\n",
        335544512 => "Input parameter mismatch for procedure @1\n",
        335544513 => "Database @1: WAL subsystem bug for pid @2@3\n",
        335544514 => "Could not expand the WAL segment for database @1\n",
        335544515 => "status code @1 unknown\n",
        335544516 => "exception @1 not defined\n",
        335544517 => "exception @1\n",
        335544518 => "restart shared cache manager\n",
        335544519 => "invalid lock handle\n",
        335544520 => "long-term journaling already enabled\n",
        335544521 => "Unable to roll over please see Firebird log.\n",
        335544522 => "WAL I/O error.  Please see Firebird log.\n",
        335544523 => "WAL writer - Journal server communication error.  Please see Firebird log.\n",
        335544524 => "WAL buffers cannot be increased.  Please see Firebird log.\n",
        335544525 => "WAL setup error.  Please see Firebird log.\n",
        335544526 => "obsolete\n",
        335544527 => "Cannot start WAL writer for the database @1\n",
        335544528 => "database @1 shutdown\n",
        335544529 => "cannot modify an existing user privilege\n",
        335544530 => "Cannot delete PRIMARY KEY being used in FOREIGN KEY definition.\n",
        335544531 => "Column used in a PRIMARY constraint must be NOT NULL.\n",
        335544532 => "Name of Referential Constraint not defined in constraints table.\n",
        335544533 => "Non-existent PRIMARY or UNIQUE KEY specified for FOREIGN KEY.\n",
        335544534 => "Cannot update constraints (RDB$REF_CONSTRAINTS).\n",
        335544535 => "Cannot update constraints (RDB$CHECK_CONSTRAINTS).\n",
        335544536 => "Cannot delete CHECK constraint entry (RDB$CHECK_CONSTRAINTS)\n",
        335544537 => "Cannot delete index segment used by an Integrity Constraint\n",
        335544538 => "Cannot update index segment used by an Integrity Constraint\n",
        335544539 => "Cannot delete index used by an Integrity Constraint\n",
        335544540 => "Cannot modify index used by an Integrity Constraint\n",
        335544541 => "Cannot delete trigger used by a CHECK Constraint\n",
        335544542 => "Cannot update trigger used by a CHECK Constraint\n",
        335544543 => "Cannot delete column being used in an Integrity Constraint.\n",
        335544544 => "Cannot rename column being used in an Integrity Constraint.\n",
        335544545 => "Cannot update constraints (RDB$RELATION_CONSTRAINTS).\n",
        335544546 => "Cannot define constraints on views\n",
        335544547 => "internal Firebird consistency check (invalid RDB$CONSTRAINT_TYPE)\n",
        335544548 => "Attempt to define a second PRIMARY KEY for the same table\n",
        335544549 => "cannot modify or erase a system trigger\n",
        335544550 => "only the owner of a table may reassign ownership\n",
        335544551 => "could not find object for GRANT\n",
        335544552 => "could not find column for GRANT\n",
        335544553 => "user does not have GRANT privileges for operation\n",
        335544554 => "object has non-SQL security class defined\n",
        335544555 => "column has non-SQL security class defined\n",
        335544556 => "Write-ahead Log without shared cache configuration not allowed\n",
        335544557 => "database shutdown unsuccessful\n",
        335544558 => "Operation violates CHECK constraint @1 on view or table @2\n",
        335544559 => "invalid service handle\n",
        335544560 => "database @1 shutdown in @2 seconds\n",
        335544561 => "wrong version of service parameter block\n",
        335544562 => "unrecognized service parameter block\n",
        335544563 => "service @1 is not defined\n",
        335544564 => "long-term journaling not enabled\n",
        335544565 => "Cannot transliterate character between character sets\n",
        335544566 => "WAL defined; Cache Manager must be started first\n",
        335544567 => "Overflow log specification required for round-robin log\n",
        335544568 => "Implementation of text subtype @1 not located.\n",
        335544569 => "Dynamic SQL Error\n",
        335544570 => "Invalid command\n",
        335544571 => "Data type for constant unknown\n",
        335544572 => "Invalid cursor reference\n",
        335544573 => "Data type unknown\n",
        335544574 => "Invalid cursor declaration\n",
        335544575 => "Cursor @1 is not updatable\n",
        335544576 => "Attempt to reopen an open cursor\n",
        335544577 => "Attempt to reclose a closed cursor\n",
        335544578 => "Column unknown\n",
        335544579 => "Internal error\n",
        335544580 => "Table unknown\n",
        335544581 => "Procedure unknown\n",
        335544582 => "Request unknown\n",
        335544583 => "SQLDA error\n",
        335544584 => "Count of read-write columns does not equal count of values\n",
        335544585 => "Invalid statement handle\n",
        335544586 => "Function unknown\n",
        335544587 => "Column is not a BLOB\n",
        335544588 => "COLLATION @1 for CHARACTER SET @2 is not defined\n",
        335544589 => "COLLATION @1 is not valid for specified CHARACTER SET\n",
        335544590 => "Option specified more than once\n",
        335544591 => "Unknown transaction option\n",
        335544592 => "Invalid array reference\n",
        335544593 => "Array declared with too many dimensions\n",
        335544594 => "Illegal array dimension range\n",
        335544595 => "Trigger unknown\n",
        335544596 => "Subselect illegal in this context\n",
        335544597 => "Cannot prepare a CREATE DATABASE/SCHEMA statement\n",
        335544598 => "must specify column name for view select expression\n",
        335544599 => "number of columns does not match select list\n",
        335544600 => "Only simple column names permitted for VIEW WITH CHECK OPTION\n",
        335544601 => "No WHERE clause for VIEW WITH CHECK OPTION\n",
        335544602 => "Only one table allowed for VIEW WITH CHECK OPTION\n",
        335544603 => "DISTINCT, GROUP or HAVING not permitted for VIEW WITH CHECK OPTION\n",
        335544604 => "FOREIGN KEY column count does not match PRIMARY KEY\n",
        335544605 => "No subqueries permitted for VIEW WITH CHECK OPTION\n",
        335544606 => "expression evaluation not supported\n",
        335544607 => "gen.c: node not supported\n",
        335544608 => "Unexpected end of command\n",
        335544609 => "INDEX @1\n",
        335544610 => "EXCEPTION @1\n",
        335544611 => "COLUMN @1\n",
        335544612 => "Token unknown\n",
        335544613 => "union not supported\n",
        335544614 => "Unsupported DSQL construct\n",
        335544615 => "column used with aggregate\n",
        335544616 => "invalid column reference\n",
        335544617 => "invalid ORDER BY clause\n",
        335544618 => "Return mode by value not allowed for this data type\n",
        335544619 => "External functions cannot have more than 10 parameters\n",
        335544620 => "alias @1 conflicts with an alias in the same statement\n",
        335544621 => "alias @1 conflicts with a procedure in the same statement\n",
        335544622 => "alias @1 conflicts with a table in the same statement\n",
        335544623 => "Illegal use of keyword VALUE\n",
        335544624 => "segment count of 0 defined for index @1\n",
        335544625 => "A node name is not permitted in a secondary, shadow, cache or log file name\n",
        335544626 => "TABLE @1\n",
        335544627 => "PROCEDURE @1\n",
        335544628 => "cannot create index @1\n",
        335544629 => "Write-ahead Log with shadowing configuration not allowed\n",
        335544630 => "there are @1 dependencies\n",
        335544631 => "too many keys defined for index @1\n",
        335544632 => "Preceding file did not specify length, so @1 must include starting page number\n",
        335544633 => "Shadow number must be a positive integer\n",
        335544634 => "Token unknown - line @1, column @2\n",
        335544635 => "there is no alias or table named @1 at this scope level\n",
        335544636 => "there is no index @1 for table @2\n",
        335544637 => "table @1 is not referenced in plan\n",
        335544638 => "table @1 is referenced more than once in plan; use aliases to distinguish\n",
        335544639 => "table @1 is referenced in the plan but not the from list\n",
        335544640 => "Invalid use of CHARACTER SET or COLLATE\n",
        335544641 => "Specified domain or source column @1 does not exist\n",
        335544642 => "index @1 cannot be used in the specified plan\n",
        335544643 => "the table @1 is referenced twice; use aliases to differentiate\n",
        335544644 => "attempt to fetch before the first record in a record stream\n",
        335544645 => "the current position is on a crack\n",
        335544646 => "database or file exists\n",
        335544647 => "invalid comparison operator for find operation\n",
        335544648 => "Connection lost to pipe server\n",
        335544649 => "bad checksum\n",
        335544650 => "wrong page type\n",
        335544651 => "Cannot insert because the file is readonly or is on a read only medium.\n",
        335544652 => "multiple rows in singleton select\n",
        335544653 => "cannot attach to password database\n",
        335544654 => "cannot start transaction for password database\n",
        335544655 => "invalid direction for find operation\n",
        335544656 => "variable @1 conflicts with parameter in same procedure\n",
        335544657 => "Array/BLOB/DATE data types not allowed in arithmetic\n",
        335544658 => "@1 is not a valid base table of the specified view\n",
        335544659 => "table @1 is referenced twice in view; use an alias to distinguish\n",
        335544660 => "view @1 has more than one base table; use aliases to distinguish\n",
        335544661 => "cannot add index, index root page is full.\n",
        335544662 => "BLOB SUB_TYPE @1 is not defined\n",
        335544663 => "Too many concurrent executions of the same request\n",
        335544664 => "duplicate specification of @1 - not supported\n",
        335544665 => "violation of PRIMARY or UNIQUE KEY constraint '@1' on table '@2'\n",
        335544666 => "server version too old to support all CREATE DATABASE options\n",
        335544667 => "drop database completed with errors\n",
        335544668 => "procedure @1 does not return any values\n",
        335544669 => "count of column list and variable list do not match\n",
        335544670 => "attempt to index BLOB column in index @1\n",
        335544671 => "attempt to index array column in index @1\n",
        335544672 => "too few key columns found for index @1 (incorrect column name?)\n",
        335544673 => "cannot delete\n",
        335544674 => "last column in a table cannot be deleted\n",
        335544675 => "sort error\n",
        335544676 => "sort error: not enough memory\n",
        335544677 => "too many versions\n",
        335544678 => "invalid key position\n",
        335544679 => "segments not allowed in expression index @1\n",
        335544680 => "sort error: corruption in data structure\n",
        335544681 => "new record size of @1 bytes is too big\n",
        335544682 => "Inappropriate self-reference of column\n",
        335544683 => "request depth exceeded. (Recursive definition?)\n",
        335544684 => "cannot access column @1 in view @2\n",
        335544685 => "dbkey not available for multi-table views\n",
        335544686 => "journal file wrong format\n",
        335544687 => "intermediate journal file full\n",
        335544688 => "The prepare statement identifies a prepare statement with an open cursor\n",
        335544689 => "Firebird error\n",
        335544690 => "Cache redefined\n",
        335544691 => "Insufficient memory to allocate page buffer cache\n",
        335544692 => "Log redefined\n",
        335544693 => "Log size too small\n",
        335544694 => "Log partition size too small\n",
        335544695 => "Partitions not supported in series of log file specification\n",
        335544696 => "Total length of a partitioned log must be specified\n",
        335544697 => "Precision must be from 1 to 18\n",
        335544698 => "Scale must be between zero and precision\n",
        335544699 => "Short integer expected\n",
        335544700 => "Long integer expected\n",
        335544701 => "Unsigned short integer expected\n",
        335544702 => "Invalid ESCAPE sequence\n",
        335544703 => "service @1 does not have an associated executable\n",
        335544704 => "Failed to locate host machine.\n",
        335544705 => "Undefined service @1/@2.\n",
        335544706 => "The specified name was not found in the hosts file or Domain Name Services.\n",
        335544707 => "user does not have GRANT privileges on base table/view for operation\n",
        335544708 => "Ambiguous column reference.\n",
        335544709 => "Invalid aggregate reference\n",
        335544710 => "navigational stream @1 references a view with more than one base table\n",
        335544711 => "Attempt to execute an unprepared dynamic SQL statement.\n",
        335544712 => "Positive value expected\n",
        335544713 => "Incorrect values within SQLDA structure\n",
        335544714 => "invalid blob id\n",
        335544715 => "Operation not supported for EXTERNAL FILE table @1\n",
        335544716 => "Service is currently busy: @1\n",
        335544717 => "stack size insufficent to execute current request\n",
        335544718 => "Invalid key for find operation\n",
        335544719 => "Error initializing the network software.\n",
        335544720 => "Unable to load required library @1.\n",
        335544721 => "Unable to complete network request to host '@1'.\n",
        335544722 => "Failed to establish a connection.\n",
        335544723 => "Error while listening for an incoming connection.\n",
        335544724 => "Failed to establish a secondary connection for event processing.\n",
        335544725 => "Error while listening for an incoming event connection request.\n",
        335544726 => "Error reading data from the connection.\n",
        335544727 => "Error writing data to the connection.\n",
        335544728 => "Cannot deactivate index used by an integrity constraint\n",
        335544729 => "Cannot deactivate index used by a PRIMARY/UNIQUE constraint\n",
        335544730 => "Client/Server Express not supported in this release\n",
        335544731 => "\n",
        335544732 => "Access to databases on file servers is not supported.\n",
        335544733 => "Error while trying to create file\n",
        335544734 => "Error while trying to open file\n",
        335544735 => "Error while trying to close file\n",
        335544736 => "Error while trying to read from file\n",
        335544737 => "Error while trying to write to file\n",
        335544738 => "Error while trying to delete file\n",
        335544739 => "Error while trying to access file\n",
        335544740 => "A fatal exception occurred during the execution of a user defined function.\n",
        335544741 => "connection lost to database\n",
        335544742 => "User cannot write to RDB$USER_PRIVILEGES\n",
        335544743 => "token size exceeds limit\n",
        335544744 => "Maximum user count exceeded.  Contact your database administrator.\n",
        335544745 => "Your login @1 is same as one of the SQL role name. Ask your database administrator to set up a valid Firebird login.\n",
        335544746 => "'REFERENCES table' without '(column)' requires PRIMARY KEY on referenced table\n",
        335544747 => "The username entered is too long.  Maximum length is 31 bytes.\n",
        335544748 => "The password specified is too long.  Maximum length is 8 bytes.\n",
        335544749 => "A username is required for this operation.\n",
        335544750 => "A password is required for this operation\n",
        335544751 => "The network protocol specified is invalid\n",
        335544752 => "A duplicate user name was found in the security database\n",
        335544753 => "The user name specified was not found in the security database\n",
        335544754 => "An error occurred while attempting to add the user.\n",
        335544755 => "An error occurred while attempting to modify the user record.\n",
        335544756 => "An error occurred while attempting to delete the user record.\n",
        335544757 => "An error occurred while updating the security database.\n",
        335544758 => "sort record size of @1 bytes is too big\n",
        335544759 => "can not define a not null column with NULL as default value\n",
        335544760 => "invalid clause --- '@1'\n",
        335544761 => "too many open handles to database\n",
        335544762 => "size of optimizer block exceeded\n",
        335544763 => "a string constant is delimited by double quotes\n",
        335544764 => "DATE must be changed to TIMESTAMP\n",
        335544765 => "attempted update on read-only database\n",
        335544766 => "SQL dialect @1 is not supported in this database\n",
        335544767 => "A fatal exception occurred during the execution of a blob filter.\n",
        335544768 => "Access violation.  The code attempted to access a virtual address without privilege to do so.\n",
        335544769 => "Datatype misalignment.  The attempted to read or write a value that was not stored on a memory boundary.\n",
        335544770 => "Array bounds exceeded.  The code attempted to access an array element that is out of bounds.\n",
        335544771 => "Float denormal operand.  One of the floating-point operands is too small to represent a standard float value.\n",
        335544772 => "Floating-point divide by zero.  The code attempted to divide a floating-point value by zero.\n",
        335544773 => "Floating-point inexact result.  The result of a floating-point operation cannot be represented as a decimal fraction.\n",
        335544774 => "Floating-point invalid operand.  An indeterminant error occurred during a floating-point operation.\n",
        335544775 => "Floating-point overflow.  The exponent of a floating-point operation is greater than the magnitude allowed.\n",
        335544776 => "Floating-point stack check.  The stack overflowed or underflowed as the result of a floating-point operation.\n",
        335544777 => "Floating-point underflow.  The exponent of a floating-point operation is less than the magnitude allowed.\n",
        335544778 => "Integer divide by zero.  The code attempted to divide an integer value by an integer divisor of zero.\n",
        335544779 => "Integer overflow.  The result of an integer operation caused the most significant bit of the result to carry.\n",
        335544780 => "An exception occurred that does not have a description.  Exception number @1.\n",
        335544781 => "Stack overflow.  The resource requirements of the runtime stack have exceeded the memory available to it.\n",
        335544782 => "Segmentation Fault. The code attempted to access memory without privileges.\n",
        335544783 => "Illegal Instruction. The Code attempted to perform an illegal operation.\n",
        335544784 => "Bus Error. The Code caused a system bus error.\n",
        335544785 => "Floating Point Error. The Code caused an Arithmetic Exception or a floating point exception.\n",
        335544786 => "Cannot delete rows from external files.\n",
        335544787 => "Cannot update rows in external files.\n",
        335544788 => "Unable to perform operation\n",
        335544789 => "Specified EXTRACT part does not exist in input datatype\n",
        335544790 => "Service @1 requires SYSDBA permissions.  Reattach to the Service Manager using the SYSDBA account.\n",
        335544791 => "The file @1 is currently in use by another process.  Try again later.\n",
        335544792 => "Cannot attach to services manager\n",
        335544793 => "Metadata update statement is not allowed by the current database SQL dialect @1\n",
        335544794 => "operation was cancelled\n",
        335544795 => "unexpected item in service parameter block, expected @1\n",
        335544796 => "Client SQL dialect @1 does not support reference to @2 datatype\n",
        335544797 => "user name and password are required while attaching to the services manager\n",
        335544798 => "You created an indirect dependency on uncommitted metadata. You must roll back the current transaction.\n",
        335544799 => "The service name was not specified.\n",
        335544800 => "Too many Contexts of Relation/Procedure/Views. Maximum allowed is 256\n",
        335544801 => "data type not supported for arithmetic\n",
        335544802 => "Database dialect being changed from 3 to 1\n",
        335544803 => "Database dialect not changed.\n",
        335544804 => "Unable to create database @1\n",
        335544805 => "Database dialect @1 is not a valid dialect.\n",
        335544806 => "Valid database dialects are @1.\n",
        335544807 => "SQL warning code = @1\n",
        335544808 => "DATE data type is now called TIMESTAMP\n",
        335544809 => "Function @1 is in @2, which is not in a permitted directory for external functions.\n",
        335544810 => "value exceeds the range for valid dates\n",
        335544811 => "passed client dialect @1 is not a valid dialect.\n",
        335544812 => "Valid client dialects are @1.\n",
        335544813 => "Unsupported field type specified in BETWEEN predicate.\n",
        335544814 => "Services functionality will be supported in a later version  of the product\n",
        335544815 => "GENERATOR @1\n",
        335544816 => "Function @1\n",
        335544817 => "Invalid parameter to FETCH or FIRST. Only integers >= 0 are allowed.\n",
        335544818 => "Invalid parameter to OFFSET or SKIP. Only integers >= 0 are allowed.\n",
        335544819 => "File exceeded maximum size of 2GB.  Add another database file or use a 64 bit I/O version of Firebird.\n",
        335544820 => "Unable to find savepoint with name @1 in transaction context\n",
        335544821 => "Invalid column position used in the @1 clause\n",
        335544822 => "Cannot use an aggregate or window function in a WHERE clause, use HAVING (for aggregate only) instead\n",
        335544823 => "Cannot use an aggregate or window function in a GROUP BY clause\n",
        335544824 => "Invalid expression in the @1 (not contained in either an aggregate function or the GROUP BY clause)\n",
        335544825 => "Invalid expression in the @1 (neither an aggregate function nor a part of the GROUP BY clause)\n",
        335544826 => "Nested aggregate and window functions are not allowed\n",
        335544827 => "Invalid argument in EXECUTE STATEMENT - cannot convert to string\n",
        335544828 => "Wrong request type in EXECUTE STATEMENT '@1'\n",
        335544829 => "Variable type (position @1) in EXECUTE STATEMENT '@2' INTO does not match returned column type\n",
        335544830 => "Too many recursion levels of EXECUTE STATEMENT\n",
        335544831 => "Use of @1 at location @2 is not allowed by server configuration\n",
        335544832 => "Cannot change difference file name while database is in backup mode\n",
        335544833 => "Physical backup is not allowed while Write-Ahead Log is in use\n",
        335544834 => "Cursor is not open\n",
        335544835 => "Target shutdown mode is invalid for database '@1'\n",
        335544836 => "Concatenation overflow. Resulting string cannot exceed 32765 bytes in length.\n",
        335544837 => "Invalid offset parameter @1 to SUBSTRING. Only positive integers are allowed.\n",
        335544838 => "Foreign key reference target does not exist\n",
        335544839 => "Foreign key references are present for the record\n",
        335544840 => "cannot update\n",
        335544841 => "Cursor is already open\n",
        335544842 => "@1\n",
        335544843 => "Context variable @1 is not found in namespace @2\n",
        335544844 => "Invalid namespace name @1 passed to @2\n",
        335544845 => "Too many context variables\n",
        335544846 => "Invalid argument passed to @1\n",
        335544847 => "BLR syntax error. Identifier @1... is too long\n",
        335544848 => "exception @1\n",
        335544849 => "Malformed string\n",
        335544850 => "Output parameter mismatch for procedure @1\n",
        335544851 => "Unexpected end of command - line @1, column @2\n",
        335544852 => "partner index segment no @1 has incompatible data type\n",
        335544853 => "Invalid length parameter @1 to SUBSTRING. Negative integers are not allowed.\n",
        335544854 => "CHARACTER SET @1 is not installed\n",
        335544855 => "COLLATION @1 for CHARACTER SET @2 is not installed\n",
        335544856 => "connection shutdown\n",
        335544857 => "Maximum BLOB size exceeded\n",
        335544858 => "Can't have relation with only computed fields or constraints\n",
        335544859 => "Time precision exceeds allowed range (0-@1)\n",
        335544860 => "Unsupported conversion to target type BLOB (subtype @1)\n",
        335544861 => "Unsupported conversion to target type ARRAY\n",
        335544862 => "Stream does not support record locking\n",
        335544863 => "Cannot create foreign key constraint @1. Partner index does not exist or is inactive.\n",
        335544864 => "Transactions count exceeded. Perform backup and restore to make database operable again\n",
        335544865 => "Column has been unexpectedly deleted\n",
        335544866 => "@1 cannot depend on @2\n",
        335544867 => "Blob sub_types bigger than 1 (text) are for internal use only\n",
        335544868 => "Procedure @1 is not selectable (it does not contain a SUSPEND statement)\n",
        335544869 => "Datatype @1 is not supported for sorting operation\n",
        335544870 => "COLLATION @1\n",
        335544871 => "DOMAIN @1\n",
        335544872 => "domain @1 is not defined\n",
        335544873 => "Array data type can use up to @1 dimensions\n",
        335544874 => "A multi database transaction cannot span more than @1 databases\n",
        335544875 => "Bad debug info format\n",
        335544876 => "Error while parsing procedure @1's BLR\n",
        335544877 => "index key too big\n",
        335544878 => "concurrent transaction number is @1\n",
        335544879 => "validation error for variable @1, value '@2'\n",
        335544880 => "validation error for @1, value '@2'\n",
        335544881 => "Difference file name should be set explicitly for database on raw device\n",
        335544882 => "Login name too long (@1 characters, maximum allowed @2)\n",
        335544883 => "column @1 is not defined in procedure @2\n",
        335544884 => "Invalid SIMILAR TO pattern\n",
        335544885 => "Invalid TEB format\n",
        335544886 => "Found more than one transaction isolation in TPB\n",
        335544887 => "Table reservation lock type @1 requires table name before in TPB\n",
        335544888 => "Found more than one @1 specification in TPB\n",
        335544889 => "Option @1 requires READ COMMITTED isolation in TPB\n",
        335544890 => "Option @1 is not valid if @2 was used previously in TPB\n",
        335544891 => "Table name length missing after table reservation @1 in TPB\n",
        335544892 => "Table name length @1 is too long after table reservation @2 in TPB\n",
        335544893 => "Table name length @1 without table name after table reservation @2 in TPB\n",
        335544894 => "Table name length @1 goes beyond the remaining TPB size after table reservation @2\n",
        335544895 => "Table name length is zero after table reservation @1 in TPB\n",
        335544896 => "Table or view @1 not defined in system tables after table reservation @2 in TPB\n",
        335544897 => "Base table or view @1 for view @2 not defined in system tables after table reservation @3 in TPB\n",
        335544898 => "Option length missing after option @1 in TPB\n",
        335544899 => "Option length @1 without value after option @2 in TPB\n",
        335544900 => "Option length @1 goes beyond the remaining TPB size after option @2\n",
        335544901 => "Option length is zero after table reservation @1 in TPB\n",
        335544902 => "Option length @1 exceeds the range for option @2 in TPB\n",
        335544903 => "Option value @1 is invalid for the option @2 in TPB\n",
        335544904 => "Preserving previous table reservation @1 for table @2, stronger than new @3 in TPB\n",
        335544905 => "Table reservation @1 for table @2 already specified and is stronger than new @3 in TPB\n",
        335544906 => "Table reservation reached maximum recursion of @1 when expanding views in TPB\n",
        335544907 => "Table reservation in TPB cannot be applied to @1 because it's a virtual table\n",
        335544908 => "Table reservation in TPB cannot be applied to @1 because it's a system table\n",
        335544909 => "Table reservation @1 or @2 in TPB cannot be applied to @3 because it's a temporary table\n",
        335544910 => "Cannot set the transaction in read only mode after a table reservation isc_tpb_lock_write in TPB\n",
        335544911 => "Cannot take a table reservation isc_tpb_lock_write in TPB because the transaction is in read only mode\n",
        335544912 => "value exceeds the range for a valid time\n",
        335544913 => "value exceeds the range for valid timestamps\n",
        335544914 => "string right truncation\n",
        335544915 => "blob truncation when converting to a string: length limit exceeded\n",
        335544916 => "numeric value is out of range\n",
        335544917 => "Firebird shutdown is still in progress after the specified timeout\n",
        335544918 => "Attachment handle is busy\n",
        335544919 => "Bad written UDF detected: pointer returned in FREE_IT function was not allocated by ib_util_malloc\n",
        335544920 => "External Data Source provider '@1' not found\n",
        335544921 => "Execute statement error at @1 :@2Data source : @3\n",
        335544922 => "Execute statement preprocess SQL error\n",
        335544923 => "Statement expected\n",
        335544924 => "Parameter name expected\n",
        335544925 => "Unclosed comment found near '@1'\n",
        335544926 => "Execute statement error at @1 :@2Statement : @3Data source : @4\n",
        335544927 => "Input parameters mismatch\n",
        335544928 => "Output parameters mismatch\n",
        335544929 => "Input parameter '@1' have no value set\n",
        335544930 => "BLR stream length @1 exceeds implementation limit @2\n",
        335544931 => "Monitoring table space exhausted\n",
        335544932 => "module name or entrypoint could not be found\n",
        335544933 => "nothing to cancel\n",
        335544934 => "ib_util library has not been loaded to deallocate memory returned by FREE_IT function\n",
        335544935 => "Cannot have circular dependencies with computed fields\n",
        335544936 => "Security database error\n",
        335544937 => "Invalid data type in DATE/TIME/TIMESTAMP addition or subtraction in add_datettime()\n",
        335544938 => "Only a TIME value can be added to a DATE value\n",
        335544939 => "Only a DATE value can be added to a TIME value\n",
        335544940 => "TIMESTAMP values can be subtracted only from another TIMESTAMP value\n",
        335544941 => "Only one operand can be of type TIMESTAMP\n",
        335544942 => "Only HOUR, MINUTE, SECOND and MILLISECOND can be extracted from TIME values\n",
        335544943 => "HOUR, MINUTE, SECOND and MILLISECOND cannot be extracted from DATE values\n",
        335544944 => "Invalid argument for EXTRACT() not being of DATE/TIME/TIMESTAMP type\n",
        335544945 => "Arguments for @1 must be integral types or NUMERIC/DECIMAL without scale\n",
        335544946 => "First argument for @1 must be integral type or floating point type\n",
        335544947 => "Human readable UUID argument for @1 must be of string type\n",
        335544948 => "Human readable UUID argument for @2 must be of exact length @1\n",
        335544949 => "Human readable UUID argument for @3 must have '-' at position @2 instead of '@1'\n",
        335544950 => "Human readable UUID argument for @3 must have hex digit at position @2 instead of '@1'\n",
        335544951 => "Only HOUR, MINUTE, SECOND and MILLISECOND can be added to TIME values in @1\n",
        335544952 => "Invalid data type in addition of part to DATE/TIME/TIMESTAMP in @1\n",
        335544953 => "Invalid part @1 to be added to a DATE/TIME/TIMESTAMP value in @2\n",
        335544954 => "Expected DATE/TIME/TIMESTAMP type in evlDateAdd() result\n",
        335544955 => "Expected DATE/TIME/TIMESTAMP type as first and second argument to @1\n",
        335544956 => "The result of TIME-<value> in @1 cannot be expressed in YEAR, MONTH, DAY or WEEK\n",
        335544957 => "The result of TIME-TIMESTAMP or TIMESTAMP-TIME in @1 cannot be expressed in HOUR, MINUTE, SECOND or MILLISECOND\n",
        335544958 => "The result of DATE-TIME or TIME-DATE in @1 cannot be expressed in HOUR, MINUTE, SECOND and MILLISECOND\n",
        335544959 => "Invalid part @1 to express the difference between two DATE/TIME/TIMESTAMP values in @2\n",
        335544960 => "Argument for @1 must be positive\n",
        335544961 => "Base for @1 must be positive\n",
        335544962 => "Argument #@1 for @2 must be zero or positive\n",
        335544963 => "Argument #@1 for @2 must be positive\n",
        335544964 => "Base for @1 cannot be zero if exponent is negative\n",
        335544965 => "Base for @1 cannot be negative if exponent is not an integral value\n",
        335544966 => "The numeric scale must be between -128 and 127 in @1\n",
        335544967 => "Argument for @1 must be zero or positive\n",
        335544968 => "Binary UUID argument for @1 must be of string type\n",
        335544969 => "Binary UUID argument for @2 must use @1 bytes\n",
        335544970 => "Missing required item @1 in service parameter block\n",
        335544971 => "@1 server is shutdown\n",
        335544972 => "Invalid connection string\n",
        335544973 => "Unrecognized events block\n",
        335544974 => "Could not start first worker thread - shutdown server\n",
        335544975 => "Timeout occurred while waiting for a secondary connection for event processing\n",
        335544976 => "Argument for @1 must be different than zero\n",
        335544977 => "Argument for @1 must be in the range [-1, 1]\n",
        335544978 => "Argument for @1 must be greater or equal than one\n",
        335544979 => "Argument for @1 must be in the range ]-1, 1[\n",
        335544980 => "Incorrect parameters provided to internal function @1\n",
        335544981 => "Floating point overflow in built-in function @1\n",
        335544982 => "Floating point overflow in result from UDF @1\n",
        335544983 => "Invalid floating point value returned by UDF @1\n",
        335544984 => "Database is probably already opened by another engine instance in another Windows session\n",
        335544985 => "No free space found in temporary directories\n",
        335544986 => "Explicit transaction control is not allowed\n",
        335544987 => "Use of TRUSTED switches in spb_command_line is prohibited\n",
        335544988 => "PACKAGE @1\n",
        335544989 => "Cannot make field @1 of table @2 NOT NULL because there are NULLs present\n",
        335544990 => "Feature @1 is not supported anymore\n",
        335544991 => "VIEW @1\n",
        335544992 => "Can not access lock files directory @1\n",
        335544993 => "Fetch option @1 is invalid for a non-scrollable cursor\n",
        335544994 => "Error while parsing function @1's BLR\n",
        335544995 => "Cannot execute function @1 of the unimplemented package @2\n",
        335544996 => "Cannot execute procedure @1 of the unimplemented package @2\n",
        335544997 => "External function @1 not returned by the external engine plugin @2\n",
        335544998 => "External procedure @1 not returned by the external engine plugin @2\n",
        335544999 => "External trigger @1 not returned by the external engine plugin @2\n",
        335545000 => "Incompatible plugin version @1 for external engine @2\n",
        335545001 => "External engine @1 not found\n",
        335545002 => "Attachment is in use\n",
        335545003 => "Transaction is in use\n",
        335545004 => "Error loading plugin @1\n",
        335545005 => "Loadable module @1 not found\n",
        335545006 => "Standard plugin entrypoint does not exist in module @1\n",
        335545007 => "Module @1 exists but can not be loaded\n",
        335545008 => "Module @1 does not contain plugin @2 type @3\n",
        335545009 => "Invalid usage of context namespace DDL_TRIGGER\n",
        335545010 => "Value is NULL but isNull parameter was not informed\n",
        335545011 => "Type @1 is incompatible with BLOB\n",
        335545012 => "Invalid date\n",
        335545013 => "Invalid time\n",
        335545014 => "Invalid timestamp\n",
        335545015 => "Invalid index @1 in function @2\n",
        335545016 => "@1\n",
        335545017 => "Asynchronous call is already running for this attachment\n",
        335545018 => "Function @1 is private to package @2\n",
        335545019 => "Procedure @1 is private to package @2\n",
        335545020 => "Request can't access new records in relation @1 and should be recompiled\n",
        335545021 => "invalid events id (handle)\n",
        335545022 => "Cannot copy statement @1\n",
        335545023 => "Invalid usage of boolean expression\n",
        335545024 => "Arguments for @1 cannot both be zero\n",
        335545025 => "missing service ID in spb\n",
        335545026 => "External BLR message mismatch: invalid null descriptor at field @1\n",
        335545027 => "External BLR message mismatch: length = @1, expected @2\n",
        335545028 => "Subscript @1 out of bounds [@2, @3]\n",
        335545029 => "Install incomplete, please read the Compatibility chapter in the release notes for this version\n",
        335545030 => "@1 operation is not allowed for system table @2\n",
        335545031 => "Libtommath error code @1 in function @2\n",
        335545032 => "unsupported BLR version (expected between @1 and @2, encountered @3)\n",
        335545033 => "expected length @1, actual @2\n",
        335545034 => "Wrong info requested in isc_svc_query() for anonymous service\n",
        335545035 => "No isc_info_svc_stdin in user request, but service thread requested stdin data\n",
        335545036 => "Start request for anonymous service is impossible\n",
        335545037 => "All services except for getting server log require switches\n",
        335545038 => "Size of stdin data is more than was requested from client\n",
        335545039 => "Crypt plugin @1 failed to load\n",
        335545040 => "Length of crypt plugin name should not exceed @1 bytes\n",
        335545041 => "Crypt failed - already crypting database\n",
        335545042 => "Crypt failed - database is already in requested state\n",
        335545043 => "Missing crypt plugin, but page appears encrypted\n",
        335545044 => "No providers loaded\n",
        335545045 => "NULL data with non-zero SPB length\n",
        335545046 => "Maximum (@1) number of arguments exceeded for function @2\n",
        335545047 => "External BLR message mismatch: names count = @1, blr count = @2\n",
        335545048 => "External BLR message mismatch: name @1 not found\n",
        335545049 => "Invalid resultset interface\n",
        335545050 => "Message length passed from user application does not match set of columns\n",
        335545051 => "Resultset is missing output format information\n",
        335545052 => "Message metadata not ready - item @1 is not finished\n",
        335545053 => "Missing configuration file: @1\n",
        335545054 => "@1: illegal line <@2>\n",
        335545055 => "Invalid include operator in @1 for <@2>\n",
        335545056 => "Include depth too big\n",
        335545057 => "File to include not found\n",
        335545058 => "Only the owner can change the ownership\n",
        335545059 => "undefined variable number\n",
        335545060 => "Missing security context for @1\n",
        335545061 => "Missing segment @1 in multisegment connect block parameter\n",
        335545062 => "Different logins in connect and attach packets - client library error\n",
        335545063 => "Exceeded exchange limit during authentication handshake\n",
        335545064 => "Incompatible wire encryption levels requested on client and server\n",
        335545065 => "Client attempted to attach unencrypted but wire encryption is required\n",
        335545066 => "Client attempted to start wire encryption using unknown key @1\n",
        335545067 => "Client attempted to start wire encryption using unsupported plugin @1\n",
        335545068 => "Error getting security database name from configuration file\n",
        335545069 => "Client authentication plugin is missing required data from server\n",
        335545070 => "Client authentication plugin expected @2 bytes of @3 from server, got @1\n",
        335545071 => "Attempt to get information about an unprepared dynamic SQL statement.\n",
        335545072 => "Problematic key value is @1\n",
        335545073 => "Cannot select virtual table @1 for update WITH LOCK\n",
        335545074 => "Cannot select system table @1 for update WITH LOCK\n",
        335545075 => "Cannot select temporary table @1 for update WITH LOCK\n",
        335545076 => "System @1 @2 cannot be modified\n",
        335545077 => "Server misconfigured - contact administrator please\n",
        335545078 => "Deprecated backward compatibility ALTER ROLE ... SET/DROP AUTO ADMIN mapping may be used only for RDB$ADMIN role\n",
        335545079 => "Mapping @1 already exists\n",
        335545080 => "Mapping @1 does not exist\n",
        335545081 => "@1 failed when loading mapping cache\n",
        335545082 => "Invalid name <*> in authentication block\n",
        335545083 => "Multiple maps found for @1\n",
        335545084 => "Undefined mapping result - more than one different results found\n",
        335545085 => "Incompatible mode of attachment to damaged database\n",
        335545086 => "Attempt to set in database number of buffers which is out of acceptable range [@1:@2]\n",
        335545087 => "Attempt to temporarily set number of buffers less than @1\n",
        335545088 => "Global mapping is not available when database @1 is not present\n",
        335545089 => "Global mapping is not available when table RDB$MAP is not present in database @1\n",
        335545090 => "Your attachment has no trusted role\n",
        335545091 => "Role @1 is invalid or unavailable\n",
        335545092 => "Cursor @1 is not positioned in a valid record\n",
        335545093 => "Duplicated user attribute @1\n",
        335545094 => "There is no privilege for this operation\n",
        335545095 => "Using GRANT OPTION on @1 not allowed\n",
        335545096 => "read conflicts with concurrent update\n",
        335545097 => "@1 failed when working with CREATE DATABASE grants\n",
        335545098 => "CREATE DATABASE grants check is not possible when database @1 is not present\n",
        335545099 => "CREATE DATABASE grants check is not possible when table RDB$DB_CREATORS is not present in database @1\n",
        335545100 => "Interface @3 version too old: expected @1, found @2\n",
        335545101 => "Input parameter mismatch for function @1\n",
        335545102 => "Error during savepoint backout - transaction invalidated\n",
        335545103 => "Domain used in the PRIMARY KEY constraint of table @1 must be NOT NULL\n",
        335545104 => "CHARACTER SET @1 cannot be used as a attachment character set\n",
        335545105 => "Some database(s) were shutdown when trying to read mapping data\n",
        335545106 => "Error occurred during login, please check server firebird.log for details\n",
        335545107 => "Database already opened with engine instance, incompatible with current\n",
        335545108 => "Invalid crypt key @1\n",
        335545109 => "Page requires encryption but crypt plugin is missing\n",
        335545110 => "Maximum index depth (@1 levels) is reached\n",
        335545111 => "System privilege @1 does not exist\n",
        335545112 => "System privilege @1 is missing\n",
        335545113 => "Invalid or missing checksum of encrypted database\n",
        335545114 => "You must have SYSDBA rights at this server\n",
        335545115 => "Cannot open cursor for non-SELECT statement\n",
        335545116 => "If <window frame bound 1> specifies @1, then <window frame bound 2> shall not specify @2\n",
        335545117 => "RANGE based window with <expr> {PRECEDING | FOLLOWING} cannot have ORDER BY with more than one value\n",
        335545118 => "RANGE based window must have an ORDER BY key of numerical, date, time or timestamp types\n",
        335545119 => "Window RANGE/ROWS PRECEDING/FOLLOWING value must be of a numerical type\n",
        335545120 => "Invalid PRECEDING or FOLLOWING offset in window function: cannot be negative\n",
        335545121 => "Window @1 not found\n",
        335545122 => "Cannot use PARTITION BY clause while overriding the window @1\n",
        335545123 => "Cannot use ORDER BY clause while overriding the window @1 which already has an ORDER BY clause\n",
        335545124 => "Cannot override the window @1 because it has a frame clause. Tip: it can be used without parenthesis in OVER\n",
        335545125 => "Duplicate window definition for @1\n",
        335545126 => "SQL statement is too long. Maximum size is @1 bytes.\n",
        335545127 => "Config level timeout expired.\n",
        335545128 => "Attachment level timeout expired.\n",
        335545129 => "Statement level timeout expired.\n",
        335545130 => "Killed by database administrator.\n",
        335545131 => "Idle timeout expired.\n",
        335545132 => "Database is shutdown.\n",
        335545133 => "Engine is shutdown.\n",
        335545134 => "OVERRIDING clause can be used only when an identity column is present in the INSERT's field list for table/view @1\n",
        335545135 => "OVERRIDING SYSTEM VALUE can be used only for identity column defined as 'GENERATED ALWAYS' in INSERT for table/view @1\n",
        335545136 => "OVERRIDING USER VALUE can be used only for identity column defined as 'GENERATED BY DEFAULT' in INSERT for table/view @1\n",
        335545137 => "OVERRIDING SYSTEM VALUE should be used to override the value of an identity column defined as 'GENERATED ALWAYS' in table/view @1\n",
        335545138 => "DecFloat precision must be 16 or 34\n",
        335545139 => "Decimal float divide by zero.  The code attempted to divide a DECFLOAT value by zero.\n",
        335545140 => "Decimal float inexact result.  The result of an operation cannot be represented as a decimal fraction.\n",
        335545141 => "Decimal float invalid operation.  An indeterminant error occurred during an operation.\n",
        335545142 => "Decimal float overflow.  The exponent of a result is greater than the magnitude allowed.\n",
        335545143 => "Decimal float underflow.  The exponent of a result is less than the magnitude allowed.\n",
        335545144 => "Sub-function @1 has not been defined\n",
        335545145 => "Sub-procedure @1 has not been defined\n",
        335545146 => "Sub-function @1 has a signature mismatch with its forward declaration\n",
        335545147 => "Sub-procedure @1 has a signature mismatch with its forward declaration\n",
        335545148 => "Default values for parameters are not allowed in definition of the previously declared sub-function @1\n",
        335545149 => "Default values for parameters are not allowed in definition of the previously declared sub-procedure @1\n",
        335545150 => "Sub-function @1 was declared but not implemented\n",
        335545151 => "Sub-procedure @1 was declared but not implemented\n",
        335545152 => "Invalid HASH algorithm @1\n",
        335545153 => "Expression evaluation error for index '@1' on table '@2'\n",
        335545154 => "Invalid decfloat trap state @1\n",
        335545155 => "Invalid decfloat rounding mode @1\n",
        335545156 => "Invalid part @1 to calculate the @1 of a DATE/TIMESTAMP\n",
        335545157 => "Expected DATE/TIMESTAMP value in @1\n",
        335545158 => "Precision must be from @1 to @2\n",
        335545159 => "invalid batch handle\n",
        335545160 => "Bad international character in tag @1\n",
        335545161 => "Null data in parameters block with non-zero length\n",
        335545162 => "Items working with running service and getting generic server information should not be mixed in single info block\n",
        335545163 => "Unknown information item, code @1\n",
        335545164 => "Wrong version of blob parameters block @1, should be @2\n",
        335545165 => "User management plugin is missing or failed to load\n",
        335545166 => "Missing entrypoint @1 in ICU library\n",
        335545167 => "Could not find acceptable ICU library\n",
        335545168 => "Name @1 not found in system MetadataBuilder\n",
        335545169 => "Parse to tokens error\n",
        335545170 => "Error opening international conversion descriptor from @1 to @2\n",
        335545171 => "Message @1 is out of range, only @2 messages in batch\n",
        335545172 => "Detailed error info for message @1 is missing in batch\n",
        335545173 => "Compression stream init error @1\n",
        335545174 => "Decompression stream init error @1\n",
        335545175 => "Segment size (@1) should not exceed 65535 (64K - 1) when using segmented blob\n",
        335545176 => "Invalid blob policy in the batch for @1() call\n",
        335545177 => "Can't change default BPB after adding any data to batch\n",
        335545178 => "Unexpected info buffer structure querying for default blob alignment\n",
        335545179 => "Duplicated segment @1 in multisegment connect block parameter\n",
        335545180 => "Plugin not supported by network protocol\n",
        335545181 => "Error parsing message format\n",
        335545182 => "Wrong version of batch parameters block @1, should be @2\n",
        335545183 => "Message size (@1) in batch exceeds internal buffer size (@2)\n",
        335545184 => "Batch already opened for this statement\n",
        335545185 => "Invalid type of statement used in batch\n",
        335545186 => "Statement used in batch must have parameters\n",
        335545187 => "There are no blobs in associated with batch statement\n",
        335545188 => "appendBlobData() is used to append data to last blob but no such blob was added to the batch\n",
        335545189 => "Portions of data, passed as blob stream, should have size multiple to the alignment required for blobs\n",
        335545190 => "Repeated blob id @1 in registerBlob()\n",
        335545191 => "Blob buffer format error\n",
        335545192 => "Unusable (too small) data remained in @1 buffer\n",
        335545193 => "Blob continuation should not contain BPB\n",
        335545194 => "Size of BPB (@1) greater than remaining data (@2)\n",
        335545195 => "Size of segment (@1) greater than current BLOB data (@2)\n",
        335545196 => "Size of segment (@1) greater than available data (@2)\n",
        335545197 => "Unknown blob ID @1 in the batch message\n",
        335545198 => "Internal buffer overflow - batch too big\n",
        335545199 => "Numeric literal too long\n",
        335545200 => "Error using events in mapping shared memory: @1\n",
        335545201 => "Global mapping memory overflow\n",
        335545202 => "Header page overflow - too many clumplets on it\n",
        335545203 => "No matching client/server authentication plugins configured for execute statement in embedded datasource\n",
        335545204 => "Missing database encryption key for your attachment\n",
        335545205 => "Key holder plugin @1 failed to load\n",
        335545206 => "Cannot reset user session\n",
        335545207 => "There are open transactions (@1 active)\n",
        335545208 => "Session was reset with warning(s)\n",
        335545209 => "Transaction is rolled back due to session reset, all changes are lost\n",
        335545210 => "Plugin @1:\n",
        335545211 => "PARAMETER @1\n",
        335545212 => "Starting page number for file @1 must be @2 or greater\n",
        335545213 => "Invalid time zone offset: @1 - must be between -14:00 and +14:00\n",
        335545214 => "Invalid time zone region: @1\n",
        335545215 => "Invalid time zone ID: @1\n",
        335545216 => "Wrong base64 text length @1, should be multiple of 4\n",
        335545217 => "Invalid first parameter datatype - need string or blob\n",
        335545218 => "Error registering @1 - probably bad tomcrypt library\n",
        335545219 => "Unknown crypt algorithm @1 in USING clause\n",
        335545220 => "Should specify mode parameter for symmetric cipher\n",
        335545221 => "Unknown symmetric crypt mode specified\n",
        335545222 => "Mode parameter makes no sense for chosen cipher\n",
        335545223 => "Should specify initialization vector (IV) for chosen cipher and/or mode\n",
        335545224 => "Initialization vector (IV) makes no sense for chosen cipher and/or mode\n",
        335545225 => "Invalid counter endianess @1\n",
        335545226 => "Counter endianess parameter is not used in mode @1\n",
        335545227 => "Too big counter value @1, maximum @2 can be used\n",
        335545228 => "Counter length/value parameter is not used with @1 @2\n",
        335545229 => "Invalid initialization vector (IV) length @1, need @2\n",
        335545230 => "TomCrypt library error: @1\n",
        335545231 => "Starting PRNG yarrow\n",
        335545232 => "Setting up PRNG yarrow\n",
        335545233 => "Initializing @1 mode\n",
        335545234 => "Encrypting in @1 mode\n",
        335545235 => "Decrypting in @1 mode\n",
        335545236 => "Initializing cipher @1\n",
        335545237 => "Encrypting using cipher @1\n",
        335545238 => "Decrypting using cipher @1\n",
        335545239 => "Setting initialization vector (IV) for @1\n",
        335545240 => "Invalid initialization vector (IV) length @1, need  8 or 12\n",
        335545241 => "Encoding @1\n",
        335545242 => "Decoding @1\n",
        335545243 => "Importing RSA key\n",
        335545244 => "Invalid OAEP packet\n",
        335545245 => "Unknown hash algorithm @1\n",
        335545246 => "Making RSA key\n",
        335545247 => "Exporting @1 RSA key\n",
        335545248 => "RSA-signing data\n",
        335545249 => "Verifying RSA-signed data\n",
        335545250 => "Invalid key length @1, need 16 or 32\n",
        335545251 => "invalid replicator handle\n",
        335545252 => "Transaction's base snapshot number does not exist\n",
        335545253 => "Input parameter '@1' is not used in SQL query text\n",
        335545254 => "Effective user is @1\n",
        335545255 => "Invalid time zone bind mode @1\n",
        335545256 => "Invalid decfloat bind mode @1\n",
        335545257 => "Invalid hex text length @1, should be multiple of 2\n",
        335545258 => "Invalid hex digit @1 at position @2\n",
        335545259 => "Error processing isc_dpb_set_bind clumplet '@1'\n",
        335545260 => "The following statement failed: @1\n",
        335545261 => "Can not convert @1 to @2\n",
        335545262 => "cannot update old BLOB\n",
        335545263 => "cannot read from new BLOB\n",
        335545264 => "No permission for CREATE @1 operation\n",
        335545265 => "SUSPEND could not be used without RETURNS clause in PROCEDURE or EXECUTE BLOCK\n",
        335545266 => "String truncated warning due to the following reason\n",
        335545267 => "Monitoring data does not fit into the field\n",
        335545268 => "Engine data does not fit into return value of system function\n",
        335740929 => "data base file name (@1) already given\n",
        335740930 => "invalid switch @1\n",
        335740932 => "incompatible switch combination\n",
        335740933 => "replay log pathname required\n",
        335740934 => "number of page buffers for cache required\n",
        335740935 => "numeric value required\n",
        335740936 => "positive numeric value required\n",
        335740937 => "number of transactions per sweep required\n",
        335740940 => "'full' or 'reserve' required\n",
        335740941 => "user name required\n",
        335740942 => "password required\n",
        335740943 => "subsystem name\n",
        335740944 => "'wal' required\n",
        335740945 => "number of seconds required\n",
        335740946 => "numeric value between 0 and 32767 inclusive required\n",
        335740947 => "must specify type of shutdown\n",
        335740948 => "please retry, specifying an option\n",
        335740951 => "please retry, giving a database name\n",
        335740991 => "internal block exceeds maximum size\n",
        335740992 => "corrupt pool\n",
        335740993 => "virtual memory exhausted\n",
        335740994 => "bad pool id\n",
        335740995 => "Transaction state @1 not in valid range.\n",
        335741012 => "unexpected end of input\n",
        335741018 => "failed to reconnect to a transaction in database @1\n",
        335741036 => "Transaction description item unknown\n",
        335741038 => "'read_only' or 'read_write' required\n",
        335741042 => "positive or zero numeric value required\n",
        336003074 => "Cannot SELECT RDB$DB_KEY from a stored procedure.\n",
        336003075 => "Precision 10 to 18 changed from DOUBLE PRECISION in SQL dialect 1 to 64-bit scaled integer in SQL dialect 3\n",
        336003076 => "Use of @1 expression that returns different results in dialect 1 and dialect 3\n",
        336003077 => "Database SQL dialect @1 does not support reference to @2 datatype\n",
        336003079 => "DB dialect @1 and client dialect @2 conflict with respect to numeric precision @3.\n",
        336003080 => "WARNING: Numeric literal @1 is interpreted as a floating-point\n",
        336003081 => "value in SQL dialect 1, but as an exact numeric value in SQL dialect 3.\n",
        336003082 => "WARNING: NUMERIC and DECIMAL fields with precision 10 or greater are stored\n",
        336003083 => "as approximate floating-point values in SQL dialect 1, but as 64-bit\n",
        336003084 => "integers in SQL dialect 3.\n",
        336003085 => "Ambiguous field name between @1 and @2\n",
        336003086 => "External function should have return position between 1 and @1\n",
        336003087 => "Label @1 @2 in the current scope\n",
        336003088 => "Datatypes @1are not comparable in expression @2\n",
        336003089 => "Empty cursor name is not allowed\n",
        336003090 => "Statement already has a cursor @1 assigned\n",
        336003091 => "Cursor @1 is not found in the current context\n",
        336003092 => "Cursor @1 already exists in the current context\n",
        336003093 => "Relation @1 is ambiguous in cursor @2\n",
        336003094 => "Relation @1 is not found in cursor @2\n",
        336003095 => "Cursor is not open\n",
        336003096 => "Data type @1 is not supported for EXTERNAL TABLES. Relation '@2', field '@3'\n",
        336003097 => "Feature not supported on ODS version older than @1.@2\n",
        336003098 => "Primary key required on table @1\n",
        336003099 => "UPDATE OR INSERT field list does not match primary key of table @1\n",
        336003100 => "UPDATE OR INSERT field list does not match MATCHING clause\n",
        336003101 => "UPDATE OR INSERT without MATCHING could not be used with views based on more than one table\n",
        336003102 => "Incompatible trigger type\n",
        336003103 => "Database trigger type can't be changed\n",
        336003104 => "To be used with RDB$RECORD_VERSION, @1 must be a table or a view of single table\n",
        336003105 => "SQLDA version expected between @1 and @2, found @3\n",
        336003106 => "at SQLVAR index @1\n",
        336003107 => "empty pointer to NULL indicator variable\n",
        336003108 => "empty pointer to data\n",
        336003109 => "No SQLDA for input values provided\n",
        336003110 => "No SQLDA for output values provided\n",
        336003111 => "Wrong number of parameters (expected @1, got @2)\n",
        336003112 => "Invalid DROP SQL SECURITY clause\n",
        336003113 => "UPDATE OR INSERT value for field @1, part of the implicit or explicit MATCHING clause, cannot be DEFAULT\n",
        336068645 => "BLOB Filter @1 not found\n",
        336068649 => "Function @1 not found\n",
        336068656 => "Index not found\n",
        336068662 => "View @1 not found\n",
        336068697 => "Domain not found\n",
        336068717 => "Triggers created automatically cannot be modified\n",
        336068740 => "Table @1 already exists\n",
        336068748 => "Procedure @1 not found\n",
        336068752 => "Exception not found\n",
        336068754 => "Parameter @1 in procedure @2 not found\n",
        336068755 => "Trigger @1 not found\n",
        336068759 => "Character set @1 not found\n",
        336068760 => "Collation @1 not found\n",
        336068763 => "Role @1 not found\n",
        336068767 => "Name longer than database column size\n",
        336068784 => "column @1 does not exist in table/view @2\n",
        336068796 => "SQL role @1 does not exist\n",
        336068797 => "user @1 has no grant admin option on SQL role @2\n",
        336068798 => "user @1 is not a member of SQL role @2\n",
        336068799 => "@1 is not the owner of SQL role @2\n",
        336068800 => "@1 is a SQL role and not a user\n",
        336068801 => "user name @1 could not be used for SQL role\n",
        336068802 => "SQL role @1 already exists\n",
        336068803 => "keyword @1 can not be used as a SQL role name\n",
        336068804 => "SQL roles are not supported in on older versions of the database.  A backup and restore of the database is required.\n",
        336068812 => "Cannot rename domain @1 to @2.  A domain with that name already exists.\n",
        336068813 => "Cannot rename column @1 to @2.  A column with that name already exists in table @3.\n",
        336068814 => "Column @1 from table @2 is referenced in @3\n",
        336068815 => "Cannot change datatype for column @1.  Changing datatype is not supported for BLOB or ARRAY columns.\n",
        336068816 => "New size specified for column @1 must be at least @2 characters.\n",
        336068817 => "Cannot change datatype for @1.  Conversion from base type @2 to @3 is not supported.\n",
        336068818 => "Cannot change datatype for column @1 from a character type to a non-character type.\n",
        336068820 => "Zero length identifiers are not allowed\n",
        336068822 => "Sequence @1 not found\n",
        336068829 => "Maximum number of collations per character set exceeded\n",
        336068830 => "Invalid collation attributes\n",
        336068840 => "@1 cannot reference @2\n",
        336068843 => "Collation @1 is used in table @2 (field name @3) and cannot be dropped\n",
        336068844 => "Collation @1 is used in domain @2 and cannot be dropped\n",
        336068845 => "Cannot delete system collation\n",
        336068846 => "Cannot delete default collation of CHARACTER SET @1\n",
        336068849 => "Table @1 not found\n",
        336068851 => "Collation @1 is used in procedure @2 (parameter name @3) and cannot be dropped\n",
        336068852 => "New scale specified for column @1 must be at most @2.\n",
        336068853 => "New precision specified for column @1 must be at least @2.\n",
        336068855 => "Warning: @1 on @2 is not granted to @3.\n",
        336068856 => "Feature '@1' is not supported in ODS @2.@3\n",
        336068857 => "Cannot add or remove COMPUTED from column @1\n",
        336068858 => "Password should not be empty string\n",
        336068859 => "Index @1 already exists\n",
        336068864 => "Package @1 not found\n",
        336068865 => "Schema @1 not found\n",
        336068866 => "Cannot ALTER or DROP system procedure @1\n",
        336068867 => "Cannot ALTER or DROP system trigger @1\n",
        336068868 => "Cannot ALTER or DROP system function @1\n",
        336068869 => "Invalid DDL statement for procedure @1\n",
        336068870 => "Invalid DDL statement for trigger @1\n",
        336068871 => "Function @1 has not been defined on the package body @2\n",
        336068872 => "Procedure @1 has not been defined on the package body @2\n",
        336068873 => "Function @1 has a signature mismatch on package body @2\n",
        336068874 => "Procedure @1 has a signature mismatch on package body @2\n",
        336068875 => "Default values for parameters are not allowed in the definition of a previously declared packaged procedure @1.@2\n",
        336068877 => "Package body @1 already exists\n",
        336068878 => "Invalid DDL statement for function @1\n",
        336068879 => "Cannot alter new style function @1 with ALTER EXTERNAL FUNCTION. Use ALTER FUNCTION instead.\n",
        336068886 => "Parameter @1 in function @2 not found\n",
        336068887 => "Parameter @1 of routine @2 not found\n",
        336068888 => "Parameter @1 of routine @2 is ambiguous (found in both procedures and functions). Use a specifier keyword.\n",
        336068889 => "Collation @1 is used in function @2 (parameter name @3) and cannot be dropped\n",
        336068890 => "Domain @1 is used in function @2 (parameter name @3) and cannot be dropped\n",
        336068891 => "ALTER USER requires at least one clause to be specified\n",
        336068894 => "Duplicate @1 @2\n",
        336068895 => "System @1 @2 cannot be modified\n",
        336068896 => "INCREMENT BY 0 is an illegal option for sequence @1\n",
        336068897 => "Can't use @1 in FOREIGN KEY constraint\n",
        336068898 => "Default values for parameters are not allowed in the definition of a previously declared packaged function @1.@2\n",
        336068900 => "role @1 can not be granted to role @2\n",
        336068904 => "INCREMENT BY 0 is an illegal option for identity column @1 of table @2\n",
        336068907 => "no @1 privilege with grant option on DDL @2\n",
        336068908 => "no @1 privilege with grant option on object @2\n",
        336068909 => "Function @1 does not exist\n",
        336068910 => "Procedure @1 does not exist\n",
        336068911 => "Package @1 does not exist\n",
        336068912 => "Trigger @1 does not exist\n",
        336068913 => "View @1 does not exist\n",
        336068914 => "Table @1 does not exist\n",
        336068915 => "Exception @1 does not exist\n",
        336068916 => "Generator/Sequence @1 does not exist\n",
        336068917 => "Field @1 of table @2 does not exist\n",
        336330753 => "found unknown switch\n",
        336330754 => "page size parameter missing\n",
        336330755 => "Page size specified (@1) greater than limit (32768 bytes)\n",
        336330756 => "redirect location for output is not specified\n",
        336330757 => "conflicting switches for backup/restore\n",
        336330758 => "device type @1 not known\n",
        336330759 => "protection is not there yet\n",
        336330760 => "page size is allowed only on restore or create\n",
        336330761 => "multiple sources or destinations specified\n",
        336330762 => "requires both input and output filenames\n",
        336330763 => "input and output have the same name.  Disallowed.\n",
        336330764 => "expected page size, encountered '@1'\n",
        336330765 => "REPLACE specified, but the first file @1 is a database\n",
        336330766 => "database @1 already exists.  To replace it, use the -REP switch\n",
        336330767 => "device type not specified\n",
        336330772 => "gds_$blob_info failed\n",
        336330773 => "do not understand BLOB INFO item @1\n",
        336330774 => "gds_$get_segment failed\n",
        336330775 => "gds_$close_blob failed\n",
        336330776 => "gds_$open_blob failed\n",
        336330777 => "Failed in put_blr_gen_id\n",
        336330778 => "data type @1 not understood\n",
        336330779 => "gds_$compile_request failed\n",
        336330780 => "gds_$start_request failed\n",
        336330781 => "gds_$receive failed\n",
        336330782 => "gds_$release_request failed\n",
        336330783 => "gds_$database_info failed\n",
        336330784 => "Expected database description record\n",
        336330785 => "failed to create database @1\n",
        336330786 => "RESTORE: decompression length error\n",
        336330787 => "cannot find table @1\n",
        336330788 => "Cannot find column for BLOB\n",
        336330789 => "gds_$create_blob failed\n",
        336330790 => "gds_$put_segment failed\n",
        336330791 => "expected record length\n",
        336330792 => "wrong length record, expected @1 encountered @2\n",
        336330793 => "expected data attribute\n",
        336330794 => "Failed in store_blr_gen_id\n",
        336330795 => "do not recognize record type @1\n",
        336330796 => "Expected backup version 1..10.  Found @1\n",
        336330797 => "expected backup description record\n",
        336330798 => "string truncated\n",
        336330799 => "warning -- record could not be restored\n",
        336330800 => "gds_$send failed\n",
        336330801 => "no table name for data\n",
        336330802 => "unexpected end of file on backup file\n",
        336330803 => "database format @1 is too old to restore to\n",
        336330804 => "array dimension for column @1 is invalid\n",
        336330807 => "Expected XDR record length\n",
        336330817 => "cannot open backup file @1\n",
        336330818 => "cannot open status and error output file @1\n",
        336330934 => "blocking factor parameter missing\n",
        336330935 => "expected blocking factor, encountered '@1'\n",
        336330936 => "a blocking factor may not be used in conjunction with device CT\n",
        336330940 => "user name parameter missing\n",
        336330941 => "password parameter missing\n",
        336330952 => " missing parameter for the number of bytes to be skipped\n",
        336330953 => "expected number of bytes to be skipped, encountered '@1'\n",
        336330965 => "character set\n",
        336330967 => "collation\n",
        336330972 => "Unexpected I/O error while reading from backup file\n",
        336330973 => "Unexpected I/O error while writing to backup file\n",
        336330985 => "could not drop database @1 (no privilege or database might be in use)\n",
        336330990 => "System memory exhausted\n",
        336331002 => "SQL role\n",
        336331005 => "SQL role parameter missing\n",
        336331010 => "page buffers parameter missing\n",
        336331011 => "expected page buffers, encountered '@1'\n",
        336331012 => "page buffers is allowed only on restore or create\n",
        336331014 => "size specification either missing or incorrect for file @1\n",
        336331015 => "file @1 out of sequence\n",
        336331016 => "can't join -- one of the files missing\n",
        336331017 => " standard input is not supported when using join operation\n",
        336331018 => "standard output is not supported when using split operation or in verbose mode\n",
        336331019 => "backup file @1 might be corrupt\n",
        336331020 => "database file specification missing\n",
        336331021 => "can't write a header record to file @1\n",
        336331022 => "free disk space exhausted\n",
        336331023 => "file size given (@1) is less than minimum allowed (@2)\n",
        336331025 => "service name parameter missing\n",
        336331026 => "Cannot restore over current database, must be SYSDBA or owner of the existing database.\n",
        336331031 => "'read_only' or 'read_write' required\n",
        336331033 => "just data ignore all constraints etc.\n",
        336331034 => "restoring data only ignoring foreign key, unique, not null & other constraints\n",
        336331078 => "verbose interval value parameter missing\n",
        336331079 => "verbose interval value cannot be smaller than @1\n",
        336331081 => "verify (verbose) and verbint options are mutually exclusive\n",
        336331082 => "option -@1 is allowed only on restore or create\n",
        336331083 => "option -@1 is allowed only on backup\n",
        336331084 => "options -@1 and -@2 are mutually exclusive\n",
        336331085 => "parameter for option -@1 was already specified with value '@2'\n",
        336331086 => "option -@1 was already specified\n",
        336331091 => "dependency depth greater than @1 for view @2\n",
        336331092 => "value greater than @1 when calculating length of rdb$db_key for view @2\n",
        336331093 => "Invalid metadata detected. Use -FIX_FSS_METADATA option.\n",
        336331094 => "Invalid data detected. Use -FIX_FSS_DATA option.\n",
        336331096 => "Expected backup version @2..@3.  Found @1\n",
        336331100 => "database format @1 is too old to backup\n",
        336397205 => "ODS versions before ODS@1 are not supported\n",
        336397206 => "Table @1 does not exist\n",
        336397207 => "View @1 does not exist\n",
        336397208 => "At line @1, column @2\n",
        336397209 => "At unknown line and column\n",
        336397210 => "Column @1 cannot be repeated in @2 statement\n",
        336397211 => "Too many values (more than @1) in member list to match against\n",
        336397212 => "Array and BLOB data types not allowed in computed field\n",
        336397213 => "Implicit domain name @1 not allowed in user created domain\n",
        336397214 => "scalar operator used on field @1 which is not an array\n",
        336397215 => "cannot sort on more than 255 items\n",
        336397216 => "cannot group on more than 255 items\n",
        336397217 => "Cannot include the same field (@1.@2) twice in the ORDER BY clause with conflicting sorting options\n",
        336397218 => "column list from derived table @1 has more columns than the number of items in its SELECT statement\n",
        336397219 => "column list from derived table @1 has less columns than the number of items in its SELECT statement\n",
        336397220 => "no column name specified for column number @1 in derived table @2\n",
        336397221 => "column @1 was specified multiple times for derived table @2\n",
        336397222 => "Internal dsql error: alias type expected by pass1_expand_select_node\n",
        336397223 => "Internal dsql error: alias type expected by pass1_field\n",
        336397224 => "Internal dsql error: column position out of range in pass1_union_auto_cast\n",
        336397225 => "Recursive CTE member (@1) can refer itself only in FROM clause\n",
        336397226 => "CTE '@1' has cyclic dependencies\n",
        336397227 => "Recursive member of CTE can't be member of an outer join\n",
        336397228 => "Recursive member of CTE can't reference itself more than once\n",
        336397229 => "Recursive CTE (@1) must be an UNION\n",
        336397230 => "CTE '@1' defined non-recursive member after recursive\n",
        336397231 => "Recursive member of CTE '@1' has @2 clause\n",
        336397232 => "Recursive members of CTE (@1) must be linked with another members via UNION ALL\n",
        336397233 => "Non-recursive member is missing in CTE '@1'\n",
        336397234 => "WITH clause can't be nested\n",
        336397235 => "column @1 appears more than once in USING clause\n",
        336397236 => "feature is not supported in dialect @1\n",
        336397237 => "CTE '@1' is not used in query\n",
        336397238 => "column @1 appears more than once in ALTER VIEW\n",
        336397239 => "@1 is not supported inside IN AUTONOMOUS TRANSACTION block\n",
        336397240 => "Unknown node type @1 in dsql/GEN_expr\n",
        336397241 => "Argument for @1 in dialect 1 must be string or numeric\n",
        336397242 => "Argument for @1 in dialect 3 must be numeric\n",
        336397243 => "Strings cannot be added to or subtracted from DATE or TIME types\n",
        336397244 => "Invalid data type for subtraction involving DATE, TIME or TIMESTAMP types\n",
        336397245 => "Adding two DATE values or two TIME values is not allowed\n",
        336397246 => "DATE value cannot be subtracted from the provided data type\n",
        336397247 => "Strings cannot be added or subtracted in dialect 3\n",
        336397248 => "Invalid data type for addition or subtraction in dialect 3\n",
        336397249 => "Invalid data type for multiplication in dialect 1\n",
        336397250 => "Strings cannot be multiplied in dialect 3\n",
        336397251 => "Invalid data type for multiplication in dialect 3\n",
        336397252 => "Division in dialect 1 must be between numeric data types\n",
        336397253 => "Strings cannot be divided in dialect 3\n",
        336397254 => "Invalid data type for division in dialect 3\n",
        336397255 => "Strings cannot be negated (applied the minus operator) in dialect 3\n",
        336397256 => "Invalid data type for negation (minus operator)\n",
        336397257 => "Cannot have more than 255 items in DISTINCT / UNION DISTINCT list\n",
        336397258 => "ALTER CHARACTER SET @1 failed\n",
        336397259 => "COMMENT ON @1 failed\n",
        336397260 => "CREATE FUNCTION @1 failed\n",
        336397261 => "ALTER FUNCTION @1 failed\n",
        336397262 => "CREATE OR ALTER FUNCTION @1 failed\n",
        336397263 => "DROP FUNCTION @1 failed\n",
        336397264 => "RECREATE FUNCTION @1 failed\n",
        336397265 => "CREATE PROCEDURE @1 failed\n",
        336397266 => "ALTER PROCEDURE @1 failed\n",
        336397267 => "CREATE OR ALTER PROCEDURE @1 failed\n",
        336397268 => "DROP PROCEDURE @1 failed\n",
        336397269 => "RECREATE PROCEDURE @1 failed\n",
        336397270 => "CREATE TRIGGER @1 failed\n",
        336397271 => "ALTER TRIGGER @1 failed\n",
        336397272 => "CREATE OR ALTER TRIGGER @1 failed\n",
        336397273 => "DROP TRIGGER @1 failed\n",
        336397274 => "RECREATE TRIGGER @1 failed\n",
        336397275 => "CREATE COLLATION @1 failed\n",
        336397276 => "DROP COLLATION @1 failed\n",
        336397277 => "CREATE DOMAIN @1 failed\n",
        336397278 => "ALTER DOMAIN @1 failed\n",
        336397279 => "DROP DOMAIN @1 failed\n",
        336397280 => "CREATE EXCEPTION @1 failed\n",
        336397281 => "ALTER EXCEPTION @1 failed\n",
        336397282 => "CREATE OR ALTER EXCEPTION @1 failed\n",
        336397283 => "RECREATE EXCEPTION @1 failed\n",
        336397284 => "DROP EXCEPTION @1 failed\n",
        336397285 => "CREATE SEQUENCE @1 failed\n",
        336397286 => "CREATE TABLE @1 failed\n",
        336397287 => "ALTER TABLE @1 failed\n",
        336397288 => "DROP TABLE @1 failed\n",
        336397289 => "RECREATE TABLE @1 failed\n",
        336397290 => "CREATE PACKAGE @1 failed\n",
        336397291 => "ALTER PACKAGE @1 failed\n",
        336397292 => "CREATE OR ALTER PACKAGE @1 failed\n",
        336397293 => "DROP PACKAGE @1 failed\n",
        336397294 => "RECREATE PACKAGE @1 failed\n",
        336397295 => "CREATE PACKAGE BODY @1 failed\n",
        336397296 => "DROP PACKAGE BODY @1 failed\n",
        336397297 => "RECREATE PACKAGE BODY @1 failed\n",
        336397298 => "CREATE VIEW @1 failed\n",
        336397299 => "ALTER VIEW @1 failed\n",
        336397300 => "CREATE OR ALTER VIEW @1 failed\n",
        336397301 => "RECREATE VIEW @1 failed\n",
        336397302 => "DROP VIEW @1 failed\n",
        336397303 => "DROP SEQUENCE @1 failed\n",
        336397304 => "RECREATE SEQUENCE @1 failed\n",
        336397305 => "DROP INDEX @1 failed\n",
        336397306 => "DROP FILTER @1 failed\n",
        336397307 => "DROP SHADOW @1 failed\n",
        336397308 => "DROP ROLE @1 failed\n",
        336397309 => "DROP USER @1 failed\n",
        336397310 => "CREATE ROLE @1 failed\n",
        336397311 => "ALTER ROLE @1 failed\n",
        336397312 => "ALTER INDEX @1 failed\n",
        336397313 => "ALTER DATABASE failed\n",
        336397314 => "CREATE SHADOW @1 failed\n",
        336397315 => "DECLARE FILTER @1 failed\n",
        336397316 => "CREATE INDEX @1 failed\n",
        336397317 => "CREATE USER @1 failed\n",
        336397318 => "ALTER USER @1 failed\n",
        336397319 => "GRANT failed\n",
        336397320 => "REVOKE failed\n",
        336397321 => "Recursive member of CTE cannot use aggregate or window function\n",
        336397322 => "@2 MAPPING @1 failed\n",
        336397323 => "ALTER SEQUENCE @1 failed\n",
        336397324 => "CREATE GENERATOR @1 failed\n",
        336397325 => "SET GENERATOR @1 failed\n",
        336397326 => "WITH LOCK can be used only with a single physical table\n",
        336397327 => "FIRST/SKIP cannot be used with OFFSET/FETCH or ROWS\n",
        336397328 => "WITH LOCK cannot be used with aggregates\n",
        336397329 => "WITH LOCK cannot be used with @1\n",
        336397330 => "Number of arguments (@1) exceeds the maximum (@2) number of EXCEPTION USING arguments\n",
        336397331 => "String literal with @1 bytes exceeds the maximum length of @2 bytes\n",
        336397332 => "String literal with @1 characters exceeds the maximum length of @2 characters for the @3 character set\n",
        336397333 => "Too many BEGIN...END nesting. Maximum level is @1\n",
        336397334 => "RECREATE USER @1 failed\n",
        336723983 => "unable to open database\n",
        336723984 => "error in switch specifications\n",
        336723985 => "no operation specified\n",
        336723986 => "no user name specified\n",
        336723987 => "add record error\n",
        336723988 => "modify record error\n",
        336723989 => "find/modify record error\n",
        336723990 => "record not found for user: @1\n",
        336723991 => "delete record error\n",
        336723992 => "find/delete record error\n",
        336723996 => "find/display record error\n",
        336723997 => "invalid parameter, no switch defined\n",
        336723998 => "operation already specified\n",
        336723999 => "password already specified\n",
        336724000 => "uid already specified\n",
        336724001 => "gid already specified\n",
        336724002 => "project already specified\n",
        336724003 => "organization already specified\n",
        336724004 => "first name already specified\n",
        336724005 => "middle name already specified\n",
        336724006 => "last name already specified\n",
        336724008 => "invalid switch specified\n",
        336724009 => "ambiguous switch specified\n",
        336724010 => "no operation specified for parameters\n",
        336724011 => "no parameters allowed for this operation\n",
        336724012 => "incompatible switches specified\n",
        336724044 => "Invalid user name (maximum 31 bytes allowed)\n",
        336724045 => "Warning - maximum 8 significant bytes of password used\n",
        336724046 => "database already specified\n",
        336724047 => "database administrator name already specified\n",
        336724048 => "database administrator password already specified\n",
        336724049 => "SQL role name already specified\n",
        336920577 => "found unknown switch\n",
        336920578 => "please retry, giving a database name\n",
        336920579 => "Wrong ODS version, expected @1, encountered @2\n",
        336920580 => "Unexpected end of database file.\n",
        336920605 => "Can't open database file @1\n",
        336920606 => "Can't read a database page\n",
        336920607 => "System memory exhausted\n",
        336986113 => "Wrong value for access mode\n",
        336986114 => "Wrong value for write mode\n",
        336986115 => "Wrong value for reserve space\n",
        336986116 => "Unknown tag (@1) in info_svr_db_info block after isc_svc_query()\n",
        336986117 => "Unknown tag (@1) in isc_svc_query() results\n",
        336986118 => "Unknown switch '@1'\n",
        336986159 => "Wrong value for shutdown mode\n",
        336986160 => "could not open file @1\n",
        336986161 => "could not read file @1\n",
        336986162 => "empty file @1\n",
        336986164 => "Invalid or missing parameter for switch @1\n",
        336986170 => "Unknown tag (@1) in isc_info_svc_limbo_trans block after isc_svc_query()\n",
        336986171 => "Unknown tag (@1) in isc_spb_tra_state block after isc_svc_query()\n",
        336986172 => "Unknown tag (@1) in isc_spb_tra_advise block after isc_svc_query()\n",
        337051649 => "Switches trusted_user and trusted_role are not supported from command line\n",
        337117213 => "Missing parameter for switch @1\n",
        337117214 => "Only one of -LOCK, -UNLOCK, -FIXUP, -BACKUP or -RESTORE should be specified\n",
        337117215 => "Unrecognized parameter @1\n",
        337117216 => "Unknown switch @1\n",
        337117217 => "Fetch password can't be used in service mode\n",
        337117218 => "Error working with password file '@1'\n",
        337117219 => "Switch -SIZE can be used only with -LOCK\n",
        337117220 => "None of -LOCK, -UNLOCK, -FIXUP, -BACKUP or -RESTORE specified\n",
        337117223 => "IO error reading file: @1\n",
        337117224 => "IO error writing file: @1\n",
        337117225 => "IO error seeking file: @1\n",
        337117226 => "Error opening database file: @1\n",
        337117227 => "Error in posix_fadvise(@1) for database @2\n",
        337117228 => "Error creating database file: @1\n",
        337117229 => "Error opening backup file: @1\n",
        337117230 => "Error creating backup file: @1\n",
        337117231 => "Unexpected end of database file @1\n",
        337117232 => "Database @1 is not in state (@2) to be safely fixed up\n",
        337117233 => "Database error\n",
        337117234 => "Username or password is too long\n",
        337117235 => "Cannot find record for database '@1' backup level @2 in the backup history\n",
        337117236 => "Internal error. History query returned null SCN or GUID\n",
        337117237 => "Unexpected end of file when reading header of database file '@1' (stage @2)\n",
        337117238 => "Internal error. Database file is not locked. Flags are @1\n",
        337117239 => "Internal error. Cannot get backup guid clumplet\n",
        337117240 => "Internal error. Database page @1 had been changed during backup (page SCN=@2, backup SCN=@3)\n",
        337117241 => "Database file size is not a multiple of page size\n",
        337117242 => "Level 0 backup is not restored\n",
        337117243 => "Unexpected end of file when reading header of backup file: @1\n",
        337117244 => "Invalid incremental backup file: @1\n",
        337117245 => "Unsupported version @1 of incremental backup file: @2\n",
        337117246 => "Invalid level @1 of incremental backup file: @2, expected @3\n",
        337117247 => "Wrong order of backup files or invalid incremental backup file detected, file: @1\n",
        337117248 => "Unexpected end of backup file: @1\n",
        337117249 => "Error creating database file: @1 via copying from: @2\n",
        337117250 => "Unexpected end of file when reading header of restored database file (stage @1)\n",
        337117251 => "Cannot get backup guid clumplet from L0 backup\n",
        337117255 => "Wrong parameter @1 for switch -D, need ON or OFF\n",
        337117257 => "Terminated due to user request\n",
        337117259 => "Too complex decompress command (> @1 arguments)\n",
        337117261 => "Cannot find record for database '@1' backup GUID @2 in the backup history\n",
        337182750 => "conflicting actions '@1' and '@2' found\n",
        337182751 => "action switch not found\n",
        337182752 => "switch '@1' must be set only once\n",
        337182753 => "value for switch '@1' is missing\n",
        337182754 => "invalid value ('@1') for switch '@2'\n",
        337182755 => "unknown switch '@1' encountered\n",
        337182756 => "switch '@1' can be used by service only\n",
        337182757 => "switch '@1' can be used by interactive user only\n",
        337182758 => "mandatory parameter '@1' for switch '@2' is missing\n",
        337182759 => "parameter '@1' is incompatible with action '@2'\n",
        337182760 => "mandatory switch '@1' is missing\n",
        _ => "Error message not found",
    }
}

/// Binary Language Representation constants
pub mod blr {
    pub const TEXT: u8 = 14;
    pub const TEXT2: u8 = 15; /* added in 3.2 JPN */
    pub const SHORT: u8 = 7;
    pub const LONG: u8 = 8;
    pub const QUAD: u8 = 9;
    pub const FLOAT: u8 = 10;
    pub const DOUBLE: u8 = 27;
    pub const D_FLOAT: u8 = 11;
    pub const TIMESTAMP: u8 = 35;
    pub const VARYING: u8 = 37;
    pub const VARYING2: u8 = 38; /* added in 3.2 JPN */
    pub const BLOB: u16 = 261;
    pub const CSTRING: u8 = 40;
    pub const CSTRING2: u8 = 41; /* added in 3.2 JPN */
    pub const BLOB_ID: u8 = 45; /* added from gds.h */
    pub const SQL_DATE: u8 = 12;
    pub const SQL_TIME: u8 = 13;
    pub const INT64: u8 = 16;
    pub const BLOB2: u8 = 17;
    pub const DOMAIN_NAME: u8 = 18;
    pub const DOMAIN_NAME2: u8 = 19;
    pub const NOT_NULLABLE: u8 = 20;
    pub const COLUMN_NAME: u8 = 21;
    pub const COLUMN_NAME2: u8 = 22;
    pub const BOOL: u8 = 23;
    // first sub parameter for domain_name[2]
    pub const DOMAIN_TYPE_OF: u8 = 0;
    pub const DOMAIN_FULL: u8 = 1;

    pub const INNER: u8 = 0;
    pub const LEFT: u8 = 1;
    pub const RIGHT: u8 = 2;
    pub const FULL: u8 = 3;
    pub const GDS_CODE: u8 = 0;
    pub const SQL_CODE: u8 = 1;
    pub const EXCEPTION: u8 = 2;
    pub const TRIGGER_CODE: u8 = 3;
    pub const DEFAULT_CODE: u8 = 4;
    pub const RAISE: u8 = 5;
    pub const EXCEPTION_MSG: u8 = 6;
    pub const EXCEPTION_PARAMS: u8 = 7;
    pub const VERSION4: u8 = 4;
    pub const VERSION5: u8 = 5;
    //const VERSION6        : u8 =6;
    pub const EOC: u8 = 76;
    pub const END: u8 = 255;
    pub const ASSIGNMENT: u8 = 1;
    pub const BEGIN: u8 = 2;
    pub const DCL_VARIABLE: u8 = 3; /* added from gds.h */
    pub const MESSAGE: u8 = 4;
    pub const ERASE: u8 = 5;
    pub const FETCH: u8 = 6;
    pub const FOR: u8 = 7;
    pub const IF: u8 = 8;
    pub const LOOP: u8 = 9;
    pub const MODIFY: u8 = 10;
    pub const HANDLER: u8 = 11;
    pub const RECEIVE: u8 = 12;
    pub const SELECT: u8 = 13;
    pub const SEND: u8 = 14;
    pub const STORE: u8 = 15;
    pub const LABEL: u8 = 17;
    pub const LEAVE: u8 = 18;
    pub const STORE2: u8 = 19;
    pub const POST: u8 = 20;
    pub const LITERAL: u8 = 21;
    pub const DBKEY: u8 = 22;
    pub const FIELD: u8 = 23;
    pub const FID: u8 = 24;
    pub const PARAMETER: u8 = 25;
    pub const VARIABLE: u8 = 26;
    pub const AVERAGE: u8 = 27;
    pub const COUNT: u8 = 28;
    pub const MAXIMUM: u8 = 29;
    pub const MINIMUM: u8 = 30;
    pub const TOTAL: u8 = 31;
    // unused codes: 32..33
    pub const ADD: u8 = 34;
    pub const SUBTRACT: u8 = 35;
    pub const MULTIPLY: u8 = 36;
    pub const DIVIDE: u8 = 37;
    pub const NEGATE: u8 = 38;
    pub const CONCATENATE: u8 = 39;
    pub const SUBSTRING: u8 = 40;
    pub const PARAMETER2: u8 = 41;
    pub const FROM: u8 = 42;
    pub const VIA: u8 = 43;
    pub const USER_NAME: u8 = 44; /* added from gds.h */
    pub const NULL: u8 = 45;
    pub const EQUIV: u8 = 46;
    pub const EQL: u8 = 47;
    pub const NEQ: u8 = 48;
    pub const GTR: u8 = 49;
    pub const GEQ: u8 = 50;
    pub const LSS: u8 = 51;
    pub const LEQ: u8 = 52;
    pub const CONTAINING: u8 = 53;
    pub const MATCHING: u8 = 54;
    pub const STARTING: u8 = 55;
    pub const BETWEEN: u8 = 56;
    pub const OR: u8 = 57;
    pub const AND: u8 = 58;
    pub const NOT: u8 = 59;
    pub const ANY: u8 = 60;
    pub const MISSING: u8 = 61;
    pub const UNIQUE: u8 = 62;
    pub const LIKE: u8 = 63;
    // unused codes: 64..66
    pub const RSE: u8 = 67;
    pub const FIRST: u8 = 68;
    pub const PROJECT: u8 = 69;
    pub const SORT: u8 = 70;
    pub const BOOLEAN: u8 = 71;
    pub const ASCENDING: u8 = 72;
    pub const DESCENDING: u8 = 73;
    pub const RELATION: u8 = 74;
    pub const RID: u8 = 75;
    pub const UNION: u8 = 76;
    pub const MAP: u8 = 77;
    pub const GROUP_BY: u8 = 78;
    pub const AGGREGATE: u8 = 79;
    pub const JOIN_TYPE: u8 = 80;
    // unused codes: 81..82
    pub const AGG_COUNT: u8 = 83;
    pub const AGG_MAX: u8 = 84;
    pub const AGG_MIN: u8 = 85;
    pub const AGG_TOTAL: u8 = 86;
    pub const AGG_AVERAGE: u8 = 87;
    pub const PARAMETER3: u8 = 88; /* same as Rdb definition */
    /* unsupported
    const RUN_MAX        : u8 =89;
    const RUN_MIN        : u8 =90;
    const RUN_TOTAL        : u8 =91;
    const RUN_AVERAGE        : u8 =92;
    */
    pub const AGG_COUNT2: u8 = 93;
    pub const AGG_COUNT_DISTINCT: u8 = 94;
    pub const AGG_TOTAL_DISTINCT: u8 = 95;
    pub const AGG_AVERAGE_DISTINCT: u8 = 96;
    // unused codes: 97..99
    pub const FUNCTION: u8 = 100;
    pub const GEN_ID: u8 = 101;
    ///const PROT_MASK        : u8 =102;
    pub const UPCASE: u8 = 103;
    ///const LOCK_STATE        : u8 =104;
    pub const VALUE_IF: u8 = 105;
    pub const MATCHING2: u8 = 106;
    pub const INDEX: u8 = 107;
    pub const ANSI_LIKE: u8 = 108;
    pub const SCROLLABLE: u8 = 109;
    // unused codes: 110..117
    pub const RUN_COUNT: u8 = 118; /* changed from 88 to avoid conflict with parameter3 */
    pub const RS_STREAM: u8 = 119;
    pub const EXEC_PROC: u8 = 120;
    // unused codes: 121..123
    pub const PROCEDURE: u8 = 124;
    pub const PID: u8 = 125;
    pub const EXEC_PID: u8 = 126;
    pub const SINGULAR: u8 = 127;
    pub const ABORT: u8 = 128;
    pub const BLOCK: u8 = 129;
    pub const ERROR_HANDLER: u8 = 130;
    pub const CAST: u8 = 131;
    pub const PID2: u8 = 132;
    pub const PROCEDURE2: u8 = 133;
    pub const START_SAVEPOINT: u8 = 134;
    pub const END_SAVEPOINT: u8 = 135;
    // unused codes: 136..138
    pub const PLAN: u8 = 139; /* access plan items */
    pub const MERGE: u8 = 140;
    pub const JOIN: u8 = 141;
    pub const SEQUENTIAL: u8 = 142;
    pub const NAVIGATIONAL: u8 = 143;
    pub const INDICES: u8 = 144;
    pub const RETRIEVE: u8 = 145;
    pub const RELATION2: u8 = 146;
    pub const RID2: u8 = 147;
    // unused codes: 148..149
    pub const SET_GENERATOR: u8 = 150;
    pub const ANSI_ANY: u8 = 151; /* required for NULL handling */
    pub const EXISTS: u8 = 152; /* required for NULL handling */
    // unused codes: 153
    pub const RECORD_VERSION: u8 = 154; /* get tid of record */
    pub const STALL: u8 = 155; /* fake server stall */
    // unused codes: 156..157
    pub const ANSI_ALL: u8 = 158; /* required for NULL handling */
    pub const EXTRACT: u8 = 159;
    /* sub parameters for extract */
    pub const EXTRACT_YEAR: u8 = 0;
    pub const EXTRACT_MONTH: u8 = 1;
    pub const EXTRACT_DAY: u8 = 2;
    pub const EXTRACT_HOUR: u8 = 3;
    pub const EXTRACT_MINUTE: u8 = 4;
    pub const EXTRACT_SECOND: u8 = 5;
    pub const EXTRACT_WEEKDAY: u8 = 6;
    pub const EXTRACT_YEARDAY: u8 = 7;
    pub const EXTRACT_MILLISECOND: u8 = 8;
    pub const EXTRACT_WEEK: u8 = 9;
    pub const CURRENT_DATE: u8 = 160;
    pub const CURRENT_TIMESTAMP: u8 = 161;
    pub const CURRENT_TIME: u8 = 162;
    /* These codes reuse  code space */
    pub const POST_ARG: u8 = 163;
    pub const EXEC_INTO: u8 = 164;
    pub const USER_SAVEPOINT: u8 = 165;
    pub const DCL_CURSOR: u8 = 166;
    pub const CURSOR_STMT: u8 = 167;
    pub const CURRENT_TIMESTAMP2: u8 = 168;
    pub const CURRENT_TIME2: u8 = 169;
    pub const AGG_LIST: u8 = 170;
    pub const AGG_LIST_DISTINCT: u8 = 171;
    pub const MODIFY2: u8 = 172;
    // unused codes: 173
    /* FB 1.0 specific  */
    pub const CURRENT_ROLE: u8 = 174;
    pub const SKIP: u8 = 175;
    /* FB 1.5 specific  */
    pub const EXEC_SQL: u8 = 176;
    pub const INTERNAL_INFO: u8 = 177;
    pub const NULLSFIRST: u8 = 178;
    pub const WRITELOCK: u8 = 179;
    pub const NULLSLAST: u8 = 180;
    /* FB 2.0 specific  */
    pub const LOWCASE: u8 = 181;
    pub const STRLEN: u8 = 182;
    /* sub parameter for strlen */
    pub const STRLEN_BIT: u8 = 0;
    pub const STRLEN_CHAR: u8 = 1;
    pub const STRLEN_OCTET: u8 = 2;
    pub const TRIM: u8 = 183;
    /* first sub parameter for trim */
    pub const TRIM_BOTH: u8 = 0;
    pub const TRIM_LEADING: u8 = 1;
    pub const TRIM_TRAILING: u8 = 2;
    /* second sub parameter for trim */
    pub const TRIM_SPACES: u8 = 0;
    pub const TRIM_CHARACTERS: u8 = 1;
    /* These codes are actions for user-defined savepoints */
    pub const SAVEPOINT_SET: u8 = 0;
    pub const SAVEPOINT_RELEASE: u8 = 1;
    pub const SAVEPOINT_UNDO: u8 = 2;
    pub const SAVEPOINT_RELEASE_SINGLE: u8 = 3;
    /* These codes are actions for cursors */
    pub const CURSOR_OPEN: u8 = 0;
    pub const CURSOR_CLOSE: u8 = 1;
    pub const CURSOR_FETCH: u8 = 2;
    pub const CURSOR_FETCH_SCROLL: u8 = 3;
    /* scroll options */
    pub const SCROLL_FORWARD: u8 = 0;
    pub const SCROLL_BACKWARD: u8 = 1;
    pub const SCROLL_BOF: u8 = 2;
    pub const SCROLL_EOF: u8 = 3;
    pub const SCROLL_ABSOLUTE: u8 = 4;
    pub const SCROLL_RELATIVE: u8 = 5;
    /* FB 2.1 specific  */
    pub const INIT_VARIABLE: u8 = 184;
    pub const RECURSE: u8 = 185;
    pub const SYS_FUNCTION: u8 = 186;
    // FB 2.5 specific
    pub const AUTO_TRANS: u8 = 187;
    pub const SIMILAR: u8 = 188;
    pub const EXEC_STMT: u8 = 189;
    // subcodes of exec_stmt
    pub const EXEC_STMT_INPUTS: u8 = 1; // input parameters count
    pub const EXEC_STMT_OUTPUTS: u8 = 2; // output parameters count
    pub const EXEC_STMT_SQL: u8 = 3;
    pub const EXEC_STMT_PROC_BLOCK: u8 = 4;
    pub const EXEC_STMT_DATA_SRC: u8 = 5;
    pub const EXEC_STMT_USER: u8 = 6;
    pub const EXEC_STMT_PWD: u8 = 7;
    pub const EXEC_STMT_TRAN: u8 = 8; // not implemented yet
    pub const EXEC_STMT_TRAN_CLONE: u8 = 9; // make transaction parameters equal to current transaction
    pub const EXEC_STMT_PRIVS: u8 = 10;
    pub const EXEC_STMT_IN_PARAMS: u8 = 11; // not named input parameters
    pub const EXEC_STMT_IN_PARAMS2: u8 = 12; // named input parameters
    pub const EXEC_STMT_OUT_PARAMS: u8 = 13; // output parameters
    pub const EXEC_STMT_ROLE: u8 = 14;
    pub const STMT_EXPR: u8 = 190;
    pub const DERIVED_EXPR: u8 = 191;
    // FB 3.0 specific
    pub const PROCEDURE3: u8 = 192;
    pub const EXEC_PROC2: u8 = 193;
    pub const FUNCTION2: u8 = 194;
    pub const WINDOW: u8 = 195;
    pub const PARTITION_BY: u8 = 196;
    pub const CONTINUE_LOOP: u8 = 197;
    pub const PROCEDURE4: u8 = 198;
    pub const AGG_FUNCTION: u8 = 199;
    pub const SUBSTRING_SIMILAR: u8 = 200;
    pub const BOOL_AS_VALUE: u8 = 201;
    pub const COALESCE: u8 = 202;
    pub const DECODE: u8 = 203;
    pub const EXEC_SUBPROC: u8 = 204;
    pub const SUBPROC_DECL: u8 = 205;
    pub const SUBPROC: u8 = 206;
    pub const SUBFUNC_DECL: u8 = 207;
    pub const SUBFUNC: u8 = 208;
    pub const RECORD_VERSION2: u8 = 209;
}
