[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/kexi/kexidb/drivers/mySQL
From: Jaroslaw Staniek <js () iidea ! pl>
Date: 2003-09-18 17:40:14
[Download RAW message or body]
CVS commit by staniek:
Cursor::m_fieldCount reused in mysql impl.
M +4 -4 mysqlcursor.cpp 1.5
M +4 -1 mysqlcursor.h 1.5
--- koffice/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp #1.4:1.5
@@ -27,5 +27,5 @@ using namespace KexiDB;
MySqlCursor::MySqlCursor(KexiDB::Connection* conn, const QString& statement, uint cursor_options)
: Cursor(conn,statement,cursor_options), m_res(0),m_row(0),
- m_lengths(0),m_numFields(0),m_numRows(0)
+ m_lengths(0),m_numRows(0)
{
}
@@ -47,5 +47,5 @@ bool MySqlCursor::drv_open() {
if(mysql_errno(conn->m_mysql) == 0) {
m_res= mysql_store_result(conn->m_mysql);
- m_numFields=mysql_num_fields(m_res);
+ m_fieldCount=mysql_num_fields(m_res);
m_readAhead=m_numRows=mysql_num_rows(m_res);
m_at=0;
@@ -72,5 +72,5 @@ bool MySqlCursor::drv_close() {
m_res=0;
m_row=0;
- m_numFields=0;
+//js: done in superclass: m_numFields=0;
m_lengths=0;
m_opened=false;
@@ -124,5 +124,5 @@ bool MySqlCursor::drv_getPrevRecord() {
QVariant MySqlCursor::value(int pos) {
if (!m_row) return QVariant();
- if (pos>=m_numFields) return QVariant();
+ if (pos>=m_fieldCount) return QVariant();
if (m_row[pos]==0) return QVariant();
return QVariant(QString::fromUtf8((const char*)m_row[pos]));
--- koffice/kexi/kexidb/drivers/mySQL/mysqlcursor.h #1.4:1.5
@@ -43,9 +43,12 @@ public:
virtual QVariant value(int);
+ /*! [PROTOTYPE] \return current record data or NULL if there is no current records. */
+ virtual const char ** recordData() { return 0; }
+
private:
MYSQL_RES *m_res;
MYSQL_ROW m_row;
unsigned long *m_lengths;
- unsigned int m_numFields;
+//js: int m_numFields;
unsigned long m_numRows;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic