Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

postgres interface

8 views
Skip to first unread message

Leopold Toetsch

unread,
Sep 24, 2006, 2:55:51 PM9/24/06
to perl6-i...@perl.org
Hi folks,

I've started hacking postgres.pir and related stuff. Some remarkable notes:

* there's a test now (or the beginnings of it):
$ ./parrot t/library/pg.t
(the old code didn't even load_bytecode)

The test assumes, there's a user's default table.

* I've removed the 'PostgreSQL::' prefix from all NCI globals and instead
inserted

.namespace ['Pg'] # (1)

* And I've started runtime/parrot/library/Pg.pir - an OO interface to
postgres.pir.

Patches, suggestions, comments, ... welcome
leo

(1) I'm still not aware of any policy regarding parrot lib namespaces.

Bob Rogers

unread,
Sep 24, 2006, 6:01:16 PM9/24/06
to perl6-i...@perl.org
From: Leopold Toetsch <l...@toetsch.at>
Date: Sun, 24 Sep 2006 20:55:51 +0200

Hi folks,

I've started hacking postgres.pir and related stuff. Some remarkable notes:

* there's a test now (or the beginnings of it):
$ ./parrot t/library/pg.t
(the old code didn't even load_bytecode)

The test assumes, there's a user's default table.

It turns out that if libpq.so doesn't exist, pg.t makes t/harness give
up completely:

rogers@rgrjr> perl t/harness t/library/pg.t
t/library/pg....Couldn't load 'libpq': libpq.so: cannot open shared object file: No such file or directory
current instr.: 'parrot;Pg;__postgres_init' pc 0 (/usr/src/parrot/runtime/parrot/library/postgres.pir:4)
[oops; continuation 0x81d5f94 of type 25 is trying to jump from runloop 8 to runloop 1]
FAILED--Further testing stopped: error loading libpg - loadlib failed
rogers@rgrjr>

I managed to get it to fail less hard (see patch):

rogers@rgrjr> perl t/harness t/library/pg.t
t/library/pg....Couldn't load 'libpq': libpq.so: cannot open shared object file: No such file or directory
current instr.: 'parrot;Pg;__postgres_init' pc 0 (/usr/src/parrot/runtime/parrot/library/postgres.pir:4)
[oops; continuation 0x81d5e90 of type 25 is trying to jump from runloop 9 to runloop 1]
t/library/pg....ok 7/7parrot: src/inter_call.c:122: Parrot_init_arg_op: Assertion `(((sig_pmc)->obj.flags) & PObj_is_PMC_FLAG) && sig_pmc->vtable->base_type == enum_class_FixedIntegerArray' failed.
t/library/pg....dubious
Test returned status 0 (wstat 6, 0x6)
Scalar found where operator expected at (eval 159) line 1, near "'int' $__val"
(Missing operator before $__val?)
after all the subtests completed successfully
Failed Test Stat Wstat Total Fail Failed List of Failed
--------------------------------------------------------------------------------
t/library/pg.t 0 6 7 0 0.00% ??
7 subtests skipped.
Failed 1/1 test scripts, 0.00% okay. 0/7 subtests failed, 100.00% okay.
rogers@rgrjr>

But, as you can see, the continuation barrier gets in the way of the
error handling.

-- Bob Rogers
http://rgrjr.dyndns.org/

pg-test-fail-gently.patch

Leopold Toetsch

unread,
Sep 25, 2006, 3:53:55 AM9/25/06
to perl6-i...@perl.org
Am Montag, 25. September 2006 00:01 schrieb Bob Rogers:
> It turns out that if libpq.so doesn't exist, pg.t makes t/harness give
> up completely:

Yep.

> I managed to get it to fail less hard (see patch):

Thanks, applied.

> But, as you can see, the continuation barrier gets in the way of the
> error handling.

Exceptions shouldn't be a problem as long as the handler doesn't try to resume
execution in a different run loop.

leo

0 new messages