PEAR is archived and read-only

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

Home » Database » MDB2 » Bug #7081

Cannot access sequences from other databases

Details

Submitted2006-03-09 20:11 UTC
Fromcow at neondragon dot net
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version4.4.2
OSLinux
Roadmaps(Not assigned)

Comments

[2006-03-09 20:11 UTC] cow at neondragon dot net

Description:
------------
In PEAR::DB, it was possible to access sequences from other databases in a script like this:

$userid = $db->nextId("database.sequence");

In MDB2, it gives the following error:

Error message: nextID: on demand sequence database.sequence could not be created

This is annoying because I use the table name as the sequence name. A lot of the time, the user table may be called from another database.

Using MySQL driver.

Test script:
---------------
<?php
print_r($db->nextId("database.sequence"));
?>

Expected result:
----------------
Sequence should function as expected using table in specified database.

Actual result:
--------------
Error message: nextID: on demand sequence database.sequence could not be created

[2006-03-09 20:14 UTC] cow at neondragon dot net

I should add that it seems like I'm getting Error message: nextID: on demand sequence database.sequence could not
be created

[2006-03-09 20:16 UTC] cow at neondragon dot net

I should add that it seems like I'm getting the following error message because of a permission error.

Error message: nextID: on
demand sequence database.sequence could not
be created

More accurately, PEAR::MDB2 treats database.sequence as database_sequence and creates a database_sequence_seq table rather than using sequence_seq in the database named database.