Commit graph

39 commits

Author SHA1 Message Date
umherirrender
3b2236e40f Remove DatabaseMysqlBase::getLagFromProcesslist() (deprecated 1.19)
Change-Id: I7dfdd943abf1c94a35e2401f92208c19683dc200
2014-06-25 19:54:15 +02:00
umherirrender
23bb3d1cb4 Follow-Ups to "Fixed some @params documentation"
Fix of inline comments of the following patch sets:
Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca
Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36
Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634
Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102
Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b

Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
2014-04-23 13:39:49 +02: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
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
jenkins-bot
d1f8fb08d4 Merge "Automatically add a new line at the end of wfLogDBError()" 2014-03-24 18:45:47 +00:00
Alexandre Emsenhuber
59c42b90d5 Automatically add a new line at the end of wfLogDBError()
I found two calls to wfLogDBError() that do not add a new line
at the end of the message. So instead of adding them to that
entries, I changed wfLogDBError() to automatically put it on
icoming messages; as for wfDebugLog().

Change-Id: Id014b5827a0aeef6873ebf08d78f0a3d7581d63b
2014-03-23 10:30:59 +01:00
Kevin Israel
f67543df06 DatabaseMysqlBase: Remove broken check for Percona Server
Percona Server does not include its name in its version suffix.
It would be possible to check for precompiled versions of the
product using the version_comment variable, though not third-
party builds from its source code (which are merely indicated
as "Source distribution").

Given that even Percona itself does not distinguish between
Percona Server and MySQL in their version of the mysql command-
line client, I have chosen simply to remove the broken check.

I have also made the check for MariaDB consistent with that
in its version of mysql (by also checking for the old suffix
"-maria-").

Follows-up 0eab1ace67.

Change-Id: I62c3949b775a38f28f09568ebb28af2adb9be69b
2014-03-21 20:17:08 -04:00
umherirrender
4c95d41c76 Standardize is_array check in Database::upsert
Change-Id: I81c7ff2cf6a1f5fe0a2a6cdad1dd26d746e17c10
2014-02-03 21:42:04 +01: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
jenkins-bot
9a3b6e5639 Merge "Return correct values and types" 2014-01-10 12:25:23 +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
aa4d6e1f2e Update formatting
Change-Id: I27e43c19906edc732b4976b8426ed34bad63622b
2014-01-06 21:04:34 +00:00
Siebrand Mazeland
985fc5226d Specify DBMasterPos::getMasterPos()
Change-Id: Id6268193d08737e2599ec84496527b3be348dfda
2014-01-06 20:02:20 +01: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
umherirrender
8a2e1a4c88 Fix doc for Database::upsert
One @params too much

Change-Id: I8cea6228587574ff90060d46b4430b2348a68973
2014-01-03 21:35:21 +01:00
jenkins-bot
3ebfa0acfc Merge "Revert "Declare visibility for class properties in MySQLMasterPos"" 2014-01-03 18:12:02 +00:00
Anomie
a399020c6a Revert "Declare visibility for class properties in MySQLMasterPos"
These members are accessed from DatabaseMysqlBase::masterPosWait and
DatabaseBase::masterPosWait, causing errors if the wiki has slave
databases or has fakeSlaveLag set.

This reverts commit d0325927d4.

Change-Id: I563bde457274dad2f254145426376b275b597e2a
2014-01-03 17:18:55 +00:00
jenkins-bot
923a6e62b8 Merge "Declare visibility for class properties in MySQLMasterPos" 2014-01-03 00:01:39 +00:00
Reedy
f239598cb1 void methods don't return anything. Especially when they always throw an exception
Change-Id: I6c959b44b64fdc38e248e0000a6594c12a10b6b4
2014-01-02 16:21:59 +00:00
Aaron Schulz
fbe350750b With mysqli, avoid setting the charset twice
* This uses MYSQLI_SET_CHARSET_NAME to set the charset to utf8/binary
* This replaces a live WMF hack to skip the extra round trip

Change-Id: I1718e013fcdc95163d111d460f0dd6d2190a99b1
2013-12-30 23:16:59 +00:00
Siebrand Mazeland
d0325927d4 Declare visibility for class properties in MySQLMasterPos
Change-Id: I020524274261144212901bfc8dfe094f03e4721c
2013-12-27 09:24:59 +00:00
Kevin Israel
bc06a9b8b7 Abstract out mysql_field_type() call from DatabaseBase
DatabaseMysqlBase::fieldType() is used in the maintenance script
convertLinks.php for upgrading from MediaWiki 1.2 or earlier. This
script was failing when the mysqli extension was enabled.

Follows-up b1cc3511fd, b2d64432ee, and 00299ecb95.

Change-Id: I5d888f4dd344ecba15506023d35f6d2d6e24cfd8
2013-12-15 18:40:50 +00:00
Platonides
73fd2d2497 Add missing wfProfileOut()s
Change-Id: I072224fdeda25f8fe8a76338e7e767ab4c0619f0
2013-11-23 19:15:07 +01:00
Aaron Schulz
d81f323f32 Avoiding implicit transactions when applying
* Some callers get the DB and flip DBO_TRX off, which does not
  help much if simply connecting to the DB starts a transaction.

Change-Id: I2bc90a1cdeade13ccb546db1183ab08f25156da1
2013-11-21 15:54:06 -08: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
umherirrender
f153998317 Fixed spacing
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line

Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
2013-11-19 19:03:54 +01:00
Alexandre Emsenhuber
a222905098 Use the native set_charset() method if available instead of SET NAMES
According to the PHP manual, it is the recommended way to set the charset.

- mysql extension has it for MySQL >= 5.0.7
- mysqli extension has it for MySQL >= 5.0.6
or if using mysqlnd.

Change-Id: I8cd2f97fcad4b045c6f99ff894254847b13c6878
2013-11-16 07:57:52 +00:00
daniel
40f6d8546c Make sure we always restore the error handler.
Change-Id: I27f5d11ea27f783eda71c2bfdba7e70695f5d53c
2013-11-15 16:57:34 +00:00
AlephNull
e9d53667f4 MySQL method to find out view + fix fatal in tests
We were missing a method to list out views defined in a database. This
patch adds in MysqlBase::isView() and MysqlBse::listViews().

Since listViews() cache its result in DatabaseBase::$allViews, we also
introduce a final DatabaseBase::clearViewsCache() to let us clear the
per process cache.

Finally, fixed fatal error when duplicating VIEWs in MySQL.

bug: 43571
Change-Id: I8650baa4b721fe69ea3e1d557dd76745c0c7754e
2013-11-07 09:43:59 +00:00
Tim Starling
00299ecb95 Resubmit "Add support for mysqli extension"
This reverts commit 1d7e12179d.

Change-Id: Id1a3fc34e94006b880f58de83e5e7c70b21d26ed
2013-10-17 01:35:28 +00:00
Tim Starling
1d7e12179d Revert "Add support for mysqli extension"
Throws exception unconditionally, installer support is totally broken.

This reverts commit b2d64432ee.

Change-Id: I2edb78440806754c42d48c5da2ff74b4cb40fa2d
2013-10-16 23:49:24 +00:00
Jakub Vrana
b2d64432ee Add support for mysqli extension
DatabaseBase::factory()'s parameter array now takes an optional
'driver' variable to allow specifying a specific driver for the
database class if we support more than one.

This is so we can gracefully support mysql/mysqli as the former is
deprecated, but the concept could be extended to other databases
as well.

Bug: 45288
Co-Author: Chad Horohoe <chadh@wikimedia.org>
Change-Id: I6733fe21c4aa7443e409c5dfa7c789552b2b62b7
2013-10-16 23:17:57 +00:00
Bryan Davis
cfde3c1958 Escape backticks when quoting MySQL identifiers
Previously mysql_real_escape_string() was improperly used which escapes
for inclusion in a plain string rather than an identifier.

Also adds basic test support for the DatabaseMysqlBase class.

Co-Authored by: Antoine Musso <hashar@free.fr>
Bug: 55427
Change-Id: Ic045e195c89d8d5d0f0edbda0cd1df781de7025c
2013-10-09 15:43:45 -06:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
Aaron Schulz
3bb52cc804 database: Improve DatabaseMysql::masterPosWait() performance by caching the position
* This is useful for things like loads of refreshLinks jobs that call wfGetLB()->waitFor().

Change-Id: I05a564a3b73999517fec2476ed946e092c16c3d4
2013-06-26 23:39:43 +00:00
Jakub Vrana
b1cc3511fd Prepare DatabaseMysql for mysqli
PHP extensions mysql and mysqli have lots in common.
In order to support mysqli, this diff separates common MySQL behavior to abstract class DatabaseMysqlBase and implements the mysql-extension specific in DatabaseMysql.
Outside behavior remains the same.

I've tried to minimize future code duplication by introducing mysql*() methods even if the parent method just unwraps the result.

Bug: 45288
Change-Id: I905d4a4550377bc849a860f0962dad710d9dc71f
2013-06-12 23:44:24 +00:00