← Back to team overview

maria-developers team mailing list archive

MariaDB/MySQL error code issue

 

Hi,

For merging MySQL into MariaDB, we need to work out what to do about error
code.

The problem occurs as (different) new error messages are added in both MySQL
and MariaDB. When we then merge from MySQL, we get conflicts between the error
numbers.

If we do not handle this somehow, it means that error numbers for a given
error message will be different, either between MySQL and MariaDB, or
alternatively between one version of MariaDB and another (depending on how
conflicts are resolved).

The problem with error code changing is that this makes it much harder for
applications to check error codes and handle errors as it want in a portable
way between MySQL and MariaDB.

I think we have these options:

1. Cooperate with MySQL@Oracle, so that whenever we add an error code in
MariaDB, the corresponding code is also reserved in MySQL (even if not used),
and vice versa.

2. Create different "namespaces" for error codes added to MariaDB and MySQL,
eg. new MariaDB codes are assigned with some offset to MySQL codes, so we
avoid conflicts.

3. Keep MariaDB error code numbers stable, re-assign MySQL error code numbers
when merging from MySQL (I rather dislike this as well because it introduces
incompatibility with MySQL).

4. Keep MySQL error code numbers when merging from MySQL, so that MariaDB-only
errors will fluctuate between releases (I really dislike this option).


It seems option (4) is the best option. Is someone from MySQL/Oracle willing
to work on getting such a procedure running?

Failing that, it seems (3) is the best option. In this case, we need (at
least) to assign a suitable error code range to new MariaDB errors and change
the source code to be able to handle this (eg. maybe we need a
sql/share/errmsg-mariadb.txt or something).

We will also need to handle the error codes already assigned to virtual
columns, which I think already conflict with new MySQL error codes. I would
suggest doing a one-time incompatible change to map them into the MariaDB
range.

So, any hope for getting solution (4) working with MySQL@Oracle? And failing
that, any opinions on how to proceed?

Thanks,

 - Kristian.



Follow ups