Commit graph

87 commits

Author SHA1 Message Date
Max Semenik
a8f718267e Follow-up r112565: fix code duplication 2012-02-28 14:42:08 +00:00
Chad Horohoe
2177a4d8b4 (bug 34762) Calling close() on a DatabaseBase object now clears the connection. Based on patch by Christian.
By the way, the duplication here is stupid.
2012-02-28 02:18:18 +00:00
Alexandre Emsenhuber
d97561461c Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback() 2012-02-25 13:23:43 +00:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Sam Reed
138ddc452f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:42:35 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Leons Petrazickis
00eb065e7c Fixes to DB2 support:
* Database schema update to reflect 1.18 and 1.19 changes. 
* Better support for numRows() and dataSeek() functions on DB2 result sets. 
* Updates to DB2 installer and updater classes.
* Developed by Andre, Diego, and other students at Minho University and reviewed by me. 
* See r85885, r85896.
2011-12-16 21:17:20 +00:00
Sam Reed
bf62deece8 Reverting r103706
Only seemingly supported by MySQL, and likely a seldom used function

Not worth trying to support it, as other non mysql db's would need workarounds, and that's just not happening
2011-12-02 00:29:46 +00:00
Sam Reed
653444790b * (bug 8859) Database::update should take array of tables too
Original patch by Andrew Dunbar

Also apply in DatabaseOracle and DB2 code as they override update
2011-11-19 20:17:29 +00:00
Sam Reed
9814e6b075 Add $fname to tableExists
Pass $fname/__METHOD__ in in upstream callers
2011-11-10 20:39:23 +00:00
Sam Reed
96641da58e Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:44:47 +00:00
Chad Horohoe
70430650e9 Followup r96369: update child classes and a few callers 2011-09-06 20:51:10 +00:00
Alexandre Emsenhuber
19c5d5e595 * Removed usage of error suppression operator in includes/db
* Changed an usage of $_REQUEST to $wgRequest
2011-07-04 15:00:30 +00:00
Tim Starling
0e73205470 General database-related code cleanup:
* Merged the 4 simulated implementations of Database*::replace(). I took diffs, they were nearly identical. I made one based on the IBM DB2 version, since it used insert() which looked like a nice touch.
* Provided the non-simulated implementation of Database*::replace() via a protected member function, and made DatabaseMysql::replace() and DatabaseSqlite::replace() into a wrapper for it. 
* Moved the MySQL-specific functionality from masterPosWait(), getSlavePos() and getMasterPos() from DatabaseBase to DatabaseMysql. 
* Renamed getStatus() to getMysqlStatus() and moved it to DatabaseMysql. Removed "unimplemented" errors from two other subclasses. Really there's no way another DBMS could or should implement this function. 
* Split the LoadMonitor class into a no-op class and a MySQL-specific class, to avoid fatal errors due to the getMysqlStatus() call if other DBMSs tried to use LoadBalancer with multiple servers. Of course there are lots of other reasons it won't work, I'm just fixing the architecture issue here.

And while I have a replicated test setup handy:
* On MySQL 4.1.9 and later, use SHOW SLAVE STATUS to get the lag instead of SHOW PROCESSLIST. This has the advantage of reading zero when there are no events for a while.
2011-06-23 03:14:11 +00:00
Tim Starling
5fcd668a02 Followup r90429:
* Reverted the public -> protected changes from r90429, except for doQuery() after a review of usage:
** resultObject() is used by lots of things in core and extensions. 
** makeSelectOptions() is used by SMW, and if that's going to be public, the other two probably should be too, for consistency. 
** doQuery() was used by several things, but mostly by mistake. It's been marked private since r21359 which is before almost all of them. I updated the callers to use query().

* Added "protected" to doQuery() declarations in other database classes.
2011-06-20 12:09:22 +00:00
Platonides
8093e9733c All the databases but MySQL were overriding DatabaseBase::deleteJoin() with the same code.
Move DatabaseBase::deleteJoin() to DatabaseMysql::deleteJoin() and the common code to DatabaseBase::deleteJoin()
Follow up r90356
2011-06-18 20:26:31 +00:00
Max Semenik
e1460c8946 E_STRICT in DB2. Ping r85885. 2011-04-18 17:28:35 +00:00
Leons Petrazickis
92966e803f Addressing comments by Krinkle on r85885. Removing commented-out code. Verified that there is no more of it. 2011-04-12 17:18:35 +00:00
Leons Petrazickis
491259a9b2 Fixes to DB2 support. DB2 support integration with 1.17 Installer and Updater. Developed by Andre, Tiago, Diego, and Cesar as described in wikitech-l message. Reviewed by me. 2011-04-12 16:35:41 +00:00
Sam Reed
ea056f5171 Fixup a few undefined variables and alike while checking REL1_17 2011-04-04 21:13:34 +00:00
Chad Horohoe
c3aeca8380 Cleanup r80892, r84485: Check user also in sqlite for consistency. 2011-03-22 15:59:50 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Platonides
6950195767 Restore global wrongly removed in r80892 2011-01-28 18:10:39 +00:00
Chad Horohoe
a5053d4c5a * Cleanup massive duplication across Database constructors. Default implementation fairly sane. Now they all share the same if( $server ) logic to allow constructing the class without forcing open a connection (MySQL has done this since at least r15094)
* Get rid of intermediate installTables() callback
* Actually cache the result of DbInstaller::getConnection() like the documentation says
2011-01-24 18:36:09 +00:00
Chad Horohoe
ccbdad9bd4 Rm unused assignment of $wgOut. $wgOut needs to be gone from Database code. 2011-01-20 01:20:27 +00:00
Chad Horohoe
a719374873 Use __construct() 2011-01-07 20:49:11 +00:00
Chad Horohoe
4ece90ed4b Remove ancient and deprecated newFromParams() constructor wrappers from various DatabaseBase implementations. Only callers are AskSql and WikiTrust. Both are calling the (very old) Database class anyway, so are obviously expecting a MySQL connection and can use the fallback (which yells wfDeprecated) in DatabaseBase 2011-01-07 20:25:52 +00:00
Daniel Friesen
aae05c49f8 MySQL is the only database which quotes identifiers primarily using backticks. Move the backtick based addIdentifierQuotes implementation from the generic into DatabaseMysql and take the duplicated implementation used by oracle, sqlite, ibm_db2, postgresql, and mssql and remove it from all of them migrating it to the generic Database class as the default. 2010-12-04 15:35:36 +00:00
Daniel Friesen
692ad26f68 Followup to r77713, rename quote_ident to addIdentifierQuotes to follow naming conventions better. While I'm at it adding a missing addIdentifierQuotes implementation for Ibm_db2. 2010-12-04 15:14:08 +00:00
Sam Reed
cadc951d15 More reversion of r77297, 1 of 2 commits to keep it readable in CR (hopefully) 2010-11-25 22:24:11 +00:00
Antoine Musso
6fe29c9c30 revert r76464
* mixed style changes and variable removing
* logic changes
* useful comments removed
2010-11-25 20:01:34 +00:00
Max Semenik
75362906ca Fixed another wrong function name 2010-11-23 14:30:01 +00:00
Max Semenik
c278bc2e09 Fixed $fname in some places 2010-11-23 11:21:00 +00:00
Max Semenik
4345c2c20e Refactoring of *Field classes:
* Made them all implement one common interface (might add more functions to it later)
* Moved MySQLField to DatabaseMysql.php
* Renamed nullable() to isNullable()
* Removed maxLength() from:
** SQLiteField: makes no sense
** MySQLField: doesn't do what people may think, useless for this class' purpose of assisting querying the DB schema
2010-11-21 19:56:51 +00:00
Sam Reed
10ecfeb03b Various unused variables, add some braces
Explicitally define some variables used in hook type calls
2010-11-10 19:49:04 +00:00
Sam Reed
c40d38a5be Remove a few more unused variables
Add a couple of braces to unobvious if
2010-10-31 23:19:40 +00:00
Sam Reed
d189aaee05 (bug 24853) Kill failFunction - Fixed! :D 2010-10-24 21:27:33 +00:00
Sam Reed
16cded8b32 Start of bug 24853, killing off 'functional' parts of failfunction code. Seems when the constructors start getting changed, it starts borking. Using this as a point of reversion/stashing 2010-10-24 20:48:48 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Chad Horohoe
e290233847 Drop no-op. initial_setup() and setup_database() are going away anyway 2010-09-13 18:00:30 +00:00
Jack Phoenix
c5ba4b459f coding style tweaks 2010-09-02 21:56:14 +00:00
Jack Phoenix
64b7ad522c trim trailing whitespace 2010-09-02 21:43:04 +00:00
Leons Petrazickis
f2c2aca3b4 Based on r72134 feedback, applied spacing conventions from MediaWiki style guide, eliminated one-line ifs, wrapped all lines at less than 80 chars, and improved comments a bit. 2010-09-02 19:10:54 +00:00
Leons Petrazickis
76e28120a7 Completed removal of $wgDBport_db2 in favour of regular $wgDBport begun by platonides in r69918.
Removed $wgDBcataloged based on discussion with platonides for r45755. All DB2 connections are now uncataloged. There is no performance difference.
Now using DB2 persistent connections.
Removed uniqueness constraint on user_groups table index in DB2 schema.
2010-09-01 21:06:42 +00:00
Leons Petrazickis
faef1c92c2 DB2: Implemented prepared statements for INSERT and UPDATE to allow more than 32k of text data
DB2: New LIST_SET_PREPARED mode for DatabaseIbm_db2::makeList() that handles ? tokens in prepared UPDATE statement
DB2: General fixes for DB2 database schema
DB2: Factored out foreign key definitions into foreignkeys.sql so that more can be added down the line without messing with the main schema
DB2: Better limit and offset support
2010-09-01 18:14:15 +00:00
Chad Horohoe
e0cb9ef9b6 Make getSoftwareLink() static so I can use it without instantiating (and opening) a bunch of databases I probably can't support. Can't have an abstract parent now, so throw an exception for anyone who writes a child class without bothering to implement it. All of this to add some helpful text links in an infobox in the installer :) 2010-08-22 20:55:07 +00:00
Sam Reed
88403ed2c5 More unused.... 2010-08-19 11:42:06 +00:00