[session] use a dedicated class to track cnxset
We introduce a new CnxSetTracker to track `cnxset` used by Transaction and
allows to wait for them. This new class does not use Thread ID not thread
joining to work. This allows to use multiple transaction per thread and a
transaction in multiple thread.
The class itself is totally threadsafe by the Transaction is still not
thread safe.
The old _threads_in_transaction attribute is dropped in favor of a new logic
based on this object. The registration of cnxset used is not done by the
Transaction itself. tx.cnset is a property handling the Consistency of its value
with the CnxSetTracker instance.
Note: The CnxSetTracker instance only track transaction id, not transaction
itself, So not reference cycle are created.
/* -*- sql -*- mysql specific registered procedures, *//* XXX limit_size version dealing with format as postgres version does. XXX mysql doesn't support overloading, each function should have a different name NOTE: fulltext renamed since it cause a mysql name conflict */CREATEFUNCTIONtext_limit_size(vfulltextTEXT,maxsizeINT)RETURNSTEXTNOSQLBEGINIFLENGTH(vfulltext)<maxsizeTHENRETURNvfulltext;ELSERETURNSUBSTRING(vfulltextfrom1formaxsize)||'...';ENDIF;END;;