Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
b3f6c9d2
Commit
b3f6c9d2
authored
Oct 31, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(SQLite): исправил ошибку в обработке ответов (SQLiteResult)
parent
f975ca5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
libuniset.spec
conf/libuniset.spec
+1
-0
SQLiteInterface.cc
extensions/DBServer-SQLite/SQLiteInterface.cc
+8
-0
test.cc
extensions/DBServer-SQLite/test.cc
+41
-0
No files found.
conf/libuniset.spec
View file @
b3f6c9d2
...
...
@@ -337,6 +337,7 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%changelog
* Thu Oct 30 2014 Pavel Vainerman <pv@altlinux.ru> 1.8-alt1
- (IOBase): added the ability to override the basic settings using the prefix.
- (SQLiteInterface): fixed bug in SQLiteResult
* Mon Oct 20 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt16
- fixed bug in UniXML::iteartor getPIntProp() for prop <= 0
...
...
extensions/DBServer-SQLite/SQLiteInterface.cc
View file @
b3f6c9d2
...
...
@@ -254,6 +254,13 @@ SQLiteResult::SQLiteResult( sqlite3_stmt* s, bool finalize )
do
{
int
n
=
sqlite3_data_count
(
s
);
if
(
n
<=
0
)
{
if
(
finalize
)
sqlite3_finalize
(
s
);
return
;
}
COL
c
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
...
...
@@ -264,6 +271,7 @@ SQLiteResult::SQLiteResult( sqlite3_stmt* s, bool finalize )
else
c
.
push_back
(
""
);
}
res
.
push_back
(
c
);
}
while
(
sqlite3_step
(
s
)
==
SQLITE_ROW
);
...
...
extensions/DBServer-SQLite/test.cc
View file @
b3f6c9d2
...
...
@@ -16,6 +16,47 @@ int main(int argc, char** argv)
cerr
<<
"db connect error: "
<<
db
.
error
()
<<
endl
;
return
1
;
}
#if 0
CREATE TABLE main_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
date date NOT NULL,
time time NOT NULL,
time_usec INTEGER NOT NULL,
sensor_id INTEGER NOT NULL,
value DOUBLE NOT NULL,
node INTEGER NOT NULL,
confirm INTEGER DEFAULT NULL
#endif
#if 0
bool fail = false;
db.query("BEGIN;");
for( int i=0; i<20; i++ )
{
stringstream qi;
qi << " INSERT INTO main_history VALUES(NULL,"
<< "date('now'), "
<< "date('now'), "
<< i << ","
<< i << ","
<< i << ","
<<"0,0);";
if( !db.insert(qi.str()) )
{
cerr << "db insert error: " << db.error() << endl;
fail = true;
break;
}
}
if( fail )
db.query("ROLLBACK;");
else
db.query("COMMIT;");
#endif
// ---------------------------------------
stringstream
q
;
q
<<
"SELECT * from main_history"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment