Date: Wednesday, November 30, 2005 @ 10:18:21
  Author: gilles
    Path: /cvsroot/carob/libmysequoia/src

Modified: libmysequoia.cpp (1.1 -> 1.2)

ResultSet refactoring:
. Added toString() implementation for all types (that are currently supported 
by serialization)
. Changed ResultSet data storage implementation: instead of using void* for all 
data-types,
a union ResultSetDataType has been introduced to store basic types (int, float, 
...)
Complex types are still using void* but inside this union.
Implications:
  - columnTypeTags vector has been introduced to store the data-types of the 
columns
  - deserializers now return the union instead of void*
  - creation of a 'null values matrix' to store null values (we can't return 
NULL anymore)
  - introduction of isNull(int) and wasNull() functions
  - getXXX (for now getString and getInt) now return values instead of pointers
  - all tests and contribs have been modified to take the getXXX change into 
account


------------------+
 libmysequoia.cpp |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)


Index: libmysequoia/src/libmysequoia.cpp
diff -u libmysequoia/src/libmysequoia.cpp:1.1 
libmysequoia/src/libmysequoia.cpp:1.2
--- libmysequoia/src/libmysequoia.cpp:1.1       Mon Nov 28 10:20:40 2005
+++ libmysequoia/src/libmysequoia.cpp   Wed Nov 30 10:18:21 2005
@@ -176,7 +176,7 @@
        }
        
 //TODO Fill the mysqlPtr structure
-       ConnectionParameters connectionParameters(toWString(host), port ? port 
: 25322, toWString(db), toWString(user), toWString(passwd), DEBUG_LEVEL_DEBUG);
+       ConnectionParameters connectionParameters(fromString(host), port ? port 
: 25322, fromString(db), fromString(user), fromString(passwd), 
DEBUG_LEVEL_DEBUG);
 
        try {
                connectionPtr = 
connectionPool->connectToController(connectionParameters);
@@ -194,7 +194,7 @@
        try {
                if (drsPtr) delete drsPtr;
 
-               if (stmtPtr->execute(toWString(query)))
+               if (stmtPtr->execute(fromString(query)))
                        mysqlPtr->my.affected_rows = 0;
                else
                        mysqlPtr->my.affected_rows = stmtPtr->getUpdateCount();
@@ -238,12 +238,9 @@
                        for (unsigned i=0; i<mysqlPtr->my.field_count; i++)
                        {
                                char s[200];
-                               int32_t *iPtr = drsPtr->getInt(i+1);
-                               if (iPtr) {
-                                       sprintf(s,"%d",*iPtr);
-                                       row[i] = new char[strlen(s)+1];
-                                       strcpy(row[i],s);
-                               }
+                               sprintf(s,"%d",drsPtr->getInt(i+1));
+                               row[i] = new char[strlen(s)+1];
+                               strcpy(row[i],s);
                        }
                        
                        mysqlPtr->my.affected_rows = 
drsPtr->getNumberOfRowsInMemory();

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

Reply via email to