UPDATE can be TRUNCATE on TEMPORARY TABLE

Bug #387627 reported by Stewart Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Critical
Stewart Smith

Bug Description

drizzle> create temporary table t1 (col1 int not null, col2 char(4) not null, primary key(col1)) engine=memory;
Query OK, 0 rows affected (0 sec)

drizzle> alter table t1 engine=myisam;
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0

drizzle> insert into t1 values (1,1),(5,2),(2,3),(3,4),(4,4);
Query OK, 5 rows affected (0 sec)
Records: 5 Duplicates: 0 Warnings: 0

drizzle> select * from t1;
+------+------+
| col1 | col2 |
+------+------+
| 1 | 1 |
| 5 | 2 |
| 2 | 3 |
| 3 | 4 |
| 4 | 4 |
+------+------+
5 rows in set (0 sec)

drizzle> update t1 set col2='7' where col1='4';
Query OK, 0 rows affected (0 sec)
Rows matched: 0 Changed: 0 Warnings: 0

drizzle> select * from t1;
Empty set (0 sec)

Related branches

Revision history for this message
Stewart Smith (stewart) wrote :

From mix2_myisam in working tree for fixing tests for temp-only myisam:

--- /home/stewart/drizzle/brian-tmp-fix/tests/r/mix2_myisam.result 2009-06-16 07:37:17.413726871 +0300
+++ /home/stewart/drizzle/brian-tmp-fix/tests/r/mix2_myisam.reject 2009-06-16 07:54:30.381725593 +0300
@@ -278,27 +278,12 @@
 update t1 set col2='7' where col1='4';
 select * from t1;
 col1 col2
-1 1
-5 2
-2 3
-3 4
-4 7
 alter table t1 add co3 int not null;
 select * from t1;
 col1 col2 co3
-1 1 0
-5 2 0
-2 3 0
-3 4 0
-4 7 0
 update t1 set col2='9' where col1='2';
 select * from t1;
 col1 col2 co3
-1 1 0
-5 2 0
-2 9 0
-3 4 0
-4 7 0
 drop table t1;
 create TEMPORARY table t1 (a int not null , b int, primary key (a)) engine = MyISAM;
 create TEMPORARY table t2 (a int not null , b int, primary key (a)) engine = MEMORY;

Changed in drizzle:
importance: Undecided → Critical
milestone: none → aloha
Revision history for this message
Stewart Smith (stewart) wrote :
Revision history for this message
Stewart Smith (stewart) wrote :

The following commit will need to be reversed when this bug is fixed:

------------------------------------------------------------
revno: 1077
committer: Stewart Smith <email address hidden>
branch nick: brian-tmp-fix
timestamp: Tue 2009-06-16 15:31:14 +1000
message:
  Put incorrect results into mix2_myisam.result so that test passes even though we are affected by BUG lp:387627
diff:
=== modified file 'tests/r/mix2_myisam.result'
--- tests/r/mix2_myisam.result 2009-06-16 05:30:24 +0000
+++ tests/r/mix2_myisam.result 2009-06-16 05:31:14 +0000
@@ -278,27 +278,12 @@
 update t1 set col2='7' where col1='4';
 select * from t1;
 col1 col2
-1 1
-5 2
-2 3
-3 4
-4 7
 alter table t1 add co3 int not null;
 select * from t1;
 col1 col2 co3
-1 1 0
-5 2 0
-2 3 0
-3 4 0
-4 7 0
 update t1 set col2='9' where col1='2';
 select * from t1;
 col1 col2 co3
-1 1 0
-5 2 0
-2 9 0
-3 4 0
-4 7 0
 drop table t1;
 create TEMPORARY table t1 (a int not null , b int, primary key (a)) engine = MyISAM;
 create TEMPORARY table t2 (a int not null , b int, primary key (a)) engine = MEMORY;

Revision history for this message
Stewart Smith (stewart) wrote :

Bad in Drizzle as far back as: <email address hidden>

Revision history for this message
Stewart Smith (stewart) wrote :
Revision history for this message
Stewart Smith (stewart) wrote :
Revision history for this message
Stewart Smith (stewart) wrote :

After fixing the close_table valgrind warning, test still fails.

Stewart Smith (stewart)
Changed in drizzle:
status: New → Fix Committed
Changed in drizzle:
assignee: nobody → Stewart Smith (stewart-flamingspork)
Revision history for this message
Stewart Smith (stewart) wrote :

Merged into 1094 IIRC

Changed in drizzle:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.