Merge lp:~stewart/drizzle/update-is-truncate into lp:~drizzle-trunk/drizzle/development

Proposed by Stewart Smith
Status: Merged
Merged at revision: not available
Proposed branch: lp:~stewart/drizzle/update-is-truncate
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: None lines
To merge this branch: bzr merge lp:~stewart/drizzle/update-is-truncate
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Review via email: mp+8116@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Approved since it fixes the bug...I'll take a looksie at the brian-tmp-fix branch to see if I can spot anything out of the ordinary...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/myisam/mi_open.cc'
2--- plugin/myisam/mi_open.cc 2009-06-26 19:37:44 +0000
3+++ plugin/myisam/mi_open.cc 2009-07-02 06:42:18 +0000
4@@ -491,8 +491,16 @@
5 {
6 share->temporary=share->delay_key_write=1;
7 share->write_flag=MYF(MY_NABP);
8- share->w_locks++; /* We don't have to update status */
9- share->tot_locks++;
10+ /*
11+ * The following two statements are commented out as a fix of
12+ * bug https://bugs.launchpad.net/drizzle/+bug/387627
13+ *
14+ * UPDATE can be TRUNCATE on TEMPORARY TABLE (MyISAM).
15+ * The root cause of why this makes a difference hasn't
16+ * been found, but this fixes things for now.
17+ */
18+// share->w_locks++; // We don't have to update status
19+// share->tot_locks++;
20 info.lock_type=F_WRLCK;
21 }
22 if (((open_flags & HA_OPEN_DELAY_KEY_WRITE) ||
23
24=== added file 'tests/r/update_is_truncate_on_temp_bug_lp387627.result'
25--- tests/r/update_is_truncate_on_temp_bug_lp387627.result 1970-01-01 00:00:00 +0000
26+++ tests/r/update_is_truncate_on_temp_bug_lp387627.result 2009-07-02 06:42:18 +0000
27@@ -0,0 +1,19 @@
28+create temporary table t1 (col1 int not null, col2 char(4) not null, primary key(col1)) engine=memory;
29+alter table t1 engine=myisam;
30+insert into t1 values (1,1),(5,2),(2,3),(3,4),(4,4);
31+select * from t1;
32+col1 col2
33+1 1
34+5 2
35+2 3
36+3 4
37+4 4
38+update t1 set col2='7' where col1='4';
39+select * from t1;
40+col1 col2
41+1 1
42+5 2
43+2 3
44+3 4
45+4 7
46+DROP TABLE t1;
47
48=== added file 'tests/t/update_is_truncate_on_temp_bug_lp387627.test'
49--- tests/t/update_is_truncate_on_temp_bug_lp387627.test 1970-01-01 00:00:00 +0000
50+++ tests/t/update_is_truncate_on_temp_bug_lp387627.test 2009-07-02 06:42:18 +0000
51@@ -0,0 +1,8 @@
52+create temporary table t1 (col1 int not null, col2 char(4) not null, primary key(col1)) engine=memory;
53+#create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)) engine=memory;
54+alter table t1 engine=myisam;
55+insert into t1 values (1,1),(5,2),(2,3),(3,4),(4,4);
56+select * from t1;
57+update t1 set col2='7' where col1='4';
58+select * from t1;
59+DROP TABLE t1;