From: Ilia Alshanetsky Date: Sun, 14 Dec 2003 18:45:37 +0000 (+0000) Subject: Do not mangle column names. X-Git-Tag: php-5.0.0b3RC1~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bebaa5b00f5cbe4837bbd34e6af2850213a58821;p=php Do not mangle column names. --- diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 6099e6665e..030dabc52c 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -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) { diff --git a/ext/sqlite/tests/sqlite_011.phpt b/ext/sqlite/tests/sqlite_011.phpt index e47d031405..9c1bf3990f 100755 --- a/ext/sqlite/tests/sqlite_011.phpt +++ b/ext/sqlite/tests/sqlite_011.phpt @@ -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" } diff --git a/ext/sqlite/tests/sqlite_oo_011.phpt b/ext/sqlite/tests/sqlite_oo_011.phpt index c8fdfd1200..ae6c445a4f 100755 --- a/ext/sqlite/tests/sqlite_oo_011.phpt +++ b/ext/sqlite/tests/sqlite_oo_011.phpt @@ -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" }