Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 115381
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: wesdmalone [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.082842



MIME-Version: 1.0
X-Spam-Status: No, score=-3.349 tagged_above=-99.9 required=10 tests=[AWL=-1.350, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <CADqWEoQ2Ds2zeukhG_ehLwWp_R2xKs6XmBkQABeq_K6Vz4wtww [...] mail.gmail.com>
X-Received: by 10.37.198.69 with SMTP id k66mr4197908ybf.105.1466119584778; Thu, 16 Jun 2016 16:26:24 -0700 (PDT)
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -3.349
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 06EC42402F5 for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Thu, 16 Jun 2016 19:26:38 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lxjDCOT+EB9J for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Thu, 16 Jun 2016 19:26:36 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4112B24024B for <bug-DBIx-Class [...] rt.cpan.org>; Thu, 16 Jun 2016 19:26:36 -0400 (EDT)
Received: (qmail 30589 invoked by alias); 16 Jun 2016 23:26:35 -0000
Received: from mail-yw0-f173.google.com (HELO mail-yw0-f173.google.com) (209.85.161.173) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 16 Jun 2016 16:26:28 -0700
Received: by mail-yw0-f173.google.com with SMTP id g20so57544839ywb.0 for <bug-DBIx-Class [...] rt.cpan.org>; Thu, 16 Jun 2016 16:26:28 -0700 (PDT)
Received: by 10.129.154.200 with HTTP; Thu, 16 Jun 2016 16:25:55 -0700 (PDT)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Delivered-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
Subject: Column value bleeds over from previous create call (MSSQL-only?)
Return-Path: <wesdmalone [...] gmail.com>
X-RT-Mail-Extension: dbix-class
X-Original-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=jBaPKcsN4dbJAg/UvhXqOuankcI0u5O/5+zOEwwGfCk=; b=hXI/6FNxmemAsVwQzEIXD/oq+Gj6ZRCTm3MBseIwAT/LG2iqSIVdIjbGi2nP/3BbUR K+DGRWFYq21aQrdZrLz/ZV5Kn/bgQ9J8GoZpXI+VuXKAtGQXJv/juGrZ5b97FsFSEulD RXGjTAfvS45qOSiW+pq87EswtxGTWcyrqTBHX32BICA/mgKBMtRvGKQAIO9EjVISAnIw PnjLCvhzl5kRXfIQRkI6SgA8Eo8zSOdNtQbn2BPXqq38E4bBdzZBFP7a7GfFhbLzQxlB NcBE2FzRirdY4wzWZwbEbZiRYWDZt/YT7s8WjGtqNBKGHyGtqARWpglpEGorzHWiIpMQ tldQ==
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jBaPKcsN4dbJAg/UvhXqOuankcI0u5O/5+zOEwwGfCk=; b=kOpOiInwSft+i5tQCQMU5ceA/mlxiL1AyDLb43D0/egp//T58wSjXIb3/ArNHChHBO qDvL663Dfr5r1voVVjY7Vdka4fsgJdWCMILdNyNAUcWq95iQ6ZLjt+JMIofFPEp06DnA Wt49A3Ev2hVeh7/isOQAZ1U9i9gsOuLJpBuENAm/XR9ayS3WRMSZ08hJ+lkdU7nFqm2B 508jmf2tahXlyq0omRdA5aASUpuHUVe1TfFd7xzqTqbeLMRkl26RsvFIQpyf3zLnMLo0 mXoP2V486ADqYSrOQc6xtFs6V6nMK83jDTgz8ykBubaDfY8RPEJ4mK4kdhuRXz7CDGKg O7lw==
Date: Thu, 16 Jun 2016 18:25:55 -0500
X-Spam-Level:
To: bug-DBIx-Class [...] rt.cpan.org
From: Wes Malone <wesdmalone [...] gmail.com>
X-GM-Message-State: ALyK8tLz9pcWMjzBfsRtJbS+2xazr/Gt1v5ZL1Oko2cXEhCDT5v/NUdGPAuk83FNcWMYOT2umTutY6c5des5hw==
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 2291
Download (untitled) / with headers
text/plain 2.2k
I found this one by accident. When creating a row for a result with a missing 'is_auto_increment' prop in it's ident column, the new row object receives the ident value from a previous row. Mildly flaky test follows: use 5.20.0; use warnings; use lib 'lib'; use Test::More; use MyApp::Schema; my $s = MyApp::Schema->connect($ENV{DBIC_TEST_CONN_STR}); $s->resultset($_)->delete for qw(Artist Cd Track); my $art = $s->resultset("Artist")->create({ name => 'ZZZ' }); diag 'Artist id: '.$art->id; my $cd = $art->create_related(cds => { title => 'YYY' }); my $cd_from_db = $s->resultset("Cd")->search({ title => 'YYY' })->next; diag 'CD id: '.$cd->id; diag 'Actual CD id: '.$cd_from_db->id; isnt $cd->id, $art->id, 'created objects id should not come from the previous object'; my $track = $cd->create_related(tracks => { title => 'XXX' }); # FK error done_testing; And the output is $ perl dbic-test.pl # Artist id: 15 # CD id: 15 # Actual CD id: 110 not ok 1 - created objects id should not come from the previous object # Failed test 'created objects id should not come from the previous object' # at dbic-test.pl line 16. # got: '15' # expected: anything else DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::ODBC::st execute failed: [Microsoft][SQL Server Native Client 11.0][SQL Server]The INSERT statement conflicted with the FOREIGN KEY constraint "track_fk_cdid". The conflict occurred in database "dbic_test", table "dbo.cd", column 'id'. (SQL-23000) [state was 23000 now 01000] [Microsoft][SQL Server Native Client 11.0][SQL Server]The statement has been terminated. (SQL-01000) [for Statement "INSERT INTO track ( cdid, title) VALUES ( ?, ? ) SELECT SCOPE_IDENTITY()" with ParamValues: 1='15', 2='XXX'] at dbic-test.pl line 18 Full repro code is here https://github.com/wesQ3/dbic-reused-ident.git I wasn't able to repro with SQLite, so this may be MSSQL specific. The provided deploy SQL has the identity seeds for each table staggered by 100, so failures are easily spotted. If you just started with blank tables at ID 1, your FK's would match :) DBIC 0.082821 DBD::ODBC 1.50 SQL Server Native Client 11.0 for Linux perl 5.20.1
MIME-Version: 1.0
In-Reply-To: <CADqWEoQ2Ds2zeukhG_ehLwWp_R2xKs6XmBkQABeq_K6Vz4wtww [...] mail.gmail.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <CADqWEoQ2Ds2zeukhG_ehLwWp_R2xKs6XmBkQABeq_K6Vz4wtww [...] mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-28320-1473782797-38.115381-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 427
Download (untitled) / with headers
text/plain 427b
On Fri Jun 17 01:26:38 2016, wesdmalone@gmail.com wrote: Show quoted text
> I found this one by accident. When creating a row for a result with a > missing 'is_auto_increment' prop in it's ident column, the new row > object receives the ident value from a previous row. >
Argh... so much grief... This is now fixed for good via https://github.com/dbsrgits/dbix-class/commit/7305f6f93, read commit msg for more details. Thanks for the report!
MIME-Version: 1.0
X-Spam-Status: No, score=-5.248 tagged_above=-99.9 required=10 tests=[AWL=1.450, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-4, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-28320-1473782797-993.115381-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-115381 [...] rt.cpan.org> <CADqWEoQ2Ds2zeukhG_ehLwWp_R2xKs6XmBkQABeq_K6Vz4wtww [...] mail.gmail.com> <rt-4.0.18-28320-1473782797-993.115381-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.37.31.196 with SMTP id f187mr2293322ybf.56.1473789917323; Tue, 13 Sep 2016 11:05:17 -0700 (PDT)
Message-ID: <CADqWEoRaNtuA8K7FfMczKUappTUcOZEuFzEQNL1hmF=hXBvdyQ [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary="001a1143e3827ee8ba053c677456"
X-Spam-Score: -5.248
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 9D2252401C6 for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Tue, 13 Sep 2016 14:05:33 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OwPAvmEQNhTV for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Tue, 13 Sep 2016 14:05:31 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 5F6352401A5 for <bug-DBIx-Class [...] rt.cpan.org>; Tue, 13 Sep 2016 14:05:31 -0400 (EDT)
Received: (qmail 3406 invoked by alias); 13 Sep 2016 18:05:30 -0000
Received: from mail-yb0-f180.google.com (HELO mail-yb0-f180.google.com) (209.85.213.180) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 13 Sep 2016 11:05:21 -0700
Received: by mail-yb0-f180.google.com with SMTP id n11so20066686yba.0 for <bug-DBIx-Class [...] rt.cpan.org>; Tue, 13 Sep 2016 11:05:21 -0700 (PDT)
Received: by 10.129.7.213 with HTTP; Tue, 13 Sep 2016 11:04:46 -0700 (PDT)
Delivered-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #115381] Column value bleeds over from previous create call (MSSQL-only?)
Return-Path: <wesdmalone [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ycceiapKfnwqFz2Jd6ljacoBkRLldNQO8NBzPLaCydM=; b=sxZFa3EaqtFBb/WZwCiaXbzECJU0fuFD4FWfMHBUAPvTD3C67l+9fR79EISY/96SbB zLIPKW8dQ0GT7/e8nYPuSGzclyQsZ8qIE6/c+Zu0ZKelBJtxg33XS0BBSuVWQZXWBVJZ +jjpRVDQmyNAYg7eWBdvfZaCTeygpJuELlO9iHzjaoZsjc1JW78E69MMfLPY7RMapquA 74znvO0wvE0k6ns67SgWo+Y8ueXCzUmr+cFs8kyPDvDUOpHFbVdANrNB8FV3cusGejxl ytPZ4aU/26RR2JNsjzmnJ8/R4bBZCX8LT4IHLHNTfj+Hkce3uLb7GfaQowLeQPrfNkKs MN6Q==
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbix-class
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ycceiapKfnwqFz2Jd6ljacoBkRLldNQO8NBzPLaCydM=; b=WRAJOc25hTU71DpLYAInphaw+84O5897BtJGWBZ9JcQZYz/W4nRycNLR6CuU8w0TMC PiNOoF4r9oxh0oBtW5pOuPRO9pZNJQi9izyfwWS22+MlOmYTv1aRK8CvZn6LiNA2Vi6z 4UrJed7f4+9tq15h6LcGae0iuOqFTP7CTJ2S5CNQtvVW5DFzexbef/9Wj6SdSgjWdbWh 12i9i8egimBOiCrnOGJljeTBzMccWts4eczXYWlardfApZRK7Mw0GyYcPAv3jtSc0tuD JTlF197VF4y94zo6O1XF6DcVccCq0w7oB19xkIgS59vYiFoZvw5N0H8uju67xySizboZ g0/Q==
Date: Tue, 13 Sep 2016 13:04:46 -0500
X-Spam-Level:
To: bug-DBIx-Class [...] rt.cpan.org
X-GM-Message-State: AE9vXwNXWhpORN0yHliVRoUP3iSxZURPIGvWIiLpV7xFIXgs3IW0YsxO4lPWjKNY9jAHpwD8NaG4xDrjIb31mg==
From: Wes Malone <wesdmalone [...] gmail.com>
RT-Message-ID: <rt-4.0.18-1560-1473789934-583.115381-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 686
Download (untitled) / with headers
text/plain 686b
That's a hell of a conditional! Good error message, too. Thanks for your help. On Tue, Sep 13, 2016 at 11:06 AM, Peter Rabbitson via RT < bug-DBIx-Class@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=115381 > > > On Fri Jun 17 01:26:38 2016, wesdmalone@gmail.com wrote:
> > I found this one by accident. When creating a row for a result with a > > missing 'is_auto_increment' prop in it's ident column, the new row > > object receives the ident value from a previous row. > >
> > Argh... so much grief... This is now fixed for good via > https://github.com/dbsrgits/dbix-class/commit/7305f6f93, read commit msg > for more details. > > Thanks for the report! >
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 1316
MIME-Version: 1.0
In-Reply-To: <CADqWEoQ2Ds2zeukhG_ehLwWp_R2xKs6XmBkQABeq_K6Vz4wtww [...] mail.gmail.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <CADqWEoQ2Ds2zeukhG_ehLwWp_R2xKs6XmBkQABeq_K6Vz4wtww [...] mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-14913-1592342788-1184.115381-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 124
Download (untitled) / with headers
text/plain 124b
This is finally on CPAN as https://metacpan.org/release/RIBASUSHI/DBIx-Class-0.082842 Sorry for the long road to get there.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.