summaryrefslogtreecommitdiff
path: root/workaround_dom_indexdb_actorsparent_allignment.patch
blob: e651efce0e1391715a323f41ca7f5584bd5295ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Workaround GCC/Clang6 not supporting class-temporary#6.7 [1]
Bugs:
+ https://bugzilla.mozilla.org/show_bug.cgi?id=1601707
+ http://gcc.gnu.org/PR92831
+ https://bugzilla.redhat.com/show_bug.cgi?id=1779082

[1] http://eel.is/c++draft/class.temporary#6.7

diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -24311,11 +24311,11 @@
   // if we allow overwrite or not. By not allowing overwrite we raise
   // detectable errors rather than corrupting data.
   DatabaseConnection::CachedStatement stmt;
-  const auto& optReplaceDirective = (!mOverwrite || keyUnset)
-                                        ? NS_LITERAL_CSTRING("")
-                                        : NS_LITERAL_CSTRING("OR REPLACE ");
   rv = aConnection->GetCachedStatement(
-      NS_LITERAL_CSTRING("INSERT ") + optReplaceDirective +
+      NS_LITERAL_CSTRING("INSERT ") +
+	  ((!mOverwrite || keyUnset)
+           ? NS_LITERAL_CSTRING("")
+           : NS_LITERAL_CSTRING("OR REPLACE ")) +
           NS_LITERAL_CSTRING("INTO object_data "
                              "(object_store_id, key, file_ids, data) "
                              "VALUES (:") +
@@ -26076,9 +26076,6 @@
 
   const bool usingKeyRange = mOptionalKeyRange.isSome();
 
-  const auto& indexTable = mCursor->mUniqueIndex
-                               ? NS_LITERAL_CSTRING("unique_index_data")
-                               : NS_LITERAL_CSTRING("index_data");
 
   NS_NAMED_LITERAL_CSTRING(sortColumn, "sort_column");
 
@@ -26099,7 +26096,9 @@
                                  "object_data.file_ids, "
                                  "object_data.data "
                                  "FROM ") +
-                             indexTable +
+                             (mCursor->mUniqueIndex
+                                 ? NS_LITERAL_CSTRING("unique_index_data")
+                                 : NS_LITERAL_CSTRING("index_data")) +
                              NS_LITERAL_CSTRING(
                                  " AS index_table "
                                  "JOIN object_data "
@@ -26198,9 +26197,6 @@
 
   const bool usingKeyRange = mOptionalKeyRange.isSome();
 
-  const auto& table = mCursor->mUniqueIndex
-                          ? NS_LITERAL_CSTRING("unique_index_data")
-                          : NS_LITERAL_CSTRING("index_data");
 
   NS_NAMED_LITERAL_CSTRING(sortColumn, "sort_column");
 
@@ -26218,7 +26214,10 @@
                              NS_LITERAL_CSTRING(
                                  "object_data_key "
                                  " FROM ") +
-                             table + NS_LITERAL_CSTRING(" WHERE index_id = :") +
+                             (mCursor->mUniqueIndex
+                                 ? NS_LITERAL_CSTRING("unique_index_data")
+                                 : NS_LITERAL_CSTRING("index_data")) +
+                             NS_LITERAL_CSTRING(" WHERE index_id = :") +
                              kStmtParamNameId;
 
   const auto keyRangeClause =
bgstack15