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.jsonby default) in which the%splaceholders 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#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 1064 | 42000 | Erreur de syntaxe SQL ; vérifiez le manuel de votre version de Miraj pour la syntaxe correcte près de '%s' à la ligne %s | Invalid 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 |
| 1065 | 42000 | La requête est vide | Empty statement sent to the server | Check that the client is not sending an empty string |
| 1139 | 42000 | Erreur « %s » dans l'expression régulière | Invalid pattern passed to REGEXP, REGEXP_REPLACE, etc. | Fix the pattern; the details of the regular expression engine's error are included in %s |
| 1210 | HY000 | Arguments incorrects pour %s | Argument(s) of a function or statement incompatible with its signature | Check the number and type of the arguments |
| 1221 | HY000 | Utilisation incorrecte de %s et %s | Combination of two incompatible constructs in the same statement | Separate the two constructs or consult the documentation of the statement concerned |
| 1235 | 42000 | Cette 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 |
| 1407 | 42000 | SQLSTATE incorrect : '%s' | SIGNAL/RESIGNAL SQLSTATE '...' with a value that is not a valid 5-character code | Use a compliant SQLSTATE (5 characters, class other than 00, 01, XA) |
2.2 Schema errors (databases, tables, columns, indexes)#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 29 | HY000 | Fichier '%s' introuvable (code : %s) | File expected by the engine missing from disk (table, journal...) | Check the path and access rights on the data folder |
| 1004 | HY000 | Impossible 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 |
| 1005 | HY000 | Impossible de créer la table '%s' (errno : %s) | Failure to write the .mrj file at creation | Check disk space and permissions |
| 1007 | HY000 | Impossible de créer la base '%s' ; elle existe déjà | CREATE DATABASE without IF NOT EXISTS on an existing database | Add IF NOT EXISTS or choose another name |
| 1008 | HY000 | Impossible de supprimer la base '%s' ; elle n'existe pas | DROP DATABASE without IF EXISTS on a missing database | Add IF EXISTS or check the name |
| 1034 | HY000 | Fichier de la table '%s' incorrect ; essayez de la réparer (%s) | Corrupted or truncated .mrj file | Run REPAIR TABLE (see the corresponding section of the manual) |
| 1044 | 42000 | Accè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 |
| 1045 | 28000 | Accès refusé pour l'utilisateur '%s'@'%s' (mot de passe utilisé : %s) | Invalid credentials at connection | Check the account and password |
| 1046 | 3D000 | Aucune base de données sélectionnée | Statement requiring a current database executed without USE | Run USE <base> before the statement, or qualify the objects |
| 1049 | 42000 | Base de données '%s' inconnue | USE or reference to a database that does not exist | Check the spelling or create the database |
| 1050 | 42S01 | La 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 |
| 1051 | 42S02 | Table '%s' inconnue | Reference to a missing table (context without an explicit database name) | Check the name and the current database |
| 1052 | 23000 | La colonne '%s' dans %s est ambiguë | Column present in several tables of the query without qualification | Qualify the column (table.column) |
| 1054 | 42S22 | Colonne '%s' inconnue dans '%s' | Misspelled column name or column that does not exist in the given context | Check DESCRIBE <table> or information_schema.COLUMNS |
| 1060 | 42S21 | Nom de colonne '%s' en double | Two columns with the same name in one table definition or a CREATE TABLE … SELECT | Rename one of the columns or give it an alias |
| 1061 | 42000 | Nom de clé '%s' en double | Two indexes/keys with the same name on the table | Choose another index name |
| 1066 | 42000 | Table ou alias non unique : '%s' | Same table name or alias used twice in a query | Give each occurrence a distinct alias |
| 1102 | 42000 | Nom 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 |
| 1103 | 42000 | Nom de table incorrect : '%s' | Same rule as 1102, applied to the table name | Same |
| 1109 | 42S02 | Table '%s' inconnue dans %s | Referenced table missing in the specified context (%s: clause, join...) | Check the table name in that clause |
| 1146 | 42S02 | La table '%s.%s' n'existe pas | Table missing from the indicated database | Check the name and the database, or create it |
| 1166 | 42000 | Nom de colonne incorrect : '%s' | Column name outside the identifier rules | Rename according to the rules (see Known limitations) |
| 1170 | 42000 | La colonne BLOB/TEXT '%s' est utilisée dans une clé sans longueur de clé | BLOB/TEXT used as a primary key, UNIQUE or index column | Use a bounded-length column, or a column generated from an excerpt |
| 1280 | 42000 | Nom d'index incorrect : '%s' | Invalid or too long index name | Shorten or fix the name |
| 3162 | HY000 | Le compte %s n'existe pas. | Role/account cited does not exist | Check CREATE USER / the exact account name |
| 3163 | HY000 | Le compte %s existe déjà. | CREATE USER on an already defined account | Use IF NOT EXISTS or choose another name |
2.3 Constraint and data errors#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 1048 | 23000 | La colonne '%s' ne peut pas être NULL | INSERT/UPDATE supplying NULL to a NOT NULL column with no implicit value available | Provide a value, or reconsider the NOT NULL constraint |
| 1062 | 23000 | Doublon '%s' pour la clé '%s' | Violation of a primary key or UNIQUE constraint | Use INSERT IGNORE, REPLACE or ON DUPLICATE KEY UPDATE if the duplicate is expected |
| 1068 | 42000 | Plusieurs clés primaires définies | Two PRIMARY KEY clauses in the same table definition | Keep only one |
| 1136 | 21S01 | Le nombre de colonnes ne correspond pas au nombre de valeurs à la ligne %s | INSERT ... VALUES (...) with a number of values different from the number of columns | Make the two lists match |
| 1138 | 22004 | Utilisation incorrecte de la valeur NULL | NULL used where it is not allowed (e.g. value of a constraint) | Remove the NULL or reconsider the expression |
| 1171 | 42000 | Toutes les parties d'une clé primaire doivent être NOT NULL ; utilisez UNIQUE pour accepter NULL | Nullable column included in a PRIMARY KEY | Make the column NOT NULL or use a UNIQUE constraint |
| 1172 | 42000 | Le résultat compte plus d'une ligne | Scalar subquery or SELECT ... INTO receiving several rows | Add a condition that reduces the result to one row, or use LIMIT 1 knowingly |
| 1215 | HY000 | Impossible d'ajouter la contrainte de clé étrangère | Invalid 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 |
| 1242 | 21000 | La sous-requête renvoie plus d'une ligne | Subquery used in a scalar context (=, SELECT ... INTO) that returns several rows | Restrict the subquery or use IN / EXISTS |
| 1264 | 22003 | Valeur hors limites pour la colonne '%s' à la ligne %s | Numeric value outside the range of the declared type (see Known limitations, types table) | Use a wider type or fix the value |
| 1292 | 22007 | Valeur %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 |
| 1365 | 22012 | Division par zéro | Division or modulo by 0 | Guard the expression (CASE WHEN ... != 0) or accept the NULL result depending on the SQL mode |
| 1366 | 22007 | Valeur %s incorrecte : '%s' pour la colonne %s à la ligne %s | Value incompatible with the column type on write | Fix the value or the column type |
| 1406 | 22001 | Données trop longues pour la colonne '%s' à la ligne %s | String longer than the declared column length | Enlarge the column or truncate the value upstream |
| 1451 | 23000 | Impossible 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 table | Delete/modify the child rows first, or reconsider the ON DELETE/ON UPDATE action |
| 1452 | 23000 | Impossible d'ajouter ou de modifier une ligne enfant : une contrainte de clé étrangère échoue (%s) | Insertion/modification referencing a nonexistent parent row | Insert the parent row first, or check the foreign key value |
| 4025 | 23000 | La CONTRAINTE %s a échoué pour %s.%s | Row rejected by a CHECK constraint | Fix the value to satisfy the constraint, or reconsider the constraint |
2.4 Privilege errors#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 1044 | 42000 | Accès refusé pour l'utilisateur '%s'@'%s' à la base de données '%s' | Database-level check (see §2.2) | Grant the required database privilege |
| 1142 | 42000 | Commande %s refusée à l'utilisateur '%s'@'%s' pour la table '%s' | Table-level check, even before name resolution | Grant the required table privilege (SELECT, INSERT...) |
| 1144 | 42000 | Commande GRANT/REVOKE invalide ; consultez le manuel pour savoir quels privilèges s'appliquent à ce niveau | GRANT/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 |
| 1227 | 42000 | Accès refusé ; il faut le privilège %s pour cette opération | Global-level check (SUPER, RELOAD, SHUTDOWN...) | Grant the global privilege named in the message |
| 3523 | HY000 | Compte ou rôle inconnu %s@%s | SET ROLE or GRANT/REVOKE on a role that does not exist | Create the role with CREATE ROLE or fix the name |
| 3530 | HY000 | %s@%s n'est pas accordé à %s@%s | SET ROLE on a role not granted to the current account | Grant the role with GRANT <role> TO <account> |
| 3619 | HY000 | Niveau de privilège invalide pour %s | Dynamic privilege requested outside the global level | Grant 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#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 1205 | HY000 | Délai d'attente du verrou dépassé ; réessayez la transaction | LOCK TABLES, SELECT ... FOR UPDATE NOWAIT/WAIT n, or waiting for a table lock beyond lock_wait_timeout | Retry the transaction; consider shortening the duration of concurrent transactions |
| 1213 | 40001 | Interblocage détecté lors de la prise du verrou ; réessayez la transaction | Concurrency 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) |
| 1792 | 25006 | Impossible 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 |
| 1927 | 70100 | La connexion a été arrêtée | Connection terminated by KILL or by the server | Reconnect |
| 1969 | 70100 | Requête interrompue : limite de durée de %s s dépassée | max_statement_time or the MAX_EXECUTION_TIME hint exceeded | Optimize the query or raise the limit if it is legitimate |
| 1095 | HY000 | Vous n'êtes pas propriétaire de la connexion %s | KILL of a connection that does not belong to the current account, without the required privilege | Use an account with the appropriate privilege, or target your own connection |
| 1094 | HY000 | Identifiant de connexion inconnu : %s | KILL with a connection identifier that no longer exists | Check the identifier with SHOW PROCESSLIST |
| 1099 | HY000 | La table '%s' est verrouillée en lecture (READ) et ne peut pas être modifiée | Write attempted on a table read-locked by LOCK TABLES | Lock for writing (WRITE) or wait for the lock to end |
| 1100 | HY000 | La table '%s' n'a pas été verrouillée par LOCK TABLES | Table used in a session under LOCK TABLES without itself having been locked | Add the table to the LOCK TABLES list |
2.6 Cluster and replication errors (Cluster edition)#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 1290 | HY000 | Le serveur fonctionne avec l'option %s et ne peut pas exécuter cette instruction | Attempted write on a read-only secondary node, or server option incompatible with the statement | Write to the cluster's primary node; consult SHOW CLUSTER STATUS |
| 9002 | HY000 | %s demande l'édition MIRAJ Cluster | Effective partitioning feature (segments, EXCHANGE PARTITION on HASH/KEY...) used outside the Cluster edition | Switch to the Cluster edition, or limit yourself to the partitioning features available in the Standard edition (definition accepted, non-partitioned storage) |
| 9003 | HY000 | Promotion refusée : %s | SET 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 |
| 9004 | HY000 | Réplication synchrone : %s | Semi-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 |
| 1194 | HY000 | La 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 it | Open 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.
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 9001 | HY000 | %s n'est pas disponible dans l'édition MIRAJ Express | Feature reserved for the Standard or Cluster edition used in the Express edition (e.g. intra-query parallelism) | Switch to the Standard or Cluster edition if the feature is needed |
| 9002 | HY000 | %s demande l'édition MIRAJ Cluster | See §2.6 | See §2.6 |
| 9003 | HY000 | Promotion refusée : %s | See §2.6 | See §2.6 |
| 9004 | HY000 | Réplication synchrone : %s | See §2.6 | See §2.6 |
| 6133 | HY000 | La colonne non scalaire (vecteur par exemple) '%s' ne peut pas servir de clé. | VECTOR(n) used as a primary key, UNIQUE or index | Do not index the vector column; index a derived column if needed |
| 6138 | HY000 | Données impossibles à convertir en vecteur valide : '%s' | Value not convertible to VECTOR(n) | Fix the value format (text form […] or binary) |
| 7600 | 22000 | dimensions de vecteurs différentes %s et %s | Operation between two vectors of different dimensions | Use vectors of the same dimension |
| 7601 | 22000 | %s dimensions attendues, et non %s | Vector written to a VECTOR(n) column with a dimension different from n | Adjust the number of components |
| 7602 | 22P02 | syntaxe incorrecte pour le type vector : "%s" | Invalid text form of a vector | Use the form [v1, v2, ...] |
| 7603 | 22000 | NaN interdit dans un vecteur | NaN component in a vector | Remove NaN values upstream |
| 7604 | 22000 | valeur infinie interdite dans un vecteur | Infinite component in a vector | Remove infinite values upstream |
| 4206 | HY000 | Impossible de déterminer le type de distance de VEC_DISTANCE : aucun index trouvé | VEC_DISTANCE called without a usable vector index (vector indexes are not yet implemented — see Known limitations) | Use ORDER BY <distance> LIMIT k, which computes an exact k-NN without an index |
2.8 Internal and miscellaneous errors#
| Code | SQLSTATE | Message | Typical cause | Suggested fix |
|---|---|---|---|---|
| 1024 | HY000 | Erreur de lecture du fichier '%s' (errno : %s) | Disk error when reading an engine file | Check the disk, restore from a backup if the file is damaged |
| 1026 | HY000 | Erreur d'écriture du fichier '%s' (errno : %s) | Disk error on write (disk full, permissions...) | Check disk space and permissions |
| 1028 | HY000 | Tri interrompu : %s | ORDER 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 |
| 1105 | HY000 | Erreur inconnue : %s | Unexpected 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 |
| 1148 | 42000 | Cette commande n'est pas autorisée avec cette version du serveur | Command refused by the network protocol (e.g. LOCAL INFILE refused by a client that does not accept it) | Check the client configuration |
| 1193 | HY000 | Variable système inconnue : '%s' | SET/SELECT @@variable on a variable name that does not exist | Check the exact name in SHOW VARIABLES |
| 1231 | 42000 | La variable '%s' ne peut pas recevoir la valeur '%s' | Value outside the expected domain for a system variable | Consult the variable's documentation for the accepted values |
| 1235 | 42000 | Cette version de Miraj ne prend pas encore en charge '%s' | See §2.1: feature not yet implemented | See 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:
| SQLSTATE | Meaning | Examples of MIRAJ codes |
|---|---|---|
42000 (and the 42Sxx) | Syntax error or access rule violation | 1064, 1049, 1050, 1051, 1054 |
23000 | Integrity constraint violation | 1048, 1062, 1451, 1452, 4025 |
3D000 | No database selected | 1046 |
28000 | Invalid authorization (authentication) | 1045 |
40001 | Serialization failure, transaction rolled back (deadlock or concurrency conflict) | 1213 |
22000 and derivatives (22001, 22003, 22007, 22012...) | Data exception: truncation, overflow, division by zero | 1264, 1292, 1365, 1366, 1406 |
25006 | Statement forbidden in a read-only transaction | 1792 |
70100 | Interrupted statement (SQLSTATE from a widespread convention in the SQL ecosystem, adopted by MIRAJ) | 1317, 1927, 1969 |
HY000 | General error, with no more specific SQLSTATE class | the majority of engine-specific errors (1004, 1105, 1193, 9001, 9002, 9003, 9004...) |
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>.jsonfiles 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.