Erlend Egeberg Aasland <erlend.aasl...@innova.no> added the comment:

"SELECT 1" yields "1" as column name.
"SELECT <...> AS N" yields "N" as column name.
"SELECT NULL" yields "NULL" as column name.

We can't set the column name via the API, so that's pretty much it (implicit 
name or explicit through the AS keyword). As long as sqlite3_prepare_v2() 
returned SQLITE_OK, it seems that SQLite assures we've got a valid column name.

As far as I can sqlite3_column_name() returns NULL if:
1) The first parameter (stmt) is NULL
2) The second parameter is out of bounds
3) Memory error
4) No column name is set (SQLite bug)

We've got 1) and 2) covered. SQLite has a pretty good code coverage, so I'd say 
4) is unlikely.

What do you think?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43251>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to