* The data directory can now be set via the construction params
* A standalone factory method now replaces the subclass
* Also made mDatabaseFile protected
Change-Id: I1791fd4f630e5c121fa7f68f473411a7c12d0c97
* The array based format is now required
* Pass any additional parameters through factory() to __construct() even
if the base clase does not recognize them. This makes DB specific
options simpler.
* Also added missing bits to Sqlite constructors
Bug: T90288
Change-Id: I29b79a3c1bb2b5e51c1c8f5e04cd08c71e0662a3
This is in preparation for changing doBegin() to use BEGIN IMMEDIATE.
PDO::beginTransaction() doesn't support any parameters for mode.
Use direct queries instead so that modes (such as IMMEDIATE) can
be used.
Since PDO's transaction system maintains state internally (similarly
to what MediaWiki Database classes do) we have to abandon use of
PDO commit() and rollback() as well (in favour of direct queries
already provided by DatabaseBase).
Bug: T89180
Change-Id: I2ad2a3c2a6d4737f5ef8822fba7cbcf5e36021f4
Adds documentation referencing the root cause of the linked intermittent
failures caused by some versions of sqlite mis-handling this data. Logs
an error indicating that this is a known buggy workaroung along with
the solution.
Bug: 72367
Change-Id: If26346e4d71560d6a8a3f79a52e52ee6e90e0304
- 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
Currently the first row of the result
is used to return the number of fields.
This fix corrects that calculation, which has returned
twice the number of fields before. The reason for that
was that the resulting data array has the following form:
array() {
[0] => value_0
["field_name0"] =>value_0
[1] => value_1
["field_name1"] =>value_1
...
Furthermore the constant 0 (int) is returned if the result
set is empty. This issue should be corrected in the future,
since the number or fields should be answered in a metadata context
independent of the data stored in the relation.
Bug: 65578
Change-Id: I399c7c857dcbd774cc4eb6102bbfe8a8764b07c9
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
this fixes the issue of the normalized sqlite
IGNORE option being discarded and ignored in
DatabaseBase::makeUpdateOptions.
Change-Id: I01579dee0f939a56c086d13683a60f4400014f62
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
Fixed from several different directions:
* The error reporting was screwed up, so I wrapped the PDOException
in a DBUnexpectedError.
* Make $db->open() trigger a close/open sequence if called a second
time, like MySQL, instead of breaking mTrxLevel.
* Don't call $this->open() twice from the constructor, even if $user is
set.
The bug dates to r84485. The nasty hack allowing you to construct a
do-nothing database object with "new Database()" dates back to 2004 and
has probably outlived its usefulness -- noted this. It was formerly used
by LoadBalancer::reportConnectionError().
Bug: 49254
Change-Id: I571f9209bec8e8ed5058b6327e1738eb4315d5a0
DROP INDEX is database-wide (and not table-specific) in SQLite,
so we need to add a rule in our MySQL to SQLite schema convert.
"DROP INDEX foo ON bar" becomes "DROP INDEX foo".
Change-Id: Ie10784d166ed5a7f6ea52cf4f3a812fb7878a744
Since SQLite doesn't have a boolean type, and doesn't enforce types, make
sure booleans get stored as integers, to prevent undesirable behavior,
such as false values being stored as empty strings.
Change-Id: I2a96065826412fa25f98ec298d806e73ebe155ba
* All callers are calling it this way and it breaks
hhvm when declared statically and called dynamically.
Change-Id: I894e615fd828615384aa8457a16a759c8aa416ef
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
- DatabaseBase::fetchRows() returns the row as an array, not an object
- Both methods return false if there are no more rows in the result
Change-Id: I328d61b237bb82479d3fcb4c54ee9fd96dc4598f
This change provides a workaround and test case for a problem
in the sqlite library:
SQLite truncates strings at ASCII value 00 aka \0. Strings
containing \0 need to be represented in hexadecimal form.
Reported to PHP as bug 63419
https://bugs.php.net/bug.php?id=63419
Change-Id: I2bbc445ffebd41e181edfc3201e6e5514de06142
* 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
* 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