Author: turnstep
Date: Mon Apr 7 09:45:39 2008
New Revision: 11054
Modified:
DBD-Pg/trunk/dbdimp.c
Log:
Account for negative PIDs when building our internal prepared statment names.
CPAN bug #34738.
Modified: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c (original)
+++ DBD-Pg/trunk/dbdimp.c Mon Apr 7 09:45:39 2008
@@ -1960,8 +1960,11 @@
Renew(imp_sth->prepare_name, 25, char); /* freed in dbd_st_destroy */
- /* Name is simply "dbdpg_PID_#" */
- sprintf(imp_sth->prepare_name,"dbdpg_%d_%d", imp_dbh->pid_number,
imp_dbh->prepare_number);
+ /* 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);
if (TRACE5)
TRC(DBILOGFP, "%sNew statement name (%s), oldprepare is %d\n",