Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2011 14:36:52 GMT
From:      Mark Johnston <markjdb@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/159209: the MDB2 SQLite driver only supports SQLite 2
Message-ID:  <201107261436.p6QEaqWu088839@red.freebsd.org>
Resent-Message-ID: <201107261440.p6QEe61I008995@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         159209
>Category:       ports
>Synopsis:       the MDB2 SQLite driver only supports SQLite 2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 26 14:40:06 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Mark Johnston
>Release:        8.2
>Organization:
>Environment:
FreeBSD oddish.mark-home 8.2-STABLE FreeBSD 8.2-STABLE #0: Mon May 16 18:43:29 EDT 2011     root@oddish.mark-home:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The MDB2 driver for SQLite (databases/pear-MDB2_Driver_sqlite) only supports SQLite 2; in particular, it doesn't work with SQLite 3. The driver documentation itself doesn't go out of its way to make this obvious, and I thought it would be good to document this in the pkg-descr so that other people don't waste too much time trying to figure out why it doesn't work with SQLite 3.
>How-To-Repeat:
Try the following script with a SQLite 3 database called "./db".

<?php

require_once 'MDB2.php';

$dsn = 'sqlite:///db';
$db = MDB2::factory($dsn);
if (MDB2::isError($db)) {
        die("Error: " . $db->getMessage() . "\n");
}

$db->connect();
if (MDB2::isError($db)) {
        die("Error: " . $db->getMessage() . "\n");
}

?>

When I run this, I get

$ php mdb2_sqlite.php 
Opening dberror is sqlite_open(): file is encrypted or is not a database
>Fix:
I don't think this driver will ever support SQLite 3 since it would need to use PDO. Hopefully the extra note in the pkg-descr will help.

Patch attached with submission follows:

--- pkg-descr	2007-02-08 02:41:29.000000000 -0500
+++ pkg-descr.new	2011-07-26 10:04:44.000000000 -0400
@@ -1,3 +1,3 @@
-This is the SQLite MDB2 driver.
+This is the SQLite MDB2 driver. It currently only supports SQLite 2.
 
 WWW: http://pear.php.net/package/MDB2_Driver_sqlite/


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107261436.p6QEaqWu088839>