Bug #2200 replace into table with default value
Submitted: 24 Dec 2003 1:19 Modified: 24 Dec 2003 6:12
Reporter: Andrey Pasukov Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S1 (Critical)
Version:4.0.7-gamma OS:FreeBSD (freeBSD4.7 on i386)
Assigned to: Dean Ellis CPU Architecture:Any

[24 Dec 2003 1:19] Andrey Pasukov
Description:
When use a table with default value(for example with '') and try to replace a record by new record in which default value should be, obtain an incorrect result.
The value from previous replace command is placed into table, not the default  value.
We make all example commands during single connection session (in different sessions everything ok). 

How to repeat:
create table T(A char(10)  not null, B char(10), primary key(A));
insert into T values("key1", "123"), ("key2", "");
replace into T set A="key1", B="123";
replace into T set A="key2", B=default;
select * from T;

result:
A     | B 
key1  | 123 
key2  | 123 

must be:
A     | B 
key1  | 123 
key2  |

Suggested fix:
May be buffer of replace record is not cleared after replace command
[24 Dec 2003 6:12] Dean Ellis
I cannot repeat this using the current release.  Your version is very old, and there have been very many bug fixes since that early gamma.

Thank you.