php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59094 Crash when trying to access empty field
Submitted: 2010-03-02 09:12 UTC Modified: 2010-03-02 12:08 UTC
From: koenk82 at gmail dot com Assigned:
Status: Closed Package: solr (PECL)
PHP Version: 5.3.1 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 + 24 = ?
Subscribe to this entry?

 
 [2010-03-02 09:12 UTC] koenk82 at gmail dot com
Description:
------------
I've used the php_solr.dll file from windows.php.net, which is version 0.9.7.

When doing getResponse() on the SolrQueryResponse object PHP seems to crash when it contains an empty field.

When var_dump'ing the query response the empty field looks like:
<str name="s_full_description"/>

When filling the field, the problem doesn't occur, so the response contains this:
<str name="s_full_description">something</str>

Reproduce code:
---------------
// make sure there's a field with no data
$document->addField('s_short_description', '');

// retrieve the field
$options = array( ... );
$client = new SolrClient($options);
$query = new SolrQuery();
$results = $query->setQuery('*:*');
$query->setStart(0);
$query->setRows(10);
$query->addField('id');
$query->addField('s_full_description'); // when leaving this out, it works correctly
$queryResponse = $client->query($query);
$response = $queryResponse->getResponse(); // makes it crash

Expected result:
----------------
not to crash

Actual result:
--------------
php stopped working

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-02 12:08 UTC] iekpo@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/solr

This issue was fixed in release 0.9.8 or SVN revision 291171

Once we get the windows version up to date you should be fine.

I will try to get that in place within the next week or so.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 11:01:30 2024 UTC