Home  |  Linux  | Mysql  | PHP  | XML
From:byterock@cvs.perl.org Date:Fri Sep 12 12:44:16 2008
Subject:[svn:dbd-oracle] r11774 - dbd-oracle/branches/utf8_ea
Author: byterock
Date: Fri Sep 12 11:44:16 2008
New Revision: 11774

Modified:
   dbd-oracle/branches/utf8_ea/dbdimp.c
   dbd-oracle/branches/utf8_ea/dbdimp.h

Log:
a few more changes

Modified: dbd-oracle/branches/utf8_ea/dbdimp.c
==============================================================================
--- dbd-oracle/branches/utf8_ea/dbdimp.c	(original)
+++ dbd-oracle/branches/utf8_ea/dbdimp.c	Fri Sep 12 11:44:16 2008
@@ -54,6 +54,7 @@
 ub2 utf8_csid = 871;
 ub2 al32utf8_csid = 873;
 ub2 al16utf16_csid = 2000;
+ub2 we8mawin1252 = 178;
 
 typedef struct sql_fbh_st sql_fbh_t;
 struct sql_fbh_st {
@@ -530,13 +531,18 @@
 
 #ifdef NEW_OCI_INIT	/* XXX needs merging into use_proc_connection branch */
 
-		    /* Get CLIENT char and nchar charset id values */
+
+PerlIO_printf(DBILOGFP,"       charsetid=%d)\n",charsetid);
+
+		    /* Get CLIENT char and nchar charset id values*/
             OCINlsEnvironmentVariableGet_log_stat( &charsetid, 0, OCI_NLS_CHARSET_ID, 0, &rsize ,status );
             if (status != OCI_SUCCESS) {
                 oci_error(dbh, NULL, status,
                     "OCINlsEnvironmentVariableGet(OCI_NLS_CHARSET_ID) Check NLS settings etc.");
                 return 0;
             }
+PerlIO_printf(DBILOGFP,"       charsetid=%d)\n",charsetid);
+PerlIO_printf(DBILOGFP,"       ncharsetid=%d)\n",ncharsetid);
 
             OCINlsEnvironmentVariableGet_log_stat( &ncharsetid, 0, OCI_NLS_NCHARSET_ID, 0, &rsize ,status );
             if (status != OCI_SUCCESS) {
@@ -544,6 +550,7 @@
                     "OCINlsEnvironmentVariableGet(OCI_NLS_NCHARSET_ID) Check NLS settings etc.");
                 return 0;
             }
+PerlIO_printf(DBILOGFP,"   out    ncharsetid=%d)\n",ncharsetid);
 
 	    /*{
 	    After using OCIEnvNlsCreate() to create the environment handle,
@@ -617,6 +624,12 @@
             al32utf8_csid  = OCINlsCharSetNameToId(imp_dbh->envhp, (void*)"AL32UTF8");
             al16utf16_csid = OCINlsCharSetNameToId(imp_dbh->envhp, (void*)"AL16UTF16");
 
+            PerlIO_printf(DBILOGFP,"   in    we8mawin1252=%d)\n",ncharsetid);
+
+            we8mawin1252   = OCINlsCharSetNameToId(imp_dbh->envhp, (void*)"WE8MAWIN1252");
+
+            PerlIO_printf(DBILOGFP,"   out    we8mawin1252=%d)\n",ncharsetid);
+
 #else /* (the old init code) NEW_OCI_INIT */
         /* this is now depricated and will be removed as we no longer support <9.2 oracle*/
 	    /* XXX recent oracle docs recommend using OCIEnvCreate() instead of	*/
@@ -3149,7 +3162,7 @@
 		else if (CSFORM_IMPLIES_UTF8(SQLCS_NCHAR))
 		     csform = SQLCS_NCHAR;   /* else leave csform == 0 */
 
-		if (trace_level || dbd_verbose >= 1)
+		if (trace_level || dbd_verbose <= 1)
 			PerlIO_printf(DBILOGFP, "do_bind_array_exec() (2): rebinding %s with UTF8 value %s", phs->name,
 			(csform == SQLCS_IMPLICIT) ? "so setting csform=SQLCS_IMPLICIT" :
 			(csform == SQLCS_NCHAR)    ? "so setting csform=SQLCS_NCHAR" :
@@ -3175,17 +3188,19 @@
 	PerlIO_printf(DBILOGFP, "csid =%d\n",phs->csid);
 	PerlIO_printf(DBILOGFP, "csid_orig =%d\n",phs->csid_orig);
 	csid = (phs->csid) ? phs->csid : phs->csid_orig;
+PerlIO_printf(DBILOGFP, "csid =%d\n",csid);
+PerlIO_printf(DBILOGFP, "we8mawin1252 =%d csid=%d\n",we8mawin1252,csid);
 
-    PerlIO_printf(DBILOGFP, "csid =%d\n",csid);
+    PerlIO_printf(DBILOGFP, "CS_IS_UTF8_COMPATIBLE(csid) =%d\n",CS_IS_UTF8_COMPATIBLE(csid));
 	/* 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)) {
-//			croak("Can't mix utf8 and non-utf8 in array bind");
-//	    }
-		//csid = utf8_csid; /* not al32utf8_csid here on purpose */
+	    if ((utf8 & ARRAY_BIND_NATIVE) && !CS_IS_UTF8_COMPATIBLE(csid)) {
+			croak("Can't mix utf8 and non-utf8 in array bind");
+	    }
+		csid = utf8_csid; /* not al32utf8_csid here on purpose */
 	}
  PerlIO_printf(DBILOGFP, "csid after=%d\n",csid);
 	if (trace_level >= 3 || dbd_verbose <= 3 )

Modified: dbd-oracle/branches/utf8_ea/dbdimp.h
==============================================================================
--- dbd-oracle/branches/utf8_ea/dbdimp.h	(original)
+++ dbd-oracle/branches/utf8_ea/dbdimp.h	Fri Sep 12 11:44:16 2008
@@ -256,6 +256,7 @@
 extern ub2 ncharsetid;
 extern ub2 us7ascii_csid;
 extern ub2 utf8_csid;
+extern ub2 we8mawin1252;
 extern ub2 al32utf8_csid;
 extern ub2 al16utf16_csid;
 
@@ -263,7 +264,7 @@
    (  ( cs == utf8_csid ) || ( cs == al32utf8_csid ) )
 
 #define CS_IS_UTF8_COMPATIBLE( cs ) \
-  ( CS_IS_UTF8(cs) || ( (cs) == us7ascii_csid ) )
+  ( CS_IS_UTF8(cs) ||  (cs) == 873   )
 
 #define CS_IS_UTF16( cs ) ( cs == al16utf16_csid )
 
Navigate in group perl.dbd.oracle.changes at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants