Subject: | Incorrect Implementation of column names within sqlite_st_FETCH_attrib |
Description:
Current implementation of fetch_hashref currently strips the table
names from the hash values.
This should be removed as this implementation overrides the SQL
implementation of how column names are displayed and prevents manual
setting of column names that contain a '.'.
e.g.
SELECT 1 as 'a.a', 1 as 'b.a';
SQL Implementation:
PRAGMA full_column_names = 0 | 1;
PRAGMA short_column_names = 0 | 1;
(Full column names require full_column_names=1 and
short_column_names=0).
File: dbdimp.c
Function: sqlite_st_FETCH_attrib
Snippet:
const char *fieldname = sqlite3_column_name(imp_sth->stmt, n);
if (fieldname) {
/* warn("Name [%d]: %s\n", n, fieldname); */
char *dot = instr(fieldname, ".");
if (dot) /* drop table name from field name */
fieldname = ++dot;
av_store(av, n, newSVpv(fieldname, 0));
}
The following lines should be removed:
char *dot = instr(fieldname, ".");
if (dot) /* drop table name from field name */
fieldname = ++dot;