Lines 24311-24321
Link Here
|
24311 |
// if we allow overwrite or not. By not allowing overwrite we raise |
24311 |
// if we allow overwrite or not. By not allowing overwrite we raise |
24312 |
// detectable errors rather than corrupting data. |
24312 |
// detectable errors rather than corrupting data. |
24313 |
DatabaseConnection::CachedStatement stmt; |
24313 |
DatabaseConnection::CachedStatement stmt; |
24314 |
const auto& optReplaceDirective = (!mOverwrite || keyUnset) |
|
|
24315 |
? NS_LITERAL_CSTRING("") |
24316 |
: NS_LITERAL_CSTRING("OR REPLACE "); |
24317 |
rv = aConnection->GetCachedStatement( |
24314 |
rv = aConnection->GetCachedStatement( |
24318 |
NS_LITERAL_CSTRING("INSERT ") + optReplaceDirective + |
24315 |
NS_LITERAL_CSTRING("INSERT ") + |
|
|
24316 |
((!mOverwrite || keyUnset) |
24317 |
? NS_LITERAL_CSTRING("") |
24318 |
: NS_LITERAL_CSTRING("OR REPLACE ")) + |
24319 |
NS_LITERAL_CSTRING("INTO object_data " |
24319 |
NS_LITERAL_CSTRING("INTO object_data " |
24320 |
"(object_store_id, key, file_ids, data) " |
24320 |
"(object_store_id, key, file_ids, data) " |
24321 |
"VALUES (:") + |
24321 |
"VALUES (:") + |
Lines 26076-26084
Link Here
|
26076 |
|
26076 |
|
26077 |
const bool usingKeyRange = mOptionalKeyRange.isSome(); |
26077 |
const bool usingKeyRange = mOptionalKeyRange.isSome(); |
26078 |
|
26078 |
|
26079 |
const auto& indexTable = mCursor->mUniqueIndex |
|
|
26080 |
? NS_LITERAL_CSTRING("unique_index_data") |
26081 |
: NS_LITERAL_CSTRING("index_data"); |
26082 |
|
26079 |
|
26083 |
NS_NAMED_LITERAL_CSTRING(sortColumn, "sort_column"); |
26080 |
NS_NAMED_LITERAL_CSTRING(sortColumn, "sort_column"); |
26084 |
|
26081 |
|
Lines 26099-26105
Link Here
|
26099 |
"object_data.file_ids, " |
26096 |
"object_data.file_ids, " |
26100 |
"object_data.data " |
26097 |
"object_data.data " |
26101 |
"FROM ") + |
26098 |
"FROM ") + |
26102 |
indexTable + |
26099 |
(mCursor->mUniqueIndex |
|
|
26100 |
? NS_LITERAL_CSTRING("unique_index_data") |
26101 |
: NS_LITERAL_CSTRING("index_data")) + |
26103 |
NS_LITERAL_CSTRING( |
26102 |
NS_LITERAL_CSTRING( |
26104 |
" AS index_table " |
26103 |
" AS index_table " |
26105 |
"JOIN object_data " |
26104 |
"JOIN object_data " |
Lines 26198-26206
Link Here
|
26198 |
|
26197 |
|
26199 |
const bool usingKeyRange = mOptionalKeyRange.isSome(); |
26198 |
const bool usingKeyRange = mOptionalKeyRange.isSome(); |
26200 |
|
26199 |
|
26201 |
const auto& table = mCursor->mUniqueIndex |
|
|
26202 |
? NS_LITERAL_CSTRING("unique_index_data") |
26203 |
: NS_LITERAL_CSTRING("index_data"); |
26204 |
|
26200 |
|
26205 |
NS_NAMED_LITERAL_CSTRING(sortColumn, "sort_column"); |
26201 |
NS_NAMED_LITERAL_CSTRING(sortColumn, "sort_column"); |
26206 |
|
26202 |
|
Lines 26218-26224
Link Here
|
26218 |
NS_LITERAL_CSTRING( |
26214 |
NS_LITERAL_CSTRING( |
26219 |
"object_data_key " |
26215 |
"object_data_key " |
26220 |
" FROM ") + |
26216 |
" FROM ") + |
26221 |
table + NS_LITERAL_CSTRING(" WHERE index_id = :") + |
26217 |
(mCursor->mUniqueIndex |
|
|
26218 |
? NS_LITERAL_CSTRING("unique_index_data") |
26219 |
: NS_LITERAL_CSTRING("index_data")) + |
26220 |
NS_LITERAL_CSTRING(" WHERE index_id = :") + |
26222 |
kStmtParamNameId; |
26221 |
kStmtParamNameId; |
26223 |
|
26222 |
|
26224 |
const auto keyRangeClause = |
26223 |
const auto keyRangeClause = |