Message387428
"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? |
|
Date |
User |
Action |
Args |
2021-02-20 21:54:08 | erlendaasland | set | recipients:
+ erlendaasland, berker.peksag, serhiy.storchaka |
2021-02-20 21:54:08 | erlendaasland | set | messageid: <1613858048.02.0.874349668581.issue43251@roundup.psfhosted.org> |
2021-02-20 21:54:08 | erlendaasland | link | issue43251 messages |
2021-02-20 21:54:07 | erlendaasland | create | |
|