Commit Graph

36 Commits

Author SHA1 Message Date
peace-maker
e5342afe2a
Add PostgreSQL database driver (#32)
* Add PostgreSQL DBI extension

Bug #3849
This adds a postgresql database driver called "pgsql".
The ambuild script changes could be very wrong ;)

* Add pgsql support to clientprefs

This was originally made by Lyfe in bug 3849! Thanks for that.
PostgreSQL supports the 'IF NOT EXISTS' clause when creating tables
since version 9.1, so i've switched to use that.

* Added pgsql support to sql-admin-manager

* Add --pgsql-path to ambuild configure

* More ambuild fixes

* Compile libpq with ambuild

* Try to generate postgres configs

* Add dummy config file

* More ambuild fixes

* Get errorcode and readable error in preparequery

No need to stop getting the errorCode, if the error string should be
retrieved. Just return both!

* Fix indentation in AMBuilderPGSQL

* Try to patch and configure postgres through ambuild

* Revert "Try to patch and configure postgres through ambuild"

This reverts commit 68dfc82b8eb0ce11f621af67ec247b5f47e4a189.

* Update to use PostgreSQL 9.4

* Move postgres preparation into seperate script

Fetching, preparing and configuring of the postgresql sourcecode
is done in a seperate prepare_postgresql.sh script now.

People can use this script for their manual builds,
if they don't want to use checkout-deps.sh.

* Add patch to configure.in again

Remove the version check for autoconf in postgres 9.4 too.

* Nit: Support older objdirs for hasPgSql ambuild option

* Update to use PostgreSQL 9.4.6

* Use newer AMTL and PGSQL 9.6

* Fix threaded queries

When running the thread part of a query, it already gets the atomic
lock. Don't try to get it twice in that case.

Use a seperate lock to protect access to the lastInsertID and
lastAffectedRows variables.

* Fix SetCharacterSet racing with threaded queries

Same fix like in the mysql driver.

* Use ke::AutoLock for lastInsertID mutex

* Fix fetching one more row than available

Don't try to access a row that doesn't exist when iterating rows.

* Improve sanity checks on column access

Don't call libpq functions with out of bounds column indices.

* Let QuoteString return false if quoting failed

* Fix build for x64 support changes and update to PGSQL 9.6.9

* Fix linux build

* Fix building of connection options string

snprintf doesn't support overlapping buffers.

* Update to PostgreSQL 9.6.15

* Fix crash after freeing first IQuery object

* Fix code crunch

* Fix memory leak, cleanup

* Nuke MSVC project and Makefile

* Remove unsupported numeric error codes

* Use STL threads

* Add prebuilt libpq for Linux and Windows

* Restore and fix version.rc file

* Add PostgreSQL build instructions

* Add prebuilt libpq for Mac

* Add win64 libpq build

This is version 9.6.15 since that's what I still had laying around.

* Fix buildscript

* Fix x64 build on linux and mac

Co-authored-by: Erik Minekus <tsunami@tsunami-productions.nl>
2021-03-11 11:21:51 +01:00
David Anderson
3b386379dd
Use more STL for vector insertion/removal. (#1284) 2020-06-13 15:57:02 -07:00
David Anderson
5d94f0bea8 Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
David Anderson
a253e175bb Replace all uses of AMTL threads with STL threads.
This also rewrites the work loop for threaded queries. It has been
simplified significantly.
2020-05-16 22:35:56 -07:00
Michael Flaherty
b9b6832a11 Streamline ConfDb loading proceedure (#791)
* Create DatabaseConfBuilder & remove locking
* Remove all refcounting

This is part 1/n in regards to this PR's rework
* Move db conf lookup out of RunThreadPart
* Return default configuration for failed lookups
* RefPtr members & stop leaks
* fix uint comparison warning
2018-06-19 09:35:37 -07:00
Michael Flaherty
5611ec54a2 Migrate extensions to common AMTL string funcs (#785) 2018-03-25 13:00:53 -07:00
Nicholas Hastings
ea86eee74e Fix SetAuthIdCookie's IsAuthIdConnect function's issues with mixed auth id types. 2014-11-15 09:34:49 -05:00
Nicholas Hastings
570570f7a0 Fix regression causing inconsistencies in clientprefs auth id handling (r=VoiDeD). 2014-09-12 13:04:37 -07:00
Nicholas Hastings
6d7115d62f Update the missed steamid nullcheck in clientprefs 2014-09-09 18:04:39 -07:00
Nicholas Hastings
9e6fcc7673 Make OnClientAuthorized use Steam2 ids where available 2014-09-09 17:43:01 -07:00
David Anderson
9267d0c803 Eliminate Newborn/NoAddRef (bug 5907, r=ds). 2014-08-22 22:50:25 -07:00
Kyle Sanderson
695fc802a9 Replace SourceHook list usages in clientprefs with AMTL. 2014-06-04 21:49:48 -07:00
Kyle Sanderson
55b77a1925 Return the 'd' to ClientPrefs::AreClientCookiesPening (r=asherkin). 2014-05-09 09:34:29 -07:00
David Anderson
f82224eba0 Move versioning to a static library to improve trivial build speed (bug 5997 part 9, r=ds). 2013-12-30 17:51:00 -05:00
David Anderson
dac42ee272 Add reference counting to IDatabase (bug 5876 part 2, r=ds).
--HG--
extra : rebase_source : 9fef982c3923a2f5cb842b3b8a5cca235ef9c6b9
2013-08-23 00:18:12 -07:00
David Anderson
94d33a4ef1 Fix various problems with unloading ClientPrefs and SourceMod (bug 5874, r=ds).
--HG--
extra : rebase_source : 0a35f8380d651ca65fac9dd402c5cd3625e3105c
2013-08-22 14:05:44 -07:00
Kyle Sanderson
5d942265f9 Overhaul of ClientPrefs extension (bug 5538, r=asherkin). 2013-02-28 21:51:49 +00:00
Asher Baker
bf76be5dfa Overhauled versioning information (bug 5453, r=dvander). 2012-08-26 01:33:54 +01:00
Nicholas Hastings
3479e452de Fixed clientprefs prefab menu double free crash (bug 5374, r=asherkin). 2012-07-03 07:51:12 -04:00
Asher Baker
997c7ebbcf Made clientprefs attempt to reconnect to the database on map change (bug 4745, r=dvander). 2012-05-24 16:07:28 +01:00
Don
00f152910b Added native to clientprefs to alter data on a disconnected player (bug 3882, r=pred). 2011-10-14 11:28:53 -04:00
David Anderson
0a060982e3 Fixed extension version reporting. 2009-08-30 01:54:45 -07:00
David Anderson
d3f0a14867 Imported support for new build system. 2009-08-30 00:21:42 -07:00
Matt Woodrow
fa8c9a8418 Clientprefs now loads cookies for clients on late load (bug 3735, r=dvander) 2009-03-17 12:28:05 +13:00
David Anderson
50e1c5ba1f Database fallback for clientprefs is now more "intelligent" (bug 3564, r=pred). 2009-01-31 23:42:35 -05:00
David Anderson
253109d1c9 Rewrote querying in client prefs to not use prepared queries (bug 2698, r=pred).
Prepared queries had annoying race conditions and became unusable on connection timeouts.
2008-10-20 03:40:46 -05:00
David Anderson
974f31c149 Various clientprefs logging to try and catch bug 2698 in the act. 2008-10-15 01:01:36 -07:00
David Anderson
4e7000368f Fixed clientprefs race condition on first run (bug 3294, r=pred). 2008-10-05 01:09:58 -05:00
Matt Woodrow
a01848c774 Increased Clientprefs error reporting and a rare leak on database connection failed.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402434
2008-08-05 08:00:54 +00:00
Matt Woodrow
e64e2534eb Fixed amb1810 - Clientprefs no longer blocks load.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402418
2008-07-15 00:24:08 +00:00
David Anderson
b01dd0798c clientprefs now uses the new dbi dependency shim
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402316
2008-07-01 06:13:09 +00:00
Matt Woodrow
cdf54a3db1 Fixed mem leak in clientprefs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402310
2008-06-30 23:07:54 +00:00
Matt Woodrow
46ce91c4f7 Fixed amb1735 - Client Prefs create table queries typo
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402241
2008-06-01 22:31:58 +00:00
Matt Woodrow
044ee841f2 Fixed amb1690 - Client prefs tables now create themselves.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402199
2008-05-26 07:51:36 +00:00
Matt Woodrow
d88ba02fde CLIENT PREFS ARE GO!!1!shiftone!!1!
Fully implemented amb734 - Including console interface and menu for clients to use.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402140
2008-05-12 08:06:47 +00:00
Matt Woodrow
e63a5cd3dc Initial import of amb734 - Client preferences extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402072
2008-04-17 04:58:09 +00:00