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

Skip reset for null Binder #4109

Closed
aleks-f opened this issue Aug 15, 2023 Discussed in #4108 · 1 comment
Closed

Skip reset for null Binder #4109

aleks-f opened this issue Aug 15, 2023 Discussed in #4108 · 1 comment
Assignees

Comments

@aleks-f
Copy link
Member

aleks-f commented Aug 15, 2023

Discussed in #4108

Originally posted by db4 December 11, 2020
I'm trying to reuse the same statement with different bindings. Surprisingly it does not work:

Session session(...);
Statement statement(session);
statement << "INSERT INTO test(f1) VALUES(?)";
statement.addBind(Poco::Data::Keywords::bind(1, "f1"));
statement.execute(); //OK
statement.removeBind("f1");
statement.addBind(Poco::Data::Keywords::bind(2, "f1"));
statement.execute(); // Assertion violation: !pBinder.isNull() [in file "D:\.conan\data\poco\1.10.1\_\_\package\79d47f014080a953179622161c373e018e32729f\include\Poco/Data/Binding.h", line 171]

This happens for SQLite, but I don't think it's database-specific. Am I just missing something?

@aleks-f
Copy link
Member Author

aleks-f commented Aug 15, 2023

First posted in #3165

@aleks-f aleks-f self-assigned this Aug 15, 2023
@aleks-f aleks-f added the bug label Aug 15, 2023
@aleks-f aleks-f added this to the Release 1.13.0 milestone Aug 15, 2023
@aleks-f aleks-f changed the title Can't reuse Poco::Data::Statement with a new set of bindings Skip reset for null Binder Aug 15, 2023
@aleks-f aleks-f added the fixed label Aug 15, 2023
@aleks-f aleks-f closed this as completed Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant