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

stream_to uses quote_name as 2 argument function #853

Closed
soro opened this issue Jun 23, 2024 · 6 comments · Fixed by #857
Closed

stream_to uses quote_name as 2 argument function #853

soro opened this issue Jun 23, 2024 · 6 comments · Fixed by #857

Comments

@soro
Copy link

soro commented Jun 23, 2024

tx.quote_name(

causes this compile error:

bazel-out/k8-fastbuild/bin/external/com_github_jtv_libpqxx/pqxx/include/pqxx/stream_to.hxx:484:24: 
error: no matching function for call to 'pqxx::transaction_base::quote_name(std::string_view&, std::string)'

I do not see a two argument version defined - I assume this might have broken with the 7.9.x changes?

@jtv
Copy link
Owner

jtv commented Jun 23, 2024

That does look like an obscure function that has escaped notice... I don't know why you're getting the error but I never got one. It's not a 7.9.x change.

What compiler is this, and did this happen while compiling libpqxx or some other code that uses libpqxx? It looks like you're compiling some different code, perhaps because of conditional compilation or something.

@jtv
Copy link
Owner

jtv commented Jun 24, 2024

Ah, I see (part of) what happened: this is a deprecated constructor. Don't use it. Use the pqxx::stream_to::table() named constructor (or pqxx::stream_to::raw_table() if you are so inclined).

I'll see if I can fix the function, but this bug seems to have been there for years without anybody else complaining. So I'm kind of inclined to just get rid of it.

jtv added a commit that referenced this issue Jun 24, 2024
Fixes: #853

This has been broken (at compile time!) for _years_ but someone finally
noticed.  It's a deprecated constructor, so perhaps I ought to delete
it rather than fix it.
@jtv
Copy link
Owner

jtv commented Jun 24, 2024

Looked to be simply a closing parenthesis that was in the wrong place. Have you got a test case that I can run against this?

@soro
Copy link
Author

soro commented Jun 24, 2024

Nothing public or something I could easily share, but I can test it if you cut a release. I'll also update the code - looks like we hadn't updated the library version for a very long time.

@soro
Copy link
Author

soro commented Jun 24, 2024

Applying this change, I ran into another compile issue because *col resolved to const char. That might be due to client code, or it might be real breakage - I decided to just fix the client code. Maybe it is indeed better to remove the function if it has been deprecated for a while.

jtv added a commit that referenced this issue Jun 26, 2024
Fixes: #853

This has been broken (at compile time!) for _years_ but someone finally
noticed.  It's a deprecated constructor, so perhaps I ought to delete
it rather than fix it.
@jtv
Copy link
Owner

jtv commented Jun 26, 2024

Alright — I'll get rd of it. It was always a bit weird and awkward anyway, passing a series of column names as a pair of iterators. In C++20 we get better ways of doing that.

@jtv jtv closed this as completed in #857 Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants