From: <ibr...@us...> - 2012-01-02 17:03:30
|
Revision: 4203 http://tora.svn.sourceforge.net/tora/?rev=4203&view=rev Author: ibre5041 Date: 2012-01-02 17:03:23 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Fix for UTF8 character - problem reported by TS. Modified Paths: -------------- trunk/tora/src/trotl/src/trotl_string.h Modified: trunk/tora/src/trotl/src/trotl_string.h =================================================================== --- trunk/tora/src/trotl/src/trotl_string.h 2011-12-30 19:42:04 UTC (rev 4202) +++ trunk/tora/src/trotl/src/trotl_string.h 2012-01-02 17:03:23 UTC (rev 4203) @@ -62,23 +62,23 @@ { BindParVarchar(unsigned int pos, SqlStatement &stmt, ColumnType &ct) : SqlStatement::BindPar(pos, stmt, ct) { - /* amount of bytes = (string length +1 ) * (array length) */ - valuep = (void**) calloc(_cnt, ct._width + 1); + /* amount of bytes = (string length +1 ) * 4 * (array length) */ + valuep = (void**) calloc(_cnt, (ct._width + 1) * 4); alenp = (ub2*) calloc(_cnt, sizeof(ub4)); dty = SQLT_STR; - value_sz = ct._width + 1; + value_sz = (ct._width + 1) * 4; type_name = typeid(tstring).name(); } BindParVarchar(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl) : SqlStatement::BindPar(pos, stmt, decl) { // amount of bytes = (string length +1 ) * (array length) - valuep = (void**) calloc(decl.bracket[0]+1, decl.bracket[1]); + valuep = (void**) calloc(decl.bracket[1], (decl.bracket[0] + 1 ) * 4); alenp = (ub2*) calloc(_cnt, sizeof(ub2)); dty = SQLT_STR; - value_sz = decl.bracket[0]+1; + value_sz = (decl.bracket[0] + 1 ) * 4; type_name = typeid(tstring).name(); } @@ -100,21 +100,21 @@ { BindParChar(unsigned int pos, SqlStatement &stmt, ColumnType &ct) : SqlStatement::BindPar(pos, stmt, ct) { - valuep = (void**) calloc(_cnt, ct._width + 1); // TODO +1 ?? why? + valuep = (void**) calloc(_cnt, (ct._width + 1) * 4); // TODO +1 ?? why? alenp = (ub2*) calloc(_cnt, sizeof(ub4)); dty = SQLT_CHR; - value_sz = ct._width; + value_sz = ct._width * 4; type_name = typeid(tstring).name(); } BindParChar(unsigned int pos, SqlStatement &stmt, BindVarDecl &decl): SqlStatement::BindPar(pos, stmt, decl) { - valuep = (void**) calloc(decl.bracket[1], decl.bracket[0]); + valuep = (void**) calloc(decl.bracket[1], (decl.bracket[0] + 1) * 4); alenp = (ub2*) calloc(_cnt, sizeof(ub2)); dty = SQLT_STR; /* use STR_CHR even if placeholder defined as "char" */ - value_sz = decl.bracket[0]; + value_sz = (decl.bracket[0] + 1) * 4; type_name = typeid(tstring).name(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |