summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/kexidb')
-rw-r--r--kexi/kexidb/alter.cpp2
-rw-r--r--kexi/kexidb/connection.cpp10
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxcursor.cpp8
-rw-r--r--kexi/kexidb/drivers/sqlite/sqlitecursor.cpp8
-rw-r--r--kexi/kexidb/expression.cpp8
-rw-r--r--kexi/kexidb/fieldlist.cpp2
-rw-r--r--kexi/kexidb/fieldvalidator.cpp2
-rw-r--r--kexi/kexidb/queryschema.cpp2
8 files changed, 24 insertions, 18 deletions
diff --git a/kexi/kexidb/alter.cpp b/kexi/kexidb/alter.cpp
index f4a1346f..8566d4df 100644
--- a/kexi/kexidb/alter.cpp
+++ b/kexi/kexidb/alter.cpp
@@ -223,7 +223,7 @@ TQString AlterTableHandler::ChangeFieldPropertyAction::debugString(const DebugOp
static AlterTableHandler::ActionDict* createActionDict(
AlterTableHandler::ActionDictDict &fieldActions, int forFieldUID )
{
- AlterTableHandler::ActionDict* dict = new AlterTableHandler::ActionDict(101, false);
+ AlterTableHandler::ActionDict* dict = new AlterTableHandler::ActionDict(1009, false);
dict->setAutoDelete(true);
fieldActions.insert( forFieldUID, dict );
return dict;
diff --git a/kexi/kexidb/connection.cpp b/kexi/kexidb/connection.cpp
index 017e75e4..a5b962da 100644
--- a/kexi/kexidb/connection.cpp
+++ b/kexi/kexidb/connection.cpp
@@ -83,10 +83,10 @@ class ConnectionPrivate
ConnectionPrivate(Connection* const conn, ConnectionData &conn_data)
: conn(conn)
, conn_data(&conn_data)
- , tableSchemaChangeListeners(101)
+ , tableSchemaChangeListeners(1009)
, m_parser(0)
- , tables_byname(101, false)
- , queries_byname(101, false)
+ , tables_byname(1009, false)
+ , queries_byname(1009, false)
, kexiDBSystemTables(101)
, dont_remove_transactions(false)
, skip_databaseExists_check_in_useDatabase(false)
@@ -104,8 +104,8 @@ class ConnectionPrivate
queries_byname.setAutoDelete(false);//queries is owner, not me
//reasonable sizes: TODO
- tables.resize(101);
- queries.resize(101);
+ tables.resize(1009);
+ queries.resize(1009);
}
~ConnectionPrivate()
{
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);
diff --git a/kexi/kexidb/expression.cpp b/kexi/kexidb/expression.cpp
index d9a33b4c..b60cd505 100644
--- a/kexi/kexidb/expression.cpp
+++ b/kexi/kexidb/expression.cpp
@@ -400,13 +400,9 @@ Field::Type BinaryExpr::type()
if (ltInt && rtInt)
return KexiDB::maximumForIntegerTypes(lt, rt);
- if (Field::isFPNumericType(lt) && rtInt)
+ if (Field::isFPNumericType(lt) && (rtInt || lt==rt))
return lt;
- if (Field::isFPNumericType(rt) && ltInt)
- return rt;
- if ((lt==Field::Double || lt==Field::Float) && rtInt)
- return lt;
- if ((rt==Field::Double || rt==Field::Float) && ltInt)
+ if (Field::isFPNumericType(rt) && (ltInt || lt==rt))
return rt;
return Field::Boolean;
diff --git a/kexi/kexidb/fieldlist.cpp b/kexi/kexidb/fieldlist.cpp
index 292ba75e..7304ed37 100644
--- a/kexi/kexidb/fieldlist.cpp
+++ b/kexi/kexidb/fieldlist.cpp
@@ -28,7 +28,7 @@ using namespace KexiDB;
FieldList::FieldList(bool owner)
//reasonable sizes: TODO
- : m_fields_by_name(101, false)
+ : m_fields_by_name(1009, false)
{
m_fields.setAutoDelete( owner );
m_fields_by_name.setAutoDelete( false );
diff --git a/kexi/kexidb/fieldvalidator.cpp b/kexi/kexidb/fieldvalidator.cpp
index 57f8bd8d..3b08301c 100644
--- a/kexi/kexidb/fieldvalidator.cpp
+++ b/kexi/kexidb/fieldvalidator.cpp
@@ -36,7 +36,7 @@ FieldValidator::FieldValidator( const Field &field, TQWidget * parent, const cha
if (field.isIntegerType()) {
TQValidator *validator = 0;
const bool u = field.isUnsigned();
- int bottom, top;
+ int bottom = 0, top = 0;
if (t==Field::Byte) {
bottom = u ? 0 : -0x80;
top = u ? 0xff : 0x7f;
diff --git a/kexi/kexidb/queryschema.cpp b/kexi/kexidb/queryschema.cpp
index 47e5d95c..8c5f1a1f 100644
--- a/kexi/kexidb/queryschema.cpp
+++ b/kexi/kexidb/queryschema.cpp
@@ -1439,7 +1439,7 @@ void QuerySchema::computeFieldsExpanded()
}
//remove duplicates for lookup fields
- TQDict<uint> lookup_dict(101); //used to fight duplicates and to update QueryColumnInfo::indexForVisibleLookupValue()
+ TQDict<uint> lookup_dict(1009); //used to fight duplicates and to update QueryColumnInfo::indexForVisibleLookupValue()
// (a mapping from table.name string to uint* lookupFieldIndex
lookup_dict.setAutoDelete(true);
i=0;