| timbo@cvs.perl.org 2005-06-03, 8:27 pm |
| Author: timbo
Date: Tue Oct 19 16:03:00 2004
New Revision: 505
Modified:
dbd-oracle/trunk/Changes
dbd-oracle/trunk/Makefile.PL
dbd-oracle/trunk/Oracle.pm
dbd-oracle/trunk/mkta.pl
Log:
Update docs
Modified: dbd-oracle/trunk/Changes
====================
====================
====================
==================
--- dbd-oracle/trunk/Changes (original)
+++ dbd-oracle/trunk/Changes Tue Oct 19 16:03:00 2004
@@ -1,9 +1,10 @@
-=head1 Changes in DBD-Oracle 1.16 (svn rev 442) 27th August 2004
+=head1 Changes in DBD-Oracle 1.16 (svn rev 505) 19th October 2004
NOTE:
This release has major changes to Unicode support. See below.
It no longer supports the old Oracle 7 OCI interface.
- With perl 5.6.x it requires DBI >= 1.38 for some of the tests.
+ It requires DBI >= 1.38 for some of the tests if using Perl 5.6.
+ It no longer supports Perl 5.5 or earlier.
Fixed placeholder names to be case insensitive thanks to Charles Jardine.
Fixed some LOB test problems with Oracle 8.1.7 by implementing ora_lob_append
Modified: dbd-oracle/trunk/Makefile.PL
====================
====================
====================
==================
--- dbd-oracle/trunk/Makefile.PL (original)
+++ dbd-oracle/trunk/Makefile.PL Tue Oct 19 16:03:00 2004
@@ -48,7 +48,7 @@
OBJECT => '$(O_FILES)',
DEFINE => '',
DIR => [],
- clean => { FILES => 'Oracle.xsi dll.base dll.exp sqlnet.log libOracle.def ora_explain mk.pm' },
+ clean => { FILES => 'xstmp.c Oracle.xsi dll.base dll.exp sqlnet.log libOracle.def ora_explain mk.pm' },
dist => {
DIST_DEFAULT => 'clean distcheck disttest tardist',
PREOP => '$(MAKE) -f Makefile.old distdir',
Modified: dbd-oracle/trunk/Oracle.pm
====================
====================
====================
==================
--- dbd-oracle/trunk/Oracle.pm (original)
+++ dbd-oracle/trunk/Oracle.pm Tue Oct 19 16:03:00 2004
@@ -1484,7 +1484,7 @@
=head2 Perl and Unicode
Perl began implementing Unicode with version 5.6, but the implementaion
-was not finalized until version 5.8 and later. If you plan to use Unicode
+did not mature until version 5.8 and later. If you plan to use Unicode
you are I<strongly> urged to use perl 5.8.2 or later and to I<carefully> read
the perl documention on Unicode:
@@ -1501,9 +1501,9 @@
Oracle supports many characters sets, including several different forms
of Unicode. These include:
- AL16UTF16 => valid for NCHAR columns (CSID=873)
+ AL16UTF16 => valid for NCHAR columns (CSID=2000)
UTF8 => valid for NCHAR columns (CSID=871), deprecated
- AL32UTF8 => valid for NCHAR and CHAR columns (CSID=2000)
+ AL32UTF8 => valid for NCHAR and CHAR columns (CSID=873)
When you create an Oracle database, you must specify the DATABASE
character set (used for DDL, DML and CHAR datatypes) and the NATIONAL
@@ -1554,7 +1554,7 @@
AL32UTF8 should be used in preference to UTF8 if it works for you,
which it should for Oracle 9.2 or later. If you're using an old
version of Oracle that doesn't support AL32UTF8 then you should
-avoid using any unicode characters that require surrogates, in other
+avoid using any Unicode characters that require surrogates, in other
words characters beyond the Unicode BMP (Basic Multilingual Plane).
That's because the character set that Oracle calls "UTF8" doesn't
@@ -1574,8 +1574,8 @@
strongly discouraged, such as the emittance of CESU-8 in output
files, markup language or other open transmission forms.
-Oracle use this internally because it collates (sorts) in the same order
-as UTF16 which is the basis of Oracle's internal collation definitions.
+Oracle uses this internally because it collates (sorts) in the same order
+as UTF16, which is the basis of Oracle's internal collation definitions.
Rather than change UTF8 for clients Oracle chose to define a new character
set called "AL32UTF8" which does conform to the UTF-8 standard.
@@ -1613,14 +1613,28 @@
B<Sending Data using Placeholders>
-DBD::Oracle allows for the insertion of any national character set
-character (determined by NLS_LANG/NLS_NCHAR), into NCHAR columns, and CHAR
-columns where the database character set is a wide character set --
-such as AL32UTF8. DBD::Oracle will also insert 8 bit characters into
-any of these columns when NLS_LANG contains a character set that
-permits it. To do this either:
+Data bound to a placeholder is assumed to be in the default client
+character set (specified by NLS_LANG) except for a few special
+cases. These are listed here with the highest precedence first:
- use DBD::Oracle qw( SQLCS_NCHAR );
+If the C<ora_csid> attribute is given to bind_param() then that
+is passed to Oracle and takes precedence.
+
+If the value is a Perl Unicode string (UTF-8) then DBD::Oracle
+ensures that Oracle uses the Unicode character set, regardless of
+the NLS_LANG and NLS_NCHAR settings.
+
+If the placeholder is for inserting an NCLOB then the client NLS_NCHAR
+character set is used. (That's useful but inconsistent with the other behaviour
+so may change. Best to be explicit by using the C<ora_csform>
+attribute.)
+
+If the C<ora_csform> attribute is given to bind_param() then that
+determines if the value should be assumed to be in the default
+(NLS_LANG) or NCHAR (NLS_NCHAR) client character set.
+
+
+ use DBD::Oracle qw( SQLCS_IMPLICIT SQLCS_NCHAR );
...
$sth->bind_param(1, $value, { ora_csform => SQLCS_NCHAR });
@@ -1628,18 +1642,12 @@
$dbh->{ora_ph_csform} = SQLCS_NCHAR; # default for all future placeholders
-If the string passed to bind_param() is considered by perl to be
-a valid utf8 string ( utf8::is_utf8($strin
g) returns true ), then
-DBD::Oracle will implicitly set csform SQLCS_NCHAR and csid AL32UTF8
-for you on insert.
-
B<Sending Data using SQL>
-If the prepared statement string is Unicode then we pass on that
-information to Oracle to ensure the string is correctly passed.
-[I think] Oracle will assume the statement is Unicode if NLS_LANG
-is AL32UTF8, but if NLS_LANG isn't but the statement string is, then
-Oracle needs to be told.
+Oracle assumes the SQL statement is in the default client character
+set (as specified by NLS_LANG). So Unicode strings containing
+non-ASCII characters should not be used unless the default client
+character set is AL32UTF8.
=head2 DBD::Oracle and Other Character Sets and Encodings
Modified: dbd-oracle/trunk/mkta.pl
====================
====================
====================
==================
--- dbd-oracle/trunk/mkta.pl (original)
+++ dbd-oracle/trunk/mkta.pl Tue Oct 19 16:03:00 2004
@@ -56,7 +56,8 @@
for my $ochar (@$charsets) {
for my $nchar (@$charsets) {
- next if $nchar eq ''; # because empty acts same as ochar
+ # because empty acts same as ochar
+ next if $nchar eq '' && $ochar ne '';
my ($tag, $fh) = start_test($sid, $ochar, $nchar);
$running{$tag} = $fh;
push @run, $tag;
|