Commit graph

50 commits

Author SHA1 Message Date
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)