Join GitHub today
Fix Postgresql #2383
Add patch https://sourceforge.net/p/mumble/patches/368/
Update postgresql create user table function to include salt and kdfiterations. Fix dblog function to work for both PostgreSQL and other database types. modified: src/murmur/ServerDB.cpp modified: src/murmur/ServerDB.h
Thanks for reviving this.
I've written down a few notes from my first read through of the patch:
Oops! I have a private bitbucket repo I use for code I share with a gaming guild, and I commit to that using my gaming username. Seems I forgot to switch back to my normal name when I made the commit.
I should explain. I tried to use postgresql with mumble and found it didn't work. I noticed it needed a code change and I also found the patch with the relevant code change. I cloned the mumble repository, applied the patch and built murmurd. I found that it didn't work because the table layout had changed since the patch was made. I fixed the code and tested the server and it worked. I decided to contribute the fixed patch so I forked the repo, cloned my fork and made a new branch, copied the fixed files from the clone of the official repo to my fork, pushed and submitted a pull request crediting the patch with a link.
Ok, I can do that. I didn't actually write those parts. I think the authors intention was that those bits should be used by any of the databases that aren't officially supported.
Would using Postgresql's UPSERT (INSERT ... ON CONFLICT UPDATE) feature be acceptable? It would achieve the same thing, but do so in a single SQL statement meaning that setting up transactions wouldn't be needed. It would mean that only PostgreSQL 9.5 and upwards would work, but that's still an improvement on the current situation.
That's also code that came from the patch. Since it worked I didn't look at it in much detail. I'll look at it some more and see about removing the reconnection logic.
Fair enough :-)
First applying the patch as one commit, and then working on with consecutive commits would be nice.
Since you're not the original author of the patch, I think this approach is fine!
We don't really want to encourage that.
I took a look at using 9.5's upsert support to accomplish this, and I couldn't figure it out.
The operation we're looking for is "update the record with primary key X to have these values: A, B, C, D".
I couldn't figure out how to accomplish that via the upsert syntax. It seemed to require me to spell out, in the
Feel free to use upsert if you can make it readable. :-) If you do, please put the PSQL-specific parts into
Yep, I know.
The reconnection thing IS very important. But the current structure of ServerDB doesn't really allow for it to work safely at the moment.
I hope we can refactor ServerDB's methods that use transactions into separate functions, and then do (in pseudo-code):
across the board.