aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/rdbms/field
Commit message (Collapse)AuthorAgeFilesLines
* installer: Add DatabaseUpdater methods to support GlobalBlockingTim Starling2024-11-151-1/+1
| | | | | | | | | | | | | | | * Add modifyFieldIfNullable, to run a patch if a field is nullable * Add modifyTableIfFieldNotExists, to run a patch if a field is absent. GlobalBlocking needs these to update a fields on a virtual domain. The updates are potentially destructive on SQLite and there is no updatelog. Also fix table prefix handling in DatabasePostgres::fieldInfo(), necessary to make GlobalBlocking tests pass with this change. Show more verbose output from modifyTable. Change-Id: I61910dba894c164bebb880aa6af39cc534bd64c5
* rdbms: Add missing documentation to class propertiesUmherirrender2024-09-112-0/+4
| | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I9e5330601ded043ad24a99932fe3fa0ea6c427aa
* rdbms: Fix PSR2.Classes.PropertyDeclaration.Multiple errorsTaavi Väänänen2024-04-223-7/+30
| | | | Change-Id: I7d3d7f759fadf76d9dbcecaf478cf53dc9203bf9
* Drop old class_aliases for before MW 1.39 that were missedJames D. Forrester2024-03-201-3/+0
| | | | | | | The RandomPage alias was dropped in an earlier commit, so group the release note entry in with these. Change-Id: I207d7463ced1a1bb8b8ac749eba175fc0037a217
* Standardise all our class alias deprecation comments for ease of greppingJames D. Forrester2024-03-191-3/+1
| | | | Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
* rdbms: Map PostgreSQL boolean values to MySQL-compatible formsTim Starling2023-11-291-6/+6
| | | | | | | | | | | | Also fix callers that were checking for t/f. In CASE and COALESCE expressions, using 't' and 'f' did actually work, because those literals have an unknown type and the other argument is boolean, so PG coerces them to boolean. But it seems safer and clearer to use the strongly typed literals TRUE and FALSE. Bug: T352229 Change-Id: Ia01b76d3d6d2e048feac8e3118d9faff63a9ac56
* rdbms: Improve documentation around false/boolUmherirrender2022-06-181-1/+1
| | | | | | | | Change type bool in union types to false where true is not allowed Add false to DatabaseSqlite::getFulltextSearchModule Change-Id: I1199b261c4e5c3f6ff184c756f46f2650b16b0c9
* Replace remaining usages of IDatabase::fetchObject()Alexander Vorwerk2022-01-191-1/+1
| | | | | Bug: T299471 Change-Id: I5acae5e72de2f85fd6e68e391297895c86ffb10e
* Add some missing __METHOD__ parameters to database callsDannyS7122021-06-071-1/+2
| | | | | | Plus fix a typo Change-Id: I8ca326990559ea80254ce0cef2ed204590716679
* Postgres: Deprecate table name remapping parameter and functionAmmarpad2021-04-261-1/+0
| | | | | | | | | These are no longer necessary, with abstract schema, the table names should now be in sync with the names used in MySQL/SQlite. Postgres-reserved identifiers need to be quoted where necessary. Bug: T164898 Change-Id: I3bb11a021062d062ca645291c3c82cc318886bd9
* Fix more Squiz.Scope.MethodScope.MissingReedy2020-05-183-23/+23
| | | | Change-Id: I271362623760be8d3aa3cffa84026e72c5d1b52a
* Fix even more Squiz.Scope.MethodScope.MissingReedy2020-05-172-8/+8
| | | | Change-Id: I0c3f8ce7fddfa6886413cdaf1edc236c4dfff44e
* Set method visibility for various constructorsUmherirrender2019-12-032-2/+2
| | | | Change-Id: Id3c88257e866923b06e878ccdeddded7f08f2c98
* Remove more Oracle and Mssql leftoversDaimona Eaytoy2019-08-251-40/+0
| | | | | | | | | | | | | | Follows-up 4d10bb14e81 and 807d793ab9079. According to codesearch [0], these were the last usages. Note that this patch leaves two constants in places, IDatabase::DBO_SYSDBA and DBO_DDLMODE. These are public constants used "mostly for oracle" according to the docs, but maybe we could find other use cases in the future (?). [0] - https://codesearch.wmflabs.org/core/?q=oracle%7Cmssql&i=fosho&files=%5C.%5B%5Ej%5Cd%5D%7Cen%5C.json&repos= Bug: T230418 Change-Id: Ibfb748b4b23b885a77f4de161af4bf2ab9649a89
* rdbms: Remove references to pg_attrdef.adsrc in Postgres codeJeff Janes2019-01-221-1/+1
| | | | | | | | | | | | | | | | | | | PostgreSQL v12 will remove the long-deprecated column pg_attrdef.adsrc. The supported way to introspect into column default values is pg_get_expr(adbin, adrelid), which works back through all versions of PostgreSQL supported by wikimedia. Changing to the supported method will allow the upcoming v12 of the database to be used while maintaining compatibility with older versions, without needing to write version-specific code. This patch has been tested with maintenance/update.php and with phpunit in PostgreSQL versions 9.2, 11, and 12dev. It does not harm the first two, and fixes errors that would otherwise arise in the dev version. All unit tests which pass under version 11 now pass under 12dev as well. Change-Id: I874d347fd286b26773113d4f0c6c30d9a4055ad3
* Fix regular expressionJakub Vrana2018-12-031-2/+2
| | | | | | Found by PHPStan. Change-Id: I95813b0db9a3d6ca8c3894e5ccba00a9dc84b336
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-5/+5
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* Add @deprecated tags to various class_alias callsReedy2018-05-291-0/+3
| | | | | Bug: T195576 Change-Id: I10cd8415891bfe4a278eee06c9cfe905b3e036dc
* rdbms: Allow PostgreSQL schema-check functions to find temporary tablesBrad Jorsch2018-04-051-22/+26
| | | | | | | | PostgreSQL puts temporary tables and such in a hidden, per-connection "schema" that's checked for unqualified table accesses before the normal search_path. We should check that in all the schema-checking functions. Change-Id: I1194ac31f31133b177f624138afee19d00e454b9
* Move Database and subclasses to Rdbms namespaceAaron Schulz2017-04-121-2/+0
| | | | Change-Id: I52bef87512f9ddd155d1f4cc0052f6b7a0db5b42
* AutoloadGenerator: Add support for class_alias()Timo Tijhof2017-02-221-1/+1
| | | | | | Blob, Field, DatabaseBase are now auto-detected. Change-Id: Ib8fae2ec3fbb3f5e4aca7965f81631c5f0485ea1
* Move Field classes to Rdbms namespaceAaron Schulz2017-02-166-50/+19
| | | | | | Update core callers and leave a class alias to \Field. Change-Id: I4908282301d5de2a20baafe510557bd2c3867de5
* Remove trailing empty lines in PHPFomafix2017-01-162-2/+0
| | | | | | | Performed using find . -name \*.php -exec sed -i -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' {} \; Change-Id: I5d0627f94c73690cf3a8a453539c22c760c2aa60
* Postgres updater fixes to make update.php able to runAaron Schulz2016-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | * Remove redundant schema prefix from relname=x query. The schema filtering is already done via the JOIN. The relname portion is just the table name not <schema>.<table name>. * Avoid explicit table schema qualification and rely on the search path, as MW 1.27 did. Previously it only used the global $wgDBschema var to pass to determineCoreSchema() instead of keeping it in mSchema. * Clean up some code duplication in Database::tableName() and make the code comments clearer. * Make DatabasePostgres::tableName() use parent::tableName() instead of a method that just wraps this method. The intent seems clearer this way. * Remove unused return value in PostgresUpdater::rebuildTextSearch(). Bug: T148628 Change-Id: Id11d9576b7c2fdad22ff7f90727c12997217a632
* Move DatabasePostgres to /libs/rdbmsAaron Schulz2016-09-191-0/+107
| | | | | | Fixed all IDEA warnings in the postgres classes too. Change-Id: I06b4c5b2c581fb65552d980cc106aa10fed40285
* Move various DB helper classes to /libs/rdbmsAaron Schulz2016-09-145-0/+263
Change-Id: I0724f1acce4f6c43b1f0983fa119e628e7c53ba5