mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-16 18:56:52 +02:00
final Data changes
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Makefile
|
||||
#
|
||||
# $Id: //poco/Main/Data/SQLite/Makefile#3 $
|
||||
# $Id: //poco/Main/Data/SQLite/Makefile#4 $
|
||||
#
|
||||
# Makefile for Poco SQLite
|
||||
#
|
||||
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
|
||||
SYSFLAGS += -DTHREADSAFE -DNO_TCL
|
||||
SYSFLAGS += -DTHREADSAFE -DNO_TCL -DSQLITE_DISABLE_LFS
|
||||
|
||||
objects = Binder Extractor SessionImpl Connector \
|
||||
SQLiteException SQLiteStatementImpl Utility \
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SQLiteStatementImpl.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/SQLite/src/SQLiteStatementImpl.cpp#4 $
|
||||
// $Id: //poco/Main/Data/SQLite/src/SQLiteStatementImpl.cpp#6 $
|
||||
//
|
||||
// Library: SQLite
|
||||
// Package: SQLite
|
||||
@@ -38,8 +38,9 @@
|
||||
#include "Poco/Data/SQLite/Utility.h"
|
||||
#include "Poco/Data/SQLite/SQLiteException.h"
|
||||
#include "Poco/String.h"
|
||||
#include "sqlite3.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include "sqlite3.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -96,7 +97,7 @@ void SQLiteStatementImpl::compileImpl()
|
||||
else if(rc == SQLITE_OK && !pStmt) // comment/whitespace ignore
|
||||
{
|
||||
pSql = pLeftover;
|
||||
if (strlen(pSql) == 0)
|
||||
if (std::strlen(pSql) == 0)
|
||||
{
|
||||
// empty statement or an conditional statement! like CREATE IF NOT EXISTS
|
||||
// this is valid
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Utility.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/SQLite/src/Utility.cpp#4 $
|
||||
// $Id: //poco/Main/Data/SQLite/src/Utility.cpp#5 $
|
||||
//
|
||||
// Library: SQLite
|
||||
// Package: SQLite
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SQLiteTest.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/SQLite/testsuite/src/SQLiteTest.cpp#3 $
|
||||
// $Id: //poco/Main/Data/SQLite/testsuite/src/SQLiteTest.cpp#5 $
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@@ -163,34 +163,6 @@ SQLiteTest::~SQLiteTest()
|
||||
}
|
||||
|
||||
|
||||
void SQLiteTest::testTAC()
|
||||
{
|
||||
Poco::File aFile("sqlite.db");
|
||||
|
||||
if (aFile.exists())
|
||||
aFile.remove();
|
||||
|
||||
Session ses (SessionFactory::instance().create(SQLite::Connector::KEY, "sqlite.db"));
|
||||
|
||||
ses << "CREATE TABLE LogTest (Id INTEGER PRIMARY KEY, Time INTEGER, Value INTEGER)", now;
|
||||
//ses << "PRAGMA synchronous = OFF", now;
|
||||
|
||||
double value = -200000000000.0;
|
||||
Poco::Int64 time = (Poco::Int64)22329988776655.0;
|
||||
Poco::Stopwatch sw;
|
||||
sw.start();
|
||||
ses.begin();
|
||||
Statement stmt = (ses << "INSERT INTO LogTest ([Time], Value) VALUES (:time, :value)", use(time), use(value));
|
||||
for(int i = 0; i < 1000; i++)
|
||||
{
|
||||
stmt.execute();
|
||||
}
|
||||
ses.commit();
|
||||
sw.stop();
|
||||
std::cout << std::endl << "Ms for 1000 inserts: " << sw.elapsed() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void SQLiteTest::testSimpleAccess()
|
||||
{
|
||||
Session tmp (SessionFactory::instance().create(SQLite::Connector::KEY, "dummy.db"));
|
||||
@@ -1619,7 +1591,6 @@ CppUnit::Test* SQLiteTest::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SQLiteTest");
|
||||
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testTAC);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testSimpleAccess);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testInsertCharPointer);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testInsertCharPointer2);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SQLiteTest.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/SQLite/testsuite/src/SQLiteTest.h#2 $
|
||||
// $Id: //poco/Main/Data/SQLite/testsuite/src/SQLiteTest.h#3 $
|
||||
//
|
||||
// Definition of the SQLiteTest class.
|
||||
//
|
||||
@@ -110,8 +110,6 @@ public:
|
||||
|
||||
void testInternalExtraction();
|
||||
|
||||
void testTAC();
|
||||
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
|
Reference in New Issue
Block a user