MediaWiki  1.23.14
DatabaseSqliteTest.php
Go to the documentation of this file.
1 <?php
2 
4  var $lastQuery;
5 
6  function __construct() {
7  parent::__construct( ':memory:' );
8  }
9 
10  function query( $sql, $fname = '', $tempIgnore = false ) {
11  $this->lastQuery = $sql;
12 
13  return true;
14  }
15 
19  public function replaceVars( $s ) {
20  return parent::replaceVars( $s );
21  }
22 }
23 
30 
34  var $db;
35 
36  protected function setUp() {
37  parent::setUp();
38 
39  if ( !Sqlite::isPresent() ) {
40  $this->markTestSkipped( 'No SQLite support detected' );
41  }
42  $this->db = new MockDatabaseSqlite();
43  if ( version_compare( $this->db->getServerVersion(), '3.6.0', '<' ) ) {
44  $this->markTestSkipped( "SQLite at least 3.6 required, {$this->db->getServerVersion()} found" );
45  }
46  }
47 
48  private function replaceVars( $sql ) {
49  // normalize spacing to hide implementation details
50  return preg_replace( '/\s+/', ' ', $this->db->replaceVars( $sql ) );
51  }
52 
53  private function assertResultIs( $expected, $res ) {
54  $this->assertNotNull( $res );
55  $i = 0;
56  foreach ( $res as $row ) {
57  foreach ( $expected[$i] as $key => $value ) {
58  $this->assertTrue( isset( $row->$key ) );
59  $this->assertEquals( $value, $row->$key );
60  }
61  $i++;
62  }
63  $this->assertEquals( count( $expected ), $i, 'Unexpected number of rows' );
64  }
65 
66  public static function provideAddQuotes() {
67  return array(
68  array( // #0: empty
69  '', "''"
70  ),
71  array( // #1: simple
72  'foo bar', "'foo bar'"
73  ),
74  array( // #2: including quote
75  'foo\'bar', "'foo''bar'"
76  ),
77  array( // #3: including \0 (must be represented as hex, per https://bugs.php.net/bug.php?id=63419)
78  "x\0y",
79  "x'780079'",
80  ),
81  array( // #4: blob object (must be represented as hex)
82  new Blob( "hello" ),
83  "x'68656c6c6f'",
84  ),
85  );
86  }
87 
92  public function testAddQuotes( $value, $expected ) {
93  // check quoting
94  $db = new DatabaseSqliteStandalone( ':memory:' );
95  $this->assertEquals( $expected, $db->addQuotes( $value ), 'string not quoted as expected' );
96 
97  // ok, quoting works as expected, now try a round trip.
98  $re = $db->query( 'select ' . $db->addQuotes( $value ) );
99 
100  $this->assertTrue( $re !== false, 'query failed' );
101 
102  if ( $row = $re->fetchRow() ) {
103  if ( $value instanceof Blob ) {
104  $value = $value->fetch();
105  }
106 
107  $this->assertEquals( $value, $row[0], 'string mangled by the database' );
108  } else {
109  $this->fail( 'query returned no result' );
110  }
111  }
112 
116  public function testReplaceVars() {
117  $this->assertEquals( 'foo', $this->replaceVars( 'foo' ), "Don't break anything accidentally" );
118 
119  $this->assertEquals( "CREATE TABLE /**/foo (foo_key INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "
120  . "foo_bar TEXT, foo_name TEXT NOT NULL DEFAULT '', foo_int INTEGER, foo_int2 INTEGER );",
121  $this->replaceVars( "CREATE TABLE /**/foo (foo_key int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
122  foo_bar char(13), foo_name varchar(255) binary NOT NULL DEFAULT '', foo_int tinyint ( 8 ), foo_int2 int(16) ) ENGINE=MyISAM;" )
123  );
124 
125  $this->assertEquals( "CREATE TABLE foo ( foo1 REAL, foo2 REAL, foo3 REAL );",
126  $this->replaceVars( "CREATE TABLE foo ( foo1 FLOAT, foo2 DOUBLE( 1,10), foo3 DOUBLE PRECISION );" )
127  );
128 
129  $this->assertEquals( "CREATE TABLE foo ( foo_binary1 BLOB, foo_binary2 BLOB );",
130  $this->replaceVars( "CREATE TABLE foo ( foo_binary1 binary(16), foo_binary2 varbinary(32) );" )
131  );
132 
133  $this->assertEquals( "CREATE TABLE text ( text_foo TEXT );",
134  $this->replaceVars( "CREATE TABLE text ( text_foo tinytext );" ),
135  'Table name changed'
136  );
137 
138  $this->assertEquals( "CREATE TABLE foo ( foobar INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL );",
139  $this->replaceVars( "CREATE TABLE foo ( foobar INT PRIMARY KEY NOT NULL AUTO_INCREMENT );" )
140  );
141  $this->assertEquals( "CREATE TABLE foo ( foobar INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL );",
142  $this->replaceVars( "CREATE TABLE foo ( foobar INT PRIMARY KEY AUTO_INCREMENT NOT NULL );" )
143  );
144 
145  $this->assertEquals( "CREATE TABLE enums( enum1 TEXT, myenum TEXT)",
146  $this->replaceVars( "CREATE TABLE enums( enum1 ENUM('A', 'B'), myenum ENUM ('X', 'Y'))" )
147  );
148 
149  $this->assertEquals( "ALTER TABLE foo ADD COLUMN foo_bar INTEGER DEFAULT 42",
150  $this->replaceVars( "ALTER TABLE foo\nADD COLUMN foo_bar int(10) unsigned DEFAULT 42" )
151  );
152 
153  $this->assertEquals( "DROP INDEX foo",
154  $this->replaceVars( "DROP INDEX /*i*/foo ON /*_*/bar" )
155  );
156 
157  $this->assertEquals( "DROP INDEX foo -- dropping index",
158  $this->replaceVars( "DROP INDEX /*i*/foo ON /*_*/bar -- dropping index" )
159  );
160  }
161 
165  public function testTableName() {
166  // @todo Moar!
167  $db = new DatabaseSqliteStandalone( ':memory:' );
168  $this->assertEquals( 'foo', $db->tableName( 'foo' ) );
169  $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) );
170  $db->tablePrefix( 'foo' );
171  $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) );
172  $this->assertEquals( 'foobar', $db->tableName( 'bar' ) );
173  }
174 
178  public function testDuplicateTableStructure() {
179  $db = new DatabaseSqliteStandalone( ':memory:' );
180  $db->query( 'CREATE TABLE foo(foo, barfoo)' );
181 
182  $db->duplicateTableStructure( 'foo', 'bar' );
183  $this->assertEquals( 'CREATE TABLE "bar"(foo, barfoo)',
184  $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'bar' ) ),
185  'Normal table duplication'
186  );
187 
188  $db->duplicateTableStructure( 'foo', 'baz', true );
189  $this->assertEquals( 'CREATE TABLE "baz"(foo, barfoo)',
190  $db->selectField( 'sqlite_temp_master', 'sql', array( 'name' => 'baz' ) ),
191  'Creation of temporary duplicate'
192  );
193  $this->assertEquals( 0,
194  $db->selectField( 'sqlite_master', 'COUNT(*)', array( 'name' => 'baz' ) ),
195  'Create a temporary duplicate only'
196  );
197  }
198 
202  public function testDuplicateTableStructureVirtual() {
203  $db = new DatabaseSqliteStandalone( ':memory:' );
204  if ( $db->getFulltextSearchModule() != 'FTS3' ) {
205  $this->markTestSkipped( 'FTS3 not supported, cannot create virtual tables' );
206  }
207  $db->query( 'CREATE VIRTUAL TABLE "foo" USING FTS3(foobar)' );
208 
209  $db->duplicateTableStructure( 'foo', 'bar' );
210  $this->assertEquals( 'CREATE VIRTUAL TABLE "bar" USING FTS3(foobar)',
211  $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'bar' ) ),
212  'Duplication of virtual tables'
213  );
214 
215  $db->duplicateTableStructure( 'foo', 'baz', true );
216  $this->assertEquals( 'CREATE VIRTUAL TABLE "baz" USING FTS3(foobar)',
217  $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'baz' ) ),
218  "Can't create temporary virtual tables, should fall back to non-temporary duplication"
219  );
220  }
221 
225  public function testDeleteJoin() {
226  $db = new DatabaseSqliteStandalone( ':memory:' );
227  $db->query( 'CREATE TABLE a (a_1)', __METHOD__ );
228  $db->query( 'CREATE TABLE b (b_1, b_2)', __METHOD__ );
229  $db->insert( 'a', array(
230  array( 'a_1' => 1 ),
231  array( 'a_1' => 2 ),
232  array( 'a_1' => 3 ),
233  ),
234  __METHOD__
235  );
236  $db->insert( 'b', array(
237  array( 'b_1' => 2, 'b_2' => 'a' ),
238  array( 'b_1' => 3, 'b_2' => 'b' ),
239  ),
240  __METHOD__
241  );
242  $db->deleteJoin( 'a', 'b', 'a_1', 'b_1', array( 'b_2' => 'a' ), __METHOD__ );
243  $res = $db->query( "SELECT * FROM a", __METHOD__ );
244  $this->assertResultIs( array(
245  array( 'a_1' => 1 ),
246  array( 'a_1' => 3 ),
247  ),
248  $res
249  );
250  }
251 
252  public function testEntireSchema() {
253  global $IP;
254 
255  $result = Sqlite::checkSqlSyntax( "$IP/maintenance/tables.sql" );
256  if ( $result !== true ) {
257  $this->fail( $result );
258  }
259  $this->assertTrue( true ); // avoid test being marked as incomplete due to lack of assertions
260  }
261 
266  public function testUpgrades() {
267  global $IP, $wgVersion, $wgProfileToDatabase;
268 
269  // Versions tested
270  $versions = array(
271  //'1.13', disabled for now, was totally screwed up
272  // SQLite wasn't included in 1.14
273  '1.15',
274  '1.16',
275  '1.17',
276  '1.18',
277  );
278 
279  // Mismatches for these columns we can safely ignore
280  $ignoredColumns = array(
281  'user_newtalk.user_last_timestamp', // r84185
282  );
283 
284  $currentDB = new DatabaseSqliteStandalone( ':memory:' );
285  $currentDB->sourceFile( "$IP/maintenance/tables.sql" );
286  if ( $wgProfileToDatabase ) {
287  $currentDB->sourceFile( "$IP/maintenance/sqlite/archives/patch-profiling.sql" );
288  }
289  $currentTables = $this->getTables( $currentDB );
290  sort( $currentTables );
291 
292  foreach ( $versions as $version ) {
293  $versions = "upgrading from $version to $wgVersion";
294  $db = $this->prepareDB( $version );
295  $tables = $this->getTables( $db );
296  $this->assertEquals( $currentTables, $tables, "Different tables $versions" );
297  foreach ( $tables as $table ) {
298  $currentCols = $this->getColumns( $currentDB, $table );
299  $cols = $this->getColumns( $db, $table );
300  $this->assertEquals(
301  array_keys( $currentCols ),
302  array_keys( $cols ),
303  "Mismatching columns for table \"$table\" $versions"
304  );
305  foreach ( $currentCols as $name => $column ) {
306  $fullName = "$table.$name";
307  $this->assertEquals(
308  (bool)$column->pk,
309  (bool)$cols[$name]->pk,
310  "PRIMARY KEY status does not match for column $fullName $versions"
311  );
312  if ( !in_array( $fullName, $ignoredColumns ) ) {
313  $this->assertEquals(
314  (bool)$column->notnull,
315  (bool)$cols[$name]->notnull,
316  "NOT NULL status does not match for column $fullName $versions"
317  );
318  $this->assertEquals(
319  $column->dflt_value,
320  $cols[$name]->dflt_value,
321  "Default values does not match for column $fullName $versions"
322  );
323  }
324  }
325  $currentIndexes = $this->getIndexes( $currentDB, $table );
326  $indexes = $this->getIndexes( $db, $table );
327  $this->assertEquals(
328  array_keys( $currentIndexes ),
329  array_keys( $indexes ),
330  "mismatching indexes for table \"$table\" $versions"
331  );
332  }
333  $db->close();
334  }
335  }
336 
340  public function testInsertIdType() {
341  $db = new DatabaseSqliteStandalone( ':memory:' );
342 
343  $databaseCreation = $db->query( 'CREATE TABLE a ( a_1 )', __METHOD__ );
344  $this->assertInstanceOf( 'ResultWrapper', $databaseCreation, "Database creation" );
345 
346  $insertion = $db->insert( 'a', array( 'a_1' => 10 ), __METHOD__ );
347  $this->assertTrue( $insertion, "Insertion worked" );
348 
349  $this->assertInternalType( 'integer', $db->insertId(), "Actual typecheck" );
350  $this->assertTrue( $db->close(), "closing database" );
351  }
352 
353  private function prepareDB( $version ) {
354  static $maint = null;
355  if ( $maint === null ) {
356  $maint = new FakeMaintenance();
357  $maint->loadParamsAndArgs( null, array( 'quiet' => 1 ) );
358  }
359 
360  global $IP;
361  $db = new DatabaseSqliteStandalone( ':memory:' );
362  $db->sourceFile( "$IP/tests/phpunit/data/db/sqlite/tables-$version.sql" );
363  $updater = DatabaseUpdater::newForDB( $db, false, $maint );
364  $updater->doUpdates( array( 'core' ) );
365 
366  return $db;
367  }
368 
369  private function getTables( $db ) {
370  $list = array_flip( $db->listTables() );
371  $excluded = array(
372  'external_user', // removed from core in 1.22
373  'math', // moved out of core in 1.18
374  'trackbacks', // removed from core in 1.19
375  'searchindex',
376  'searchindex_content',
377  'searchindex_segments',
378  'searchindex_segdir',
379  // FTS4 ready!!1
380  'searchindex_docsize',
381  'searchindex_stat',
382  );
383  foreach ( $excluded as $t ) {
384  unset( $list[$t] );
385  }
386  $list = array_flip( $list );
387  sort( $list );
388 
389  return $list;
390  }
391 
392  private function getColumns( $db, $table ) {
393  $cols = array();
394  $res = $db->query( "PRAGMA table_info($table)" );
395  $this->assertNotNull( $res );
396  foreach ( $res as $col ) {
397  $cols[$col->name] = $col;
398  }
399  ksort( $cols );
400 
401  return $cols;
402  }
403 
404  private function getIndexes( $db, $table ) {
405  $indexes = array();
406  $res = $db->query( "PRAGMA index_list($table)" );
407  $this->assertNotNull( $res );
408  foreach ( $res as $index ) {
409  $res2 = $db->query( "PRAGMA index_info({$index->name})" );
410  $this->assertNotNull( $res2 );
411  $index->columns = array();
412  foreach ( $res2 as $col ) {
413  $index->columns[] = $col;
414  }
415  $indexes[$index->name] = $index;
416  }
417  ksort( $indexes );
418 
419  return $indexes;
420  }
421 
422  public function testCaseInsensitiveLike() {
423  // TODO: Test this for all databases
424  $db = new DatabaseSqliteStandalone( ':memory:' );
425  $res = $db->query( 'SELECT "a" LIKE "A" AS a' );
426  $row = $res->fetchRow();
427  $this->assertFalse( (bool)$row['a'] );
428  }
429 }
DatabaseSqliteTest\testAddQuotes
testAddQuotes( $value, $expected)
@dataProvider provideAddQuotes() @covers DatabaseSqlite::addQuotes
Definition: DatabaseSqliteTest.php:91
DatabaseBase\lastQuery
lastQuery()
Return the last query that went through DatabaseBase::query()
Definition: Database.php:574
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
DatabaseSqlite\duplicateTableStructure
duplicateTableStructure( $oldName, $newName, $temporary=false, $fname=__METHOD__)
Definition: DatabaseSqlite.php:913
DatabaseSqliteTest\testCaseInsensitiveLike
testCaseInsensitiveLike()
Definition: DatabaseSqliteTest.php:421
DatabaseSqliteTest\assertResultIs
assertResultIs( $expected, $res)
Definition: DatabaseSqliteTest.php:52
DatabaseSqliteTest\testTableName
testTableName()
@covers DatabaseSqlite::tableName
Definition: DatabaseSqliteTest.php:164
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$tables
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
Definition: hooks.txt:815
DatabaseBase\close
close()
Closes a database connection.
Definition: Database.php:914
MockDatabaseSqlite\__construct
__construct()
Definition: DatabaseSqliteTest.php:6
MockDatabaseSqlite\replaceVars
replaceVars( $s)
Override parent visibility to public.
Definition: DatabaseSqliteTest.php:19
DatabaseSqliteTest\testEntireSchema
testEntireSchema()
Definition: DatabaseSqliteTest.php:251
DatabaseSqliteStandalone
This class allows simple acccess to a SQLite database independently from main database settings.
Definition: DatabaseSqlite.php:974
DatabaseSqliteTest\getTables
getTables( $db)
Definition: DatabaseSqliteTest.php:368
$fname
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
Definition: Setup.php:35
Blob
Utility class.
Definition: DatabaseUtility.php:53
$s
$s
Definition: mergeMessageFileList.php:156
fail
as a message key or array as accepted by ApiBase::dieUsageMsg after processing request parameters Return false to let the request fail
Definition: hooks.txt:375
DatabaseSqlite\tableName
tableName( $name, $format='quoted')
Use MySQL's naming (accounts for prefix etc) but remove surrounding backticks.
Definition: DatabaseSqlite.php:367
DatabaseSqliteTest
@group sqlite @group Database @group medium
Definition: DatabaseSqliteTest.php:29
DatabaseSqliteTest\testReplaceVars
testReplaceVars()
@covers DatabaseSqlite::replaceVars
Definition: DatabaseSqliteTest.php:115
MockDatabaseSqlite
Definition: DatabaseSqliteTest.php:3
DatabaseBase\tablePrefix
tablePrefix( $prefix=null)
Get/set the table prefix.
Definition: Database.php:418
DatabaseSqlite\insert
insert( $table, $a, $fname=__METHOD__, $options=array())
Based on generic method (parent) with some prior SQLite-sepcific adjustments.
Definition: DatabaseSqlite.php:560
MockDatabaseSqlite\query
query( $sql, $fname='', $tempIgnore=false)
Run an SQL query and return the result.
Definition: DatabaseSqliteTest.php:10
DatabaseSqliteTest\setUp
setUp()
Definition: DatabaseSqliteTest.php:35
DatabaseBase\selectField
selectField( $table, $var, $cond='', $fname=__METHOD__, $options=array())
A SELECT wrapper which returns a single field from a single result row.
Definition: Database.php:1281
DatabaseUpdater\newForDB
static newForDB(&$db, $shared=false, $maintenance=null)
Definition: DatabaseUpdater.php:159
DatabaseSqlite\insertId
insertId()
This must be called after nextSequenceVal.
Definition: DatabaseSqlite.php:391
DatabaseSqliteTest\testDeleteJoin
testDeleteJoin()
@covers DatabaseSqlite::deleteJoin
Definition: DatabaseSqliteTest.php:224
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
DatabaseSqlite\listTables
listTables( $prefix=null, $fname=__METHOD__)
List all tables on the database.
Definition: DatabaseSqlite.php:946
DatabaseSqliteTest\provideAddQuotes
static provideAddQuotes()
Definition: DatabaseSqliteTest.php:65
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
FakeMaintenance
Fake maintenance wrapper, mostly used for the web installer/updater.
Definition: Maintenance.php:1198
DatabaseSqliteTest\getIndexes
getIndexes( $db, $table)
Definition: DatabaseSqliteTest.php:403
Sqlite\isPresent
static isPresent()
Checks whether PHP has SQLite support.
Definition: sqlite.inc:35
DatabaseSqliteTest\testDuplicateTableStructureVirtual
testDuplicateTableStructureVirtual()
@covers DatabaseSqlite::duplicateTableStructure
Definition: DatabaseSqliteTest.php:201
DatabaseBase\sourceFile
sourceFile( $filename, $lineCallback=false, $resultCallback=false, $fname=false, $inputCallback=false)
Read and execute SQL commands from a file.
Definition: Database.php:3745
DatabaseSqliteTest\testInsertIdType
testInsertIdType()
@covers DatabaseSqlite::insertId
Definition: DatabaseSqliteTest.php:339
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
$value
$value
Definition: styleTest.css.php:45
DatabaseSqliteTest\getColumns
getColumns( $db, $table)
Definition: DatabaseSqliteTest.php:391
DatabaseSqliteTest\testUpgrades
testUpgrades()
Runs upgrades of older databases and compares results with current schema.
Definition: DatabaseSqliteTest.php:265
$version
$version
Definition: parserTests.php:86
Sqlite\checkSqlSyntax
static checkSqlSyntax( $files)
Checks given files for correctness of SQL syntax.
Definition: sqlite.inc:47
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
$t
$t
Definition: testCompression.php:65
DatabaseSqliteTest\testDuplicateTableStructure
testDuplicateTableStructure()
@covers DatabaseSqlite::duplicateTableStructure
Definition: DatabaseSqliteTest.php:177
DatabaseBase\deleteJoin
deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname=__METHOD__)
DELETE where the condition is a join.
Definition: Database.php:2819
MockDatabaseSqlite\$lastQuery
$lastQuery
Definition: DatabaseSqliteTest.php:4
DatabaseSqlite\addQuotes
addQuotes( $s)
Definition: DatabaseSqlite.php:768
DatabaseSqliteTest\prepareDB
prepareDB( $version)
Definition: DatabaseSqliteTest.php:352
$IP
$IP
Definition: WebStart.php:92
$res
$res
Definition: database.txt:21
DatabaseSqliteTest\replaceVars
replaceVars( $sql)
Definition: DatabaseSqliteTest.php:47
DatabaseSqlite\getFulltextSearchModule
static getFulltextSearchModule()
Returns version of currently supported SQLite fulltext search module or false if none present.
Definition: DatabaseSqlite.php:196
DatabaseSqliteTest\$db
MockDatabaseSqlite $db
Definition: DatabaseSqliteTest.php:33