Bug #15669 Test case 'csv' produces incorrect result on OpenBSD
Submitted: 11 Dec 2005 16:47 Modified: 30 Aug 2006 19:46
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: CSV Severity:S2 (Serious)
Version:5.0.17-pre OS:Other (OpenBSD)
Assigned to: Antony Curtis CPU Architecture:Any

[11 Dec 2005 16:47] Kent Boortz
Description:
On OpenBSD the test 'csv' produces incorrect result

*** r/csv.result
--- r/csv.reject
***************
*** 4945,4953
  SELECT * FROM bug13894;
  val
  5
  11
- 6
- 6
  DROP TABLE bug13894;
  DROP TABLE IF EXISTS bug14672;
  CREATE TABLE bug14672 (c1 integer) engine = CSV;
--- 4945,4952
  SELECT * FROM bug13894;
  val
  5
+ 10
  11
  DROP TABLE bug13894;
  DROP TABLE IF EXISTS bug14672;
  CREATE TABLE bug14672 (c1 integer) engine = CSV;
***************
*** 4961,4978
  SELECT * FROM bug14672;
  c1
  1
! 3
  INSERT INTO bug14672 VALUES (4);
  SELECT * FROM bug14672;
  c1
  1
! 3
  4
  INSERT INTO bug14672 VALUES (5);
  SELECT * FROM bug14672;
  c1
  1
! 3
  4
  5
  DROP TABLE bug14672;
  SELECT * FROM bug14672;
  c1
  1
! 2
  INSERT INTO bug14672 VALUES (4);
  SELECT * FROM bug14672;
  c1
  1
! 2
  4
  INSERT INTO bug14672 VALUES (5);
  SELECT * FROM bug14672;
  c1
  1
! 2
  4
  5
  DROP TABLE bug14672;

How to repeat:
Run the test case 'csv' on OpenBSD
[21 Jul 2006 21:17] 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/9437
[31 Jul 2006 22:27] 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/9857

ChangeSet@1.2226, 2006-07-31 15:26:53-07:00, acurtis@xiphis.org +1 -0
  Bug#15669
    "Test case 'csv' produces incorrect result on OpenBSD"
    mmapped pages were not being invalidated when writes occurred to the file via
    fd i/o. Force explicit invalidation and not rely on implicit invalidation.
[1 Aug 2006 16:37] 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/9908

ChangeSet@1.2240, 2006-08-01 09:36:34-07:00, acurtis@xiphis.org +1 -0
  Bug#15669
    "Test case 'csv' produces incorrect result on OpenBSD"
    mmapped pages were not being invalidated when writes occurred to the
    file vi a fd i/o operation. 
    Force explicit invalidation and not rely on implicit invalidation.
[1 Aug 2006 16:46] Antony Curtis
Petr approved patch via email
[1 Aug 2006 16:48] Antony Curtis
pushed to 5.0-engines tree, (5.0.25)
[16 Aug 2006 15:18] Patrick Galbraith
merged from 5.0-engines to 5.0 main tree. Version 5.0.25
[18 Aug 2006 13:01] Jon Stephens
We need to know:

1. What the issue was that was fixed. Users don't care about our tests, they want to know how it effects their use of the product. If there's no change visible to the end user in the product's behaviour, that's fine, but please tell us this, if such is the case.

2. 3-part version numbers for all versions in which the fix will appear. Since this is tagged 5.1, we assume there must be a push pending for this fix into the 5.1 tree as well.

Thanks!
[28 Aug 2006 8:34] Antony Curtis
This bug only affects MySQL version 5.0.
The affected code does not exist in 5.1.

The bug is most visible on OpenBSD where the results of a SELECT after an UPDATE is incorrect. It is caused by the memory-mapped pages of the data file not being flushed/invalidated after new data has been appeneded to the data file.
[30 Aug 2006 19:46] Paul DuBois
Noted in 5.0.25 changelog.