summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-05-01 13:20:22 +0000
committerMarcus Boerger <helly@php.net>2003-05-01 13:20:22 +0000
commit2c2774c204564c20e7effa729a03441c66781bc2 (patch)
tree1f2c6d7c4c9d3e2c1528b74210b456008bb266d1 /ext/sqlite/sqlite.c
parent2cef4c3470a09fc2e32a36247c130d9855672284 (diff)
downloadphp-git-2c2774c204564c20e7effa729a03441c66781bc2.tar.gz
Don't return table names
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index d55d994cf6..c38a47c502 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -814,7 +814,7 @@ int php_sqlite_fetch(struct php_sqlite_result *rres TSRMLS_DC)
{
const char **rowdata, **colnames;
int ret, i, base;
- char *errtext = NULL;
+ char *errtext = NULL, *colname;
next_row:
ret = sqlite_step(rres->vm, &rres->ncolumns, &rowdata, &colnames);
@@ -822,7 +822,16 @@ next_row:
/* first row - lets copy the column names */
rres->col_names = safe_emalloc(rres->ncolumns, sizeof(char *), 0);
for (i = 0; i < rres->ncolumns; i++) {
- rres->col_names[i] = estrdup(colnames[i]);
+ colname = strchr(colnames[i], '.');
+ if (!colname++) {
+ colname = (char*)colnames[i];
+ }
+ if (SQLITE_G(assoc_case) == 1) {
+ php_sqlite_strtoupper(colname);
+ } else if (SQLITE_G(assoc_case) == 2) {
+ php_sqlite_strtolower(colname);
+ }
+ rres->col_names[i] = estrdup(colname);
}
if (!rres->buffered) {
/* non buffered mode - also fetch memory for on single row */
@@ -1079,11 +1088,6 @@ PHP_FUNCTION(sqlite_fetch_array)
}
if (mode & PHPSQLITE_ASSOC) {
/* Lets see if we need to change case of the assoc key */
- if (SQLITE_G(assoc_case) == 1) {
- php_sqlite_strtoupper((char*)colnames[j]);
- } else if (SQLITE_G(assoc_case) == 2) {
- php_sqlite_strtolower((char*)colnames[j]);
- }
if (decoded == NULL) {
add_assoc_null(return_value, (char*)colnames[j]);
} else {