Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
4d882a40
Commit
4d882a40
authored
Jan 22, 2016
by
Hugo Beauzée-Luyssen
Browse files
SqliteTools: Ensure we completely clean statements between each executions
parent
402cc256
Changes
1
Show whitespace changes
Inline
Side-by-side
src/database/SqliteTools.h
View file @
4d882a40
...
...
@@ -102,7 +102,10 @@ class Statement
{
public:
Statement
(
SqliteConnection
::
Handle
dbConnection
,
const
std
::
string
&
req
)
:
m_stmt
(
nullptr
,
&
sqlite3_reset
)
:
m_stmt
(
nullptr
,
[](
sqlite3_stmt
*
stmt
)
{
sqlite3_clear_bindings
(
stmt
);
sqlite3_reset
(
stmt
);
})
,
m_dbConn
(
dbConnection
)
,
m_req
(
req
)
,
m_bindIdx
(
0
)
...
...
@@ -173,9 +176,12 @@ private:
}
private:
// Used during the connection lifetime. This holds a compiled request
using
CachedStmtPtr
=
std
::
unique_ptr
<
sqlite3_stmt
,
int
(
*
)(
sqlite3_stmt
*
)
>
;
using
StmtPtr
=
CachedStmtPtr
;
StmtPtr
m_stmt
;
// Used for the current statement execution, this
// basically holds the state of the currently executed request.
using
StatementPtr
=
std
::
unique_ptr
<
sqlite3_stmt
,
void
(
*
)(
sqlite3_stmt
*
)
>
;
StatementPtr
m_stmt
;
SqliteConnection
::
Handle
m_dbConn
;
std
::
string
m_req
;
unsigned
int
m_bindIdx
;
...
...
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