Last modified: 2011-05-15 11:31:06 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 T28202, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26202 - Install/Upgrade Semantic MW fails due to syntax error in PostgreSQL
Install/Upgrade Semantic MW fails due to syntax error in PostgreSQL
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Jeroen De Dauw
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-02 12:52 UTC by Urpo Lankinen
Modified: 2011-05-15 11:31 UTC (History)
3 users (show)

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


Attachments
Postgresql database upgrade fix (975 bytes, patch)
2011-02-06 16:27 UTC, John Morton
Details

Description Urpo Lankinen 2010-12-02 12:52:53 UTC
I have an already existing Semantic MediaWiki site in PostgreSQL. When I upgraded to SMW 1.5.4, there were luckily no schema changes, because the "Initialise or upgrade tables" process fails.

Here's the bizarre error message that the software spits out - apparently, someone's being oddly specific about quotes, and PostgreSQL has a problem with that:

---------------
Setting up standard database configuration for SMW ...

Selected storage engine is "SMWSQLStore2" (or an extension thereof)

Checking table smw_ids ...
   Table already exists, checking structure ...


Warning:  pg_query() [function.pg-query]: Query failed: ERROR:  syntax error at or near "\"
LINE 6:   case when a.attnotnull THEN \'NO\'::text else \'YES\'::tex...
                                      ^ in /usr/share/mediawiki/includes/db/DatabasePostgres.php on line 580
---------------

I use MediaWiki 1.15.5-1 (Debian packaged version), PHP 5.2.6 and PostgreSQL 8.4.2.
Comment 1 John Morton 2011-02-06 16:18:57 UTC
The problem is that getFields function in SemanticMediaWiki/includes/storage/SMW_SQLHelpers.php uses a heredoc for the SQL for the postgre branch, but the query text is escaping single quotes like it's a big block of single quote string.

Which would have been painfully obvious if, before making a versioned release, a simple upgrade was run against a test postgresql installation :-/

I'll attach a patch against 1.5.5.1
Comment 2 John Morton 2011-02-06 16:27:00 UTC
Created attachment 8087 [details]
Postgresql database upgrade fix
Comment 3 Jeroen De Dauw 2011-02-06 18:26:08 UTC
Thanks John, I'll review your patch and apply it so it's in the next release (and set up a PostGres install to test compatibility :)
Comment 4 p858snake 2011-04-30 00:10:16 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 5 Jeroen De Dauw 2011-05-15 11:31:06 UTC
This should now be fixed, I installed SMW trunk on MW trunk using PostGres, and fixed the issues popping up both during the installation and upgrading process. This code will be in SMW 1.6.

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


Navigation
Links