diff options
author | Timothy Pearson <[email protected]> | 2012-01-11 16:53:26 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-11 16:53:26 -0600 |
commit | c91e96258b6c127201397dd5309c4433655e63b2 (patch) | |
tree | 85682ed6f7056b51a95e85cf1711ffcc74588d34 /kexi/kexidb/drivers | |
parent | 5ec453c2580654ef1d9c019964fa3b9cf3c601a9 (diff) | |
download | koffice-c91e96258b6c127201397dd5309c4433655e63b2.tar.gz koffice-c91e96258b6c127201397dd5309c4433655e63b2.zip |
Apply a number of kexi patches
This closes Bug 777
Diffstat (limited to 'kexi/kexidb/drivers')
-rw-r--r-- | kexi/kexidb/drivers/pqxx/pqxxcursor.cpp | 8 | ||||
-rw-r--r-- | kexi/kexidb/drivers/sqlite/sqlitecursor.cpp | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp index afcad047..3b5de6f9 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp +++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp @@ -237,12 +237,20 @@ TQVariant pqxxSqlCursor::pValue(uint pos)const { return (*m_res)[at()][pos].as(double()); } + else if (f->type() == Field::Boolean ) + { + return QString((*m_res)[at()][pos].c_str()).lower() == "t" ? QVariant(true, 1) : QVariant(false, 1); + } else if (f->typeGroup() == Field::BLOBGroup) { // pqxx::result::field r = (*m_res)[at()][pos]; // kdDebug() << r.name() << ", " << r.c_str() << ", " << r.type() << ", " << r.size() << endl; return ::pgsqlByteaToByteArray((*m_res)[at()][pos]); } + else + { + return pgsqlCStrToVariant((*m_res)[at()][pos]); + } } else // We probably have a raw type query so use pqxx to determin the column type { diff --git a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp index 20d80f9c..fe6a78ea 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp @@ -324,19 +324,21 @@ void SQLiteCursor::drv_getNextRecord() } //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] ? TQString::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; + 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); |