@@ -601,6 +601,9 @@ mysqlx_get_client_from_options(mysqlx_session_options_t *opt,
601
601
Sessions created by this client are closed, but their resources are not freed.
602
602
`mysqlx_session_close()` has to be called to prevent memory leaks.
603
603
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
+
604
607
605
608
@param client client handle
606
609
@@ -772,6 +775,9 @@ mysqlx_get_session_from_options(mysqlx_session_options_t *opt,
772
775
Closing session frees all related resources, including those
773
776
allocated by statements and results belonging to the session.
774
777
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
+
775
781
@param session session handle
776
782
777
783
@ingroup xapi_sess
@@ -790,6 +796,10 @@ PUBLIC_API void mysqlx_session_close(mysqlx_session_t *session);
790
796
@note The function checks only the internal session status without
791
797
communicating with server(s).
792
798
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
+
793
803
@ingroup xapi_sess
794
804
*/
795
805
@@ -2546,6 +2556,9 @@ mysqlx_set_row_locking(mysqlx_stmt_t *stmt, int locking, int contention);
2546
2556
After calling this function on a handle it becomes invalid and
2547
2557
should not be used any more.
2548
2558
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
+
2549
2562
@note Statement, result, schema, collection, table and some error
2550
2563
handles are also freed automatically when the session is closed.
2551
2564
0 commit comments