Commit graph

313 commits

Author SHA1 Message Date
Aaron
ff187ea7cc [SiteStatsUpdate] Reduced contention by using a new lockIsFree() DB function.
* Note: follows up a4b3979160
* Cleanup up transaction statements a bit; transactions don't effect the lock calls
* Also made DatabaseMysql::unlock() actually return a bool

Change-Id: Iade2efa94165b6918eae0863716cc163f36a07b8
2012-05-10 15:48:58 -07:00
Alexandre Emsenhuber
1d3934e1ad (bug 36568) Fixed "Illegal string offset 'LIMIT'" warnings in updater
No RELEASE-NOTES entry since this is going to be backported and RELEASE-NOTES-1.19 is out of sync.

Change-Id: I1ec6c824677606ac6f93cc43345942e4de8bd3f4
2012-05-07 15:52:55 +02:00
umherirrender
f8101287bd Do not treat EXPLAIN as write query
Change-Id: Idb15955b94ee6977f3a4692df44d445d3450b1a5
2012-05-05 11:24:07 +02:00
Alexandre Emsenhuber
78a56a67ba Added missing GPLv2 headers in includes/db.
Change-Id: Ib8fe301c6db77603e411113cea5a39c25c664961
2012-04-26 10:47:10 +02:00
Sam Reed
34c77067c3 Bug 35162 - Change in Database api break extension MSSQLBackCompat
$canonicalDBTypes is probably superfluous information, but doesn't harm as a shortcut

Ping r108051

(imported from SVN)

Change-Id: I09ecf56d984405506f654919a822a939e5a9b1ee
2012-03-21 15:56:33 -07:00
Roan Kattouw
0fca9a7991 Revert r107309, r113601, r113704, r113742, r113792, r113838, r113859, r113893, r113894, r113952, r114047, r114252, r114256, r114257. This reverts the remaining 'new' revisions in core.
All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-21 00:16:50 +00:00
Sam Reed
c6f38f8bf6 Bug 35162 - Change in Database api break extension MSSQLBackCompat
$canonicalDBTypes is probably superfluous information, but doesn't harm as a shortcut

Ping r108051
2012-03-11 23:40:33 +00:00
Marcin Cieślak
cfb8e9a251 Handle PostgreSQL transaction errors and improve schema detection
* Introduce $wgDebugDBTransactions facility to help
  figure out what's going on with transactions.
  Currently PostgreSQL only.

  PostgresTransactionState can be easily be made more general 
  to trace all sorts of state machinery.

* Improve r113408: we don't need to full reconnect on error,
  rollback is enough. 
  
  Rolling back breaks search_path, as PostgreSQL
  can manage sessions settings under transaction therefore
  we need to improve schema sniffing introduced in r82674

* Introduce few schema handling functions. This could
  probably be generalized for other databases like DB2 and Oracle.

* Fix bug 15816 - Add a switch for SETting the search_path

  We try to avoid touching search_path at all unless
  really necessary. Even in this case we append MediaWiki
  core schema to the front of the list.

* No longer add $wgDBmwschema to PostgreSQL role search_path
  in the installer. This is no longer necessary as 
  setting schema on connect should ReallyWorkNow(tm).

* Get rid as much as possible of $wgDBmwschema and
  bring us one step closer to fix bug 16794 (wgSharedDB
  support). 
  
  All references to core MediaWiki schema in PostgreSQL
  specific code should now use Database::getCoreSchema() 
  unless we know what we are doing. 

Followup-To: r113408 r82674
2012-03-09 17:24:57 +00:00
Alexandre Emsenhuber
58d34d95f3 DatabaseBase::selectRow() return a simple object, not a ResultWrapper instance 2012-03-03 20:22:18 +00:00
Aaron Schulz
fbf3db96db [DatabaseBase] Made encodeExpiry() recognize 'infinity' and added a decodeExpiry() function 2012-03-03 11:49:02 +00:00
Antoine Musso
ba07c37ea0 Bug 34818 improves regex to capture DB error message
Patch by christian at quelltextlich dot at
2012-03-01 13:11:25 +00:00
Max Semenik
a8f718267e Follow-up r112565: fix code duplication 2012-02-28 14:42:08 +00:00
Sam Reed
c760826b64 Documentations! 2012-02-14 04:05:49 +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
Alexandre Emsenhuber
d109eae77f Pass some more __METHOD__ to DatabaseBase::begin() and DatabaseBase::commit() 2012-01-18 12:10:16 +00:00
Sam Reed
ebf916f3fb Give sql.php eval.php type scrollback 2012-01-12 22:57:51 +00:00
Sam Reed
5f2222c87c Followup r108768, callign the right callback helps too 2012-01-12 22:35:48 +00:00
Sam Reed
0a0cff26aa Add $inputCsllback to sourceStream(), to return full lines back to the calling function
Will be used soooon
2012-01-12 22:10:24 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Max Semenik
6d87a6ea8f Revert r108603, which was itself a revert of r107376, r107994. Before considering something unneeded, please ask first ;) 2012-01-11 20:19:55 +00:00
Antoine Musso
f5f1b6d0bb Reverts MySQL stored procedure support
This is reverting the work done by MaxSem to support stored procedures
and stored function in MySQL. The reasons are:
 - it is not needed yet
 - tests are not functionals
 - alter the stable include/db/Database.php and drop support for ';;'

So please create a branch to work on it and merge it back in trunk
once we have branched 1.19 :-)

I have opened bug 33654 to track this enhancement request.

Reverts r107376, r107994.
2012-01-11 09:46:21 +00:00
Chad Horohoe
75edf9f7d2 Couple of fname -> __method__ 2012-01-06 18:30:11 +00:00
Chad Horohoe
2e0bc11bd7 (bug 32787) Add DB name to debug output. Based on patch by Solitarius 2012-01-06 18:23:52 +00:00
Sam Reed
cd4cdfc15d Followup r107932
Check random class to be isntantiated is a subclass of DatabaseBase
2012-01-05 18:49:19 +00:00
Mark A. Hershberger
0911c3dd81 follow up r107932 with w/s fixes 2012-01-04 16:43:46 +00:00
Mark A. Hershberger
6fb0164343 Fix Bug 33384 - database drivers cannot be provided by extension
Author: Adam Wight

Love the simplicity of this fix.
2012-01-03 19:55:45 +00:00
Max Semenik
6b7317c91f Added support for stored procedures/functions to MySQL:
* Refactored DatabaseBase::sourceStream(), made it possible for descendant classes to alter its behaviour w/o having to redo it completely like Oracle does.
* MySQL class now supports specifying DELIMITER.
* Thrown away the mess of catering for double semicolon. If it's a problem, fix your .sql files!
* Haven't actually touched Oracle.
* Tests!
2011-12-27 12:29:36 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Brion Vibber
e4ea0fa287 * (bug 32786) Fix backwards compatibility for extensions using 1.17's Database::newFromType()
Patch based on https://bugzilla.wikimedia.org/attachment.cgi?id=9604 by Solitarius -- thanks!
Added a conversion for a changed tablePrefix / tableprefix bit.
2011-12-06 22:37:38 +00:00
Sam Reed
5bfce03820 More documentation of parameters following up r104591 2011-12-05 16:50:58 +00:00
John Du Hart
0de3082ca4 Adding new debugging toolbar
Needs a UI cleanup still, but for the most part is working.
2011-12-04 18:29:57 +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
39356de1a4 Moar documentations 2011-11-29 21:04:20 +00:00
Sam Reed
1a1fdcf3e4 Bit more documentation
(test commit also)
2011-11-29 00:09:04 +00:00
Aaron Schulz
bd07cf97f5 Added Database::getServerUptime() function to return seconds of uptime 2011-11-24 19:55:38 +00:00
Aaron Schulz
608963577b Added wasLockTimeout() DB function. All our DBMS can implement this accept for PG. 2011-11-23 23:45:46 +00:00
Aaron Schulz
dfc1675f31 Reverted 'lockTimeout' option from r104069: table_lock_wait_timeout is GLOBAL and the other one requires an innoDB plugin...so that was useless. 2011-11-23 21:03:57 +00:00
Aaron Schulz
12f430217f Factored setTimeout() into setSessionOptions() and deprecated the former. In the future we can batch the queries perhaps. Also added a lock wait timeout option. 2011-11-23 19:25:59 +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
Aaron Schulz
a5ed95fdbf Added rollback-related comment to nextSequenceValue() 2011-11-13 11:28:56 +00:00
Sam Reed
9814e6b075 Add $fname to tableExists
Pass $fname/__METHOD__ in in upstream callers
2011-11-10 20:39:23 +00:00
Platonides
a7704b7075 Allow raw conditions on insertSelect, given that array syntax isn't always expressive enough (r96930) 2011-11-07 17:19:08 +00:00
Sam Reed
2f23e71490 arrray -> array
Whitespace

Other documentation improvements

Comment out some unused code (which has a fixme left with it already)
2011-11-01 23:48:09 +00:00
Niklas Laxström
b286202829 Hmph, yet another bug caused by not having @since 2011-10-30 13:44:27 +00:00
Sam Reed
96641da58e Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:44:47 +00:00