Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix adding new columns instead of updating them if one of the key values is a NULL in upserts. #4369

Merged
merged 6 commits into from
Jan 9, 2019

Conversation

hawkowl
Copy link
Contributor

@hawkowl hawkowl commented Jan 9, 2019

No description provided.

@hawkowl hawkowl requested a review from a team January 9, 2019 10:51
synapse/storage/_base.py Outdated Show resolved Hide resolved
synapse/storage/_base.py Outdated Show resolved Hide resolved
@@ -547,11 +547,19 @@ def _simple_upsert_txn(self, txn, table, keyvalues, values, insertion_values={},
if lock:
self.database_engine.lock_table(txn, table)

def _getwhere(val):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that val is a key as opposed to a value, could it be called key ?

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/ lgtm, assuming the CI passes

@codecov-io
Copy link

codecov-io commented Jan 9, 2019

Codecov Report

Merging #4369 into develop will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4369      +/-   ##
===========================================
+ Coverage    73.68%   73.69%   +<.01%     
===========================================
  Files          300      300              
  Lines        29815    29815              
  Branches      4895     4895              
===========================================
+ Hits         21970    21971       +1     
  Misses        6407     6407              
+ Partials      1438     1437       -1
Impacted Files Coverage Δ
synapse/util/file_consumer.py 82.45% <0%> (+1.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1d81d0...4ebf1dd. Read the comment docs.

@hawkowl hawkowl merged commit 7960c26 into develop Jan 9, 2019
@hawkowl hawkowl deleted the hawkowl/nulls-in-upsert branch January 9, 2019 11:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants