Author: byterock
Date: Fri Dec 5 09:10:26 2008
New Revision: 12141
Modified:
dbd-oracle/trunk/dbdimp.c
dbd-oracle/trunk/dbdimp.h
dbd-oracle/trunk/t/26exe_array.t
Log:
This should be the next release. I cleaned up the 26array test it will now
make sure the csid is us7ascii which is the only one that will cause the bug
Modified: dbd-oracle/trunk/dbdimp.c
==============================================================================
--- dbd-oracle/trunk/dbdimp.c (original)
+++ dbd-oracle/trunk/dbdimp.c Fri Dec 5 09:10:26 2008
@@ -3167,7 +3167,7 @@
(csform == SQLCS_IMPLICIT) ? "so setting
csform=SQLCS_IMPLICIT" :
(csform == SQLCS_NCHAR) ? "so setting
csform=SQLCS_NCHAR" :
"but neither CHAR nor NCHAR are unicode\n");
- }
+ }
if (csform) {
/* set OCI_ATTR_CHARSET_FORM before we get the default
OCI_ATTR_CHARSET_ID */
@@ -3186,14 +3186,12 @@
/* if app has specified a csid then use that, else use default */
csid = (phs->csid) ? phs->csid : phs->csid_orig;
-
-
/* if data is utf8 but charset isn't then switch to utf8 csid if
possible */
if ((utf8 & ARRAY_BIND_UTF8) && !CS_IS_UTF8(csid)) {
/* if the specified or default csid is not utf8 _compatible_ AND we
have
* mixed utf8 and native (non-utf8) data, then it's a fatal problem
* utf8 _compatible_ means, can be upgraded to utf8, ie. utf8 or
ascii */
- if ((utf8 & ARRAY_BIND_NATIVE) && !CS_IS_UTF8_COMPATIBLE(csid)) {
+ if ((utf8 & ARRAY_BIND_NATIVE) && CS_IS_NOT_UTF8_COMPATIBLE(csid)) {
oratext charsetname[OCI_NLS_MAXBUFSZ];
OCINlsCharSetIdToName(imp_sth->envhp,charsetname, sizeof(charsetname),csid );
@@ -3205,9 +3203,7 @@
err_svs[1] = newSVpvf("DBD Oracle Warning: You
have mixed utf8 and non-utf8 in an array bind in parameter#%d. This may result
in corrupt data. The Query charset id=%d,
name=%s",parma_index+1,csid,charsetname);
av_store(tuples_status_av,SvIV(item),newRV_noinc((SV *)(av_make(2, err_svs))));
}
- /*av_store(tuples_status_av,tuple_index,
- newRV_noinc((SV *)(av_make(2, err_svs))));
-*/
+
}
Modified: dbd-oracle/trunk/dbdimp.h
==============================================================================
--- dbd-oracle/trunk/dbdimp.h (original)
+++ dbd-oracle/trunk/dbdimp.h Fri Dec 5 09:10:26 2008
@@ -263,8 +263,8 @@
#define CS_IS_UTF8( cs ) \
( ( cs == utf8_csid ) || ( cs == al32utf8_csid ) )
-#define CS_IS_UTF8_COMPATIBLE( cs ) \
- ( CS_IS_UTF8(cs) || ( (cs) == us7ascii_csid ) )
+#define CS_IS_NOT_UTF8_COMPATIBLE( cs ) \
+ ( cs == us7ascii_csid )
#define CS_IS_UTF16( cs ) ( cs == al16utf16_csid )
Modified: dbd-oracle/trunk/t/26exe_array.t
==============================================================================
--- dbd-oracle/trunk/t/26exe_array.t (original)
+++ dbd-oracle/trunk/t/26exe_array.t Fri Dec 5 09:10:26 2008
@@ -27,11 +27,12 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
$ENV{NLS_NCHAR} = "US7ASCII";
+$ENV{NLS_LANG} = "AMERICAN";
my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
AutoCommit=>1,
PrintError => 0,
- ora_envhp => 0});
-
+ ora_envhp => 0,
+ });
# check that our db handle is good
isa_ok($dbh, "DBI::db");
@@ -168,7 +169,7 @@
drop_table($dbh);
-
+#dbh->{dbd_verbose}=0;
$dbh->disconnect;
1;