- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I7b65fe04db431342cc58b469dc48f41a50c4e891
- Added/removed spaces around parenthesis
- Added space after switch/if/foreach
- changed else if to elseif
Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2
MySQL automatically orders by the GROUP BY columns if no ORDER BY
is specified. You can countermand this by specifying
ORDER BY NULL, which can give speed improvements in some cases,
for example if the GROUP BY was implemented by hashing then a
sort is unneeded and wastes time.
PostgreSQL does not tolerate the ORDER BY NULL syntax,
and does not need an analgous hint because it never does
gratuitious sorting of the nature just discussed.
This patch makes PostgreSQL ignore the ORDER BY NULL clause.
It might be a better approach to find a way to add this clause
specifically to MySQL, rather than to drop it specifically from
other database engines.
SQLite seems to tolerate the MySQL syntax. Oracle and MSSQL
were not evaluated.
Bug: 65794
Change-Id: Ia9666136edd25e1e0d0728a8b28a92e44d00abc6
SQL errors would issue a rollback, even when it was
not actually in a transactions. Doing so would cause
another error to be reported. This could obscure the
original error, particularly during unit tests.
Fix this by not rolling back when not in a transaction.
Bug: 58095
Change-Id: Ib5220e37dd6c364feee6b7f8e7ecbdae2a2e0ba1
PostgreSQL is usually not used with table name prefixes,
and some of the PostgreSQL-specific code took the
shortcut of not dealing with prefixes. However, the PHPUnit
tests do force a prefix to be used, exposing this limitation.
Make PostgreSQL code add the prefix to table names being used
in FOR UPDATE OF clause.
This fixes 13 of the 17 PostgreSQL unit tests errors against
git HEAD:
EditPageTest::testAutoMerge with data set #1 ('Elmo', 'one
EditPageTest::testAutoMerge with data set #2 ('Elmo', 'Intro
EditPageTest::testAutoMerge with data set #3 ('Adam', 'one
EditPageTest::testAutoMerge with data set #4 ('Adam', 'one
EditPageTest::testAutoMerge with data set #5 ('Adam', 'Intro
EditPageTest::testAutoMerge with data set #6 ('Berta', 'one
EditPageTest::testAutoMerge with data set #7 ('Berta', 'one
EditPageTest::testAutoMerge with data set #8 ('Berta', 'Intro
WikiPageTest::testDoEdit
WikiPageTest::testDoEditContent
WikiPageTest::testDoRollback
WikiPageTest::testDoRollbackFailureSameContent
WikiPageTest::testExists
The change also applies to 1.22.6 and fixes several unit tests
errors there.
Change-Id: I054690f49e250cadd2dc2a6d9e20dea879d896b6
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
The fix for 47055 introduced a fatal error when running rebuildall.php. This
is a workaround suggested by gebhkla on Bugzilla (idle for 10+ days). It just
checks to make sure $options is actually an array before calling array_search
on it.
Bug: 60094
Change-Id: Ib54420b5a749c60b82a4757a9f5fa511f48fdb72
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
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
* Add used by not declared class properties.
* Rename private $numeric_version to $numericVersion.
* Update some documentation.
Change-Id: I233001e732724146fcee04f0e358a9563c9e9fd4
Postgresql cannot handle FOR UPDATE with outer joins, but it allows
specifying which tables can be locked. This changes DatabasePostgresql
to render proper FOR UPDATE statements that only include the main
table and any tables in inner joins.
Bug: 47055
Change-Id: I1ac587ac39f448b9e7f4befb44826b43044ad6f0
* All callers are calling it this way and it breaks
hhvm when declared statically and called dynamically.
Change-Id: I894e615fd828615384aa8457a16a759c8aa416ef
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
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
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
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
* In newer versions of PG, a "hex" escaping format is used, which
totally breaks things like SqlBagOStuff since the pg_unescape_bytea
function still works the old way (it does not use a DB handle).
Setting the format to the old way via SET fixes this.
Change-Id: I9f5a64922acd2d954880790f42ba4efafaed314e
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
For PostgreSQL only:
SavepointPostgres tries to rollback already committed/rolled
back transactions, so after it got committed, don't try
to rollback it again in SavepointPostgres::__destroy.
This happens only when trying to INSERT IGNORE something
without having a transaction open first (e.g. during
unit testing).
Thanks to: OverlordQ <overlordq@gmail.com>
Change-Id: I40ff757a7e2c6ff21f73e1ecd35754e1981f1941