Re: [Dbi-interbase-devel] ak-dbd.t error
Status: Beta
Brought to you by:
edpratomo
From: Edwin P. <ed....@co...> - 2000-08-25 13:05:37
|
Michael Samanov wrote: > > Hello dbi-interbase-devel, > > The new driver (0.20.6) or t/ak-dbd.t have bug: when executing > > Test($state or (defined($$ref[0]) && ($$ref[0] eq ''))) > or ErrMsgF("blank value returned as '%s'.\n", $$ref[0]); > ChopBlanks attrib must be used: ### Now, re-connect again so that we can do some more complicated stuff.. Test($state or ($dbh = DBI->connect($test_dsn, $test_user, $test_password, {ChopBlanks=>1}))) or ErrMsg("reconnect failed: $DBI::errstr\n"); > it shows error that value returned is filled with spaces. The error > happens even when I change field type from CHAR(64) to VARCHAR(64). > No, VARCHAR is handled correctly. Try this: $dbh = DBI->connect('dbi:InterBase:db=test.gdb', '', '', {RaiseError =>1, ChopBlanks=>1}) or die $DBI::errstr; $dbh->do("CREATE TABLE SAMPLE (id INTEGER, name VARCHAR(255))"); $dbh->do("INSERT INTO SAMPLE VALUES(1, 'Anything')"); $res = $dbh->selectall_arrayref("SELECT * FROM SAMPLE")->[0]; print join('|', @$res), "|\n"; $dbh->disconnect; Rgds, Edwin. |