PHP 4.0 Bug #6527 Updated: empty field returned are not empty
| From: | Bug Database | Date: | Tue, 05 Sep 2000 12:16:41 +0000 |
| Subject: | PHP 4.0 Bug #6527 Updated: empty field returned are not empty | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32134@lists.php.net to get a copy of this message | ||
ID: 6527
User Update by: lenar@city.ee
Status: Open
Bug Type: Sybase-ct (ctlib) related
Description: empty field returned are not empty
In ISQL I can do the same way you did and the results are ok:
select '**', '*'+phone+'*' from users where phone = ''
And I get:
---------
** **
** **
so on...
and the result can't be NULL beacuse the phone field is defined as NOT NULL DEFAULT
''
so it always contains a string '' whenever it's not explictly specified to something
else.
We are here using Sybase ASE (Adaptive Server Anywhere) ver 6.0.3 and this is not the same
thingas ASA 11.x. The versioning sequence is different. ASE supports open client connectivity
and we are using ASA 11.9.x ct-libs client side libraries to provide the connectivity to our
applications
on windows platform and to php-sybase-ct on linux platform. This is because ASE isn't coming
default
with these libraries, but provides protocol-level compatibility when it's lot cheaper than ASA
itself.
Maybe I find time to debug php-sybase module myself but right now I just reported that in my opinion
the problem still exists and still needs attention. Maybe the problem resides in these client
libraries, but right now I don't know.
Lenar
Previous Comments:
[2000-09-05 03:14:38] joey@php.net
Note that the empty string is NOT the same thing in
Sybase as a null...here's what ISQL shows us.
1> select "**", "*"+OPP_VOLUNTEERS_NEEDED+"*" from OPPORTUNITY
1> where OPP_VOLUNTEERS_NEEDED = NULL
2> go
-- -----------------
** **
** **
<... snip ...>
(18 rows affected)
1>
1> select "**", "*"+OPP_VOLUNTEERS_NEEDED+"*" from OPPORTUNITY
1> where OPP_VOLUNTEERS_NEEDED = ""
2> go
-- -----------------
** * *
<... snip ...>
** * *
** * *
(389 rows affected)
1>
And what version of Sybase ASE are you using?
6.0? There is no (AFAIK) Linux port earlier than
11.5, so something is definitely wrong here.
---------------------------------------------------------------------------
[2000-09-04 06:56:01] lenar@city.ee
And don't say it's sybase's fault. At least in ISQL it works. It's ASE 6 here
and in ISQL over ctlib I get very proper results:
SELECT '**', '*'+phone+'*', LENGTH(phone) FROM users WHERE
LENGTH(phone) = 0
result records:
** ** 0
** ** 0
not:
** * * 0
or something more bizarre.
So please check it out.
Lenar
---------------------------------------------------------------------------
[2000-09-04 06:44:56] lenar@city.ee
When fetching a record from sybase with sybase_fetch_row
and some fields contain no value ("") then in resulting array there are spaces instead.
list($space) = sybase_fetch_row(sybase_query("SELECT phone FROM users WHERE LENGTH(phone) =
0"));
now $space == " ".
This is not what I want. I want strlen($space) == 0.
Hope this bug will be fixed.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6527