Bug #36319 Maria: table is not empty but DELETE and SELECT find no rows
Submitted: 24 Apr 2008 15:10 Modified: 10 Jun 2008 20:27
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Maria storage engine Severity:S3 (Non-critical)
Version:5.1-maria OS:Linux
Assigned to: Guilhem Bichot CPU Architecture:Any

[24 Apr 2008 15:10] Guilhem Bichot
Description:
Put what is in "How to repeat" in a .test file and run it. I see:
+set global maria_log_file_size=4294967295;
+CREATE TABLE t1 (
+line BLOB,
+kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
+name VARCHAR(32)
+) transactional=0 row_format=page engine=maria;
+select count(*) from t1;
+count(*)
+812
+delete from t1 limit 1000;
+select count(*) from t1;
+count(*)
+812
+select name from t1;
+name
+check table t1 extended;
+Table  Op      Msg_type        Msg_text
+test.t1        check   status  OK

See: 812 rows before the DELETE, DELETE should delete all rows, but then SELECT COUNT(*) says 812 rows, still "SELECT name" shows no rows. Table is said to not be corrupted.
After shutdown, "maria_chk -e" shows no problem, "-dvv" says 812 records.
It looks like _ma_scan_block_record() finds no rows during DELETE and "SELECT name".

How to repeat:
--source include/have_maria.inc

set global maria_log_file_size=4294967295;
let $MARIA_LOG=.;

CREATE TABLE t1 (
  line BLOB,
  kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
  name VARCHAR(32)
) transactional=0 row_format=page engine=maria;

let $query=   INSERT INTO t1 (name, kind, line) VALUES 
  ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
  ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
  ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
  ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")),
  ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")),
  ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")),
  ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")),
  ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")),
  ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")),
  ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")),
  ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")),
  ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")),
  ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")),
  ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")),
  ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")),
  ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")),
  ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")),
  ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")),
  ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")),
  ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")),
  ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")),
  ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")),
  ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")),
  ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
  ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")),
  ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")),
  ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")),
  ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")),
  ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)"));

--disable_query_log
let $1=90;
while($1)
{
  eval $query;
  dec $1;
}
let $1=90;
while($1)
{
  delete from t1 limit 1;
  delete from t1 limit 10;
  delete from t1 limit 7;
  delete from t1 limit 2;
  dec $1;
}
--enable_query_log

select count(*) from t1;
delete from t1 limit 1000;
select count(*) from t1;
select name from t1;
check table t1 extended;
[10 Jun 2008 20:27] Guilhem Bichot
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html
[30 Jun 2008 18:17] Bugs System
Pushed into 5.1.25-maria-alpha
[30 Jun 2008 18:21] Bugs System
Pushed into 5.1.25-maria-alpha
[30 Jun 2008 18:25] Bugs System
Pushed into 5.1.25-maria-alpha
[30 Jun 2008 18:28] Bugs System
Pushed into 5.1.25-maria-alpha
[30 Jun 2008 18:31] Bugs System
Pushed into 5.1.25-maria-alpha
[30 Jun 2008 18:33] Bugs System
Pushed into 5.1.25-maria-alpha