Bug #29652 csv.test failure: two changes conflict after merge
Submitted: 9 Jul 2007 17:39 Modified: 11 Jul 2007 5:17
Reporter: Timothy Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: CSV Severity:S2 (Serious)
Version:5.1-maint OS:Any
Assigned to: Ramil Kalimullin CPU Architecture:Any
Tags: pbfail

[9 Jul 2007 17:39] Timothy Smith
Description:
main.csv                       [ fail ]

Errors are (from /Users/tsmith/m/bk/maint/51/mysql-test/var/log/mysqltest-time) :
mysqltest: Result length mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** /Users/tsmith/m/bk/maint/51/mysql-test/r/csv.result Mon Jul  9 12:27:22 2007
--- /Users/tsmith/m/bk/maint/51/mysql-test/r/csv.reject Mon Jul  9 14:06:30 2007
***************
*** 5265,5271 ****
  update t1 set b=2;
  select * from t1;
  a     b
- a     2
  drop table t1;
  create table t1(a int) engine=csv;
  insert into t1 values(-1), (-123.34), (2), (-23);
--- 5265,5270 ----
-------------------------------------------------------

======= csv.test =========
....

# 
# BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table make server
# crash
#
create table t1(a blob, b int) engine=csv;
insert into t1 values('a', 1);
flush tables;
update t1 set b=2;
select * from t1;
drop table t1; 

--echo End of 5.1 tests
======================

======= csv.result ========
create table t1(a blob, b int) engine=csv;
insert into t1 values('a', 1);
flush tables;
update t1 set b=2;
select * from t1;
a       b
a       2
drop table t1;
End of 5.1 tests
======================

How to repeat:
Run csv.test in current mysql-5.1-maint tree.

Suggested fix:
Ramil has isolated the cause of the problem, and will post a patch here for review.
[10 Jul 2007 4:44] Ramil Kalimullin
Also, there is a strange result set within csv.result:

CREATE TABLE bug13894 ( val integer ) ENGINE = CSV;                             
INSERT INTO bug13894 VALUES (5);                                                
INSERT INTO bug13894 VALUES (10);                                               
INSERT INTO bug13894 VALUES (11);                                               
INSERT INTO bug13894 VALUES (10);
UPDATE  bug13894 SET val=6 WHERE val=10;                                        
SELECT * FROM bug13894;                                                         
val                                                                             
6                                                                               
6              

Should be 6, 6, 5, 11.
[10 Jul 2007 7:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30588

ChangeSet@1.2544, 2007-07-10 12:53:43+05:00, ramil@mysql.com +2 -0
  Fix for bug #29652: csv.test failure: two changes conflict after merge
  
  Problem: we don't take into account the length of the data written
  to the temporary data file during update on a CSV table.
  
  Fix: properly calculate the data file length during update.
[10 Jul 2007 8:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30589

ChangeSet@1.2544, 2007-07-10 13:09:07+05:00, ramil@mysql.com +3 -0
  Fix for bug #29652: csv.test failure: two changes conflict after merge
  
  Problem: we don't take into account the length of the data written
  to the temporary data file during update on a CSV table.
  
  Fix: properly calculate the data file length during update.
[10 Jul 2007 8:12] Sergey Vojtovich
ok to push.
[10 Jul 2007 13:26] Bugs System
Pushed into 5.1.21-beta
[11 Jul 2007 5:17] Paul Dubois
Test case change. No changelog entry needed.