Do not mangle column names.

This commit is contained in:
Ilia Alshanetsky 2003-12-14 18:45:37 +00:00
parent 097ed939a6
commit bebaa5b00f
3 changed files with 22 additions and 12 deletions

View File

@ -1376,10 +1376,8 @@ 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++) {
colname = strchr(colnames[i], '.');
if (!colname++) {
colname = (char*)colnames[i];
}
colname = (char*)colnames[i];
if (SQLITE_G(assoc_case) == 1) {
php_sqlite_strtoupper(colname);
} else if (SQLITE_G(assoc_case) == 2) {

View File

@ -18,11 +18,17 @@ var_dump(sqlite_fetch_array($r));
sqlite_close($db);
?>
--EXPECT--
array(3) {
["c1"]=>
array(6) {
["foo.c1"]=>
string(1) "1"
["foo.c2"]=>
string(1) "2"
["foo.c3"]=>
string(1) "3"
["bar.c1"]=>
string(1) "4"
["c2"]=>
["bar.c2"]=>
string(1) "5"
["c3"]=>
["bar.c3"]=>
string(1) "6"
}

View File

@ -17,11 +17,17 @@ $r = $db->query("SELECT * from foo, bar", SQLITE_ASSOC);
var_dump($r->fetch_array());
?>
--EXPECT--
array(3) {
["c1"]=>
array(6) {
["foo.c1"]=>
string(1) "1"
["foo.c2"]=>
string(1) "2"
["foo.c3"]=>
string(1) "3"
["bar.c1"]=>
string(1) "4"
["c2"]=>
["bar.c2"]=>
string(1) "5"
["c3"]=>
["bar.c3"]=>
string(1) "6"
}