Skip to content

Commit

Permalink
Fixed $sth->{PRECISION} for utf-8, with thanks Eric Lenio.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.perl.org/modules/dbd-oracle/trunk@2273 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information
timbo committed Nov 25, 2005
1 parent 3a299bc commit c21ec6c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Fixed csform setting for Oracle 8.0.
Fixed csform setting for some UTF8 cases.
Fixed INTERVAL DAY TO SECOND thanks to Honza Pazdziora.
Fixed $sth->{PRECISION} for utf-8, with thanks Eric Lenio.

Added support for nested cursors in select lists thanks to Charles Jardine.
Added "Trailing Spaces" section to docs thanks to Michael A Chase.
Expand Down
2 changes: 1 addition & 1 deletion dbdimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ dbd_db_login6(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *uid, char *pwd, S
charsetid, ncharsetid, status );
if (status != OCI_SUCCESS) {
oci_error(dbh, NULL, status,
"OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.)");
"OCIEnvNlsCreate (check ORACLE_HOME and NLS settings, permissions etc.)");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion oci8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,9 +1223,9 @@ dbd_describe(SV *h, imp_sth_t *imp_sth)
/* FALLTHRU */
case 96: /* CHAR */
fbh->disize = fbh->dbsize;
fbh->prec = fbh->disize;
if (CS_IS_UTF8(fbh->csid))
fbh->disize = fbh->dbsize * 4;
fbh->prec = fbh->disize;
break;
case 23: /* RAW */
fbh->disize = fbh->dbsize * 2;
Expand Down
9 changes: 8 additions & 1 deletion t/20select.t
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ my @test_sets = (
my $sz = 8;

my $tests = 2;
my $tests_per_set = 12;
my $tests_per_set = 14;
$tests += @test_sets * $tests_per_set;
print "1..$tests\n";

Expand Down Expand Up @@ -107,6 +107,13 @@ sub run_select_tests {
ok(0, $tmp->[2][1] =~ m/$data2/,
cdif($tmp->[2][1], $data2, "Len ".length($tmp->[2][1])) );

# 10/25/2005 lenio: adding tests around $sth->{PRECISION}:
# 1st column, an integer, should have PRECISION of 38
ok(0, $sth->{PRECISION}->[0] == 38);
# 2nd column, character type, should have PRECISION of 10
ok(0, $sth->{PRECISION}->[1] == 10);
# 3rd column, date type, should have PRECISION of 75
ok(0, $sth->{PRECISION}->[2] == 75);

} # end of run_select_tests

Expand Down

0 comments on commit c21ec6c

Please sign in to comment.