Subject: | from gborg: digit after '\x81\x5c' is lost. |
[this bug has been migrated from Gborg. An additional note is below. ]
Environment:
OS Red Hat Linux release 8.0
perl 5.8.0
DBI 1.37
DBD::Pg 1.32
Created By: makoto@cpan.org
Description:
sample script:
BEGIN{$ENV{PGCLIENTENCODING}='sjis'}
use strict;
use warnings;
use DBI;
my $str = "1\x81\x5c5";
#"1\x81\x5c5"= 1[dable byte dash of Shift_JIS]5
my $dbh = DBI->connect('dbi:Pg:dbname=makoto','makoto',undef,{
AutoCommit => 0,
PrintError => 1,
RaiseError => 1,
ShowErrorStatement => 1,
});
$dbh->trace(1);
my $sth = $dbh->prepare("insert into test values(?)");
print "execute:" , ( $sth->execute($str) ? 'OK' : 'NG' ) , "\n";
$dbh->commit;
$dbh->disconnect;
1;
trace output:
$ createdb -EEUC_JP makoto
CREATE DATABASE
$ PGCLIENTENCODING=EUC_JP psql
makoto=> create table test(a text);
CREATE
makoto=> \q
$ perl test.pl
DBI::db=HASH(0x81aa334) trace level set to 1 in DBI 1.37-ithread
dbd_st_prepare: statement = >insert into test values(?)<
dbd_st_preparse: statement = >insert into test values(?)<
<- prepare('insert into test values(?)')= DBI::st=HASH(0x81aa43c) at test.pl
line 14
dbd_bind_ph
dbd_st_rebind
dbd_st_execute
<- execute('1.\5')= 1 at test.pl line 15
execute:OK
dbd_db_commit
<- commit= 1 at test.pl line 16
dbd_db_disconnect
<- disconnect= 1 at test.pl line 17
dbd_st_destroy
<- DESTROY= undef
dbd_db_destroy
<- DESTROY= undef
$ PGCLIENTENCODING=EUC_JP psql
makoto=> select * from test;
a
------
1\
(1 row)
##############
This bug needs to be tested against current CVS. Could you do that to help us? I've created a snapshot to make this easier:
http://mark.stosberg.com/perl/DBD-Pg-cvs-2004-09-24.tgz