Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UPSERT with prepared statements #1196

Merged
merged 1 commit into from
Apr 30, 2019
Merged

Conversation

svenklemm
Copy link
Member

@svenklemm svenklemm commented Apr 30, 2019

When doing upsert with prepared statement the code to restore
arbiter_indexes would not trigger when an error occurred on the
INSERT leading to a segfault on the next EXECUTE of the prepared
statement.

Fixes #1165

@codecov
Copy link

codecov bot commented Apr 30, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@899cd05). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #1196   +/-   ##
========================================
  Coverage          ?   92.4%           
========================================
  Files             ?     107           
  Lines             ?   13689           
  Branches          ?       0           
========================================
  Hits              ?   12650           
  Misses            ?    1039           
  Partials          ?       0
Impacted Files Coverage Δ
src/chunk_dispatch_state.c 93.67% <ø> (ø)
src/hypertable_insert.c 97.33% <100%> (ø)

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 899cd05...bff7d8c. Read the comment docs.

@svenklemm svenklemm force-pushed the upsert_bug branch 3 times, most recently from 84eeba1 to 33ed1b7 Compare April 30, 2019 18:37
@svenklemm svenklemm requested a review from cevian April 30, 2019 18:50
@svenklemm svenklemm force-pushed the upsert_bug branch 4 times, most recently from c5533d0 to f137edd Compare April 30, 2019 19:53
Copy link
Contributor

@cevian cevian left a comment

Choose a reason for hiding this comment

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

Looks great. One outdated comment to fix before merge.

@@ -158,17 +158,6 @@ chunk_dispatch_end(CustomScanState *node)
ExecEndNode(substate);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a now-outdated comment at line 245 of this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

starts with "Save arbiterIndexes..."

When doing upsert with prepared statement the code to restore
arbiter_indexes would not trigger when an error occurred on the
INSERT leading to a segfault on the next EXECUTE of the prepared
statement.
@svenklemm svenklemm merged commit cd71556 into timescale:master Apr 30, 2019
@cevian cevian added this to the 1.3.0 milestone May 1, 2019
@cevian cevian added the bug label May 2, 2019
@svenklemm svenklemm deleted the upsert_bug branch October 10, 2019 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault,"Failed process was running: insert hypertable"
2 participants