From: Raj T. <win...@us...> - 2005-04-02 12:25:44
|
Update of /cvsroot/tora/tora In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20117 Modified Files: NEWS configure.pl otlv4.h tooracleconnection.cpp Log Message: otl 4.0.110 + fix for bug 1115326 Index: NEWS =================================================================== RCS file: /cvsroot/tora/tora/NEWS,v retrieving revision 1.979 retrieving revision 1.980 diff -C2 -d -r1.979 -r1.980 *** NEWS 21 Mar 2005 23:56:31 -0000 1.979 --- NEWS 2 Apr 2005 12:24:57 -0000 1.980 *************** *** 7,10 **** --- 7,12 ---- 2005-03-20: Added support for type TIMESTAMP in column listing in table browser 2005-03-20: Fix bug with NVARCHAR2/NCHAR2 field size in browser (new query for oracle 9) + 2005-04-02: updated otl to 4.0.110 + 2005-04-02: Fix bug with NVARCHAR2/NCHAR2 fields not displaying properly (Bug# 1115326) 1.3.16: 2005-03-04 Index: tooracleconnection.cpp =================================================================== RCS file: /cvsroot/tora/tora/tooracleconnection.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** tooracleconnection.cpp 21 Mar 2005 20:07:16 -0000 1.93 --- tooracleconnection.cpp 2 Apr 2005 12:24:58 -0000 1.94 *************** *** 456,459 **** --- 456,466 ---- break; } + #ifdef OTL_ORA_UNICODE + if (description[i].charset_form==2 && + ((desc.Datatype==QString::fromLatin1("VARCHAR2")) || + (desc.Datatype==QString::fromLatin1("CHAR")))) { + desc.Datatype=QString::fromLatin1("N")+desc.Datatype; + } + #endif if (desc.Datatype==QString::fromLatin1("NUMBER")) { *************** *** 473,477 **** desc.Datatype.append(QString::fromLatin1(")")); } ! } else { desc.Datatype.append(QString::fromLatin1(" (")); --- 480,491 ---- desc.Datatype.append(QString::fromLatin1(")")); } ! } ! #ifdef OTL_ORA_UNICODE ! else if (desc.Datatype==QString::fromLatin1("NVARCHAR2") || desc.Datatype==QString::fromLatin1("NCHAR")) { ! desc.Datatype.append(QString::fromLatin1(" (")); ! desc.Datatype.append(QString::number(description[i].char_size)); ! desc.Datatype.append(QString::fromLatin1(")")); ! } ! #endif else { desc.Datatype.append(QString::fromLatin1(" (")); Index: otlv4.h =================================================================== RCS file: /cvsroot/tora/tora/otlv4.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** otlv4.h 21 Mar 2005 04:17:20 -0000 1.22 --- otlv4.h 2 Apr 2005 12:24:58 -0000 1.23 *************** *** 1,4 **** // ============================================================== ! // Oracle, ODBC and DB2/CLI Template Library, Version 4.0.109, // Copyright (C) Sergei Kuchin, 1996,2005 // Author: Sergei Kuchin --- 1,4 ---- // ============================================================== ! // Oracle, ODBC and DB2/CLI Template Library, Version 4.0.110, // Copyright (C) Sergei Kuchin, 1996,2005 // Author: Sergei Kuchin *************** *** 12,16 **** #define __OTL_H__ ! #define OTL_VERSION_NUMBER (0x04006DL) #include <string.h> --- 12,16 ---- #define __OTL_H__ ! #define OTL_VERSION_NUMBER (0x04006EL) #include <string.h> *************** *** 319,323 **** if(sqlstm_label) \ OTL_TRACE_STREAM<<", label="<<sqlstm_label; \ ! OTL_TRACE_STREAM<<");" \ <<OTL_TRACE_LINE_SUFFIX; \ } --- 319,323 ---- if(sqlstm_label) \ OTL_TRACE_STREAM<<", label="<<sqlstm_label; \ ! OTL_TRACE_STREAM<<");" \ <<OTL_TRACE_LINE_SUFFIX; \ } *************** *** 738,742 **** #if defined(OTL_VALUE_TEMPLATE_ON) && !defined(OTL_STL) && !defined(OTL_ACE) #define STD_NAMESPACE_PREFIX ! #if defined(_MSC_VER) && (_MSC_VER >= 1300) #include <iostream> using namespace std; --- 738,742 ---- #if defined(OTL_VALUE_TEMPLATE_ON) && !defined(OTL_STL) && !defined(OTL_ACE) #define STD_NAMESPACE_PREFIX ! #if (defined(_MSC_VER)&&(_MSC_VER>=1300))||defined(OTL_ANSI_CPP) #include <iostream> using namespace std; *************** *** 1168,1171 **** --- 1168,1175 ---- int prec; int nullok; + #if defined(OTL_ORA_UNICODE) + int charset_form; + int char_size; + #endif otl_column_desc() *************** *** 1179,1182 **** --- 1183,1190 ---- prec=0; nullok=0; + #if defined(OTL_ORA_UNICODE) + charset_form=0; + char_size=0; + #endif } *************** *** 1206,1209 **** --- 1214,1222 ---- prec=desc.prec; nullok=desc.nullok; + #if defined(OTL_ORA_UNICODE) + charset_form=desc.charset_form; + char_size=desc.char_size; + #endif + return *this; } *************** *** 2778,2782 **** null_flag=new short[tab_size]; p_null=null_flag; ! p_v=(unsigned char*)v; elem_size=sizeof(T); for(i=0;i<atab_size;++i) --- 2791,2795 ---- null_flag=new short[tab_size]; p_null=null_flag; ! p_v=OTL_RCAST(unsigned char*,v); elem_size=sizeof(T); for(i=0;i<atab_size;++i) *************** *** 2816,2820 **** null_flag=new short[tab_size]; p_null=null_flag; ! p_v=(unsigned char*)v; elem_size=sizeof(otl_oracle_date); for(i=0;i<atab_size;++i) --- 2829,2833 ---- null_flag=new short[tab_size]; p_null=null_flag; ! p_v=OTL_RCAST(unsigned char*,v); elem_size=sizeof(otl_oracle_date); for(i=0;i<atab_size;++i) *************** *** 3330,3334 **** const int column_ndx) { ! TVariableStruct::map_ftype(desc,max_long_size,aftype,aelem_size,override,column_ndx); } --- 3343,3353 ---- const int column_ndx) { ! TVariableStruct::map_ftype ! (desc, ! max_long_size, ! aftype, ! aelem_size, ! override, ! column_ndx); } *************** *** 4781,4784 **** --- 4800,4807 ---- j+1); sl[j].copy_pos(j+1); + #if defined(OTL_ORA_UNICODE) + if(sl_desc_tmp[j].charset_form==2) + sl[j].var_struct.nls_flag=true; + #endif sl[j].init(ftype, elem_size, *************** *** 6288,6292 **** } }else ! memcpy(OTL_RCAST(char*,this->vl[cur_x]->val()),OTL_RCAST(char*,tab.val()), tab.elem_size*tmp_len); for(i=0;i<tmp_len;++i){ --- 6311,6316 ---- } }else ! memcpy(OTL_RCAST(char*,this->vl[cur_x]->val()), ! OTL_RCAST(char*,tab.val()), tab.elem_size*tmp_len); for(i=0;i<tmp_len;++i){ *************** *** 7026,7032 **** } #if (defined(OTL_STL) || defined(USER_DEFINED_STRING_CLASS)) && !defined(OTL_ACE) ! s.assign((char*)temp_buf,len); #elif defined(OTL_ACE) ! s.set((char*)temp_buf,len,1); #endif --- 7050,7056 ---- } #if (defined(OTL_STL) || defined(USER_DEFINED_STRING_CLASS)) && !defined(OTL_ACE) ! s.assign(OTL_RCAST(char*,temp_buf),len); #elif defined(OTL_ACE) ! s.set(OTL_RCAST(char*,temp_buf),len,1); #endif *************** *** 7964,7969 **** #if (ODBCVER >= 0x0300) ! status=SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION, ! OTL_RCAST(void*,SQL_OV_ODBC3),SQL_NTS); if(status!=SQL_SUCCESS&&status!=SQL_SUCCESS_WITH_INFO)return 0; #endif --- 7988,7996 ---- #if (ODBCVER >= 0x0300) ! status=SQLSetEnvAttr ! (henv, ! SQL_ATTR_ODBC_VERSION, ! OTL_RCAST(void*,SQL_OV_ODBC3), ! SQL_NTS); if(status!=SQL_SUCCESS&&status!=SQL_SUCCESS_WITH_INFO)return 0; #endif *************** *** 7983,7987 **** (hdbc, SQL_ATTR_AUTOCOMMIT, ! (SQLPOINTER)SQL_AUTOCOMMIT_ON, SQL_IS_POINTER); else --- 8010,8014 ---- (hdbc, SQL_ATTR_AUTOCOMMIT, ! OTL_RCAST(SQLPOINTER,SQL_AUTOCOMMIT_ON), SQL_IS_POINTER); else *************** *** 7989,7993 **** (hdbc, SQL_ATTR_AUTOCOMMIT, ! (SQLPOINTER)SQL_AUTOCOMMIT_OFF, SQL_IS_POINTER); #else --- 8016,8020 ---- (hdbc, SQL_ATTR_AUTOCOMMIT, ! OTL_RCAST(SQLPOINTER,SQL_AUTOCOMMIT_OFF), SQL_IS_POINTER); #else *************** *** 8019,8023 **** (hdbc, SQL_ATTR_LONGDATA_COMPAT, ! (SQLPOINTER)SQL_LD_COMPAT_YES, SQL_IS_INTEGER); if(status!=SQL_SUCCESS&&status!=SQL_SUCCESS_WITH_INFO)return 0; --- 8046,8050 ---- (hdbc, SQL_ATTR_LONGDATA_COMPAT, ! OTL_RCAST(SQLPOINTER,SQL_LD_COMPAT_YES), SQL_IS_INTEGER); if(status!=SQL_SUCCESS&&status!=SQL_SUCCESS_WITH_INFO)return 0; *************** *** 8116,8120 **** (hdbc, SQL_ATTR_AUTOCOMMIT, ! (SQLPOINTER)SQL_AUTOCOMMIT_ON, SQL_IS_POINTER); #else --- 8143,8147 ---- (hdbc, SQL_ATTR_AUTOCOMMIT, ! OTL_RCAST(SQLPOINTER,SQL_AUTOCOMMIT_ON), SQL_IS_POINTER); #else *************** *** 8137,8141 **** (hdbc, SQL_ATTR_AUTOCOMMIT, ! (SQLPOINTER)SQL_AUTOCOMMIT_OFF, SQL_IS_POINTER); #else --- 8164,8168 ---- (hdbc, SQL_ATTR_AUTOCOMMIT, ! OTL_RCAST(SQLPOINTER,SQL_AUTOCOMMIT_OFF), SQL_IS_POINTER); #else *************** *** 8617,8623 **** --- 8644,8663 ---- case SQL_CHAR: return SQL_C_CHAR; case SQL_VARCHAR: return SQL_C_CHAR; + #if defined(SQL_WCHAR) + case SQL_WCHAR: return SQL_C_CHAR; + #else + case -8: return SQL_C_CHAR; + #endif + #if defined(SQL_WVARCHAR) case SQL_WVARCHAR: return SQL_C_CHAR; + #else + case -9: return SQL_C_CHAR; + #endif case SQL_LONGVARCHAR: return SQL_LONGVARCHAR; + #if defined(SQL_WLONGVARCHAR) case SQL_WLONGVARCHAR: return SQL_LONGVARCHAR; + #else + case -10: return SQL_LONGVARCHAR; + #endif case OTL_SQL_UNICODE_VARCHAR: return SQL_C_CHAR; case OTL_SQL_UNICODE_CHAR: return SQL_C_CHAR; *************** *** 9310,9314 **** const int name_pos, const int /* apl_tab_size */) ! {OTL_SQLSMALLINT ftype=(OTL_SQLSMALLINT)tmpl_ftype2odbc_ftype(aftype); OTL_SQLSMALLINT ftype_save=ftype; int param_type; --- 9350,9354 ---- const int name_pos, const int /* apl_tab_size */) ! {OTL_SQLSMALLINT ftype=OTL_SCAST(OTL_SQLSMALLINT,tmpl_ftype2odbc_ftype(aftype)); OTL_SQLSMALLINT ftype_save=ftype; int param_type; *************** *** 9405,9411 **** --- 9445,9453 ---- #endif OTL_SQLINTEGER buflen=0; + #if defined(OTL_UNICODE) if(ftype==SQL_C_WCHAR) buflen=aelem_size*sizeof(OTL_CHAR); else + #endif buflen=aelem_size; status=SQLBindParameter *************** *** 9464,9469 **** --- 9506,9513 ---- }else{ SQLINTEGER buflen=elem_size; + #if defined(OTL_UNICODE) if(ftype==SQL_C_WCHAR||ftype==SQL_WLONGVARCHAR) buflen=elem_size*sizeof(OTL_CHAR); + #endif status=SQLBindCol (cda, *************** *** 17624,17628 **** #ifdef OTL_UNICODE if(ftype==otl_var_char) ! var_elem_size=elem_size*sizeof(OTL_WCHAR); else if(ftype==otl_var_varchar_long) var_elem_size=elem_size; --- 17668,17672 ---- #ifdef OTL_UNICODE if(ftype==otl_var_char) ! var_elem_size=elem_size*sizeof(OTL_WCHAR);// ### else if(ftype==otl_var_varchar_long) var_elem_size=elem_size; *************** *** 17947,17950 **** --- 17991,18016 ---- OTL_RCAST(OCIError*,errhp)); if(status!=OCI_SUCCESS)return 0; + #if defined(OTL_ORA_UNICODE) + ub1 charset_form; + status=OCIAttrGet + (OTL_RCAST(dvoid*,pard), + OTL_SCAST(ub4,OCI_DTYPE_PARAM), + OTL_RCAST(dvoid*,&charset_form), + 0, + OTL_SCAST(ub4,OCI_ATTR_CHARSET_FORM), + OTL_RCAST(OCIError*,errhp)); + if(status!=OCI_SUCCESS)return 0; + col.charset_form=OTL_SCAST(int,charset_form); + ub2 char_size; + status=OCIAttrGet + (OTL_RCAST(dvoid*,pard), + OTL_SCAST(ub4,OCI_DTYPE_PARAM), + OTL_RCAST(dvoid*,&char_size), + 0, + OTL_SCAST(ub4,OCI_ATTR_CHAR_SIZE), + OTL_RCAST(OCIError*,errhp)); + if(status!=OCI_SUCCESS)return 0; + col.char_size=OTL_SCAST(int,char_size); + #endif col.dbtype=dtype; status=OCIAttrGet Index: configure.pl =================================================================== RCS file: /cvsroot/tora/tora/configure.pl,v retrieving revision 1.183 retrieving revision 1.184 diff -C2 -d -r1.183 -r1.184 *** configure.pl 21 Mar 2005 20:36:02 -0000 1.183 --- configure.pl 2 Apr 2005 12:24:58 -0000 1.184 *************** *** 1270,1273 **** --- 1270,1274 ---- print MAKEFILE "# OTL_ORA8I - Compile for Oracle 8.1.x\n"; print MAKEFILE "# OTL_ORA8 - Compile for Oracle 8.0.x\n"; + print MAKEFILE "# OTL_ORA_UNICODE - Add (some) support for UNICODE\n"; print MAKEFILE "# OTL_ORA_TIMESTAMP - Include support for timestamps\n"; print MAKEFILE "# TO_NEW_CHECK - Disable new version check globally\n"; *************** *** 1277,1285 **** print MAKEFILE "DEFINES+=-DOTL_ORA8 -DOTL_ANSI_CPP\n"; } elsif ($OracleRelease ge "9") { ! print MAKEFILE "DEFINES+=-DOTL_ORA9I -DOTL_ORA_TIMESTAMP -DOTL_ANSI_CPP\n"; } elsif (!$OracleFound) { print MAKEFILE "DEFINES+=-DTO_NO_ORACLE -DOTL_ANSI_CPP\n"; } else { ! print MAKEFILE "DEFINES+=-DOTL_ORA8I -DOTL_ORA_TIMESTAMP -DOTL_ANSI_CPP\n"; } if (!$NewCheck) { --- 1278,1286 ---- print MAKEFILE "DEFINES+=-DOTL_ORA8 -DOTL_ANSI_CPP\n"; } elsif ($OracleRelease ge "9") { ! print MAKEFILE "DEFINES+=-DOTL_ORA9I -DOTL_ORA_UNICODE -DOTL_ORA_TIMESTAMP -DOTL_ANSI_CPP\n"; } elsif (!$OracleFound) { print MAKEFILE "DEFINES+=-DTO_NO_ORACLE -DOTL_ANSI_CPP\n"; } else { ! print MAKEFILE "DEFINES+=-DOTL_ORA8I -DOTL_ORA_UNICODE -DOTL_ORA_TIMESTAMP -DOTL_ANSI_CPP\n"; } if (!$NewCheck) { |