fix: rework external sql api
Summary
BREAKING CHANGE!: ext sql functions changed their signatures.
- In picodata SQL we prepare statement in one session and want to execute it from another session. The problem wouldn't be so severe if not for local execution: not all queries go through vshard connections, some queries execute locally using current connection which can have quiet short lifetime.
- Now sql_prepare_ext does NOT bind statement to current session, instead it expects caller to call sql_unprepare_ext. The returned statement id can't be used with tarantool execute function: because it checks for statement to be in current session.
- sql_unprepare_ext now does not check whether statement is in current session, it simply unrefs it.
- If statement was prepared in other session, during sql_execute_prepared_ext we ref it in order to prevent dropping statement while it is executed. But we must not keep this reference after execution, because it prevents statement being dropped until current session is dropped, which can be quiet long. Fix this by removing the statement from current session and unreffing it.
- remove extra paramenter session_id from sql_(un)prepare_ext, earlier we added this parameter in order to call unprepare from other session, now it is not needed, because we don't check whether statement is in current session in sql_unprepare_ext
NO_DOC=picodata internal patch NO_CHANGELOG=picodata internal patch
Close #... Docs follow-up: not necessary
Edited by Arseniy Volynets