ID: 19898
Updated by: alan@roojs.com
Reported By: pyry at imaginer dot fi
Summary: DB_DataObject->query no table found
-Status: Open
+Status: Feedback
Type: Bug
Package: DB_DataObject
Operating System: Linux
Package Version: 1.11.2
PHP Version: 5.4.6
Roadmap Versions:
New Comment:
-Status: Open
+Status: Feedback
This should work fine.
I can not see how the new databaseStructure() would get called in that
scenario.
Can you try some simple debugging, and work out how it is getting
called.
Previous Comments:
------------------------------------------------------------------------
[2013-04-16 12:39:19] pyrliu
Description:
------------
I don't know if this is a bug or a feature, but I have often utilized
DB_DataObject class query function by creating a new instance
straight from DB_DataObject (and not some generated table
class) and then executing raw sql queries with $Do-
query("..some sql statement..")
When I upgraded from 1.10.0 to 1.11.2, I got a error message"Cant find database schema [database]/" because there is no
generated table.
I noticed that the databaseStructure() method has major
changes in 1.10.0 -> 1.11.2 and now I'm wondering that is it not
allowed to instantiate the DB_DataObject class (then it should be
defined as abstract class) or is this a bug.
I'm using PostgreSQL 9.1 as my database.
Test script:
---------------
$sql = ".. any sql statement ...";
$Do = new \DB_DataObject();
$Do->query($sql);
while( $Do->fetch() ) {
print_r($Do);
}
Expected result:
----------------
printed object data.
Actual result:
--------------
"Cant find database schema ..." error.
------------------------------------------------------------------------