Commit Graph

20 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
peace-maker
47eb7d60e5 Fix use-after-free crash in SQLite extension (#481)
When the server crashed and the process got terminated, the SqDriver
instance was killed first (e.g. by atexit). SqDatabase tries to access
SqDriver in its destructor.
This patch tells SqDatabase to not use anything from SqDriver anymore
after SqDriver got destroyed.

Next to that, the clientprefs extension relied on the IDatabase pointer
being valid to get the driver pointer. Cache the pointer, so the dbi
system still knows the IDBThreadOperation belonged to the now gone
driver, even after the database object is gone.
2016-10-03 16:31:17 +01: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
David Anderson
008e98d980 Fixed incorrect escaping in clientprefs SQLite queries (bug 3904, r+a12=pred). 2009-08-10 22:16:58 -04:00
Matt Woodrow
c23ffa2ce5 Added GetClientCookieTime native (bug 3736, r=dvander) 2009-03-17 12:30:21 +13:00
Matt Woodrow
f19cb010a0 Upgraded clientprefs to use the client serial API (bug 3616) 2009-02-19 19:28:50 +13:00
David Anderson
3c18289465 Fixed race condition where client cookie callbacks could be fired against wrong clients (bug 3375). 2008-10-31 08:28:08 -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
5a2f8afd33 Fixed calling the wrong GetError(), causing misleading spew (part of bug 2698). 2008-10-17 02:04:09 -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
David Anderson
463cfb0015 fixed a crash-on-load bug in clientprefs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402420
2008-07-16 02:48:50 +00:00
Matt Woodrow
3ed5d1e8d7 Fixed build. I <3 you too gcc.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402419
2008-07-15 02:26:22 +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
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
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