More fixes to make SQL thread safe Fix for bug 1403334 – T2 multithread tests core dump in SQLCLI_DropContext
NAMemory was not threadsafe in derived memory management. The calls registerMemory, unRegisterMemory was not threadSafe when the heap is marked as threadsafe heap. Also, the mutex is now dropped as part of NAHeap destructor.
Fix for bug 1403410 - With 128 threads thru T2 driver, MTTrans and YCSB tests crash and generate this core
The context list was being manipulated without acquiring a mutex in some places These obsolete codes are now removed.
Some of the globals were wrongly declared as thread globals.
Other Fixes SQL_EXEC_GetDiagnosticsCondInfo2 CLI call is now protected by mutexes like any other CLI call. Also removed some of the obsolete codes in the cli layer.
Currently commented out the code to close all the open cursors in all the contexts when a change in transaction id is detected. We need to detect the change in transaction at context level and close cursors belonging to that context only.
SQL syntax to cancel executing query, phase 2 This check-in causes queries to register with the cancel broker using a nowait Seabed message, and to process the completion of the message by canceling the executing query if the cancel broker so indicates in the message reply. The check-in includes new test cases in the regression test to cancel different types of SELECT queries.
These types of queries do not yet respond to cancel: 1. Queries that are decomposed into child queries, e.g., CREATE INDEX, CREATE TABLE AS, UPDATE STATISTICS, etc; 2. UPDATE and DELETE 3. INSERT queries might work now, but haven't been tested.