← Back to team overview

maria-developers team mailing list archive

Re: MariaDB/MySQL error code issue


18 апр. 2011, в 12:40, Kristian Nielsen написал(а):

> 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).

5. Add interface of translation NAME <-> CODE as we do it for our test suite files where one can use ER_* names instead of numbers.

I agre that it is might be not the best solution but I think it should be listed, because the name constants is something which we do not change but only add.