Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #1085 SQLite Databse name causes problèmes
Submitted: 2004-03-28 11:26 UTC
From: contact at mann dot fr Assigned:
Status: No Feedback Package: DB_DataObject
PHP Version: 4.3.4 OS: Debian
Roadmaps: (Not assigned)    

 [2004-03-28 11:26 UTC] contact at mann dot fr
Description: ------------ I'm getting a segmentation fault on the createTables script. I think it may be because SQLite doesn't support SHOW TABLES. Reproduce code: --------------- [DB_DataObject] database = sqlite:///root/_________/projets/programmation_imairie/model_data/pp.sqlite schema_location = /root/_________/projets/programmation_imairie/model_data/ class_location = /root/_________/projets/programmation_imairie/model_data/ require_prefix = class_prefix = infopol-chris:/usr/share/php/DB/DataObject# php -f createTables.php /root/_________/projets/programmation_imairie/model_data/pp-db_object.ini Erreur de segmentation Expected result: ---------------- CREATE TABLE personne ( p_id INTEGER UNSIGNED NOT NULL PRIMARY KEY, nom VARCHAR NOT NULL, login VARCHAR NOT NULL, prenom VARCHAR NULL ); CREATE TABLE personne_projet ( projet_id INTEGER UNSIGNED NOT NULL, p_id INTEGER UNSIGNED NOT NULL); CREATE TABLE projet ( projet_id INTEGER UNSIGNED NOT NULL PRIMARY KEY, nom_projet VARCHAR NULL, description_projet TEXT NULL, date_debut TIMESTAMP NULL, date_cible DATE NULL, date_fini DATETIME NULL ); create table test (test);


 [2004-03-28 11:43 UTC] alan_k
can you add define('DB_DATAOBJECT_NO_OVERLOAD',true); as the first line in createTables.php (after the <?php see if that stops the segfault. Regards Alan
 [2004-03-28 12:31 UTC] contact at mann dot fr
OK for the modif : SQLite doesn't take columns into account. The resulting Personne, Projet and Personne_Projet classes ar attributeless. Taht would make sense if we can't get meta-information out of SQLlite. I can't seem to locate the schema file. Do I need to write a schema file ?
 [2004-03-28 12:55 UTC] contact at mann dot fr
SQLite database will have a database name of /root/mywork/mysqlitebase.db if the SQLIte datafile is /root/mywork/mysqlitebase.db Which causes problèmes in the createTables part of the script. I copied the database file in my local directory. The schema file and resulting classes are still attributeless.
 [2004-03-28 13:54 UTC] contact at mann dot fr
Yea, I'm pretty certain that the SQLite databse name will cause problems. Take a llok at this : object(personne)(15) { ["__table"]=> string(8) "Personne" ["id"]=> NULL ["nom"]=> NULL ["login"]=> NULL ["prenom"]=> NULL ["_DB_DataObject_version"]=> string(5) "1.5.3" ["N"]=> int(0) ["_database_dsn"]=> string(0) "" ["_database_dsn_md5"]=> string(32) "c0cfdecd7fad771bb07b64971a3cadcf" ["_database"]=> string(78) "/root/_________/projets/programmation_imairie/model_data/DataObjects/pp.sqlite"
 [2004-04-02 00:54 UTC] alan_k
ah.. doing a basename() on the database name is probably a good idea. I'll see if I get time to have a look at it. - otherwise add a patch if you find the problem.
 [2004-06-02 15:07 UTC] alan_k
I'm not sure the generator will work unless tableInfo() is working in DB. - if it does, then it may be worth trying database_pp = sqlite:///root/_________/projets/programmation_imairie/model_data/pp.sql ite as this will use 'pp' as the ini file name.