The sql_auto_is_null variable is used by some special drivers, such as ODBC, to control whether to obtain the value of the auto-increment column of the last inserted row.
| Attribute | Description |
|---|---|
| Type | bool |
| Default value | OFF |
| Value range | |
| Scope |
When sql_auto_is_null is set to ON, the following two statements are equivalent:
// CREATE TABLE t1 (auto_inc_column auto_increment, j int);
obclient> SELECT * FROM t1 WHERE auto_inc_column is null;
obclient> SELECT * FROM t1 WHERE auto_inc_column = last_insert_id();