mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
SYN-163: Add an order by rowid to selects.
This should fix the bug where the edges of the graph get returned in a different order than they were inserted in, and so no get_event no longer returned the exact same JSON as was inserted. This meant that signature checks failed.
This commit is contained in:
parent
ae8ad55cb8
commit
a46e5ef621
2 changed files with 18 additions and 9 deletions
|
@ -84,7 +84,8 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
|
||||
self.assertEquals("Value", value)
|
||||
self.mock_txn.execute.assert_called_with(
|
||||
"SELECT retcol FROM tablename WHERE keycol = ?",
|
||||
"SELECT retcol FROM tablename WHERE keycol = ? "
|
||||
"ORDER BY rowid asc",
|
||||
["TheKey"]
|
||||
)
|
||||
|
||||
|
@ -101,7 +102,8 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
|
||||
self.assertEquals({"colA": 1, "colB": 2, "colC": 3}, ret)
|
||||
self.mock_txn.execute.assert_called_with(
|
||||
"SELECT colA, colB, colC FROM tablename WHERE keycol = ?",
|
||||
"SELECT colA, colB, colC FROM tablename WHERE keycol = ? "
|
||||
"ORDER BY rowid asc",
|
||||
["TheKey"]
|
||||
)
|
||||
|
||||
|
@ -135,7 +137,8 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
|
||||
self.assertEquals([{"colA": 1}, {"colA": 2}, {"colA": 3}], ret)
|
||||
self.mock_txn.execute.assert_called_with(
|
||||
"SELECT colA FROM tablename WHERE keycol = ?",
|
||||
"SELECT colA FROM tablename WHERE keycol = ? "
|
||||
"ORDER BY rowid asc",
|
||||
["A set"]
|
||||
)
|
||||
|
||||
|
@ -184,7 +187,8 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
|
||||
self.assertEquals({"columname": "Old Value"}, ret)
|
||||
self.mock_txn.execute.assert_has_calls([
|
||||
call('SELECT columname FROM tablename WHERE keycol = ?',
|
||||
call('SELECT columname FROM tablename WHERE keycol = ? '
|
||||
'ORDER BY rowid asc',
|
||||
['TheKey']),
|
||||
call("UPDATE tablename SET columname = ? WHERE keycol = ?",
|
||||
["New Value", "TheKey"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue