MediaWiki REL1_40
|
Inherits Wikimedia\Rdbms\Platform\MySQLPlatform.
Public Member Functions | |||||||||||||||||||
getFloatDeclarationSQL (array $column) | |||||||||||||||||||
Public Member Functions inherited from Wikimedia\Rdbms\Platform\MySQLPlatform | |||||||||||||||||||
addIdentifierQuotes ( $s) | |||||||||||||||||||
MySQL uses backticks for identifier quoting instead of the sql standard "double quotes". | |||||||||||||||||||
buildExcludedValue ( $column) | |||||||||||||||||||
Build a reference to a column value from the conflicting proposed upsert() row. | |||||||||||||||||||
buildIntegerCast ( $field) | |||||||||||||||||||
buildStringCast ( $field) | |||||||||||||||||||
| |||||||||||||||||||
deleteJoinSqlText ( $delTable, $joinTable, $delVar, $joinVar, $conds) | |||||||||||||||||||
ignoreIndexClause ( $index) | |||||||||||||||||||
isQuotedIdentifier ( $name) | |||||||||||||||||||
isTransactableQuery ( $sql) | |||||||||||||||||||
Determine whether a SQL statement is sensitive to isolation level. | |||||||||||||||||||
lockIsFreeSQLText ( $lockName) | |||||||||||||||||||
lockSQLText ( $lockName, $timeout) | |||||||||||||||||||
makeLockName ( $lockName) | |||||||||||||||||||
unlockSQLText ( $lockName) | |||||||||||||||||||
useIndexClause ( $index) | |||||||||||||||||||
Public Member Functions inherited from Wikimedia\Rdbms\Platform\SQLPlatform | |||||||||||||||||||
__construct (DbQuoter $quoter, LoggerInterface $logger=null, DatabaseDomain $currentDomain=null, $errorLogger=null) | |||||||||||||||||||
anyChar () | |||||||||||||||||||
Returns a token for buildLike() that denotes a '_' to be used in a LIKE query. | |||||||||||||||||||
anyString () | |||||||||||||||||||
Returns a token for buildLike() that denotes a '' to be used in a LIKE query. | |||||||||||||||||||
assertValidUpsertSetArray (array $set, array $identityKey, array $rows) | |||||||||||||||||||
bitAnd ( $fieldLeft, $fieldRight) | |||||||||||||||||||
| |||||||||||||||||||
bitNot ( $field) | |||||||||||||||||||
| |||||||||||||||||||
bitOr ( $fieldLeft, $fieldRight) | |||||||||||||||||||
| |||||||||||||||||||
buildComparison (string $op, array $conds) | |||||||||||||||||||
Build a condition comparing multiple values, for use with indexes that cover multiple fields, common when e.g. | |||||||||||||||||||
buildConcat ( $stringList) | |||||||||||||||||||
Build a concatenation list to feed into a SQL query.
| |||||||||||||||||||
buildGreatest ( $fields, $values) | |||||||||||||||||||
Build a GREATEST function statement comparing columns/values.Integer and float values in $values will not be quotedIf $fields is an array, then each value with a string key is treated as an expression (which must be manually quoted); such string keys do not appear in the SQL and are only descriptive aliases.
| |||||||||||||||||||
buildGroupConcatField ( $delim, $table, $field, $conds='', $join_conds=[]) | |||||||||||||||||||
Build a GROUP_CONCAT or equivalent statement for a query.This is useful for combining a field for several rows into a single string. NULL values will not appear in the output, duplicated values will appear, and the resulting delimiter-separated values have no defined sort order. Code using the results may need to use the PHP unique() or sort() methods.
| |||||||||||||||||||
buildLeast ( $fields, $values) | |||||||||||||||||||
Build a LEAST function statement comparing columns/values.Integer and float values in $values will not be quotedIf $fields is an array, then each value with a string key is treated as an expression (which must be manually quoted); such string keys do not appear in the SQL and are only descriptive aliases.
| |||||||||||||||||||
buildLike ( $param,... $params) | |||||||||||||||||||
LIKE statement wrapper.This takes a variable-length argument list with parts of pattern to match containing either string literals that will be escaped or tokens returned by anyChar() or anyString(). Alternatively, the function could be provided with an array of aforementioned parameters.Example: $dbr->buildLike( 'My_page_title/', $dbr->anyString() ) returns a LIKE clause that searches for subpages of 'My page title'. Alternatively: $pattern = [ 'My_page_title/', $dbr->anyString() ]; $query .= $dbr->buildLike( $pattern );
| |||||||||||||||||||
buildSelectSubquery ( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[]) | |||||||||||||||||||
Equivalent to IDatabase::selectSQLText() except wraps the result in Subquery. | |||||||||||||||||||
buildSubstring ( $input, $startPosition, $length=null) | |||||||||||||||||||
conditional ( $cond, $caseTrueExpression, $caseFalseExpression) | |||||||||||||||||||
Returns an SQL expression for a simple conditional.This doesn't need to be overridden unless CASE isn't supported in the RDBMS.
| |||||||||||||||||||
decodeExpiry ( $expiry, $format=TS_MW) | |||||||||||||||||||
Decode an expiry time into a DBMS independent format. | |||||||||||||||||||
deleteSqlText ( $table, $conds) | |||||||||||||||||||
dispatchingInsertSqlText ( $table, $rows, $options) | |||||||||||||||||||
dropTableSqlText ( $table) | |||||||||||||||||||
encodeExpiry ( $expiry) | |||||||||||||||||||
Encode an expiry time into the DBMS dependent format. | |||||||||||||||||||
escapeLikeInternal ( $s, $escapeChar='`') | |||||||||||||||||||
extractSingleFieldFromList ( $var) | |||||||||||||||||||
factorConds ( $condsArray) | |||||||||||||||||||
Given an array of condition arrays representing an OR list of AND lists, for example: | |||||||||||||||||||
fieldNameWithAlias ( $name, $alias=false) | |||||||||||||||||||
Get an aliased field name e.g. | |||||||||||||||||||
getInfinity () | |||||||||||||||||||
Find out when 'infinity' is.Most DBMSes support this. This is a special keyword for timestamps in PostgreSQL, and works with CHAR(14) as well because "i" sorts after all numbers.
| |||||||||||||||||||
getQueryVerb ( $sql) | |||||||||||||||||||
getTableAliases () | |||||||||||||||||||
implicitOrderby () | |||||||||||||||||||
Returns true if this database does an implicit order by when the column has an index For example: SELECT page_title FROM page LIMIT 1.
| |||||||||||||||||||
indexName ( $index) | |||||||||||||||||||
Allows for index remapping in queries where this is not consistent across DBMS. | |||||||||||||||||||
insertNonConflictingSqlText ( $table, array $rows) | |||||||||||||||||||
insertSelectNativeSqlText ( $destTable, $srcTable, array $varMap, $conds, $fname, array $insertOptions, array $selectOptions, $selectJoinConds) | |||||||||||||||||||
insertSqlText ( $table, array $rows) | |||||||||||||||||||
isFlagInOptions ( $option, array $options) | |||||||||||||||||||
isWriteQuery ( $sql, $flags) | |||||||||||||||||||
Determine whether a query writes to the DB. | |||||||||||||||||||
limitResult ( $sql, $limit, $offset=false) | |||||||||||||||||||
Construct a LIMIT query with optional offset.The SQL should be adjusted so that only the first $limit rows are returned. If $offset is provided as well, then the first $offset rows should be discarded, and the next $limit rows should be returned. If the result of the query is not ordered, then the rows to be returned are theoretically arbitrary.$sql is expected to be a SELECT, if that makes a difference.
| |||||||||||||||||||
makeInsertLists (array $rows, $aliasPrefix='', array $typeByColumn=[]) | |||||||||||||||||||
Make SQL lists of columns, row tuples, and column aliases for INSERT/VALUES expressions. | |||||||||||||||||||
makeKeyCollisionCondition (array $rows, array $uniqueKey) | |||||||||||||||||||
Build an SQL condition to find rows with matching key values to those in $rows. | |||||||||||||||||||
makeList (array $a, $mode=self::LIST_COMMA) | |||||||||||||||||||
Makes an encoded list of strings from an array. | |||||||||||||||||||
makeWhereFrom2d ( $data, $baseKey, $subKey) | |||||||||||||||||||
Build a partial where clause from a 2-d array such as used for LinkBatch. | |||||||||||||||||||
normalizeConditions ( $conds, $fname) | |||||||||||||||||||
normalizeOptions ( $options) | |||||||||||||||||||
normalizeUpsertParams ( $uniqueKeys, &$rows) | |||||||||||||||||||
Validate and normalize parameters to upsert() or replace() | |||||||||||||||||||
qualifiedTableComponents ( $name) | |||||||||||||||||||
Get the table components needed for a query given the currently selected database. | |||||||||||||||||||
releaseSavepointSqlText ( $identifier) | |||||||||||||||||||
replaceVars ( $ins) | |||||||||||||||||||
Database-independent variable replacement. | |||||||||||||||||||
rollbackSqlText () | |||||||||||||||||||
rollbackToSavepointSqlText ( $identifier) | |||||||||||||||||||
savepointSqlText ( $identifier) | |||||||||||||||||||
selectSQLText ( $table, $vars, $conds='', $fname=__METHOD__, $options=[], $join_conds=[]) | |||||||||||||||||||
Take the same arguments as IDatabase::select() and return the SQL it would use.This can be useful for making UNION queries, where the SQL text of each query is needed. In general, however, callers outside of Database classes should just use select().
| |||||||||||||||||||
setCurrentDomain (DatabaseDomain $currentDomain) | |||||||||||||||||||
setIndexAliases (array $aliases) | |||||||||||||||||||
Convert certain index names to alternative names before querying the DB.Note that this applies to indexes regardless of the table they belong to.This can be employed when an index was renamed X => Y in code, but the new Y-named indexes were not yet built on all DBs. After all the Y-named ones are added by the DBA, the aliases can be removed, and then the old X-named indexes dropped.
| |||||||||||||||||||
setPrefix ( $prefix) | |||||||||||||||||||
setSchemaVars ( $vars) | |||||||||||||||||||
Set schema variables to be used when streaming commands from SQL files or stdin. | |||||||||||||||||||
setTableAliases (array $aliases) | |||||||||||||||||||
Make certain table names use their own database, schema, and table prefix when passed into SQL queries pre-escaped and without a qualified database name.For example, "user" can be converted to "myschema.mydbname.user" for convenience. Appearances like user , somedb.user, somedb.someschema.user will used literally.Calling this twice will completely clear any old table aliases. Also, note that callers are responsible for making sure the schemas and databases actually exist.
| |||||||||||||||||||
strreplace ( $orig, $old, $new) | |||||||||||||||||||
Returns a SQL expression for simple string replacement (e.g.REPLACE() in mysql)
| |||||||||||||||||||
tableName ( $name, $format='quoted') | |||||||||||||||||||
Format a table name ready for use in constructing an SQL query.This does two important things: it quotes the table names to clean them up, and it adds a table prefix if only given a table name with no quotes.All functions of this object which require a table name call this function themselves. Pass the canonical name to such functions. This is only needed when calling query() directly.
| |||||||||||||||||||
tableNames (... $tables) | |||||||||||||||||||
Fetch a number of table names into an associative array. | |||||||||||||||||||
tableNamesN (... $tables) | |||||||||||||||||||
Fetch a number of table names into a zero-indexed numerical array. | |||||||||||||||||||
timestamp ( $ts=0) | |||||||||||||||||||
Convert a timestamp in one of the formats accepted by ConvertibleTimestamp to the format used for inserting into timestamp fields in this DBMS.The result is unquoted, and needs to be passed through addQuotes() before it can be included in raw SQL.
| |||||||||||||||||||
timestampOrNull ( $ts=null) | |||||||||||||||||||
Convert a timestamp in one of the formats accepted by ConvertibleTimestamp to the format used for inserting into timestamp fields in this DBMS. | |||||||||||||||||||
unionConditionPermutations ( $table, $vars, array $permute_conds, $extra_conds='', $fname=__METHOD__, $options=[], $join_conds=[]) | |||||||||||||||||||
Construct a UNION query for permutations of conditions. | |||||||||||||||||||
unionQueries ( $sqls, $all) | |||||||||||||||||||
Construct a UNION query.This is used for providing overload point for other DB abstractions not compatible with the MySQL syntax.
| |||||||||||||||||||
unionSupportsOrderAndLimit () | |||||||||||||||||||
Determine if the RDBMS supports ORDER BY and LIMIT for separate subqueries within UNION.
| |||||||||||||||||||
updateSqlText ( $table, $set, $conds, $options) | |||||||||||||||||||
Public Member Functions inherited from Wikimedia\Rdbms\Platform\ISQLPlatform | |||||||||||||||||||
buildSubString ( $input, $startPosition, $length=null) | |||||||||||||||||||
Build a SUBSTRING function. | |||||||||||||||||||
Additional Inherited Members | |
Public Attributes inherited from Wikimedia\Rdbms\Platform\ISQLPlatform | |
const | QUERY_PSEUDO_PERMANENT = 2 |
Track a TEMPORARY table CREATE as if it was for a permanent table (for testing) | |
Protected Member Functions inherited from Wikimedia\Rdbms\Platform\MySQLPlatform | |
normalizeJoinType (string $joinType) | |
Validate and normalize a join type. | |
Protected Member Functions inherited from Wikimedia\Rdbms\Platform\SQLPlatform | |
assertBuildSubstringParams ( $startPosition, $length) | |
Check type and bounds for parameters to self::buildSubstring() | |
assertConditionIsNotEmpty ( $conds, string $fname, bool $deprecate) | |
Check type and bounds conditions parameters for update. | |
assertValidUpsertRowArray (array $rows, array $identityKey) | |
buildSuperlative ( $sqlfunc, $fields, $values) | |
Build a superlative function statement comparing columns/values. | |
fieldHasBit (int $flags, int $bit) | |
fieldNamesWithAlias ( $fields) | |
Gets an array of aliased field names. | |
getDefaultSchemaVars () | |
Get schema variables to use if none have been set via setSchemaVars(). | |
getSchemaVars () | |
Get schema variables. | |
makeGroupByWithHaving ( $options) | |
Returns an optional GROUP BY with an optional HAVING. | |
makeInsertNonConflictingVerbAndOptions () | |
makeOrderBy ( $options) | |
Returns an optional ORDER BY. | |
makeSelectOptions (array $options) | |
Returns an optional USE INDEX clause to go after the table, and a string to go at the end of the query. | |
makeUpdateOptions ( $options) | |
Make UPDATE options for the Database::update function. | |
makeUpdateOptionsArray ( $options) | |
Make UPDATE options array for Database::makeUpdateOptions. | |
normalizeRowArray (array $rowOrRows) | |
relationSchemaQualifier () | |
tableNamesWithIndexClauseOrJOIN ( $tables, $use_index=[], $ignore_index=[], $join_conds=[]) | |
Get the aliased table name clause for a FROM clause which might have a JOIN and/or USE INDEX or IGNORE INDEX clause. | |
tableNameWithAlias ( $table, $alias=false) | |
Get an aliased table name. | |
Protected Attributes inherited from Wikimedia\Rdbms\Platform\SQLPlatform | |
DatabaseDomain null | $currentDomain |
callable | $errorLogger |
Error logging callback. | |
string[] | $indexAliases = [] |
Current map of (index alias => index) | |
LoggerInterface | $logger |
DbQuoter | $quoter |
array null | $schemaVars |
Current variables use for schema element placeholders. | |
array[] | $tableAliases = [] |
Current map of (table => (dbname, schema, prefix) map) | |
Definition at line 7 of file MWMySQLPlatform.php.
Wikimedia\Rdbms\MWMySQLPlatform::getFloatDeclarationSQL | ( | array | $column | ) |
Definition at line 12 of file MWMySQLPlatform.php.