List:Commits« Previous MessageNext Message »
From:ramil Date:March 28 2008 10:34am
Subject:bk commit into 5.1 tree (ramil:1.2575) BUG#35392
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of ramil.  When ramil does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-03-28 14:34:49+04:00, ramil@stripped +3 -0
  Fix for bug #35392: Delete all statement does not execute properly 
  after few delete statements
  
  Problem: changing a file size might require that the it must be 
  unmapped beforehand.
  
  Fix: unmap the file before changing its size.

  mysql-test/r/temp_table.result@stripped, 2008-03-28 14:34:46+04:00, ramil@stripped +11 -0
    Fix for bug #35392: Delete all statement does not execute properly 
    after few delete statements
      - test result.

  mysql-test/t/temp_table.test@stripped, 2008-03-28 14:34:46+04:00, ramil@stripped +14 -0
    Fix for bug #35392: Delete all statement does not execute properly 
    after few delete statements
      - test case.

  storage/myisam/mi_delete_all.c@stripped, 2008-03-28 14:34:46+04:00, ramil@stripped +12 -4
    Fix for bug #35392: Delete all statement does not execute properly 
    after few delete statements
      - unmap file before changing its size as it's required 
        by SetEndOfFile() function (see my_chsize()).

diff -Nrup a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
--- a/mysql-test/r/temp_table.result	2008-02-12 23:09:14 +04:00
+++ b/mysql-test/r/temp_table.result	2008-03-28 14:34:46 +04:00
@@ -184,3 +184,14 @@ select * from t1;
 a
 42
 drop table t1;
+CREATE TEMPORARY TABLE t1(a INT, b VARCHAR(20));
+INSERT INTO t1 VALUES(1, 'val1'), (2, 'val2'), (3, 'val3');
+DELETE FROM t1 WHERE a=1;
+SELECT count(*) FROM t1;
+count(*)
+2
+DELETE FROM t1;
+SELECT * FROM t1;
+a	b
+DROP TABLE t1;
+End of 5.1 tests
diff -Nrup a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
--- a/mysql-test/t/temp_table.test	2007-06-06 22:48:15 +05:00
+++ b/mysql-test/t/temp_table.test	2008-03-28 14:34:46 +04:00
@@ -191,3 +191,17 @@ truncate t1;
 insert into t1 values (42);
 select * from t1;
 drop table t1;
+
+#
+# Bug #35392: Delete all statement does not execute properly after 
+#  few delete statements
+#
+CREATE TEMPORARY TABLE t1(a INT, b VARCHAR(20));
+INSERT INTO t1 VALUES(1, 'val1'), (2, 'val2'), (3, 'val3');
+DELETE FROM t1 WHERE a=1;
+SELECT count(*) FROM t1;
+DELETE FROM t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff -Nrup a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
--- a/storage/myisam/mi_delete_all.c	2007-05-10 14:59:32 +05:00
+++ b/storage/myisam/mi_delete_all.c	2008-03-28 14:34:46 +04:00
@@ -53,15 +53,23 @@ int mi_delete_all_rows(MI_INFO *info)
     since it was locked then there may be key blocks in the key cache
   */
   flush_key_blocks(share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED);
+#ifdef HAVE_MMAP
+  /* Unmap before changing file size */
+  rw_wrlock(&share->mmap_lock);
+  if (share->file_map)
+    _mi_unmap_file(info);
+  rw_unlock(&share->mmap_lock);
+#endif
   if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
       my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME))  )
     goto err;
   VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
 #ifdef HAVE_MMAP
-  /* Resize mmaped area */
-  rw_wrlock(&info->s->mmap_lock);
-  mi_remap_file(info, (my_off_t)0);
-  rw_unlock(&info->s->mmap_lock);
+  /* Map again */
+  rw_wrlock(&share->mmap_lock);
+  if (share->file_map)
+    mi_dynmap_file(info, (my_off_t) 0);
+  rw_unlock(&share->mmap_lock);
 #endif
   allow_break();			/* Allow SIGHUP & SIGINT */
   DBUG_RETURN(0);
Thread
bk commit into 5.1 tree (ramil:1.2575) BUG#35392ramil28 Mar
  • RE: bk commit into 5.1 tree (ramil:1.2575) BUG#35392Vladislav Vaintroub28 Mar