Commit graph

126 commits

Author SHA1 Message Date
Skizzerz
1781729aa2 Fix some issues with Microsoft SQL Server support
- Add in missing schema update for 1.23
- Fix detection of table/field existence
- Fix INSERT IGNORE support for cases where the primary key was being duplicated

Change-Id: Ia15673c869c2cf732ffe96f1608cee884d106ccd
2014-04-22 01:08:45 -05: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
Alexandre Emsenhuber
a0d178740a Fix usage of $wgDebugDumpSql
- In DatabaseMssql, use $this->debug() instead of $wgDebugDumpSql
  so that it takes into account the DBO_DEBUG flag
- Use the same construction to set the DBO_DEBUG flag in
  LBFactorySimple::newMainLB() as for the other flags so that
  it is easier to read the code

Change-Id: Ie775cdb3677739a97e0d64dabbf80fc685149337
2014-04-05 08:54:11 +02:00
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +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
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
Siebrand Mazeland
0cef781886 Fix CodeSniffer errors and warnings
Change-Id: Idc74e34634d88625773fb8f73315f61edfa67e28
2014-02-05 11:20:17 +01: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
1b0a0021ca Make tableNamesWithUseIndexOrJOIN() and makeUpdateOptions() protected
Per parents.

Change-Id: I4419e19abac84f8f4e397c4ebc9d1cf2e1f6a945
2014-01-06 18:47:42 +00:00
Siebrand Mazeland
559cc681d3 Ensure variables in database classes are defined, used and correctly cased
Change-Id: I12065b2c2bae1c000edac3c92d1db0c03fc40f90
2014-01-06 18:46:48 +00:00
Siebrand Mazeland
e22a70a103 Update documentation for database related classes
Change-Id: I364e192e2624f89a91dcb19e371ce3412142a95f
2014-01-06 19:45:40 +01:00
jenkins-bot
249a46ffac Merge "Declare visibility for class properties in DatabaseMssql" 2013-12-29 19:30:35 +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
d3b19b3a7b Declare visibility for class properties in DatabaseMssql
Change-Id: Icf0209a1f1f601a50dbc1e8cf59ca0b8afabd40f
2013-12-27 09:25:15 +00: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
MarkAHershberger
c24f8be729 Revert "Remove unsupported and mostly non-functional Mssql support"
This reverts commit 5e1efc3144.

This sort of thing needs to be discussed.  Please do not self-approve changes like this.

Change-Id: I9eb9ea315d90584b7fe95db43a6759884f9506b5
2013-11-16 02:06:01 +00:00
Chad Horohoe
5e1efc3144 Remove unsupported and mostly non-functional Mssql support
Change-Id: Id0a688865a5b7b6bb363f7b118fad4f455d2b3b6
2013-11-15 10:59:37 -08: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
umherirrender
cbc4fd7a5b print is not a function
Removed parenthesis after print

Change-Id: I1343872de7aa7c64952a3d86a63aaa091e46bda3
2013-05-09 20:06:03 +02: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
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
Timo Tijhof
acb292d733 phpcs: Fix Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore violations
ERROR: Closing brace must be on a line by itself
Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore

- For non-empty scopes it means the closing brace must be on a separate
  line. This is already the case in most classes in some cases the "lazy
  closing" is still used.
  array(
   'x' ); // Moved } to next line
  function () { return 'x'; } // Moved } to next line
  case 1:
    stuff; break; // Moved break to next line
- For empty function it serves as a visual distinction between there not
  being a scope block / function body and there being an empty function
  body.
  function foo(); // No body
  function foo() {} // Empty body - violation
  function bar() { // Empty body corrected
  }

Change-Id: I0310ec379c6d41cc7d483671994d027a49f32164
2013-04-11 07:34:41 +00: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
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
jenkins-bot
419786beb0 Merge "remove not needed return and break" 2013-02-10 13:02:07 +00:00
umherirrender
3779d16d59 remove not needed return and break
break after throw is not executed

return; at end of function is not needed

Change-Id: I7c1c1799f78da11b7607a753d4f215c4547f0428
2013-02-09 23:55:46 +01: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
jenkins-bot
cb6ee6758d Merge "refactor Database::makeSelectOptions" 2013-02-02 00:14:08 +00:00
umherirrender
2e8da558ba fix some spacing
Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
2013-01-26 22:11:09 +01: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
Antoine Musso
9362bb6c56 miscellaneous doxygen warnings
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
  elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
  code.
* various undocumented function parameters
* typos in parameters declarations

Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
2012-10-22 14:00:08 +02: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
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
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
6f3c9ff025 Fix syntax error I introduced from r102683 2011-11-10 20:49:11 +00:00
Sam Reed
9814e6b075 Add $fname to tableExists
Pass $fname/__METHOD__ in in upstream callers
2011-11-10 20:39:23 +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