SQLite Forum

Improve sqlite3_column_name() return value documentation
Login
> If either the statement pointer or the column index are invalid then the result is undefined.

The result is not undefined if the column index is invalid; it is `NULL`. If the statement pointer is `NULL`, the result is also `NULL`. If the statement pointer points to a random location, the result is undefined.