Home » Database » DB_DataObject » Bug #2912
if tables in pgsql are upper case createtables throws error
Details
| Submitted | 2004-12-07 10:18 UTC |
|---|---|
| From | eingfoan at yahoo dot de |
| Assigned | alan_k |
| Status | No Feedback |
| Package | DB_DataObject |
| PHP Version | 4.3.9 |
| OS | LINUX RED HAT |
| Roadmaps | (Not assigned) |
Comments
[2004-12-07 10:18 UTC] eingfoan at yahoo dot de
Description:
------------
i tried to do createtables with a pgsql database
with table names like ARTIKEL and BILD
what resulted such an error
------------
[db_error: message="DB Error: insufficient data supplied" code=-20 mode=return level=notice prefix="" info="SELECT c.relname as "Name"
FROM pg_class c, pg_user u
WHERE c.relowner = u.usesysid AND c.relkind = 'r'
AND not exists (select 1 from pg_views where viewname = c.relname)
AND c.relname !~ '^(pg_|sql_)'
UNION
SELECT c.relname as "Name"
FROM pg_class c
WHERE c.relkind = 'r'
AND not exists (select 1 from pg_views where viewname = c.relname)
AND not exists (select 1 from pg_user where usesysid = c.relowner)
AND c.relname !~ '^pg_' [nativecode=ERROR: relation "artikel" does not exist]"]
------------
when i renamed them to bild and artikel everything worked out fine!
could this be an uppercase problem?
thx chris
[2005-01-04 18:08 UTC] andreas dot henden at vice-chairman dot net
Using PHP Version 5.0.3, DB_DataObject 1.7.2 stable and postgresql I get an error when I try to use createtable.php.
[db_error: message="DB Error: insufficient data supplied" code=-20 mode=return level=notice prefix="" info="SELECT c.relname as "Name"
FROM pg_class c, pg_user u
WHERE c.relowner = u.usesysid AND c.relkind = 'r'
AND not exists (select 1 from pg_views where viewname = c.relname)
AND c.relname !~ '^(pg_|sql_)'
UNION
SELECT c.relname as "Name"
FROM pg_class c
WHERE c.relkind = 'r'
AND not exists (select 1 from pg_views where viewname = c.relname)
AND not exists (select 1 from pg_user where usesysid = c.relowner)
AND c.relname !~ '^pg_'"]
It's almost like the first error but I don't have the nativecode part of the error message.
I have tried the sql in the database and it works without any problems!
[2005-01-17 09:14 UTC] jbh at karakoum dot com
Same problem with 5.0.3. It was working all right in version 5.0.2
[2005-01-19 14:02 UTC] sa at ventigo dot com
I've got the same Error with createTables.php:
[DB_Error: message="DB Error: insufficient data supplied" code=-20 mode=return level=notice prefix="" info="SHOW TABLES [nativecode=0 **]"]
My Setup:
PHP 5.0.3
MySQL 2.6.0-pl3
Gentoo Linux 2.4.23_pre8
PEAR DB_DataObject-1.7.2
[2005-01-19 16:16 UTC] sa at ventigo dot com
I guess, that the problem is in the database driver.
I had this problem in the PHP 5.0.3 CLI version.
I solved the problem by adding "is_object($result) &&" to the (first) if-condition of the method tableInfo in the database-driver. (In my case __PEAR_ROOT__/DB/mysql.php)
Original:
----------
if (isset($result->result)) {
New:
----------
if(is_object($result) && isset($result->result)) {
More details:
http://bugs.php.net/bug.php?id=31611
I hope this hack can help you.