Last modified: 2012-08-04 20:48:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29765, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27765 - Postgresql: invalid input syntax for type timestamp (Semantic MW)
Postgresql: invalid input syntax for type timestamp (Semantic MW)
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2011-02-27 18:27 UTC by Anton Kochkov
Modified: 2012-08-04 20:48 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Anton Kochkov 2011-02-27 18:27:49 UTC
On MediaWiki 1.16 and Semantic MediaWiki from svn on PostgreSQL 9.0.1 when i'm edit/create new page i'm always see this error:

A database error has occurred
Query: UPDATE page SET page_touched = '11012' WHERE page_namespace = '0' AND page_title = 'PPA'
Function: SMWStore::updateData
Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "11012"
LINE 1: ...re::updateData XVilka */ page SET page_touched = '11012' WH...
^
Backtrace:
#0 /usr/home/droid-dev/www/includes/db/Database.php(538): DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'UPDATE page SE...', 'SMWStore::updat...', false)
#1 /usr/home/droid-dev/www/includes/db/Database.php(1212): DatabaseBase->query('UPDATE page SE...', 'SMWStore::updat...')
#2 /usr/home/droid-dev/www/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php(238): DatabaseBase->update('page', Array, Array, 'SMWStore::updat...')
#3 /usr/home/droid-dev/www/extensions/SemanticMediaWiki/includes/SMW_ParseData.php(252): SMWStore->updateData(Object(SMWSemanticData))
#4 /usr/home/droid-dev/www/extensions/SemanticMediaWiki/includes/SMW_ParseData.php(406): SMWParseData::storeData(Object(ParserOutput), Object(Title), true)
#5 [internal function]: SMWParseData::onLinksUpdateConstructed(Object(LinksUpdate))
#6 /usr/home/droid-dev/www/includes/Hooks.php(133): call_user_func_array(Array, Array)
#7 /usr/home/droid-dev/www/includes/LinksUpdate.php(72): wfRunHooks('LinksUpdateCons...', Array)
#8 /usr/home/droid-dev/www/includes/Article.php(3317): LinksUpdate->LinksUpdate(Object(Title), Object(ParserOutput))
#9 /usr/home/droid-dev/www/includes/Article.php(2081): Article->editUpdates('== Primary Prot...', 'Created page wi...', true, '20110227174448', '953', true)
#10 /usr/home/droid-dev/www/includes/Article.php(1764): Article->doEdit('== Primary Prot...', '', 101)
#11 /usr/home/droid-dev/www/includes/EditPage.php(900): Article->insertNewArticle('== Primary Prot...', '', true, false, false, false, false)
#12 /usr/home/droid-dev/www/includes/EditPage.php(2552): EditPage->internalAttemptSave(false, false)
#13 /usr/home/droid-dev/www/includes/EditPage.php(389): EditPage->attemptSave()
#14 /usr/home/droid-dev/www/includes/EditPage.php(271): EditPage->edit()
#15 /usr/home/droid-dev/www/extensions/FCKeditor/FCKeditor.body.php(159): EditPage->submit()
#16 [internal function]: FCKeditor_MediaWiki->onCustomEditor(Object(Article), Object(User))
#17 /usr/home/droid-dev/www/includes/Hooks.php(133): call_user_func_array(Array, Array)
#18 /usr/home/droid-dev/www/includes/Wiki.php(545): wfRunHooks('CustomEditor', Array)
#19 /usr/home/droid-dev/www/includes/Wiki.php(70): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#20 /usr/home/droid-dev/www/index.php(117): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
#21 {main}
Comment 1 Anton Kochkov 2011-02-27 18:28:40 UTC
Also similar error was in this bug: https://bugzilla.wikimedia.org/show_bug.cgi?id=26295
Comment 2 Jeroen De Dauw 2011-02-27 18:34:59 UTC
Thanks for reporting this. There are multiple known issues with the recent versions of SMW and PostGres. I will have a look at this as soon as the PostGres support of the MW 1.17 installer gets fixed.
Comment 3 Markus Krötzsch 2011-02-27 20:18:36 UTC
I note that this error relates to the recent AutoRefreshSubject extension in SMW. It might be that it is not specific to Postgres.
Comment 4 Jeroen De Dauw 2011-02-27 21:07:17 UTC
How do you figure it's related to the AutoRefreshSubject stuff?
Comment 5 Markus Krötzsch 2011-02-28 08:31:48 UTC
Its in the bug report: it gives the lines where the SQL error came from. Moreover, SMW does usually not touch any MW tables, and the bug is about an insert in the "page" table. Is this really necessary?
Comment 6 Jeroen De Dauw 2011-02-28 14:46:13 UTC
Indeed, now I see. It's an update to indicate the page cache is invalid (not an insert), and it's doing pretty much the same as the invalidation function in MW core, with the difference that the code in SMW is adding some number to the timestamp, to ensure it's bigger then the one at which the page is actually saved.

In any case, I'll have another go at the whole MW+SMW PostGres story tomorrow.
Comment 7 Pieter J. Kersten 2011-04-06 13:54:21 UTC
FWIW, removing the extra addition on the timestamp in SMW_Store.php:238 makes it work again.
Comment 8 Jeroen De Dauw 2011-04-07 21:38:39 UTC
I just changed the addition to only happen for mysql, should find a more decent fix later on though, because now the automatic refresh won't happen for postgres. Can you confirm the issue is 'fixed'?
Comment 9 Pieter J. Kersten 2011-04-08 12:55:45 UTC
Your modification is the same as I did. It's working for me, without further verifying cache behavior.
Comment 10 Pieter J. Kersten 2011-04-09 19:59:39 UTC
A better fix: SMW_Store.php +233
$dbw->update(
                                'page',
                                array( 'page_touched' => $dbw->timestamp(time() +9001) ),
                                $title->pageCond(),
                                __METHOD__
                        );

Seems to work as well and should fix the cache problem.
Comment 11 Jeroen De Dauw 2011-04-09 20:12:23 UTC
Ah, nice, thanks :) Just committed that
Comment 12 Brandon Plewe 2011-07-27 20:33:00 UTC
This wasn't an issue in SMW 1.5.4, but seems to have reappeared in 1.5.6; when I put Pieter Kersten's patch back into SMW_Store.php, it works fine.  Please check this for 1.6.
Comment 13 Jeroen De Dauw 2011-07-27 22:15:59 UTC
(In reply to comment #12)
> This wasn't an issue in SMW 1.5.4, but seems to have reappeared in 1.5.6; when
> I put Pieter Kersten's patch back into SMW_Store.php, it works fine.  Please
> check this for 1.6.

I'm not sure what you are referring to. Please elaborate or open a new bug report.
Comment 14 Brandon Plewe 2011-07-29 03:34:33 UTC
I mean that I started seeing this bug when I upgraded SMW to 1.5.6.  I was not seeing it in 1.5.4.  I assume in April you committed Pieter's patch into what became 1.5.4, but somehow 1.5.6 had the older code.  I was able to put the patch back in, and it worked.  I just was hoping someone could check the code for SMW 1.6 to make sure the patched code is there.
Comment 15 Jeroen De Dauw 2011-07-29 15:34:06 UTC
The patch might have been reverted due to side effects. I don't really remember, so will have to look into this further. I really can't make this change and risk introducing this side effect at this point, as SMW 1.6 is planned to be released tomorrow. I'll look at it after the release.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links