Commit graph

190 commits

Author SHA1 Message Date
withoutaname
176213b898 Fetch string to pass through writeTemporary() in DatabaseOracle.php
Pulled some code from insertOneRow() to fix the update() function
and prevent the error warnings in bugzilla 64970 from showing up.
Note that since insertOneRow() and update() contains a lot of
duplicate code, they may be candidates for merging, but that is
outside the scope of this request.

Bug: 64970
Change-Id: I9ff9077d68e77f05f878fc541f87e0a5ce86ecc2
2014-06-08 02:45:46 -07:00
umherirrender
f5f1e38b9a Fixed some @params documentation (includes/[db|installer])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
2014-04-19 13:55:27 +02:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
umherirrender
7c314de876 Rename some local vars to start with a lowercase letter
Change-Id: I6e5975ed7351c1439eda19afaba5120c6afa50f1
2014-03-15 21:03:05 +00:00
Siebrand Mazeland
db7de5f4c1 Fix CodeSniffer and warnings in includes/db
Follow-up with a slightly wider scope to e611604d10.

Change-Id: I9bb5ef0ceef0cd7a9c044e675b953db6d3b35407
2014-03-12 18:29:16 +00:00
jenkins-bot
89ca4641e6 Merge "Add sequence support for upsert in DatabaseOracle" 2014-02-25 00:49:31 +00:00
Skizzerz
f7174057a4 Add preliminary MS SQL support
This likely has outstanding bugs but basic wiki operations work just fine in it.

Change-Id: I25df82065a307b9abc30c694f8c8afff0996d7c1
2014-02-15 10:40:19 -08:00
umherirrender
3d0f393ced Add sequence support for upsert in DatabaseOracle
In the same way as in selectInsert

Bug: 53710
Change-Id: I26f891da808ecdc932e29eebda71df4c17a29617
2014-02-15 15:43:00 +00:00
Brad Jorsch
d5f52588a2 Move MySQL-specific fakeMaster/fakeSlave stuff to DatabaseMysqlBase
Probably the fakeMaster/fakeSlave stuff was originally intended to be
generic, but the existing code in Database.php is making some very
MySQL-specific assumptions. So let's evict it from Database.php (except
for the minimal support functions) and put it in DatabaseMysqlBase where
it makes more sense.

This also takes care of fixing the breakage described in I5d2a1696 by
reverting Id6268193 and the problematic bit of I364e192e (again).

Change-Id: I3dc6ca216bf2c2f07d3090e86f2539292e1fa86b
2014-01-13 15:00:27 -05:00
jenkins-bot
5330243416 Merge "WebInstaller: Don't call getSoftwareLink()" 2014-01-11 21:55:50 +00:00
Kevin Israel
0eab1ace67 WebInstaller: Don't call getSoftwareLink()
This gets the web installer working without the mysql or mysqli
PHP extension, which is not needed for other database systems.

* Avoid "lego" construction: put link text directly in the messages,
  which because the messages are parsed as wikitext, is easy to do.
* Put URLs in separate, ignored messages to avoid duplication in
  Database*::getSoftwareLink().
* Because I had to touch a MySQL-related i18n message, I figured
  this would be a good time to address bug 28281 (regarding MySQL
  forks and Special:Version).
* Other miscellaneous message changes, such as recommending the
  mysqli PHP extension over the old, deprecated mysql extension.

Bug: 28281
Bug: 58167
Change-Id: I6dbc9d32c8c2d8f233a67d574229b80444885aea
2014-01-10 03:38:44 -05:00
Siebrand Mazeland
687319540e Return correct values and types
Change-Id: Ia069856160aae1ab937daee2da0d6800fe89698f
2014-01-06 18:47:58 +00:00
Siebrand Mazeland
e22a70a103 Update documentation for database related classes
Change-Id: I364e192e2624f89a91dcb19e371ce3412142a95f
2014-01-06 19:45:40 +01:00
jenkins-bot
f947afc81e Merge "Declare visibility for class properties in DatabaseOracle.php" 2013-12-30 00:01:38 +00:00
Siebrand Mazeland
9b05bf903d Add missing return value for DatabaseBase::open() overrides
Change-Id: Ifcd9e6fb36a5f8f53ad38a60719267d69c86c17e
2013-12-27 17:05:57 +00:00
Siebrand Mazeland
9e76d847e0 Declare visibility for class properties in DatabaseOracle.php
* Remove unused $lastResult and $cursor.
* Rename private $ignore_DUP_VAL_ON_INDEX to $ignoreDupValOnIndex.
* Update/add some documentation.

Change-Id: Ie5d82836fe4907337e50f10cc1654d5ddf08f270
2013-12-27 09:24:37 +00:00
umherirrender
ce356414d3 Use square brackets instead of curly braces for char of a string
The use of curly braces is deprecated in php 4.0, so changing it to
square brackets

Change-Id: I807da8c873bb937ee32df75c27d632075bc84be1
2013-11-23 19:22:03 +01:00
Siebrand Mazeland
b547395796 Break long lines and formatting updates for includes/db/
Fix all line length related CodeSniffer warnings.

Change-Id: Id0fd8f4c7276185f51489659ee3cd06962fbc16d
2013-11-21 16:43:40 +00:00
Siebrand Mazeland
1e10dcd3aa Update formatting on database-related classes
Change-Id: I91f83e28ae25f80ba9e36c612f1ad050ffa1573c
2013-11-21 16:39:38 +00:00
Aaron Schulz
a97402559b Changed use of tag_summary to use change_tag with GROUP_CONCAT()
* Added buildGroupConcatField() method to the DB classes

bug: 53577
Change-Id: I976f297653880e66af429ba9b622a954fefcc512
2013-11-17 06:37:08 +00:00
Aaron Schulz
58a0e0c06d Cleaned up DatabaseBase constructor to use an array
Change-Id: I094185585dc844ca4d2d8b629107b2ab8f9bef39
2013-11-06 12:17:15 -08:00
jenkins-bot
34981172de Merge "Changed tableName so it returns uppercased table names (+prefix) Changed tableExists so it returns boolean (and closes resource when it's done in case it fails)" 2013-09-18 19:11:04 +00:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
umherirrender
0a810a5a87 Avoid date()/gmdate() for date formatting
Added a MWTimestamp::format method to format a timestamp object in the
given pattern. This avoids date(), which needs the local time
zone corretly set on the server, which is assumed at the moment in
Setup.php

Added MWTimestamp::getInstance for gmdate() and
MWTimestamp::getLocalInstance for date() to create a MWTimestamp object
and use it as inline statement.
Also MWTimestamp::setTimezone and MWTimestamp::getTimzone was added for
timezone handling.

Change-Id: I812aa013be2f4380e0cf10dc465202756fe8347b
2013-07-08 04:14:12 +00:00
freakolowsky
cd736291de Oracle: DRCP and persistent connections support
Adds $wgDBOracleDRCP, when set to true, enables persistent connection
with DRCP on Oracle.

Requires Oracle DB 11gR1 or above. More informations about DRCP can be
found at:
http://www.oracle-base.com/articles/11g/database-resident-connection-pool-11gr1.php

Change-Id: I2be7120a2ebec39d866b79be62ac715bbc3738a9
2013-05-29 21:46:36 +02:00
freakolowsky
850d17211b Changed tableName so it returns uppercased table names (+prefix)
Changed tableExists so it returns boolean (and closes resource when
it's done in case it fails)

Change-Id: I4f842a634900756618bb4b3b6d83f86492e73fab
2013-05-26 16:49:28 +02:00
Aaron Schulz
be7b10166a Made DatabaseBase::getSoftwareLink() dynamic.
* All callers are calling it this way and it breaks
  hhvm when declared statically and called dynamically.

Change-Id: I894e615fd828615384aa8457a16a759c8aa416ef
2013-05-14 21:18:57 -07:00
Chad Horohoe
b27cfbd9e8 Use __METHOD__ for default $fname params to database functions
Change-Id: I86cbdeabee9709cde15a6b7bd47a53229c2e3f92
2013-05-07 06:18:57 +00:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
umherirrender
9f14ecf829 Added space after switch/Removed spaces after unset
While at it, added/removed some other spaces in the same files

Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
2013-04-26 16:42:31 +02:00
umherirrender
892ee7a4af Fixed spacing in db/debug/diff/externalstore/objectcache folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I32a43c547630ce31b6b25cc1bc9eedc50e67b2d7
2013-04-20 22:28:52 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
umherirrender
8764b3aa7c Remove spaces in function signature
Change-Id: I45aea7a7af88cd913b2f485913620a8af0ab2fed
2013-03-18 20:44:43 +01:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
c16e1a4490 TRUE, FALSE and NULL must be lowercase
From phpcs

Change-Id: I09672012be28ae3985702e314442db00d154de24
2013-02-09 21:10:44 +01:00
umherirrender
f97a3a4027 fix some spacing
Change-Id: I670a7baf3ba1e70d18346bb00938d518ba2063bd
2013-02-04 19:59:14 +00:00
umherirrender
ad6706f671 refactor Database::makeSelectOptions
Created new method for creating the group by/having and order by sql,
this avoids code duplication in each database with a overridden
makeSelectOptions.

This fix the group by/having/order by for DB2/MSSQL to support array
conditions. Fixed the having for Postgres for array conditions.

Change-Id: I0fbcb3e8e68d995d93be0bf3d0a347788a39194a
2013-01-26 10:43:20 +01:00
freakolowsky
9816dcbe8e * Oracle Schema update to latest
* fixed makeSelectOptions (bug 43533)

Change-Id: Ib146a5073de18f2b20a22f34bd60222b230c9514
2012-12-31 15:32:33 +01:00
lupo
2071bf880e (bug 41146) DatabaseOracle no more rely on mbstring
DatabaseOracle class has been using mb_check_encoding which might not
always be available.  We now rely on the StringUtils::isUtf8() method
implemented by I4cf4dfe2.

Change-Id: I5a9ffa23e3e738e4886d61e85974b0af25058308
2012-12-12 11:28:28 +00:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Aaron
3f277e8744 Added post-commit callback support to DB classes.
* This can allow for autocommit job queue insertion without
  breaking existing transactions (which currently happens since
  job queue insert does begin/commit).

Change-Id: I021d4a73635168c05bbc1068912c2c6dbdf9cdc4
2012-08-29 13:01:38 -07:00
Aaron Schulz
eb16f5898d [Database] Various DB cleanups.
* Removed unused and obsolete set() and safeQuery() functions.
* Removed unused deprecated constructor functions.
* Removed unused limitResultForUpdate() cruft function.
* Removed unused standardSelectDistinct(), it's better to just follow the standard for all queries.
* Removed other cruft functions unused by core/extensions.
* Made some internal functions protected.

Change-Id: I90be88ea740834a417a17d7751f1be7bac4eae4e
2012-08-08 11:00:48 -07:00
Aaron Schulz
a021ffc9ce [Database] mark some methods as explicitly public
Change-Id: I95fca6d346ae812c22b88b577477be02b5a0676b
2012-07-17 10:59:19 +02:00
Alexandre Emsenhuber
78a56a67ba Added missing GPLv2 headers in includes/db.
Change-Id: Ib8fe301c6db77603e411113cea5a39c25c664961
2012-04-26 10:47:10 +02:00
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
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00