Skip Menu |
 

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 83017
Status: rejected
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: purification [...] ukr.net
Cc:
AdminCc:

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



From purification [...] ukr.net Mon Jan 28 17: 13:52 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-6.334 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, SPF_SOFTFAIL=0.665] autolearn=ham
X-Spam-Flag: NO
Content-Type: text/plain; charset=UTF-8
Message-ID: <5106F811.5080209 [...] ukr.net>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.334
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 417BE240520 for <cpan-bug+DBD-Pg [...] hipster.bestpractical.com>; Mon, 28 Jan 2013 17:13:52 -0500 (EST)
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 OdJ0G9pqRgjj for <cpan-bug+DBD-Pg [...] hipster.bestpractical.com>; Mon, 28 Jan 2013 17:13:49 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4166A24051E for <bug-DBD-Pg [...] rt.cpan.org>; Mon, 28 Jan 2013 17:13:48 -0500 (EST)
Received: (qmail 28252 invoked by uid 103); 28 Jan 2013 22:13:47 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 28 Jan 2013 22:13:47 -0000
Received: from fsm1.ukr.net (HELO fsm1.ukr.net) (195.214.192.120) by 16.mx.develooper.com (qpsmtpd/0.84/v0.84-167-g4ed6cab) with ESMTP; Mon, 28 Jan 2013 14:13:43 -0800
Received: from [95.158.11.2] (helo=[192.168.1.2]) by fsm1.ukr.net with esmtpsa ID 1TzwxO-000HGH-62 for bug-DBD-Pg [...] rt.cpan.org; Tue, 29 Jan 2013 00:13:38 +0200
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] ukr.net
Delivered-To: cpan-bug+DBD-Pg [...] hipster.bestpractical.com
Subject: [FEATURE REQUEST] DBD::Pg $sth with server-side prepares fails when executed in forked process due to unreliable prepare_name scheme
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12
Return-Path: <purification [...] ukr.net>
X-RT-Mail-Extension: dbd-pg
X-Original-To: cpan-bug+DBD-Pg [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID; bh=eBjBRwMDO6rQXTKKwBU4w/AtOsKa9GTKdaZwtEjDtXQ=; b=xRxgKFyZoL6EKBPQa/QDo9G1pfJLrIirQFyMEO3jCsVyxQRoBANq1VZHaY6qBm1IkROim116Z8QzuvK4VjyEaJGnL1JQVfmuulilOF5ucC87r0SC/wf5LJn3K/ksVZmqguTf7i7mWqTWwOXlhjeCf+HbQwjMRCukIf9Udk3dV78=;
Date: Tue, 29 Jan 2013 00:13:37 +0200
X-Spam-Level:
To: bug-DBD-Pg [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
X-Enigmail-Version: 1.4.1
From: retaliation <purification [...] ukr.net>
X-RT-Original-Encoding: utf-8
Content-Length: 583
Download (untitled) / with headers
text/plain 583b
When $sth is prepared inside a forked process, and then executed multiple times in a forked processes, it fails in a second and all next calls due to forked process producing the same prepare_name. The current code is as follows: /* Name is "dbdpg_xPID_#", where x is 'p'ositive or 'n'egative */ sprintf(imp_sth->prepare_name,"dbdpg_%c%d_%d", (imp_dbh->pid_number < 0 ? 'n' : 'p'), abs(imp_dbh->pid_number), imp_dbh->prepare_number); I think it would be better if this code was replaced with a reliable scheme, for example UUID-based.
MIME-Version: 1.0
In-Reply-To: <5106F811.5080209 [...] ukr.net>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <5106F811.5080209 [...] ukr.net>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-13571-1360357215-498.83017-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 164
Download (untitled) / with headers
text/plain 164b
Not sure I understand - wouldn't forking create other problems? One cannot fork active database connections, as the messages will start interfering with each other.
MIME-Version: 1.0
In-Reply-To: <5106F811.5080209 [...] ukr.net>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <5106F811.5080209 [...] ukr.net>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.16-15718-1380576186-31.83017-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: 190
Download (untitled) / with headers
text/plain 190b
DBI handles do not work across forks. Use something like DBIx::Connector to get around that -- but even still, you cannot prepare a statement handle in one process and execute it in another.


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.