Date: Wednesday, August 2, 2006 @ 17:55:26
  Author: csaba
    Path: /cvsroot/carob/libmysequoia/src

Modified: CarobStmt.cpp (1.36 -> 1.37)

Try to set the real string length instead of the whole buffer size what was 
returned earlier if the user does not set the correct size. If we have garbage 
in the buffer we got CodecException from Carob. This is a workaround to avoid 
it.


---------------+
 CarobStmt.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: libmysequoia/src/CarobStmt.cpp
diff -u libmysequoia/src/CarobStmt.cpp:1.36 libmysequoia/src/CarobStmt.cpp:1.37
--- libmysequoia/src/CarobStmt.cpp:1.36 Tue Aug  1 18:16:21 2006
+++ libmysequoia/src/CarobStmt.cpp      Wed Aug  2 17:55:26 2006
@@ -342,7 +342,8 @@
                   if (p->long_data_used && LONGDATAFIELD(p))
                     c_stmt->setString(no, to_wstring(*(string 
*)LONGDATAFIELD(p)));
                   else
-                    c_stmt->setString(no, to_wstring(string((char *)p->buffer, 
p->buffer_length)));
+                    // FIXME: can we use strnlen on string???
+                    c_stmt->setString(no, to_wstring(string((char *)p->buffer, 
strnlen((char *)p->buffer, p->buffer_length))));
                   break;
                 case MYSQL_TYPE_TIME:
                 case MYSQL_TYPE_DATE:

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to