SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.37k stars 472 forks source link

Fix for supporting enum types with rowset in Postgresql backend #1026

Closed parvit closed 1 year ago

parvit commented 1 year ago

Hello everyone, i've been develpoing a feature on a project called ZoneMinder which wants to introduce SOCI to support at this time the MySQL and Postgresql databases (https://github.com/ZoneMinder/zoneminder/pull/3644).

During development i've encountered an issue when combining the rowset and custom enum types features, when they are used together a strongly typed enum fails to be selected with error:

unknown data type with typelem: 104811 for colNum: 1 with name: type while
executing "SELECT Type FROM soci_test;"

This PR addresses that issue and i hope it is can be included in the main project, let me know if there is any improvement / change that would need to be addressed.

parvit commented 1 year ago

@vadz Thanks for the quick response, the leak is actually from the tests, i didn't think it would be reported as a leak being a test but i'll fix it no problem.

I concur with you on the size check, but not knowing in depth the postgres internals it was the best i could get. I'll see if i can implement an equivalent check using the solution you indicated, if it works i'll push it also.

parvit commented 1 year ago

@vadz could you check the updates? i think i have provided all the changes you indicated.

parvit commented 1 year ago

@vadz I've included your comments in the change, this time i've run it with asan so its sure to not have leaks anymore.

vadz commented 1 year ago

Thanks, looks good now, will merge soon!

vadz commented 1 year ago

Thanks, I've (squash) merged this now with some cosmetic changes.

parvit commented 1 year ago

@vadz thanks, just for information, can i assume already the version this will be released in will be 4.1.0 ?

vadz commented 1 year ago

Yes, unless we decide to call the next release 5.0 but this looks unlikely for now.