[ODBC-10] Strings right padded with NULL charcters in ADODB Created: 2014-05-28  Updated: 2014-05-29  Resolved: 2014-05-29

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ulf Engstrand Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows Server 2008 R2
IIS 7.5
ASP Classic / ADODB



 Description   

VARCHAR column values are right padded with NULL charcters in ADODB.

The SQL:
select companyName from company where companyId = 1;

In ASP Classic and ADODB the corresponding byte array of the results is (40 characters?):
77 121 32 67 111 109 112 97 110 121 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

In .NET the string is correct:
77 121 32 67 111 109 112 97 110 121

The above byte array corresponds to "My Company".

Table definition:
CREATE TABLE `company` (
`companyId` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`companyName` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`companyId`),
UNIQUE KEY `companyName` (`companyName`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;



 Comments   
Comment by Georg Richter [ 2014-05-29 ]

Fixed in rev. 24

Generated at Thu Feb 08 03:25:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.