Before I write this off as a SQLite 1.13 problem, I just wanted to get
some feedback and see if anyone else has seen this. IT all started when
perigrin tracked my down on IRC about some failing create tests in Handel.

What id came down to was that the last passing test was testing for a PK
violation on insert. Then the next test, which inserts a record with a
unique fails with the [almost] same error about id not being unique even
though it is.

After whittling away Handel and just using the DBIC schem class, it
comes down to this:

> #!/usr/bin/perl -w
> use strict;
> use warnings;
> use lib 'lib';
> use Handel::Cart::Schema;
> 
> my $schema = Handel::Cart::Schema->connect('dbi:SQLite:t/var/handel.db');
> 
> eval {
      # THIS ID EXISTS!
>     $schema->resultset('Carts')->create({
>         id => '11111111-1111-1111-1111-111111111111',
>         shopper => '11111111-1111-1111-1111-111111111111',
>     });
> };
> print $@;
> 
> 
> eval {
      # THIS ID IS UNIQUE
>     $schema->resultset('Carts')->create({
>         id => '23411111-1111-1111-1111-111111111111',
>         shopper => '11111111-1111-1111-1111-111111111111',
>     });
> };
> print $@;

This produces the following:

> 3DBIx::Class::ResultSet::create(): Error executing 'INSERT INTO cart (id, 
> shopper) VALUES (?, ?)': DBD::SQLite::st execute failed: column id
>  is not unique(1) at dbdimp.c line 402 at 
> C:/Development/Perl/584/site/lib/DBIx/Class/Storage/DBI.pm line 879.
> 
> DBIx::Class::ResultSet::create(): Error executing 'INSERT INTO cart (id, 
> shopper) VALUES (?, ?)': DBD::SQLite::st execute failed: column id
> is not unique(21) at dbdimp.c line 376 at 
> C:/Development/Perl/584/site/lib/DBIx/Class/Storage/DBI.pm line 879.

The error message is the same, almost. The second create should succeed,
and it does under SQLite 1.12. However, if I change my test script to
simple do two do() statements, the second statement succeeds. So, either
it's something in DBIC, or it's a bug that only surfaces when using
bindparams. I'm voting for the former. Thoughts?

In the end, I'm going to bug baud to see if there's a DBD::SQLite 1.14
on the way, since it's somewhat out of data with the SQLite libs at this
point.

After that, time for some BAIL_OUTs on my tests if DBD::SQLite 1.13 is
installed.

-=Chris

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to