Commit graph

112 commits

Author SHA1 Message Date
Sam Reed
a5db15505b Return comment stuffs 2011-05-11 23:11:41 +00:00
Sam Reed
a194b078ea Kill & from r87290 2011-05-02 21:38:48 +00:00
Sam Reed
a39e48078c Add makeInsertOptions
Allow Sqlite to OR IGNORE on UPDATE or INSERT
2011-05-02 20:14:17 +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
Max Semenik
c2f49a75f2 Bug 28478: database error in DatabaseSqlite::getFulltextSearchModule().
It was caused by a weird bug in SQLite: virtual table using a non-existent module still gets created somehow, and it is completely undeletable.
2011-04-11 17:16:41 +00:00
Max Semenik
1275cc6df6 SQLite is picky about the position of AUTOINCREMENT in field definition, handle it when converting from MySQL syntax 2011-04-10 08:44:06 +00:00
Chad Horohoe
c3aeca8380 Cleanup r80892, r84485: Check user also in sqlite for consistency. 2011-03-22 15:59:50 +00:00
Max Semenik
10a739f9da Case insensitivity for r82860 2011-02-26 17:04:26 +00:00
Max Semenik
798dafa4dd Follow-up r82856: instead of remembering magic table names, just analyse its structure, added tests. 2011-02-26 16:45:35 +00:00
Bryan Tong Minh
5d2794d89d Add TEMPORARY TABLE support to Sqlite 2011-02-26 14:30:52 +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
Chad Horohoe
537bf1ef01 Followup r80864: DatabaseSqlite exploded on installer page because it tried to open an invalid $wgSqliteDataDir.
Even though it doesn't use $server, only call open() if it's set, like in the other constructors.

The amount of code duplication here is stupid.
2011-01-24 17:37:06 +00:00
Niklas Laxström
b6433f144d No space after unary minus 2011-01-11 14:30:03 +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
X!
dd68f3947a More work on getting SQLite to work with unit tests. DB Prefix changing is now static to allow for external classes to change it. 2010-12-31 20:42:39 +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
X!
1993c83277 -Destroy the DB automatically when initting the DB
-Add $force option to wfSetVar
-More work on getting SQLite to work
2010-12-30 17:30:35 +00:00
X!
198b54f454 Fix r79109: listTables() does not work without a prefix, and verified that SQLite works now 2010-12-28 18:30:03 +00:00
X!
86df2d2755 It's here! It's finally here! The skies are falling, pigs have sprouted wings, and it's pretty cold in hell!
-Add a working PHPUnit test that instantiates a new DB, adds set data, and deleted when done.
-Add listTables() to the Database classes (only MySql and SQLite use it, and only MySQL is tested)
2010-12-28 17:15:50 +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
Mark A. Hershberger
bdf0b5efc7 revert r77271 since it was an expensive fix to a non-existant problem. 2010-11-26 02:37:28 +00:00
Mark A. Hershberger
028d32b0ff Give SQLite a translation for MySQL's UNIX_TIMESTAMP() functions. Pg will probably need something similar. 2010-11-25 07:39:51 +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
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
Max Semenik
46209df2b8 SQLite types can be non-nullable 2010-11-19 20:34:44 +00:00
Chad Horohoe
a5947f6e87 Drop setup_database() here too. Only caller is the old installer 2010-11-10 16:06:42 +00:00
Max Semenik
108f8f8ef4 Follow-up r68127: honor table prefix, perverted though it may seem on SQLite. 2010-11-01 19:51:36 +00:00
Sam Reed
d189aaee05 (bug 24853) Kill failFunction - Fixed! :D 2010-10-24 21:27:33 +00:00
Sam Reed
16cded8b32 Start of bug 24853, killing off 'functional' parts of failfunction code. Seems when the constructors start getting changed, it starts borking. Using this as a point of reversion/stashing 2010-10-24 20:48:48 +00:00
Max Semenik
84d86f3116 Reverted r70151 and re-did what it was intended to do in a proper way: instead of just quietly serializing a crippled connection, fix the caller and receive nice exceptions when something else is broken instead of bug-hunting later. 2010-10-23 11:16:44 +00:00
Max Semenik
a2b34bc18d Revert r73942, which was itself a revert of r73887. After r75213 it will not cause additional test failures. 2010-10-23 09:59:57 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Max Semenik
a426ec56c0 Support conversion of floating-point MySQL types in DatabaseSqlite::sourceStream() 2010-10-07 16:13:54 +00:00
Max Semenik
fd5a7a705d rm obsolete comment 2010-10-02 08:37:51 +00:00
Alexandre Emsenhuber
1360aadafd removed call to deprecated function dbsource() and a comment that mentioned it 2010-10-02 08:29:01 +00:00
Max Semenik
3f38197f26 Revert r73887. I blame Nikerabbit! 2010-09-29 12:09:55 +00:00
Max Semenik
ebf79e4058 DatabaseSqlite: better check for error. Noticed by Nikerabbit 2010-09-28 13:46:23 +00:00
Max Semenik
c357bc7c8a Special:Version now displays whether a SQLite database supports full-text search 2010-09-23 19:36:06 +00:00
Max Semenik
2da7f1fe20 Fixed DatabaseSqlite::tableName() to avoid prefixing system tables 2010-09-19 15:19:38 +00:00
Max Semenik
0bc4101ac8 DatabaseSqliteStandalone should ignore $wgDBprefix, too 2010-09-07 17:34:42 +00:00
Max Semenik
6434168d5d Temporary plug for bug 24939 (interwiki creation during installation fails on SQLite), before we switch to new-installer. 2010-08-26 15:47:18 +00:00
Sam Reed
0b521dbbf2 Braces for MaxSem 2010-08-25 15:38:32 +00:00
Sam Reed
6bf4878668 Followup r71593 - Spaces, I *still* hate you 2010-08-25 15:26:45 +00:00
Sam Reed
4870b31eee Move unreachable $this->mConn = false in DatabaseSqlite 2010-08-24 22:04:49 +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
96114da761 Fix wrong removal in r71250 2010-08-18 13:50:07 +00:00