mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Don't return table names
This commit is contained in:
parent
2cef4c3470
commit
2c2774c204
1 changed files with 11 additions and 7 deletions
|
@ -814,7 +814,7 @@ int php_sqlite_fetch(struct php_sqlite_result *rres TSRMLS_DC)
|
||||||
{
|
{
|
||||||
const char **rowdata, **colnames;
|
const char **rowdata, **colnames;
|
||||||
int ret, i, base;
|
int ret, i, base;
|
||||||
char *errtext = NULL;
|
char *errtext = NULL, *colname;
|
||||||
|
|
||||||
next_row:
|
next_row:
|
||||||
ret = sqlite_step(rres->vm, &rres->ncolumns, &rowdata, &colnames);
|
ret = sqlite_step(rres->vm, &rres->ncolumns, &rowdata, &colnames);
|
||||||
|
@ -822,7 +822,16 @@ next_row:
|
||||||
/* first row - lets copy the column names */
|
/* first row - lets copy the column names */
|
||||||
rres->col_names = safe_emalloc(rres->ncolumns, sizeof(char *), 0);
|
rres->col_names = safe_emalloc(rres->ncolumns, sizeof(char *), 0);
|
||||||
for (i = 0; i < rres->ncolumns; i++) {
|
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) {
|
if (!rres->buffered) {
|
||||||
/* non buffered mode - also fetch memory for on single row */
|
/* non buffered mode - also fetch memory for on single row */
|
||||||
|
@ -1079,11 +1088,6 @@ PHP_FUNCTION(sqlite_fetch_array)
|
||||||
}
|
}
|
||||||
if (mode & PHPSQLITE_ASSOC) {
|
if (mode & PHPSQLITE_ASSOC) {
|
||||||
/* Lets see if we need to change case of the assoc key */
|
/* 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) {
|
if (decoded == NULL) {
|
||||||
add_assoc_null(return_value, (char*)colnames[j]);
|
add_assoc_null(return_value, (char*)colnames[j]);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue