Commit graph

150 commits

Author SHA1 Message Date
lupo
2071bf880e (bug 41146) DatabaseOracle no more rely on mbstring
DatabaseOracle class has been using mb_check_encoding which might not
always be available.  We now rely on the StringUtils::isUtf8() method
implemented by I4cf4dfe2.

Change-Id: I5a9ffa23e3e738e4886d61e85974b0af25058308
2012-12-12 11:28:28 +00:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Aaron
3f277e8744 Added post-commit callback support to DB classes.
* 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
2012-08-29 13:01:38 -07:00
Aaron Schulz
eb16f5898d [Database] Various DB cleanups.
* 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
2012-08-08 11:00:48 -07:00
Aaron Schulz
a021ffc9ce [Database] mark some methods as explicitly public
Change-Id: I95fca6d346ae812c22b88b577477be02b5a0676b
2012-07-17 10:59:19 +02:00
Alexandre Emsenhuber
78a56a67ba Added missing GPLv2 headers in includes/db.
Change-Id: Ib8fe301c6db77603e411113cea5a39c25c664961
2012-04-26 10:47:10 +02:00
Max Semenik
a8f718267e Follow-up r112565: fix code duplication 2012-02-28 14:42:08 +00:00
Chad Horohoe
2177a4d8b4 (bug 34762) Calling close() on a DatabaseBase object now clears the connection. Based on patch by Christian.
By the way, the duplication here is stupid.
2012-02-28 02:18:18 +00:00
Alexandre Emsenhuber
d97561461c Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback() 2012-02-25 13:23:43 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
01698002f1 Strict Standards: Declaration of DatabaseOracle::sourceStream() should be compatible with that of DatabaseBase::sourceStream()
Followup r108768, and also use $inputCallback
2012-02-02 15:12:28 +00:00
Jure Kajzer
ec53acbede * removed manual cascading of recentchanges on page delete
* fixed purgeCache bug in updater
* TESTED install/update from 1.18/phpunit
2011-12-20 16:11:45 +00:00
Sam Reed
bf62deece8 Reverting r103706
Only seemingly supported by MySQL, and likely a seldom used function

Not worth trying to support it, as other non mysql db's would need workarounds, and that's just not happening
2011-12-02 00:29:46 +00:00
Sam Reed
653444790b * (bug 8859) Database::update should take array of tables too
Original patch by Andrew Dunbar

Also apply in DatabaseOracle and DB2 code as they override update
2011-11-19 20:17:29 +00:00
Sam Reed
9814e6b075 Add $fname to tableExists
Pass $fname/__METHOD__ in in upstream callers
2011-11-10 20:39:23 +00:00
Jure Kajzer
5933586266 some more oracle-phpunit-fu (should not affect non-oracle)
* CloneDatabase - already droping tables in internal function, removed duplicate action
* DatabaseOracle - stopped ignoring "temporary" parameter
* added two parameters to phpunit (use-normal-tables & reuse-db), default actions stay the same
* with reuse-db oracle phpunit test run on oracle down to 1m 20s ;)
2011-11-10 13:29:32 +00:00
Jure Kajzer
be3bbfc539 * Added getInfinity to DatabaseOracle
* Block - replaced 'infinity' strings with DB->getInfinity calls
* UploadStash - added sequence value generation for ID
2011-11-10 07:41:12 +00:00
Jure Kajzer
636f304d20 * phpunit fixes & optimizations for oracle backend 2011-11-09 15:50:24 +00:00
Chad Horohoe
70430650e9 Followup r96369: update child classes and a few callers 2011-09-06 20:51:10 +00:00
Jure Kajzer
8951968902 * resolved some issues with sequences and deleting of rows on referenced tables 2011-09-02 10:42:08 +00:00
Sam Reed
8c59bf69ee Fix fail double pasting from r95497 2011-08-25 17:48:55 +00:00
Sam Reed
4d21db9f0b Followup r95449, fix the code to do what it was actually intended to do 2011-08-25 17:47:33 +00:00
Sam Reed
87f03bf97e Allow update to be passed an empty array for the WHERE condition 2011-08-24 21:38:31 +00:00
Jure Kajzer
3ac0d87cfb * DatabaseOracle.php binds variables, so using $val = 'NULL' breaks certain maint. scripts 2011-07-08 12:28:59 +00:00
Tim Starling
0e73205470 General database-related code cleanup:
* Merged the 4 simulated implementations of Database*::replace(). I took diffs, they were nearly identical. I made one based on the IBM DB2 version, since it used insert() which looked like a nice touch.
* Provided the non-simulated implementation of Database*::replace() via a protected member function, and made DatabaseMysql::replace() and DatabaseSqlite::replace() into a wrapper for it. 
* Moved the MySQL-specific functionality from masterPosWait(), getSlavePos() and getMasterPos() from DatabaseBase to DatabaseMysql. 
* Renamed getStatus() to getMysqlStatus() and moved it to DatabaseMysql. Removed "unimplemented" errors from two other subclasses. Really there's no way another DBMS could or should implement this function. 
* Split the LoadMonitor class into a no-op class and a MySQL-specific class, to avoid fatal errors due to the getMysqlStatus() call if other DBMSs tried to use LoadBalancer with multiple servers. Of course there are lots of other reasons it won't work, I'm just fixing the architecture issue here.

And while I have a replicated test setup handy:
* On MySQL 4.1.9 and later, use SHOW SLAVE STATUS to get the lag instead of SHOW PROCESSLIST. This has the advantage of reading zero when there are no events for a while.
2011-06-23 03:14:11 +00:00
Tim Starling
5fcd668a02 Followup r90429:
* Reverted the public -> protected changes from r90429, except for doQuery() after a review of usage:
** resultObject() is used by lots of things in core and extensions. 
** makeSelectOptions() is used by SMW, and if that's going to be public, the other two probably should be too, for consistency. 
** doQuery() was used by several things, but mostly by mistake. It's been marked private since r21359 which is before almost all of them. I updated the callers to use query().

* Added "protected" to doQuery() declarations in other database classes.
2011-06-20 12:09:22 +00:00
Platonides
8093e9733c All the databases but MySQL were overriding DatabaseBase::deleteJoin() with the same code.
Move DatabaseBase::deleteJoin() to DatabaseMysql::deleteJoin() and the common code to DatabaseBase::deleteJoin()
Follow up r90356
2011-06-18 20:26:31 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Jure Kajzer
edd10806bc * merge r89759 from REL1_17 into trunk
* changed addQuotes expected result for addQuotes in DatabaseTest
2011-06-09 08:43:53 +00:00
Jure Kajzer
4922a1cbda * fixed table duplication for unit tests
* fixed sequence handling when using DB prefix
* deferring constraints on transaction, switching back to immediate on commit/rollback
* hardcoded NLS_NUMERIC_CHARACTERS as it breaks using floats in sql if connection is in a non-US-like NLS_LANG (all vars are bound as chars)
2011-06-07 05:09:32 +00:00
Jure Kajzer
2967a44864 * fixed table duplication for phpunit testing 2011-06-02 22:23:05 +00:00
Jure Kajzer
cdd4176e8d * unified where clause parameter wrapping for delete, update and selectRow
* fixed replace where clause handling
2011-06-01 11:38:25 +00:00
Jure Kajzer
97fe1bc9aa * updated listTables function to also take in account possible user-dbname difference
* using different database will still probabbly break phpunit tests, but it's a step
2011-06-01 08:41:44 +00:00
Jure Kajzer
6047e22b5e * upgrade patches for oracle 1.17->1.19
* fixed tableExists to handle possible username-dbname difference
* added indexExists for updater
* fixed a bug in DatabaseUpdater
* tried not to produce bugs (may have failed)
2011-06-01 08:27:51 +00:00
Sam Reed
527e85fa9f More documentation in various files 2011-05-29 14:01:47 +00:00
Sam Reed
c73746981c Param documentation updates/added 2011-05-26 19:21:50 +00:00
Jure Kajzer
b6418393ac * fixed tableName handling for internal purposes (bug if using sharedDB as i need raw table name) 2011-05-04 10:43:34 +00:00
Jure Kajzer
955385cee7 * close connection in class destructor (unlike MySql, Oracle does not commit on close) 2011-04-28 12:44:19 +00:00
Sam Reed
8e80b8c3c1 Tidy up some unused variables and such 2011-04-23 21:40:52 +00:00
Jure Kajzer
398a7891f8 * begin, commit, rollback functions updated
* using ->execFlags instead of hardcoded OCI_DEFAULT
* added dummy page (id=0) to satisfy FK checks
2011-04-22 11:31:18 +00:00
Sam Reed
a6f56411a2 Remove some unused variables/globals
Fix another unreachable statement
2011-04-16 11:28:35 +00:00
Jure Kajzer
3b916c3763 * updated tableName function changed addIdentifierQuotes, added isQuotedIdentifier and removeIdentifierQuotes
* quoting objects in Oracle is poorly supported prior to 10g (it still has bugs in 10g) so i wish to avoid it for as long as possible
* i've added /*Q*/ marker to avoid double-prefixing of table names
* tableName quoted parameter is usable only in cases where you call it directly in functions where it might occur that tableName can get called twice it is unusable as the tableName gets prefixed twice


Oracle documentation is generally crappy. They claim a lot of things but some of those claims depend on a gazillion of factors and in case of one of this factors being a bit off have no general solution. Object name quoting is one of such things and is general practice amongst oracle DBAs that if you write the code directly you can use them but if you write abstracted or embedded code it's best to stay away if you can.
2011-04-15 10:48:02 +00:00
Platonides
d210706028 $wgDBprefix shall be converted to uppercase per r85786 2011-04-12 20:56:35 +00:00
Platonides
bdbe39d28c Follow up r85888: Add the parameter to DatabasePostgres.php and DatabaseOracle.php
Follow up r85884: The parent tableName() should work now for DatabaseMssql.php
2011-04-12 18:59:19 +00:00
Platonides
f524482f2d Change the duplicateTableStructure() to use the original names.
It is now duplicateTableStructure() duty to addIdentifierQuotes() them.
Fixed bug for mysql < 4.1 where the new name would be quoted twice.

Always quote identifier in Oracle, doing otherwise seems a bug (can someone confirm?)
2011-04-12 18:54:51 +00:00
Platonides
a91d6f4cac Abstract tableName() by adding new function isQuotedIdentifier() to databases.
This fixes bug in DatabaseOracle.php tableName() on line 671 and allows it to call 
the parent implementation instead of copying it with different quotes.
Adapt Mssql addIdentifierQuotes(). Replace its addIdentifierQuotes calls with addQuotes
as it's what it really is. The serialize() is probably unneeded, since I don't think it will
ever be called with objects but I kept it anyway.
2011-04-12 16:34:12 +00:00
Chad Horohoe
2adce95338 rm unused member var 2011-03-03 15:34:12 +00:00
Jure Kajzer
7ba01e2038 * forgot about those ... 2011-03-01 13:58:50 +00:00
Jure Kajzer
3002621fb7 * OracleInstaller now also supports installation with (requested by Tim):
** preexisting account 
** privileged account into a restricted account
* DatabaseOracle fixed a fixme (made by Reedy)
2011-03-01 13:50:52 +00:00
Sam Reed
d2e409eed1 Mark a fixme comment in Oracle DB file for undefined variable
Add documentation
2011-02-18 22:58:02 +00:00