Commit graph

235 commits

Author SHA1 Message Date
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
Tim Starling
e1c8e80297 * Fixed Oracle new installer support, broken by r80957. This is a minimal patch and doesn't address the architectural issues.
** Moved the responsibility for calling setupSchemaVars() on install to the DatabaseInstaller subclass. This allows it to be called after setupDatabase() has completed, as required by Oracle and PostgreSQL.
** Fixed OracleInstaller::getConnection() so that it respects $this->useSysDBA correctly.
** In OracleInstaller, added some more variables to the list of schema vars, which are needed by user.sql and tables.sql
** In SearchOracle, specify the database name when calling ctx_ddl.sync_index(). This fixes a fatal error in the createMainpage step, caused by the schema name not being equal to the current user. 

* In oracle/tables.sql, fixed a couple of indexes with missing table prefixes.
* Improved debugging output in DatabaseInstaller::getConnection() and Installer::createMainpage().
* In DatabaseBase::selectDB(), set $this->mDBname correctly, as in DatabaseMysql.
2011-01-27 08:25:48 +00:00
Tim Starling
0c86b1611a * Fixed a bug causing the installer to ignore the "engine" and "charset" settings when installing a MySQL database.
* Fixed a bug causing the engine and charset settings to not be properly preserved when adding new tables on upgrade.
* Fixed total breakage of SQLite upgrade, by reusing the administrative connection to the SQLite database instead of creating a new one when wfGetDB() is called. Added LBFactory_Single to support this. 
* Introduced a "schema variable" concept to DatabaseBase to avoid the use of globals for communication between the installer and the Database. Removed a lot of old global variable names from Database::replaceVars(), most were only added on a whim and were never used.
* Introduced DatabaseInstaller::getSchemaVars(), to allow schema variables to be supplied by the DatabaseInstaller child classes.
* Removed messages config-mysql-egine-mismatch [sic] and config-mysql-charset-mismatch. In the old installer it was possible for users to request a certain character set for an upgrade, but in the new installer the question is never asked. So these warnings were shown whenever a non-default character set or engine was used in the old database.
* In MysqlInstaller::preUpgrade(), fixed the incorrect strings used to identify the MySQL character sets: mysql5 instead of utf8 and mysql5-binary instead of binary.
* On install, initialise the site_stats table, using code copied from the old installer. Unlike the old installer, use SiteStats to increment the user count when the initial user is added.
* Fixed several instances of inappropriate call-by-reference. 
* Replaced call_user_func_array() with call_user_func() where possible, it is shorter and simpler.	
* Moved the caching boilerplate for DatabaseInstaller::getConnection() to the base class, and have the derived classes override an uncached function openConnection() instead. Updates r80892.
* In MysqlInstaller::getLocalSettings(), escape PHP strings correctly with LocalSettingsGenerator::escapePhpString(). 
* Reduce timeout for checks in dirIsExecutable() to 3 seconds, so that it doesn't take 30s to run when apache is in single-threaded mode for debugging.
* MySQL and SQLite have been tested and they appear to work. PostgreSQL upgrade is totally broken, apparently it was like that before I started. The Oracle code is untested.
2011-01-25 07:37:48 +00:00
Chad Horohoe
a5053d4c5a * Cleanup massive duplication across Database constructors. Default implementation fairly sane. Now they all share the same if( $server ) logic to allow constructing the class without forcing open a connection (MySQL has done this since at least r15094)
* Get rid of intermediate installTables() callback
* Actually cache the result of DbInstaller::getConnection() like the documentation says
2011-01-24 18:36:09 +00:00
Jure Kajzer
ba8019afff * fixed oracle code for updater (corrected not null BLOB field adding)
* added required DB vars in WebInstaller_ExistingWiki 
* oracle upgrades normally 1.16=>1.17
2011-01-10 20:11:43 +00:00
Jure Kajzer
f853d711ac * fixed Oracle code for installer and phpunit tests
* removed ORABlob class
2011-01-10 19:22:27 +00:00
Chad Horohoe
4ece90ed4b Remove ancient and deprecated newFromParams() constructor wrappers from various DatabaseBase implementations. Only callers are AskSql and WikiTrust. Both are calling the (very old) Database class anyway, so are obviously expecting a MySQL connection and can use the fallback (which yells wfDeprecated) in DatabaseBase 2011-01-07 20:25:52 +00:00
Chad Horohoe
60e537e774 Fixes for r75545: don't use MEDIAWIKI_INSTALL in the updaters classes, it's not what it's for. Add new DBO_DDLMODE flag which does the same thing (and moved it up to DatabaseUpdater, in case any other children need it) 2011-01-06 19:25:47 +00:00
Roan Kattouw
475c331f60 Remove now-unused SQL timestamp conversion functions added in r77231. They were made obsolete by the querypage-work2 branch merge in r78786 2010-12-31 16:29:44 +00:00
Sam Reed
48ebf5bbb5 Fix private class member variable access
Some method documentation
2010-12-30 17:41:19 +00:00
Chad Horohoe
358539bc1d More old installer cruft 2010-12-17 15:49:51 +00:00
Daniel Friesen
aae05c49f8 MySQL is the only database which quotes identifiers primarily using backticks. Move the backtick based addIdentifierQuotes implementation from the generic into DatabaseMysql and take the duplicated implementation used by oracle, sqlite, ibm_db2, postgresql, and mssql and remove it from all of them migrating it to the generic Database class as the default. 2010-12-04 15:35:36 +00:00
Daniel Friesen
692ad26f68 Followup to r77713, rename quote_ident to addIdentifierQuotes to follow naming conventions better. While I'm at it adding a missing addIdentifierQuotes implementation for Ibm_db2. 2010-12-04 15:14:08 +00:00
Daniel Friesen
da469e3abe Fix a bug in the installer caused by r77487 creating installer sql statements like "GRANT ALL PRIVILEGES ON 'dbname'.* TO ''tablename''@'%" while improving the database independence of replaceVars.
* Drop unused and likely broken /*$var*/` -> `$var syntax
* Replace {$var} with '{$var}' and `{$var}` handling that uses relevant database independent quoting ({$var} without surrouding quotes are never used)
* Give the generic/mysql class a proper quote_ident implementation
* Fix the unused Oracle and Sqlite quote_ident implementations which are potential sql injections if used
* Split common variable replacemnt code off to a replaceGlobalVars and make the generic and oracle code use it instead of duplicating the same code as each other
2010-12-04 09:27:02 +00:00
Platonides
bd6b4d7af8 Replace addslashes with Database::addQuotes() 2010-11-30 18:21:55 +00:00
Alexandre Emsenhuber
6cb276056b Moved switches in Special:Unusedimages and Special:Ancientpages to extract a unix timestamp from a fielf to DatabaseBase and related classes to avoid code duplication 2010-11-24 15:40:25 +00:00
Max Semenik
c278bc2e09 Fixed $fname in some places 2010-11-23 11:21:00 +00:00
Max Semenik
4345c2c20e Refactoring of *Field classes:
* Made them all implement one common interface (might add more functions to it later)
* Moved MySQLField to DatabaseMysql.php
* Renamed nullable() to isNullable()
* Removed maxLength() from:
** SQLiteField: makes no sense
** MySQLField: doesn't do what people may think, useless for this class' purpose of assisting querying the DB schema
2010-11-21 19:56:51 +00:00
Jure Kajzer
43e9d51b0e * Oracle: prefetching column names in ORAResult so i can release statement after constructor.
This fixes too many open cursors issue, importing of large sets now works.
2010-11-18 13:17:16 +00:00
Jure Kajzer
7c0db2ba75 * BLOB temporary handling
* en/decodeBlob
2010-11-09 08:56:15 +00:00
Chad Horohoe
6150c3d8fb Oracle maintainer should enable E_STRICT ;-) 2010-10-30 17:20:41 +00:00
Chad Horohoe
8f0a7ccc00 E_STRICT: Function signature should match parent. This newFromParams stuff should be going away soon anyway 2010-10-30 17:17:26 +00:00
Jure Kajzer
e99125adf1 * installers skips recreation of existing user
* updater for 16->17 schema changes 
* i dedicate this revision to my greatest supporter ... Reedy :)
2010-10-27 14:52:18 +00:00
Jure Kajzer
1eede8e88b * DatabaseOracle - throw connection exception instead of debug+false
* DatabaseOracle - fixed $wgContLang local usage in update
* Installer - added Main Page insertion as a new installation step (fixes bug 22308)
2010-10-25 16:49:59 +00:00
Jure Kajzer
8e777b538a * fixed accidental revert of r75343 2010-10-25 12:06:37 +00:00
Jure Kajzer
ef484d5fe7 * null value => default value handling
* duplicateTable call fix
* some internal calls to query replaced with doQuery 
* added update method overload
2010-10-25 10:56:07 +00:00
Sam Reed
d189aaee05 (bug 24853) Kill failFunction - Fixed! :D 2010-10-24 21:27:33 +00:00
Jure Kajzer
49c9990074 * fixed r74949 remarks
* modified version lookup, added 9iR1 as minimum version for installation.
2010-10-19 06:25:12 +00:00
Jure Kajzer
6d11fb986f * Installer: works (beta). More testing tomorow.
* Updater: todo. For now it skips.
2010-10-18 16:09:18 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Alexandre Emsenhuber
3c386b90cb __FUNCTION__ -> __METHOD__ 2010-10-02 08:04:58 +00:00
Chad Horohoe
1374598e38 Followup r72535, I suppose I shouldn't break the old installer yet 2010-09-07 12:48:48 +00:00
Jack Phoenix
0443990ccd coding style tweaks 2010-09-05 18:35:34 +00:00
Jack Phoenix
1252d00372 trim trailing spaces 2010-09-05 18:00:33 +00:00
Chad Horohoe
e0cb9ef9b6 Make getSoftwareLink() static so I can use it without instantiating (and opening) a bunch of databases I probably can't support. Can't have an abstract parent now, so throw an exception for anyone who writes a child class without bothering to implement it. All of this to add some helpful text links in an infobox in the installer :) 2010-08-22 20:55:07 +00:00
Sam Reed
85af1b0901 Revert r71250 r71251 r71252 r71253
Know what the problem is, roughly, can't fix atm, so not leaving phase3 broken
2010-08-18 14:15:32 +00:00
Sam Reed
9ea1f1d388 Kill some crappy "failFunction" stuff, marked as old in r14625 2010-08-18 13:38:42 +00:00
Sam Reed
4ea2cfe811 Followup r71241
Another $bitField to $field
2010-08-18 10:09:03 +00:00
Chad Horohoe
4c74490bb8 Big commit: kill almost every freeResult() call as useless 2010-08-08 12:27:48 +00:00
Alexandre Emsenhuber
c13687bdb6 Standardisation of file headers 2010-08-01 21:13:44 +00:00
Sam Reed
5fd23ed8b5 More unused globals 2010-07-25 17:47:41 +00:00
Sam Reed
04f68827d0 Removal of unused globals
Removal of one setting of a variable to '', then not using further
2010-07-24 19:11:52 +00:00
Tim Starling
42017a2f47 Use $wgContLang not $wgLang for checkTitleEncoding() and getSpecialPageAliases(), it doesn't make sense to use the user language, WebRequest and SpecialPage certainly don't. The DatabaseOracle use of checkTitleEncoding() is weird and probably broken, but at least it uses the right object now. 2010-07-22 04:00:39 +00:00
Max Semenik
775adbf329 Got rid of remaining usages of immediateBegin()/immediateCommit(), marked these functions with wfDeprecated() 2010-07-05 19:47:46 +00:00
Alexandre Emsenhuber
a643b87295 Fixed some doxygen warnings 2010-07-04 14:41:26 +00:00
Max Semenik
75d41fe3b6 Refactored Database*::getLag(): moved the default implementation to MySQL, replaced it with a proper dummy, deleted stub implementations from other classes. This adds fake lag support to all databases. 2010-07-02 13:17:28 +00:00
Max Semenik
67ebe72ade * Replaced the mess of every database class implementing filedExists() is its own way with one simple function in base class. Verified to work on MySQL, Postgres and SQLite.
* Fixed fieldInfo() on Postgres not using tableName() and thus failing for table user, for example.
* Made fieldInfo() on MySQL return false instead of throwing a query error if table does not exist. This is consistent with other databases' behaviour.
2010-07-02 10:01:09 +00:00
Chad Horohoe
44229b50e6 Fixed a bunch of silly instances of [^!=]==\s*(true|false) 2010-06-09 11:44:05 +00:00
Jure Kajzer
9b653aa0d5 * Fixed parserTests compatibility for Oracle
* Fixed DBPrefix not being set in the old installer
2010-06-08 18:14:28 +00:00
Jure Kajzer
2c803d58be * reportQueryError must break execution on parse and execute 2010-05-03 14:16:46 +00:00
Platonides
62a615c6c0 Actually check sourceFile for failure, showing the error message in the install.
See report on http://permalink.gmane.org/gmane.org.wikimedia.mediawiki/33902
Fixed several tag nesting problems from setup_database().
Make sourceFile() always use text errors in the installer. It can't handle 
exceptions properly (introduced in r36211). But they are appropiate for update.php
thus the ugly branches.
The installer now always handles sourceFile() errors.
2010-04-29 21:49:58 +00:00
Jure Kajzer
d43a5844dd oracle: missing table prefix 2010-03-02 16:58:21 +00:00
Jure Kajzer
29544758f1 tableName calls moved inside fieldInfoMulti and removed call that existed only for this call 2010-02-23 10:38:06 +00:00
Alexandre Emsenhuber
a3d4855413 Fix for r62744: use tabs for indentation, not spaces 2010-02-20 19:22:27 +00:00
Jure Kajzer
ec7782fe97 tableName has to be encoded before field type checking 2010-02-20 18:27:00 +00:00
Jure Kajzer
8fcb7e42a1 Fixed as per Tim's comments on r61179:
* made insertOneRow and getSequenceData private
* renamed fieldInfo to fieldInfoMulti and made it private (for internal use on Oracle only)
* wrapped fieldInfoMulti in fieldInfo with error if $table parameter is an array
* reverted tableName function to only support a non-array parameter
* wrapped all tableName calls with array parameter with array_map with callback
* wrapped fieldInfo into textFieldSize function to avoid reimplementation of functionality
* fixed unnessesary multiple calls to tableName with same parameter inside a single procedure
2010-01-28 14:58:45 +00:00
Jure Kajzer
3707fcc2f8 Fixed as per Tim's comments on r60665:
* fieldExists reduced to bool-cast output of fieldInfo
* added negative cache (handled acordingly on fieldInfo usage)
* uppercased parameters on entry. DB data is uppercased by default
2010-01-20 16:19:08 +00:00
Jure Kajzer
0e361f492b Fixed error suppressing suggested in r58559 by Tim. Also fixed some warnings and bugs in Oracle abstraction. 2010-01-17 20:42:54 +00:00
Tim Starling
9a420fa847 Remove code commented out by r58597 2010-01-11 00:55:21 +00:00
Aryeh Gregor
70f749ba75 Use string interpolation, not .
Prompted by r60731, although that didn't actually add the concatenation
(which should have had more spaces, too).
2010-01-10 23:24:47 +00:00
Jure Kajzer
f488d7de97 Prevented delete call in replace function if conditions empty. Removed some old commented code. 2010-01-08 07:23:43 +00:00
Tim Starling
fd3794c5bc For r60757: implement Database::getType() explicitly in each subclass, to make Roan happy. 2010-01-08 00:31:24 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Jure Kajzer
7fc32afd48 Fixed variable name typo from r60665. (problems while sending file in previous attempt r60730) 2010-01-06 14:00:17 +00:00
Jure Kajzer
12e9352062 Fixed variable name typo from r60665. 2010-01-06 13:52:58 +00:00
Jure Kajzer
98aedd07b3 fixme for r58356 2010-01-05 13:35:19 +00:00
Jack Phoenix
7a1448b4f0 more coding style cleanup to DatabaseOracle.php 2009-12-11 18:23:24 +00:00
Jure Kajzer
1600e22d14 Fixed missing table in ora/tables.sql. Replaced instantiation of DBUndexpecedError with DBQueryError in reportQueryError function 2009-12-11 16:47:06 +00:00
Aryeh Gregor
d5c5375ec4 stylize.php on DatabaseOracle.php
Please follow <http://www.mediawiki.org/wiki/Manual:Coding_conventions>
so that code is easier to read.  (For anyone whose blames are getting
messed up by whitespace changes, use svn blame -x -w, or git blame -w,
to ignore them.)
2009-12-10 23:22:34 +00:00
Jure Kajzer
f46754821a Fixed wrong field definition for filearchive. Fixed delete function to handle encoding checking of array values in condition. 2009-11-27 13:44:57 +00:00
Jure Kajzer
287ec29135 replaced charset definition to php var instead of forced env var 2009-11-17 09:41:26 +00:00
Jure Kajzer
17821ff2f1 Fixed parserTests to work with Oracle (added Anonymous user 0 to fix FK violations). Fixed a few bugs identified by parserTests fails. 2009-11-09 14:34:03 +00:00
Jure Kajzer
fd63c9c9d8 Started working on parserTests Oracle compatibility, still getting FK violations 2009-11-06 17:12:18 +00:00
Jure Kajzer
fa2fc4823a added encoding handlin on delete() and selectRow(), switched manual delete in replace() with a function call 2009-11-05 20:04:47 +00:00
Jure Kajzer
e773c0d23e removed x-codeBlob functions and modified blob handling acordingly 2009-11-05 18:49:12 +00:00
Jure Kajzer
bf16a1ccff Fixed replace function behaviour when required ID not specified 2009-11-04 19:27:22 +00:00
Jure Kajzer
782a3d4d37 Fixed some Oracle-specific installer and Strict Standards issues 2009-11-04 19:09:11 +00:00
Jure Kajzer
0f664ab6c7 DatabaseOracle removed makeList overload and added delete overload for CLOB handling in delete parameters. 2009-11-03 14:32:34 +00:00
Jure Kajzer
ebb1391939 overloaded makeList in DatabaseOracle to handle CLOBs in WHERE clauses 2009-10-30 09:44:37 +00:00
Jure Kajzer
446fd503d0 * Replaced LIMIT with limitResult call in rebuildrecentchanges.php
* Added a wrapper-function for sequence number generation and modified insertSelect in DatabaseOracle to fill missing ID-field references
2009-10-28 19:15:19 +00:00
Jure Kajzer
785ad24aa7 Changed sequence names to a standard <table>_<field>_seq form.
Updated all nextSequenceValue calls with new sequence names.
OverlordQ stated he'll handle changes to Postgres scripts.
Need someone to change DB2 scripts.
2009-10-28 16:17:16 +00:00
Alex Z
374b9e4af1 Mostly revert r53358 and r53365 per comments on code review. Change message to just say "Database" and remove the getDBtypeForMsg function (since I can't think of any other use for it) 2009-08-22 20:17:28 +00:00
Chad Horohoe
df296de32e * Move generic return true; various for lock functions to parent, no need to implement this everywhere
* Make LOW PRIORITY optional
* Use sourceFile instead of dbsource
2009-07-29 23:41:16 +00:00
Alex Z
bc1b8182e9 Followup to r53358 - Tweak the function name to be a little clearer as to what it does
Also make it abstract in DatabaseBase so all subclasses have to implement some human readable name 
(also make getSoftwareLink abstract for the same reason) Every current Database class already implements both.
2009-07-16 16:49:09 +00:00
Alex Z
3742d1058d (bug 19590) Database error messages are no longer hardcoded to use "MySQL".
Added a new function DatabaseBase::getDBtype() to get the DB type for messages, updated all subclasses.
Message change needs propagating.
2009-07-16 15:18:57 +00:00
Aryeh Gregor
db8cbcd108 Remove redundant no-op implementations
Followup to r52951.
2009-07-09 01:04:10 +00:00
Aryeh Gregor
9244ed0c57 Abstract more methods in DatabaseBase
Notably, this will switch conditional() in MySQL from using IF() to
using CASE, like all other DBMSes.  Documentation suggests this works
back to 4.0.  If it's a problem, it's a matter of a few lines to
override it in DatabaseMysql.php.

Also, some extra explanatory comments have been added to a number of
methods in DatabaseBase.
2009-06-16 21:00:38 +00:00
Aryeh Gregor
2b83b91906 Make some Database methods optional to override
Specifically freeResult(), selectDB(), close(), and ping(), as suggested
by Tim on code review for r51918.  Where these were overridden by stubs
in subclasses, I deleted the stubs.
2009-06-16 20:22:11 +00:00
Jure Kajzer
67dcf6e3b8 typos 2009-06-13 06:49:54 +00:00
Jure Kajzer
c3fafd96f7 Added bitwise operations to DatabaseBase and overloaded in DatabaseOracle. 2009-06-13 06:31:38 +00:00
Aryeh Gregor
d20794df5c Make Database into abstract class DatabaseBase
All other databases were changed to extend DatabaseBase instead of
Database.  Database was kept as an alias for DatabaseMysql for
compatibility.  Existing explicit references to Database that I could
find were changed to DatabaseMysql for the sake of clarity.

Should cause no functional changes.
2009-06-12 17:59:04 +00:00
Jure Kajzer
32af69f8d5 Web installation support for Oracle. 2009-06-08 18:30:27 +00:00
Jure Kajzer
da53ed0501 Oracle database abstraction updated.
Rewriten tables.sql, added user.sql (creating db user with privileges)
Fixed epoch in Special Ancientpages and Unusedimages
Timestamp default format altered in db abstraction and changed wfTimestamp function 
SearchOracle changed to return empty resultset on empty term search (query error in oracle)
TODO: Maintenance scripts update
2009-06-05 11:45:32 +00:00
Tim Starling
cb3bbe1809 Implemented save/restore logic for sql_big_selects, per CR comments on r50168. 2009-05-27 06:10:48 +00:00
Alexandre Emsenhuber
7bb2cada63 * fixed Doxygen errors in Database.php, DatabasePostgres.php, DatabaseOracle.php and DatabaseMssql.php
* renamed \2types and \3types both to \types (with different number of param), Doxygen doesn't seem to like numbers in aliases
* Added aliases for @private, @protected and @public
2008-11-29 18:50:39 +00:00
Chad Horohoe
e8ad8d066d Remove DB logic from SearchEngine. New method in Database and associated subclasses called getSearchEngine() does this now. 2008-08-18 15:22:00 +00:00
Chad Horohoe
fcc6f32017 (bug 14763) Strict standards issue in DatabasePostgres (also happened with DatabaseOracle, no one reported it though). 2008-07-09 18:14:01 +00:00
Brion Vibber
7b78f7b7aa Revert r36755 for the moment; various things use 'new Database'
or Database::newFromParams() explicitly at the moment. While that's already bad (breaking PG support etc), I'd rather see those get fixed before we go introducing differences between Database and DatabaseMySql.
2008-07-02 18:22:38 +00:00
Chad Horohoe
de58074c74 Refactoring (un)lock. All the subclasses are currently returning true, except for mySQL. Makes more sense to put the no-op in the parent class then just subclass it as needed. Other things could maybe do this too. 2008-06-27 17:06:34 +00:00
Chad Horohoe
5bfb68f4e4 Add no-ops for the (un)lock functions. 2008-06-27 15:06:22 +00:00
Tim Starling
c6b902f180 * Reorganised the includes directory, creating subdirectories db, parser and specials
* Wrote a tool to check the integrity of the autoloader class list, fixed some issues that came up.
* Start the autoloader before LocalSettings.php, so that when an extension writer thinks an inefficient one-file special page extension is the way to go, they don't have to use explicit includes to make the class inheritance work. Should continue to work with $IP set in LocalSettings.php as long as $IP is set before extensions are included.
2008-06-16 20:21:26 +00:00
Renamed from includes/DatabaseOracle.php (Browse further)