Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
5171b0a2
Commit
5171b0a2
authored
Jan 22, 2016
by
Hugo Beauzée-Luyssen
Browse files
sqlite: Statement: Don't store the raw sql request
parent
03cc4e1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/database/SqliteTools.h
View file @
5171b0a2
...
...
@@ -107,7 +107,6 @@ public:
sqlite3_reset
(
stmt
);
})
,
m_dbConn
(
dbConnection
)
,
m_req
(
req
)
,
m_bindIdx
(
0
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
StatementsCacheLock
);
...
...
@@ -151,9 +150,10 @@ public:
switch
(
res
)
{
case
SQLITE_CONSTRAINT
:
throw
errors
::
ConstraintViolation
(
m_req
,
errMsg
);
throw
errors
::
ConstraintViolation
(
sqlite3_sql
(
m_stmt
.
get
()
)
,
errMsg
);
default:
throw
std
::
runtime_error
(
m_req
+
": "
+
errMsg
);
throw
std
::
runtime_error
(
std
::
string
{
sqlite3_sql
(
m_stmt
.
get
()
)
}
+
": "
+
errMsg
);
}
}
}
...
...
@@ -183,7 +183,6 @@ private:
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
;
static
std
::
mutex
StatementsCacheLock
;
static
std
::
unordered_map
<
SqliteConnection
::
Handle
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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