Public feed #722089

Unnamed

public text v1 · immutable
Raw Edit
·published 2007-10-01 19:08 UTC
rendered paste body
[piggz@enterprise sqlite]$ svn diff
Index: sqlitecursor.cpp
===================================================================
--- sqlitecursor.cpp    (revision 695300)
+++ sqlitecursor.cpp    (working copy)
@@ -324,31 +324,35 @@
        }

        //debug
-/*
-       if (m_result == FetchOK && d->curr_coldata) {
+
+       if (((int)m_result == (int)FetchOK) && d->curr_coldata) {
                for (uint i=0;i<m_fieldCount;i++) {
                        KexiDBDrvDbg<<"col."<< i<<": "<< d->curr_colname[i]<<" "<< d->curr_colname[m_fieldCount+i]
                        << " = " << (d->curr_coldata[i] ? QString::fromLocal8Bit(d->curr_coldata[i]) : "(NULL)") <<endl;
                }
-//             KexiDBDrvDbg << "SQLiteCursor::drv_getNextRecord(): "<<m_fieldCount<<" col(s) fetched"<<endl;
-       }*/
+               KexiDBDrvDbg << "SQLiteCursor::drv_getNextRecord(): "<<m_fieldCount<<" col(s) fetched"<<endl;
+       }
 }

 void SQLiteCursor::drv_appendCurrentRecordToBuffer()
 {
-//     KexiDBDrvDbg << "SQLiteCursor::drv_appendCurrentRecordToBuffer():" <<endl;
+       KexiDBDrvDbg << "SQLiteCursor::drv_appendCurrentRecordToBuffer():" <<endl;
+
+       if (!d->curr_coldata)
+               return;
+
        if (!d->cols_pointers_mem_size)
                d->cols_pointers_mem_size = m_fieldCount * sizeof(char*);
        const char **record = (const char**)malloc(d->cols_pointers_mem_size);
        const char **src_col = d->curr_coldata;
        const char **dest_col = record;
        for (uint i=0; i<m_fieldCount; i++,src_col++,dest_col++) {
-//             KexiDBDrvDbg << i <<": '" << *src_col << "'" <<endl;
-//             KexiDBDrvDbg << "src_col: " << src_col << endl;
+               KexiDBDrvDbg << i <<": '" << *src_col << "'" <<endl;
+               KexiDBDrvDbg << "src_col: " << src_col << endl;
                *dest_col = *src_col ? strdup(*src_col) : 0;
        }
        d->records.insert(m_records_in_buf,record);
-//     KexiDBDrvDbg << "SQLiteCursor::drv_appendCurrentRecordToBuffer() ok." <<endl;
+       KexiDBDrvDbg << "SQLiteCursor::drv_appendCurrentRecordToBuffer() ok." <<endl;
 }

 void SQLiteCursor::drv_bufferMovePointerNext()