PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #1085

SQLite Databse name causes problèmes

Details

Submitted2004-03-28 11:26 UTC
Fromcontact at mann dot fr
StatusNo Feedback
PackageDB_DataObject
PHP Version4.3.4
OSDebian
Roadmaps(Not assigned)

Comments

[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 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"