Mirajv1.0
EN

15. Error codes

Every error that MIRAJ returns carries three pieces of information: a numeric code, a 5-character SQLSTATE and a message in the session language. This page lists the numeric codes that the engine can produce, with their SQLSTATE and the exact French wording from the message catalog (kept unchanged below), together with an explanation of the typical cause and, where useful, a suggested fix.

Note on method: each row of this chapter was verified directly in the engine code (message catalog and code table). Where the exact behavior of a code could not be confirmed with certainty, this is stated explicitly rather than risking an invented wording.

1. How to read a MIRAJ error#

An error returned by the engine or by the network server looks like this:

ERROR 1146 (42S02): La table 'ventes.clients' n'existe pas
  • 1146 is the numeric code, specific to MIRAJ (taken from a well-established historical numbering in the SQL ecosystem, so as to remain familiar to existing tools);
  • 42S02 is the SQLSTATE, an engine-independent standard (see §3);
  • the text is the message, produced from a template in the catalog (resources/french.json by default) in which the %s placeholders have been replaced by the values of the error (table name, column name, etc.).

2. Error code reference table#

The codes below are those that the engine's message catalog actually defines (file crates/miraj-core/resources/french.json, code table crates/miraj-core/src/error.rs). The French message is the one in the catalog, word for word (%s = value substituted at runtime: table name, column name, etc.).

2.1 Syntax and parsing errors#

CodeSQLSTATEMessageTypical causeSuggested fix
106442000Erreur de syntaxe SQL ; vérifiez le manuel de votre version de Miraj pour la syntaxe correcte près de '%s' à la ligne %sInvalid SQL construct, misplaced keyword, unsupported syntax, or query nesting depth exceeded (beyond 1,000 levels)Re-read the statement around the text quoted after "near"; check parentheses and commas
106542000La requête est videEmpty statement sent to the serverCheck that the client is not sending an empty string
113942000Erreur « %s » dans l'expression régulièreInvalid pattern passed to REGEXP, REGEXP_REPLACE, etc.Fix the pattern; the details of the regular expression engine's error are included in %s
1210HY000Arguments incorrects pour %sArgument(s) of a function or statement incompatible with its signatureCheck the number and type of the arguments
1221HY000Utilisation incorrecte de %s et %sCombination of two incompatible constructs in the same statementSeparate the two constructs or consult the documentation of the statement concerned
123542000Cette version de Miraj ne prend pas encore en charge '%s'Syntactically valid construct but not implemented in this version (see the Known limitations chapter)See docs/manuel/16-limites-connues.md for an alternative
140742000SQLSTATE incorrect : '%s'SIGNAL/RESIGNAL SQLSTATE '...' with a value that is not a valid 5-character codeUse a compliant SQLSTATE (5 characters, class other than 00, 01, XA)

2.2 Schema errors (databases, tables, columns, indexes)#

CodeSQLSTATEMessageTypical causeSuggested fix
29HY000Fichier '%s' introuvable (code : %s)File expected by the engine missing from disk (table, journal...)Check the path and access rights on the data folder
1004HY000Impossible de créer le fichier '%s' (errno : %s)Disk write impossible (permissions, disk full, invalid path)Check disk space and permissions on the data folder
1005HY000Impossible de créer la table '%s' (errno : %s)Failure to write the .mrj file at creationCheck disk space and permissions
1007HY000Impossible de créer la base '%s' ; elle existe déjàCREATE DATABASE without IF NOT EXISTS on an existing databaseAdd IF NOT EXISTS or choose another name
1008HY000Impossible de supprimer la base '%s' ; elle n'existe pasDROP DATABASE without IF EXISTS on a missing databaseAdd IF EXISTS or check the name
1034HY000Fichier de la table '%s' incorrect ; essayez de la réparer (%s)Corrupted or truncated .mrj fileRun REPAIR TABLE (see the corresponding section of the manual)
104442000Accès refusé pour l'utilisateur '%s'@'%s' à la base de données '%s'Account without privilege on the database (checked at each USE and at the handshake)Grant a database privilege with GRANT
104528000Accès refusé pour l'utilisateur '%s'@'%s' (mot de passe utilisé : %s)Invalid credentials at connectionCheck the account and password
10463D000Aucune base de données sélectionnéeStatement requiring a current database executed without USERun USE <database> before the statement, or qualify the objects
104942000Base de données '%s' inconnueUSE or reference to a database that does not existCheck the spelling or create the database
105042S01La table '%s' existe déjàCREATE TABLE without IF NOT EXISTS on a name already taken (table or view)Add IF NOT EXISTS, or DROP / CREATE OR REPLACE
105142S02Table '%s' inconnueReference to a missing table (context without an explicit database name)Check the name and the current database
105223000La colonne '%s' dans %s est ambiguëColumn present in several tables of the query without qualificationQualify the column (table.column)
105442S22Colonne '%s' inconnue dans '%s'Misspelled column name or column that does not exist in the given contextCheck DESCRIBE <table> or information_schema.COLUMNS
106042S21Nom de colonne '%s' en doubleTwo columns with the same name in one table definition or a CREATE TABLE … SELECTRename one of the columns or give it an alias
106142000Nom de clé '%s' en doubleTwo indexes/keys with the same name on the tableChoose another index name
106642000Table ou alias non unique : '%s'Same table name or alias used twice in a queryGive each occurrence a distinct alias
110242000Nom de base de données incorrect : '%s'Name outside the rules (length, allowed characters — see Known limitations)Use ASCII characters, digits, _, $ and space (never in last position), 64 bytes at most
110342000Nom de table incorrect : '%s'Same rule as 1102, applied to the table nameSame
110942S02Table '%s' inconnue dans %sReferenced table missing in the specified context (%s: clause, join...)Check the table name in that clause
114642S02La table '%s.%s' n'existe pasTable missing from the indicated databaseCheck the name and the database, or create it
116642000Nom de colonne incorrect : '%s'Column name outside the identifier rulesRename according to the rules (see Known limitations)
117042000La colonne BLOB/TEXT '%s' est utilisée dans une clé sans longueur de cléBLOB/TEXT used as a primary key, UNIQUE or index columnUse a bounded-length column, or a column generated from an excerpt
128042000Nom d'index incorrect : '%s'Invalid or too long index nameShorten or fix the name
3162HY000Le compte %s n'existe pas.Role/account cited does not existCheck CREATE USER / the exact account name
3163HY000Le compte %s existe déjà.CREATE USER on an already defined accountUse IF NOT EXISTS or choose another name

2.3 Constraint and data errors#

CodeSQLSTATEMessageTypical causeSuggested fix
104823000La colonne '%s' ne peut pas être NULLINSERT/UPDATE supplying NULL to a NOT NULL column with no implicit value availableProvide a value, or reconsider the NOT NULL constraint
106223000Doublon '%s' pour la clé '%s'Violation of a primary key or UNIQUE constraintUse INSERT IGNORE, REPLACE or ON DUPLICATE KEY UPDATE if the duplicate is expected
106842000Plusieurs clés primaires définiesTwo PRIMARY KEY clauses in the same table definitionKeep only one
113621S01Le nombre de colonnes ne correspond pas au nombre de valeurs à la ligne %sINSERT ... VALUES (...) with a number of values different from the number of columnsMake the two lists match
113822004Utilisation incorrecte de la valeur NULLNULL used where it is not allowed (e.g. value of a constraint)Remove the NULL or reconsider the expression
117142000Toutes les parties d'une clé primaire doivent être NOT NULL ; utilisez UNIQUE pour accepter NULLNullable column included in a PRIMARY KEYMake the column NOT NULL or use a UNIQUE constraint
117242000Le résultat compte plus d'une ligneScalar subquery or SELECT ... INTO receiving several rowsAdd a condition that reduces the result to one row, or use LIMIT 1 knowingly
1215HY000Impossible d'ajouter la contrainte de clé étrangèreInvalid foreign key definition (incompatible types, missing index on the parent side...)Check the column types and the existence of an index on the referenced column
124221000La sous-requête renvoie plus d'une ligneSubquery used in a scalar context (=, SELECT ... INTO) that returns several rowsRestrict the subquery or use IN / EXISTS
126422003Valeur hors limites pour la colonne '%s' à la ligne %sNumeric value outside the range of the declared type (see Known limitations, types table)Use a wider type or fix the value
129222007Valeur %s incorrecte tronquée : '%s'Failed conversion with truncation (e.g. non-numeric string converted to a number)Fix the source value or its format
136522012Division par zéroDivision or modulo by 0Guard the expression (CASE WHEN ... != 0) or accept the NULL result depending on the SQL mode
136622007Valeur %s incorrecte : '%s' pour la colonne %s à la ligne %sValue incompatible with the column type on writeFix the value or the column type
140622001Données trop longues pour la colonne '%s' à la ligne %sString longer than the declared column lengthEnlarge the column or truncate the value upstream
145123000Impossible de supprimer ou de modifier une ligne parente : une contrainte de clé étrangère échoue (%s)Deletion/modification of a row still referenced by a child tableDelete/modify the child rows first, or reconsider the ON DELETE/ON UPDATE action
145223000Impossible d'ajouter ou de modifier une ligne enfant : une contrainte de clé étrangère échoue (%s)Insertion/modification referencing a nonexistent parent rowInsert the parent row first, or check the foreign key value
402523000La CONTRAINTE %s a échoué pour %s.%sRow rejected by a CHECK constraintFix the value to satisfy the constraint, or reconsider the constraint

2.4 Privilege errors#

CodeSQLSTATEMessageTypical causeSuggested fix
104442000Accès refusé pour l'utilisateur '%s'@'%s' à la base de données '%s'Database-level check (see §2.2)Grant the required database privilege
114242000Commande %s refusée à l'utilisateur '%s'@'%s' pour la table '%s'Table-level check, even before name resolutionGrant the required table privilege (SELECT, INSERT...)
114442000Commande GRANT/REVOKE invalide ; consultez le manuel pour savoir quels privilèges s'appliquent à ce niveauGRANT/REVOKE of a privilege at a level where it makes no sense (e.g. table privilege at the global level)Use the level appropriate to the privilege
122742000Accès refusé ; il faut le privilège %s pour cette opérationGlobal-level check (SUPER, RELOAD, SHUTDOWN...)Grant the global privilege named in the message
3523HY000Compte ou rôle inconnu %s@%sSET ROLE or GRANT/REVOKE on a role that does not existCreate the role with CREATE ROLE or fix the name
3530HY000%s@%s n'est pas accordé à %s@%sSET ROLE on a role not granted to the current accountGrant the role with GRANT <role> TO <account>
3619HY000Niveau de privilège invalide pour %sDynamic privilege requested outside the global levelGrant at the global level (ON *.*)

Column-level privileges (GRANT SELECT (colonne) ON ...) and routine-level privileges are not implemented in this version (see the Known limitations chapter): no error of this specific kind is therefore emitted for this case.

2.5 Transaction and concurrency errors#

CodeSQLSTATEMessageTypical causeSuggested fix
1205HY000Délai d'attente du verrou dépassé ; réessayez la transactionLOCK TABLES, SELECT ... FOR UPDATE NOWAIT/WAIT n, or waiting for a table lock beyond lock_wait_timeoutRetry the transaction; consider shortening the duration of concurrent transactions
121340001Interblocage détecté lors de la prise du verrou ; réessayez la transactionConcurrency between transactions on the same rows (MIRAJ never waits: this code covers both a real deadlock and a simple MV-OCC version conflict after 3 internal attempts). Also returned by a COMMIT whose deferred update can no longer be applied (row deleted, WHERE condition that has become false, row held by another transaction, row read then modified by another transaction)Retry the transaction on the client side; since MIRAJ has no blocking wait, this code appears more often than on a classic lock-based engine. A COMMIT may also return the code of a computation error discovered while recomputing a deferred update (1264, 1048, 4025…): the transaction is then rolled back entirely (chapter 9, §9.2)
179225006Impossible d'exécuter l'instruction dans une transaction en lecture seule (READ ONLY).Write attempted in a transaction opened as READ ONLY, or on a cluster secondary (see §2.6)Open a read-write transaction, or write to the primary node
192770100La connexion a été arrêtéeConnection terminated by KILL or by the serverReconnect
196970100Requête interrompue : limite de durée de %s s dépasséemax_statement_time or the MAX_EXECUTION_TIME hint exceededOptimize the query or raise the limit if it is legitimate
1095HY000Vous n'êtes pas propriétaire de la connexion %sKILL of a connection that does not belong to the current account, without the required privilegeUse an account with the appropriate privilege, or target your own connection
1094HY000Identifiant de connexion inconnu : %sKILL with a connection identifier that no longer existsCheck the identifier with SHOW PROCESSLIST
1099HY000La table '%s' est verrouillée en lecture (READ) et ne peut pas être modifiéeWrite attempted on a table read-locked by LOCK TABLESLock for writing (WRITE) or wait for the lock to end
1100HY000La table '%s' n'a pas été verrouillée par LOCK TABLESTable used in a session under LOCK TABLES without itself having been lockedAdd the table to the LOCK TABLES list

2.6 Cluster and replication errors (Cluster edition)#

CodeSQLSTATEMessageTypical causeSuggested fix
1290HY000Le serveur fonctionne avec l'option %s et ne peut pas exécuter cette instructionAttempted write on a read-only secondary node, or server option incompatible with the statementWrite to the cluster's primary node; consult SHOW CLUSTER STATUS
9002HY000%s demande l'édition MIRAJ ClusterEffective partitioning feature (segments, EXCHANGE PARTITION on HASH/KEY...) used outside the Cluster editionSwitch to the Cluster edition, or limit yourself to the partitioning features available in the Enterprise edition (definition accepted, non-partitioned storage)
9003HY000Promotion refusée : %sSET GLOBAL cluster_role = 'primary' refused after probing the other nodes: primary still reachable, another promotion in progress, peer that still sees the primary, more advanced peer that no longer keeps the missing part of the journal, different databases, writes confirmed to clients (semi-synchronous replication) held by no reachable node, lag greater than max_promotion_lag_mb, database awaiting re-seeding after a table rewritten outside the journal by the primary (waiting to be copied again), node FENCED or being seeded; in raft mode (automatic election), refusal by a voter (node n2 refused: not up to date on database shop (epoch 4 < 5), candidate lacks database …, already voted for …), no reachable majority (cluster has no quorum: 1 of 3 members reachable) or election already in progress (the precise reason follows the colon, in English)Depending on the reason: first demote the former primary ('secondary'), promote another secondary, or force while accepting the loss (SET GLOBAL cluster_role = 'force_primary'); see chapter 12, §12.4
9004HY000Réplication synchrone : %sSemi-synchronous replication (@@cluster_sync_commit set to RECEIVED, APPLIED or MAJORITY): acknowledgments from the secondaries not received within @@cluster_sync_timeout or too few secondaries connected (warning with the FALLBACK behavior, error with ERROR), wait canceled by KILL QUERY (warning), node demoted or removed during the wait (error; quorum lost when an elected leader gives up its role for lack of a majority, raft mode). The write is always committed on the primary (reason in English after the colon)Do not replay the write without re-reading (risk of duplicate); check the secondaries (SHOW CLUSTER STATUS, SYNC column); see chapter 12, §12.8
9005HY000Limite de données de MIRAJ Express atteinte (%s) : supprimez des données ou utilisez l'édition EntrepriseExpress edition: the total of the tables reaches 20 GB and the statement would grow the data (INSERT, REPLACE, LOAD DATA, UPDATE, CREATE TABLE, ALTER TABLE)Delete data (DELETE, TRUNCATE, DROP, always allowed) or switch to the Enterprise or Cluster edition
1194HY000La table '%s' est marquée comme endommagée et doit être réparée (%s)Special case: reading a table partitioned into segments by the Cluster edition from an edition that cannot read itOpen the table from a server running the Cluster edition

2.7 MIRAJ-specific errors (editions and vectors)#

These codes exist in no other SQL engine; they are specific to Miraj.

CodeSQLSTATEMessageTypical causeSuggested fix
9001HY000%s n'est pas disponible dans l'édition MIRAJ ExpressFeature reserved for the Enterprise or Cluster edition used in the Express edition (e.g. intra-query parallelism)Switch to the Enterprise or Cluster edition if the feature is needed
9002HY000%s demande l'édition MIRAJ ClusterSee §2.6See §2.6
9003HY000Promotion refusée : %sSee §2.6See §2.6
9004HY000Réplication synchrone : %sSee §2.6See §2.6
9005HY000Limite de données de MIRAJ Express atteinte (%s)See §2.6See §2.6
6133HY000La colonne non scalaire (vecteur par exemple) '%s' ne peut pas servir de clé.VECTOR(n) used as a primary key, UNIQUE or indexDo not index the vector column; index a derived column if needed
6138HY000Données impossibles à convertir en vecteur valide : '%s'Value not convertible to VECTOR(n)Fix the value format (text form […] or binary)
760022000dimensions de vecteurs différentes %s et %sOperation between two vectors of different dimensionsUse vectors of the same dimension
760122000%s dimensions attendues, et non %sVector written to a VECTOR(n) column with a dimension different from nAdjust the number of components
760222P02syntaxe incorrecte pour le type vector : "%s"Invalid text form of a vectorUse the form [v1, v2, ...]
760322000NaN interdit dans un vecteurNaN component in a vectorRemove NaN values upstream
760422000valeur infinie interdite dans un vecteurInfinite component in a vectorRemove infinite values upstream
4206HY000Impossible de déterminer le type de distance de VEC_DISTANCE : aucun index trouvéVEC_DISTANCE called without a vector index on one of its columnsCreate a VECTOR INDEX on the column (chapter 19) or spell out the metric: VEC_DISTANCE_EUCLIDEAN, VEC_DISTANCE_COSINE

2.8 Internal and miscellaneous errors#

CodeSQLSTATEMessageTypical causeSuggested fix
1024HY000Erreur de lecture du fichier '%s' (errno : %s)Disk error when reading an engine fileCheck the disk, restore from a backup if the file is damaged
1026HY000Erreur d'écriture du fichier '%s' (errno : %s)Disk error on write (disk full, permissions...)Check disk space and permissions
1028HY000Tri interrompu : %sORDER BY interrupted (e.g. by KILL or a limit on examined rows)See the message for the precise cause; rerun if the interruption was not intended
1105HY000Erreur inconnue : %sUnexpected internal error (engine bug, corrupted routine/trigger definitions file...)Report the error with the full context; check the integrity of the files of the database concerned
114842000Cette commande n'est pas autorisée avec cette version du serveurCommand refused by the network protocol (e.g. LOCAL INFILE refused by a client that does not accept it)Check the client configuration
1193HY000Variable système inconnue : '%s'SET/SELECT @@variable on a variable name that does not existCheck the exact name in SHOW VARIABLES
123142000La variable '%s' ne peut pas recevoir la valeur '%s'Value outside the expected domain for a system variableConsult the variable's documentation for the accepted values
123542000Cette version de Miraj ne prend pas encore en charge '%s'See §2.1: feature not yet implementedSee docs/manuel/16-limites-connues.md

3. The SQLSTATE#

The SQLSTATE is a code of exactly 5 characters (digits and uppercase letters), standardized independently of MIRAJ and shared by most SQL engines. An application can rely on it for generic handling, without knowing the wording or even the MIRAJ-specific numeric code — useful when porting code written against another SQL engine.

A few classes worth knowing:

SQLSTATEMeaningExamples of MIRAJ codes
42000 (and the 42Sxx)Syntax error or access rule violation1064, 1049, 1050, 1051, 1054
23000Integrity constraint violation1048, 1062, 1451, 1452, 4025
3D000No database selected1046
28000Invalid authorization (authentication)1045
40001Serialization failure, transaction rolled back (deadlock or concurrency conflict)1213
22000 and derivatives (22001, 22003, 22007, 22012...)Data exception: truncation, overflow, division by zero1264, 1292, 1365, 1366, 1406
25006Statement forbidden in a read-only transaction1792
70100Interrupted statement (SQLSTATE from a widespread convention in the SQL ecosystem, adopted by MIRAJ)1317, 1927, 1969
HY000General error, with no more specific SQLSTATE classthe majority of engine-specific errors (1004, 1105, 1193, 9001, 9002, 9003, 9004, 9005...)

Recommended usage on the application side: a driver (ODBC, JDBC, ADO.NET...) generally exposes the SQLSTATE alongside the native code. For portable handling across engines (retrying a transaction on 40001, distinguishing a 23000 constraint error from a 42000 syntax error), rely on the SQLSTATE. For precise MIRAJ-specific diagnosis (displaying a suitable message, distinguishing two causes that share the same SQLSTATE), rely on the numeric code from this page.

When no more specific SQLSTATE is defined for a code, MIRAJ returns HY000 by default (including for a code entirely unknown to the catalog).

An error raised by a stored routine with SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '...' carries the SQLSTATE chosen by the routine rather than the one associated with the generic numeric code of SIGNAL — this is the normal mechanism for raising an application error with a custom SQLSTATE (class 45 reserved for this use).

4. Message language#

MIRAJ error messages exist in several languages: French, English, and eight additional languages (Chinese, Hindi, Spanish, Arabic, Portuguese, Russian, German, Japanese). This page documents the French wording, the reference language of this manual.

To obtain the messages in English (or in another available language):

  • at server startup or on the command line, the engine's language option selects the catalog used for the whole session;
  • each error can also be reworded in a given language without changing the session language, if the API or tool used exposes this feature (on-demand retranslation from the error's code and arguments);
  • <language>.json files placed next to the server executable allow you to complete or replace the embedded translations, including to add a language not listed above.

The numeric code and the SQLSTATE of an error never change with the language: only the message text is translated. An application that tests the code or the SQLSTATE (rather than the message text) therefore works identically regardless of the language configured on the server.