SELECT after an UPDATE continues to show old values

Bug #1325443 reported by Atanu Mishra
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
Critical
Suresh Subbiah

Bug Description

Reported by Selva --

Begin work;
Update some rows in table t ;
Select * from t;
Commit work;

The test was expecting the updated rows to have new values in the select statement. But the select statement continue to show the old values.

Tags: sql-exe
Revision history for this message
Adriana Fuentes (adriana-fuentes) wrote :

I tried the following on a table and I was not able to reproduce the problem:

Begin work;
Update some rows in table t ;
Select * from t;
Commit work;

I also did an update to the same table outside of a transaction and I was not able to reproduce the problem either.

Changed in trafodion:
importance: Medium → Critical
status: New → In Progress
Revision history for this message
Atanu Mishra (atanu-mishra) wrote :

Adriana is now able to reproduce the problem.

Revision history for this message
Adriana Fuentes (adriana-fuentes) wrote :

The problem is reproducible and I figured out that the problem started appearing after the following check-in in github:

13e3f70 2014-05-30 | Changes to improve the performance of select statement [Selvaganesan]

I added the changes for the early reply that Oliver/John did and it did not make a difference in the select after an update.

information type: Proprietary → Public
Changed in trafodion:
assignee: Adriana Fuentes (adriana-fuentes) → Suresh Subbiah (suresh-subbiah)
tags: added: sql-exe
removed: dtm
Revision history for this message
Suresh Subbiah (suresh-subbiah) wrote :

create table t1 (a int not null not droppable primary key, b int not null not droppable) ;
insert into t1 values (1,9),(2,9),(3,9);
Begin work;
Update t1 set b = 4 ;
Select * from t1;
commit;

will show the problem. It shows every time and is easily reproducible.

The issue was that while executing the update statement the executor calls scanner.next() with the correct transid. It gets 2 values for column b, both the "old" (before update value) and the "new" (after update value). Executor was expecting only only one version per column since the previous Thrift class provided that to the executor. Logic has been added in executor to copy the most recent version into the SQL row for each column.

Changed in trafodion:
status: In Progress → Fix Committed
Alice Chen (alchen)
Changed in trafodion:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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