3630 Sergey Vojtovich 2011-10-21 [merge]
Merge.
modified:
mysql-test/r/myisam.result
mysql-test/t/myisam.test
storage/myisam/ha_myisam.cc
storage/myisam/mi_delete_all.c
3629 Marko Mäkelä 2011-10-21
Bug#13116045 Compilation failure using GCC 4.6.1 in btr/btr0cur.c
btr_record_not_null_field_in_rec(): Remove the parameter rec.
Use rec_offs_nth_sql_null() instead of rec_get_nth_field().
rb:788 approved by Jimmy Yang
modified:
storage/innobase/btr/btr0cur.c
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/btr/btr0cur.c
=== modified file 'mysql-test/r/myisam.result'
--- a/mysql-test/r/myisam.result 2010-03-25 12:11:16 +0000
+++ b/mysql-test/r/myisam.result 2011-10-20 11:03:22 +0000
@@ -2412,4 +2412,28 @@ CARDINALITY
DROP TABLE t1;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
SET myisam_repair_threads=@@global.myisam_repair_threads;
+#
+# BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
+# USING MYISAM_USE_MMAP ON WINDOWS
+#
+SET GLOBAL myisam_use_mmap=1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(1),(2);
+DELETE FROM t1 WHERE a=1;
+FLUSH TABLE t1;
+LOCK TABLE t1 WRITE;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+INSERT INTO t1 VALUES(3);
+UNLOCK TABLES;
+SELECT * FROM t1;
+a
+2
+3
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+SET GLOBAL myisam_use_mmap=default;
End of 5.1 tests
=== modified file 'mysql-test/t/myisam.test'
--- a/mysql-test/t/myisam.test 2010-03-12 10:43:30 +0000
+++ b/mysql-test/t/myisam.test 2011-10-20 11:03:22 +0000
@@ -1645,4 +1645,22 @@ DROP TABLE t1;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
SET myisam_repair_threads=@@global.myisam_repair_threads;
+--echo #
+--echo # BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
+--echo # USING MYISAM_USE_MMAP ON WINDOWS
+--echo #
+SET GLOBAL myisam_use_mmap=1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(1),(2);
+DELETE FROM t1 WHERE a=1;
+FLUSH TABLE t1;
+LOCK TABLE t1 WRITE;
+OPTIMIZE TABLE t1;
+INSERT INTO t1 VALUES(3);
+UNLOCK TABLES;
+SELECT * FROM t1;
+CHECK TABLE t1;
+DROP TABLE t1;
+SET GLOBAL myisam_use_mmap=default;
+
--echo End of 5.1 tests
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2011-07-03 15:47:37 +0000
+++ b/storage/myisam/ha_myisam.cc 2011-10-20 11:03:22 +0000
@@ -1135,6 +1135,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK
mi_get_mask_all_keys_active(share->base.keys) :
share->state.key_map);
uint testflag=param.testflag;
+#ifdef HAVE_MMAP
+ bool remap= test(share->file_map);
+ /*
+ mi_repair*() functions family use file I/O even if memory
+ mapping is available.
+
+ Since mixing mmap I/O and file I/O may cause various artifacts,
+ memory mapping must be disabled.
+ */
+ if (remap)
+ mi_munmap_file(file);
+#endif
if (mi_test_if_sort_rep(file,file->state->records,key_map,0) &&
(local_testflag & T_REP_BY_SORT))
{
@@ -1166,6 +1178,10 @@ int ha_myisam::repair(THD *thd, MI_CHECK
error= mi_repair(¶m, file, fixed_name,
param.testflag & T_QUICK);
}
+#ifdef HAVE_MMAP
+ if (remap)
+ mi_dynmap_file(file, file->state->data_file_length);
+#endif
param.testflag=testflag;
optimize_done=1;
}
=== modified file 'storage/myisam/mi_delete_all.c'
--- a/storage/myisam/mi_delete_all.c 2011-06-30 15:37:13 +0000
+++ b/storage/myisam/mi_delete_all.c 2011-10-20 11:03:22 +0000
@@ -63,11 +63,6 @@ int mi_delete_all_rows(MI_INFO *info)
my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) )
goto err;
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
-#ifdef HAVE_MMAP
- /* Map again */
- if (share->file_map)
- mi_dynmap_file(info, (my_off_t) 0);
-#endif
allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.1 branch (sergey.vojtovich:3629 to 3630) | Sergey Vojtovich | 21 Oct |