Bug #24950 Using a incorrect message file not prevented
Submitted: 11 Dec 2006 9:24 Modified: 8 Jan 2007 20:02
Reporter: Jan Lindström Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S4 (Feature request)
Version:5.0 OS:Any (Any)
Assigned to: CPU Architecture:Any

[11 Dec 2006 9:24] Jan Lindström
Description:
If a column is a primary key, and I try to insert a duplicate value, crash.

How to repeat:
* Download MySQL 5.1 source file.
* Install (./configure; make; sudo make install) using default prefix. Files
gets installed in the standard places under /usr/local/
* sudo mkdir /usr/local/mysql/
* sudo ln -s /usr/local/share/ /usr/local/mysql/share
* Download MySQL 5.0 binary file.
* untar to a new directory
* Start MySQL for this new directory
./mysqld --user=root --skip-networking --default-storage-engine=innodb
--datadir=../data/ --socket=/tmp/mysql.sock &
* Start MySQL client and give a following commands

create table t1 (s1 int primary key) engine=innodb;
insert into t1 values (0),(0);

Suggested fix:
MySQL should check that error message file is a supported one.
[14 Dec 2006 21:42] Valeriy Kravchuk
Thank you for a problem report. As your example works as expected with current 5.0.32-BK built from sources:

openxs@suse:~/dbs/5.0> bin/mysqld_safe --skip-networking --default-storage-engi
ne=innodb &
[1] 23682
openxs@suse:~/dbs/5.0> Starting mysqld daemon with databases from /home/openxs/d
bs/5.0/var

openxs@suse:~/dbs/5.0> bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.32 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table t1 (s1 int primary key) engine=innodb;
ERROR 1050 (42S01): Table 't1' already exists
mysql> drop table t1;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t1 (s1 int primary key) engine=innodb;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t1 values (0),(0);
ERROR 1062 (23000): Duplicate entry '0' for key 1

please, specify exact binaries (give URLs) of 5.1.x and 5.0.x used. Send 

uname -a 

results also.
[8 Jan 2007 20:02] Sergei Golubchik
Well, it is prevented to a certain extent - but this "prevention" assumes that error messages are always backward compatible.
Unfortunately a incompatible change sneaked in - and now we cannot remove it, because it would be an incompatible change too, that would cause older versions to crash on new error message files :(