php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22100 Query failure when WHERE clause matches on column with value '0'
Submitted: 2003-02-06 18:05 UTC Modified: 2003-02-08 02:23 UTC
From: eigenuser at yahoo dot com Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.3.0 OS: FreeBSD 4.7
Private report: No CVE-ID: None
 [2003-02-06 18:05 UTC] eigenuser at yahoo dot com
I have a PostgreSQL db with the table 'news_article', which has its primary index a serial column named 'art_id'. This table has a row whose art_id is set to zero. Now I'll do the following:

1. Make a persistent connection.
2. Make query of the form: 
     SELECT * FROM news_article WHERE art_id = 0

Most of the time this query will work fine, but if I refresh the PHP script multiple times, I'll eventually get an error with the following error messages.

-------------------
PHP error message:
-------------------
Warning: pg_query() [function.pg-query]: Query failed: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. .in [filename.php] on line 21

--------------------------
PostgreSQL error message:
--------------------------
pq_recvbuf: recv() failed: Undefined error: 0


Some things I've noticed:

* This problem does not seem to appear when
  connecting with non-persistent connections.

* Although the PHP error message suggests the
  connection was closed prematurely, you can
  still issue successful queries using the same
  connection resource later on in the PHP page,
  so it appears that the connection is still
  open.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-08 02:07 UTC] eigenuser at yahoo dot com
This must've been a PostgreSQL bug, not PHP.

I installed php4-STABLE-200302080430, and the problem was still there. I noticed a new release of PostgreSQL, so I upgraded from 7.3.1 to 7.3.2, and now everything seems to be fine.
 [2003-02-08 02:23 UTC] magnus@php.net
Not a PHP bug => Bogus 
 [2021-04-06 10:40 UTC] git@php.net
Automatic comment on behalf of roojs
Revision: https://github.com/php/pecl-tools-svn/commit/5847b12975a84134bbdc27786c56603debc21a88
Log: fix #22100 - segfault on shutdown when using multiple repositories - patch by jimmy at velsoft
 [2021-04-06 10:40 UTC] git@php.net
-Status: Not a bug +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 23:01:30 2024 UTC