Bug 244736 - varchar fields with empty string return NULL
Summary: varchar fields with empty string return NULL
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: php-extras
Version: 6
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Dmitry Butskoy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-18 20:19 UTC by Edward Rudd
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version: 5.1.6-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-22 12:03:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch based off of 5.1.6 to fix the issue. (773 bytes, patch)
2007-06-18 20:19 UTC, Edward Rudd
no flags Details | Diff
PHP test case. (1.16 KB, text/plain)
2007-06-18 20:28 UTC, Edward Rudd
no flags Details

Description Edward Rudd 2007-06-18 20:19:53 UTC
Description of problem:
when selecting a varchar column that contains an empty string (""), php returns
a NULL instead of "".

Version-Release number of selected component (if applicable):
5.1.6-3.fc6

Comment 1 Edward Rudd 2007-06-18 20:19:53 UTC
Created attachment 157322 [details]
Patch based off of 5.1.6 to fix the issue.

Comment 3 Edward Rudd 2007-06-18 20:28:12 UTC
Created attachment 157325 [details]
PHP test case.

Comment 4 Dmitry Butskoy 2007-06-19 12:21:40 UTC
Well, it is an issue for FC6 only.

php-5.2.2 (from Fedora 7) seems to have this fixed, but partially (only in one
of two functions from the comment #1 patch). Is it enough to fix only
"_with_type" case?

Also note, that you should first check a pointer for NULL, and then for zero
length of pointer's data...






Note You need to log in before you can comment on or make changes to this bug.