On Wed, Jul 27, 2011 at 12:47 PM, Robert Vogel <vogel(a)hallowelt.biz> wrote:
At my company we develop extensions for MediaWiki. We use the
"LoadExtensionSchemaUpdates" hook to create tables with the
Recently we faced the question whether it is possible to have stored procedures/functions
in an extensions SQL-File, or not. We tried it out and it didn't work for us. The
update.php says we've got an error in the SQL syntax, but there isn't one.
Can anybody help us? Is it possible to provide stored procedures to the database using
the update.php? Is there an example anywhere? Thx.
The SQL syntax error message comes from the database engine, not from
MediaWiki. So if it tells you there's an SQL syntax error, there's a
syntax error for sure. What you should look at:
1. does the DB backend you connect to support the syntax you're using?
Infamously, MySQL 4.0 will reject anything containing subqueries as a
syntax error, because subquery support wasn't introduced until 4.1 if
2. is MediaWiki connecting to the DB that you think it's connecting
to? There might be a version-triggered error like #1 above, but you
might not notice if you're connecting to a different version than
3. are you using magic phrases like /*_*/, /*$wgDBTablePrefix*/, /*i*/
or /*$wgDBTableOptions*/ ? MediaWiki substitutes these before sending
the SQL to the DB backend, so make sure you test your queries with
these substitutions applied
Roan Kattouw (Catrope)