MDB driver_test.php

From: Date: Mon, 15 Jul 2002 15:11:41 +0000
Subject: MDB driver_test.php
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7726@lists.php.net to get a copy of this message
I've been trying to test the MDB pgsql driver ready for release and I uncovered something of bug / problem with the driver_test.php (taken from metabase originally). The test table that gets created is CREATE TABLE users ( user_name CHAR (12), user_password TEXT, subscribed CHAR (1), user_id INT DEFAULT 0 NOT NULL, quota TEXT , weight TEXT , access_date CHAR (10), access_time CHAR (8), approved CHAR (19) ) and populated with data like INSERT INTO users (user_name,user_password,subscribed,user_id,quota,weight,access_date,access_time,approved) VALUES ('user_0','somepassword','N',0,101,0,'2002-07-15','15:46:23','2002-07-15 15:46:23') All good and well. Later on in the tests it compares the values of the user_name column return by a select with what is expected, however the strcmp comparison fails because user_name is a char(12) so in postgres the value 'user_0' get's padded to 'user_0 ' and hence the strcmp fails. For the time being I've added rtrim where necessary in my copy of the tests, since I think the driver is correct (it returns the data as stored in the database) Any thoughts, Paul -- ----------------------------------------------------------------- Paul Cooper | Tel: 0121 331 7858 Senior Programmer and Database Engineer | Fax: 0121 331 7859 UCEcom | mailto:pgc@ucecom.com University of Central England | http://www.ucecom.com Birmingham, B4 7DX | -----------------------------------------------------------------

« previous php.pear.dev (#7726) next »