Skip to content

Commit b4e5947

Browse files
committed
bug#29119813: Documentation update.
Better explain that clinet/session_close() invalidate the handle passed to the function.
1 parent 3ae33a5 commit b4e5947

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/mysqlx/xapi.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ mysqlx_get_client_from_options(mysqlx_session_options_t *opt,
601601
Sessions created by this client are closed, but their resources are not freed.
602602
`mysqlx_session_close()` has to be called to prevent memory leaks.
603603
604+
After a call to this function the given client handle becomes invalid.
605+
Any attempt to use the handle after this, results in undefined behavior.
606+
604607
605608
@param client client handle
606609
@@ -772,6 +775,9 @@ mysqlx_get_session_from_options(mysqlx_session_options_t *opt,
772775
Closing session frees all related resources, including those
773776
allocated by statements and results belonging to the session.
774777
778+
After a call to this function the given session handle becomes invalid.
779+
Any attempt to use the handle after this, results in undefined behavior.
780+
775781
@param session session handle
776782
777783
@ingroup xapi_sess
@@ -790,6 +796,10 @@ PUBLIC_API void mysqlx_session_close(mysqlx_session_t *session);
790796
@note The function checks only the internal session status without
791797
communicating with server(s).
792798
799+
@note This function cannot be called for a session that was closed,
800+
because in this case the session handle itself is invalid and
801+
cannot be used in API calls.
802+
793803
@ingroup xapi_sess
794804
*/
795805

@@ -2546,6 +2556,9 @@ mysqlx_set_row_locking(mysqlx_stmt_t *stmt, int locking, int contention);
25462556
After calling this function on a handle it becomes invalid and
25472557
should not be used any more.
25482558
2559+
@note This function should not be called on a client or session handle
2560+
- use `mysqlx_client_close()` or `mysqlx_session_close()` instead.
2561+
25492562
@note Statement, result, schema, collection, table and some error
25502563
handles are also freed automatically when the session is closed.
25512564

0 commit comments

Comments
 (0)