sql_auto_is_null is used by some special drivers, such as ODBC, to obtain the auto-increment column value of the last inserted row.
| Property | Description |
|---|---|
| Parameter type | Boolean |
| Default value | OFF |
| Value range | * OFF * ON |
| Effective scope | * GLOBAL * SESSION |
| Involved in serialization | Yes |
| Plan generation affected | Yes |
If sql_auto_is_null is set to ON, it is equivalent to the following two statements:
// 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();