[Kexi] Crash

Adam Pigg piggz1 at gmail.com
Sat Jun 20 00:37:18 CEST 2009


The following program crashes for me because the cursor is buffered.

Any chance of a fix for sqlite, pqxx is ok (no hack required! ;)

 #include <kdebug.h>
#include <KAboutData>
#include <KApplication>
#include <KCmdLineArgs>

#include <kexidb/connection.h>
#include <kexidb/drivermanager.h>
#include <kexidb/cursor.h>

int main(int argc, char** argv)
{
  KAboutData aboutData("kexicrash", 0, ki18n("kexicrash"), "0.1");
  KCmdLineArgs::init(argc, argv, &aboutData);
  KApplication app;
  
  KexiDB::DriverManager manager;
  KexiDB::Driver* driver = manager.driver("sqlite3");
  KexiDB::ConnectionData cd;
  
  cd.setFileName("/home/piggz/Documents/usda.kexi");
  
  KexiDB::Connection *connection = driver->createConnection(cd);
  connection->connect();
  connection->useDatabase("/home/piggz/Documents/usda.kexi");
  
  KexiDB::Cursor *cursor = connection->executeQuery("select * from 
kexi__objects", KexiDB::Cursor::Buffered);
  
  if (cursor)
  {
    cursor->moveNext();
    cursor->moveNext();
    cursor->moveNext();
    
    cursor->movePrev();
    cursor->moveNext(); // <---- Crashes here
  }
  return 0;
}



More information about the Kexi mailing list