If we get SELECT query in a single-statement txn, we should mark it as 'read-only'. This will avoid conflicts with other txns that are running at the same time.
I think the only place that we need to change is TrafficCop::ExecuteHelper():
I'm not sure how we can write a test case to prove that this is working correctly. I don't know whether we have test cases for running single-stmt txns in the TrafficCop and then being able to see the TransactionContext after the txn commits.
If we get
SELECT
query in a single-statement txn, we should mark it as 'read-only'. This will avoid conflicts with other txns that are running at the same time.I think the only place that we need to change is
TrafficCop::ExecuteHelper()
:https://github.com/cmu-db/peloton/blob/master/src/traffic_cop/traffic_cop.cpp#L163
I'm not sure how we can write a test case to prove that this is working correctly. I don't know whether we have test cases for running single-stmt txns in the
TrafficCop
and then being able to see theTransactionContext
after the txn commits.