From:             graham1 dot simpson at hsbcib dot com
Operating system: Linux Redhat AS 3.0
PHP version:      5.0.4
PHP Bug Type:     Sybase-ct (ctlib) related
Bug description:  Varchar >255 not supported

Description:
------------
PHP client application truncates text/varchar columns to 255 chars, even
when compiled with a new Sybase CT open client.
-
I think this is more of a feature enhancement request rather than a bug
per se.
-

Load the form mentioned belowin your web browser and add data until bigger
than 255.

My environment is php 5.0.4 under apache 2.0.48 with --with-sybase-ct
option compiled in. The version of open client is 12.5.1. which supports
large varchars.


Reproduce code:
---------------
To reproduce:
% cat <<EOT >testform.php
<html>
<head>
<title>testform
</title>
</head>
<body>
<?php
require_once ("dbconfig.php");

if ($_POST[Submit]) {
  $servercomments = $_POST[servercomments];
  $qry = "update tempdb..gsi set Key1 = '" . $servercomments . "'";
  $result = sybase_query($qry,$cnn);
}

$qry = "select Key1 from tempdb..gsi";
$result = sybase_query($qry,$cnn);
$row = sybase_fetch_array($result);
$servercomments = $row[Key1];

echo "<form action=\"ta.php\" method=\"post\">";
echo "<textarea rows=20 cols=80 name=servercomments>";
  echo "$servercomments\n";
echo "</textarea>";
echo "<input type=\"submit\" name=\"Submit\" value=\"Do It\">";
echo "</form>";
?>
</body>
</html>
EOT

In isql:
use tempdb
go
create table gsi (Key1 varchar(1500))
go
insert gsi values ("somevalue")
go


Expected result:
----------------
Ideally, I would expect to get my row returned when bigger than 255
characters.

Actual result:
--------------
As the PHP client cannot handle varchars > 255, a server error is
generated informing that a truncation has occurred:

Warning: sybase_query() [function.sybase-query]: Sybase: Server message:
Character or binary data returned from Adaptive Server has been truncated.
The client application does not support more than 255 bytes of data as a
result column or output parameter. (severity 10, procedure N/A) in
/home/sybase/public_html/testform.php on line 20

-- 
Edit bug report at http://bugs.php.net/?id=33221&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33221&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33221&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33221&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33221&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33221&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33221&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33221&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33221&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33221&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33221&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33221&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33221&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33221&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33221&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33221&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33221&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33221&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33221&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33221&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33221&r=mysqlcfg

Reply via email to