diff --git a/system-variables.md b/system-variables.md index 97d82a441a54e..79faa9dbb4f26 100644 --- a/system-variables.md +++ b/system-variables.md @@ -175,6 +175,13 @@ mysql> SELECT * FROM t1; - Unit: Seconds - This variable represents the idle timeout of the interactive user session, which is measured in seconds. Interactive user session refers to the session established by calling [`mysql_real_connect()`](https://dev.mysql.com/doc/c-api/5.7/en/mysql-real-connect.html) API using the `CLIENT_INTERACTIVE` option (for example, MySQL shell client). This variable is fully compatible with MySQL. +### last_insert_id + +- Scope: SESSION +- Default value: `0` +- This variable returns the last `AUTO_INCREMENT` or `AUTO_RANDOM` value generated by an insert statement. +- The value of `last_insert_id` is the same as the value returned by the function `LAST_INSERT_ID()`. + ### last_plan_from_binding New in v4.0 - Scope: SESSION