#22204 [NEW]: DB tableInfo(): table set where it should not be
| From: | marc at links2linux dot de | Date: | Thu, 13 Feb 2003 13:04:35 +0000 |
| Subject: | #22204 [NEW]: DB tableInfo(): table set where it should not be | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-13223@lists.php.net to get a copy of this message | ||
From: marc@links2linux.de
Operating system: Linux
PHP version: 4.2.3
PHP Bug Type: PEAR related
Bug description: DB tableInfo(): table set where it should not be
Hi!
I use the PEAR DB tableInfo() funtion to get information about table
fields (mysql).
if you say "SELECT id FROM table1 ..." then the table attribute for id is
set to "table1". Thats correct because I can use "table1.id" to refer to
that field in a WHERE clause for example.
If I use something like SELECT CONCAT(anschr_1, ' - ',
IFNULL(anschr_2,''), ' - ',
IFNULL(anschr_3,''))
AS customer_name FROM table1
then the table attribute is *not* set. That very OK because the field
table1.customer_name does not exist.
Now the problem:
If I say "SELECT table1.id AS id2 ,table2.foo FROM table1, table2 ..."
then the "table" attribute of "id2" in tableInfo() is set to "table1"
which is IMHO *not* OK because table1.id2 is not a valid field.
I hope It's clear what I am pointing to...
-Marc
--
Edit bug report at http://bugs.php.net/?id=22204&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22204&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22204&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22204&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22204&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22204&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22204&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22204&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22204&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22204&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22204&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22204&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22204&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22204&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22204&r=gnused