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

SSql: Use unique_ptr for statements #4692

Merged
merged 1 commit into from Aug 11, 2017

Conversation

Projects
None yet
3 participants
@cmouse
Contributor

cmouse commented Nov 16, 2016

Short description

Convert gSQLBackend and BindBackend to use unique_ptr for storing SSqlStatement pointers. This will prevent any accidentical copying or misuse of said pointers.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added regression tests
  • added unit tests
@nlyan

This comment has been minimized.

Show comment
Hide comment
@nlyan

nlyan Jul 6, 2017

Contributor

Why not make the prepare() function return a unique_ptr by value?

Contributor

nlyan commented Jul 6, 2017

Why not make the prepare() function return a unique_ptr by value?

@cmouse

This comment has been minimized.

Show comment
Hide comment
@cmouse

cmouse Jul 7, 2017

Contributor

I'll have to see what it causes.

Contributor

cmouse commented Jul 7, 2017

I'll have to see what it causes.

@cmouse

This comment has been minimized.

Show comment
Hide comment
@cmouse

cmouse Jul 7, 2017

Contributor

Seems to be doable, fixed.

Contributor

cmouse commented Jul 7, 2017

Seems to be doable, fixed.

@cmouse

This comment has been minimized.

Show comment
Hide comment
@cmouse

cmouse Jul 7, 2017

Contributor

@mind04 has tested goracle that it compiles.

Contributor

cmouse commented Jul 7, 2017

@mind04 has tested goracle that it compiles.

@nlyan

This comment has been minimized.

Show comment
Hide comment
@nlyan

nlyan Jul 13, 2017

Contributor

Modulo shitty compilers, use of std::move() in setupStatements() is redundant, since the return value from prepare() is already an rvalue and will be moved-from by default

Contributor

nlyan commented Jul 13, 2017

Modulo shitty compilers, use of std::move() in setupStatements() is redundant, since the return value from prepare() is already an rvalue and will be moved-from by default

@cmouse

This comment has been minimized.

Show comment
Hide comment
@cmouse

cmouse Jul 14, 2017

Contributor

fixed @nlyan's nit.

Contributor

cmouse commented Jul 14, 2017

fixed @nlyan's nit.

@nlyan

This comment has been minimized.

Show comment
Hide comment
@nlyan

nlyan Jul 18, 2017

Contributor

LGTM

Contributor

nlyan commented Jul 18, 2017

LGTM

@rgacogne rgacogne merged commit a7b4083 into PowerDNS:master Aug 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cmouse cmouse deleted the cmouse:ssql-unique-ptr branch Aug 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment