Page MenuHomePhabricator

Database error when moving protection settings with pages when SQLite is used as a backend
Closed, ResolvedPublic


Using a SQLite backend, when a page with protection settings is moved, the following error occurs:

INSERT IGNORE INTO page_restrictions (pr_page,pr_type,pr_level,pr_cascade,pr_user,pr_expiry) SELECT 47,pr_type,pr_level,pr_cascade,pr_user,pr_expiry FROM page_restrictions WHERE pr_page = '20'
Function: Title::moveTo
Error: 1 near "IGNORE": syntax error


#0 C:\xampp\htdocs\core\includes\db\Database.php(1077): DatabaseBase->reportQueryError('near "IGNORE": ...', 1, 'INSERT IGNORE I...', 'Title::moveTo', false)
#1 C:\xampp\htdocs\core\includes\db\Database.php(2907): DatabaseBase->query('INSERT IGNORE I...', 'Title::moveTo')
#2 C:\xampp\htdocs\core\includes\Title.php(3805): DatabaseBase->insertSelect('page_restrictio...', 'page_restrictio...', Array, Array, 'Title::moveTo', Array)
#3 C:\xampp\htdocs\core\includes\specials\SpecialMovepage.php(528): Title->moveTo(Object(Title), true, '', true)
#4 C:\xampp\htdocs\core\includes\specials\SpecialMovepage.php(100): MovePageForm->doSubmit()
#5 C:\xampp\htdocs\core\includes\specialpage\SpecialPage.php(679): MovePageForm->execute(NULL)
#6 C:\xampp\htdocs\core\includes\SpecialPageFactory.php(487): SpecialPage->run(NULL)
#7 C:\xampp\htdocs\core\includes\Wiki.php(298): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#8 C:\xampp\htdocs\core\includes\Wiki.php(596): MediaWiki->performRequest()
#9 C:\xampp\htdocs\core\includes\Wiki.php(460): MediaWiki->main()
#10 C:\xampp\htdocs\core\index.php(49): MediaWiki->run()
#11 {main}

Version: 1.23.0
Severity: major



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:17 AM
bzimport added a project: Wikimedia-Rdbms.
bzimport set Reference to bz59233.
bzimport added a subscriber: Unknown Object (MLST).

Change 105190 had a related patch set uploaded by Umherirrender:
Call Database::makeInsertOptions from Database::insertSelect

Just for reference: I have no sqlite to test my change on that DBMS, but the change does not break mysql and now the same things is done with the options as in Database::insert, so that should fix this problem on sqlite (when merged).

Change 105190 merged by jenkins-bot:
Call Database::makeInsertOptions from Database::insertSelect

successfully merged - fix was confirmed by bug reporter on gerrit