Commit graph

32 commits

Author SHA1 Message Date
Aryeh Gregor
db8cbcd108 Remove redundant no-op implementations
Followup to r52951.
2009-07-09 01:04:10 +00:00
Alexandre Emsenhuber
b682500421 quick fix for r52382: fix errors in DatabasePostgres, lock() has incompatible signature lockTables(), unlockTables() (lockTables could have some implementation but not unlockTables since PostgreSQL has no command "UNLOCK TABLES") 2009-06-26 13:25:10 +00:00
Aryeh Gregor
9244ed0c57 Abstract more methods in DatabaseBase
Notably, this will switch conditional() in MySQL from using IF() to
using CASE, like all other DBMSes.  Documentation suggests this works
back to 4.0.  If it's a problem, it's a matter of a few lines to
override it in DatabaseMysql.php.

Also, some extra explanatory comments have been added to a number of
methods in DatabaseBase.
2009-06-16 21:00:38 +00:00
Aryeh Gregor
2b83b91906 Make some Database methods optional to override
Specifically freeResult(), selectDB(), close(), and ping(), as suggested
by Tim on code review for r51918.  Where these were overridden by stubs
in subclasses, I deleted the stubs.
2009-06-16 20:22:11 +00:00
Aryeh Gregor
d20794df5c Make Database into abstract class DatabaseBase
All other databases were changed to extend DatabaseBase instead of
Database.  Database was kept as an alias for DatabaseMysql for
compatibility.  Existing explicit references to Database that I could
find were changed to DatabaseMysql for the sake of clarity.

Should cause no functional changes.
2009-06-12 17:59:04 +00:00
Tim Starling
cb3bbe1809 Implemented save/restore logic for sql_big_selects, per CR comments on r50168. 2009-05-27 06:10:48 +00:00
Tim Starling
1caee6915b Proposed fix for bug 16937: pg_version() missing server version due to PHP bug. 2009-05-11 11:35:52 +00:00
Greg Sabino Mullane
dbd2d32f30 We can rely on usesuper and not just usecreatedb here. 2009-03-24 13:37:50 +00:00
Alexandre Emsenhuber
725ea7afb3 * Fixed $fname in functions definitions to have "DatabasePostgres::..." rather than "Database::..."
* Some whitespaces tweaks
2009-02-26 09:10:18 +00:00
Alexandre Emsenhuber
87bec86ae7 (bug 17460) Client ecoding is now correctly set for PostgreSQL, as we do for MySQL with "SET NAMES utf8" 2009-02-23 21:23:14 +00:00
Tim Starling
51c311a1b0 More installer XSS 2009-02-06 03:46:35 +00:00
Roan Kattouw
a7c7a3fd33 Revert r45821, r45830, r45831 and r45835 all in order to revert r45819, per discussions on CR. Will redo part of r45819 momentarily. 2009-01-19 13:56:08 +00:00
Roan Kattouw
312316088e Attempt at cleaning up r45764, r45769 (renamed indices for SQLite compat):
* removing the indexName() hack and with it the /*i*/ stuff from tables.sql
* undoing renames of formerly implicitly named indices
* three indices have to be called different in SQLite because of naming conflicts, adding a patch to updaters.inc that does that
2009-01-16 23:02:44 +00:00
Tim Starling
f058162bc5 * Preserve usertext_timestamp index name for MySQL, prefix it for SQLite. Issues remain on the experimental non-installable DBMSes.
* Clean up some E_STRICT issues
2009-01-15 14:20:28 +00:00
Tim Starling
54c6f867df * (bug 16937) Show appropriate error message when someone attempts an install on PostgreSQL 7.3 or earlier.
* Fix some issues with the earlier migration of getServerVersion() to numeric only.
2009-01-10 00:53:26 +00:00
Alexandre Emsenhuber
7bb2cada63 * fixed Doxygen errors in Database.php, DatabasePostgres.php, DatabaseOracle.php and DatabaseMssql.php
* renamed \2types and \3types both to \types (with different number of param), Doxygen doesn't seem to like numbers in aliases
* Added aliases for @private, @protected and @public
2008-11-29 18:50:39 +00:00
Greg Sabino Mullane
6ac82136a6 Set numeric_version more globally so things like search don't break. 2008-11-22 06:49:16 +00:00
Greg Sabino Mullane
40dd8ce63f Set numeric_version 2008-11-22 06:40:46 +00:00
Greg Sabino Mullane
c3d1c42bb4 Need to bail without error if no user so installer works. 2008-11-22 06:39:55 +00:00
Tim Starling
0d322a394e * Allow $wgDiff3=false
* Don't call quickUserCan('edit') unless section edit is enabled
* In DatabasePostgres and DatabaseSqlite: throw an exception on connection error
* In DatabasePostgres: don't send an invalid connection string whenever one of the fields is empty. Use quoting.
* In Database: make the captured PHP error prettier
* Display a descriptive error message when the user navigates to index.php with PHP 4, not a parse error. Check to see if the *.php5 extension works, using file_get_contents().
* The default port number for PostgreSQL is 5432, not blank.
* Better default for $wgDBname
2008-10-06 00:45:18 +00:00
Greg Sabino Mullane
9bb6920774 Return numeric version only. 2008-09-22 03:15:17 +00:00
Tim Starling
20cfed18d9 Fixed bug 15148, total breakage of Special:BlockIP on PostgreSQL:
* Migrated to a unique index for IP block conflict detection, like we did for MySQL some aeons ago.
* Modified DatabasePostgres to return a correct affected row count for INSERT IGNORE. Tested for single and multi.
* Fixed an unrelated bug: duplicate index rc_timestamp in tables.sql
* Tested for install and upgrade on PG 8.3.

No changelog because I'll backport it to 1.13.
2008-09-06 07:05:14 +00:00
Greg Sabino Mullane
609ad54835 Force inserted bools to be ints, per Tim's suggestion on bug 15148.
This should be fine for now as Postgres uses SMALLINTs for BOOLs, to 
match MySQLs BOOL/TINYINT aliasing and subsequent MW coding assumptions.
It's possible this will cause bad effects if inserted values are called 
in a boolean context when they are going into a non-SMALLINT column, but we can handle 
those as they come up.
2008-08-21 13:10:19 +00:00
Chad Horohoe
e8ad8d066d Remove DB logic from SearchEngine. New method in Database and associated subclasses called getSearchEngine() does this now. 2008-08-18 15:22:00 +00:00
Chad Horohoe
6cd47a4f5e bug 14907 - DatabasePostgres::fieldType() wasn't defined, fatal errors abound. 2008-07-24 12:37:07 +00:00
Chad Horohoe
fcc6f32017 (bug 14763) Strict standards issue in DatabasePostgres (also happened with DatabaseOracle, no one reported it though). 2008-07-09 18:14:01 +00:00
Greg Sabino Mullane
5e6fc17565 Handle multi-insert ignores properly, as pointed out on wikitech. 2008-07-05 17:00:01 +00:00
Greg Sabino Mullane
d5b7177cf5 Properly handle the 'IGNORE' option passed to the insert funtion:
rather than just turning off errors, do some savepoint trickery 
so we end at the same state as when we started, to emulate 
MySQL's INSERT...IGNORE. Bug 14708.
2008-07-04 15:57:44 +00:00
Brion Vibber
7b78f7b7aa Revert r36755 for the moment; various things use 'new Database'
or Database::newFromParams() explicitly at the moment. While that's already bad (breaking PG support etc), I'd rather see those get fixed before we go introducing differences between Database and DatabaseMySql.
2008-07-02 18:22:38 +00:00
Chad Horohoe
de58074c74 Refactoring (un)lock. All the subclasses are currently returning true, except for mySQL. Makes more sense to put the no-op in the parent class then just subclass it as needed. Other things could maybe do this too. 2008-06-27 17:06:34 +00:00
Greg Sabino Mullane
9532aa9eaa Add some quick no-ops for the new lock() and unlock() funcs. 2008-06-24 20:58:10 +00:00
Tim Starling
c6b902f180 * Reorganised the includes directory, creating subdirectories db, parser and specials
* Wrote a tool to check the integrity of the autoloader class list, fixed some issues that came up.
* Start the autoloader before LocalSettings.php, so that when an extension writer thinks an inefficient one-file special page extension is the way to go, they don't have to use explicit includes to make the class inheritance work. Should continue to work with $IP set in LocalSettings.php as long as $IP is set before extensions are included.
2008-06-16 20:21:26 +00:00
Renamed from includes/DatabasePostgres.php (Browse further)