php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2879 Tinyint and bit fields return extra garbage on Sybase ASE on Linux and MS SQL 6
Submitted: 1999-11-30 18:13 UTC Modified: 1999-11-30 18:18 UTC
From: adam_wilkinson at sehamerica dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 3.0.12 OS: Linux 2.2.5
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: adam_wilkinson at sehamerica dot com
New email:
PHP Version: OS:

 

 [1999-11-30 18:13 UTC] adam_wilkinson at sehamerica dot com
Create a table that contains a tinyint and/or a bit:

create table TestTab(ID varchar(10), Verified bit, Slot tinyint)

If you return the bit or tinyint fields, you get garbage appended to the end.  This is the same on MS SQL Server 6.5 on NT as well as Sybase ASE 11.0.3 for Linux (The free unsupported one).  

You can work around it by converting the results to a varchar field, then you can read them normally.

So you can use:

SELECT ID, CONVERT(char(1), Verified) AS Verified, 
CONVERT(varchar(2), Slot) AS Slot FROM TestTab

Instead of:

SELECT * FROM TestTab;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-30 18:18 UTC] rasmus at cvs dot php dot net
This is fixed in CVS and will be in 3.0.13
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC