lidingpku / smwbp

Automatically exported from code.google.com/p/smwbp
0 stars 0 forks source link

Halo Extension is picky on wiki database name #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. name wiki database "wikidb_test-swm"  (containing '-' in database name

What is the expected output? What do you see instead?

halo extension will not initialize the table gardeningissue properly
{{{
$ php -e maintenance/SMW_setup.php

Setup database for HALO extension...PHP Warning:  Call-time
pass-by-reference ha
s been deprecated - argument passed by value;  If you would like to pass it
by r
eference, modify the declaration of preg_replace_callback().  If you would like
to enable call-time pass-by-reference, you can set
allow_call_time_pass_referenc
e to true in your INI file.  However, future versions may not support this
any l
onger.  in
/var/www/html/wiki/test-smwrpi/extensions/SMWHalo/specials/SMWWebServ
ice/SMW_WebServiceUsage.php on line 83
Setting up table `smw_gardeningissues` ...
A database query syntax error has occurred.
The last attempted database query was:
"CREATE TABLE wikidb_test-smwrpi.`smw_gardeningissues` (bot_id  VARCHAR(32) NOT
NULL COLLATE latin1_bin,gi_type  INT(8) UNSIGNED NOT NULL,gi_class  INT(8)
UNSIG
NED NOT NULL,p1_id  INT(8) UNSIGNED,p1_namespace  INTEGER,p1_title 
VARCHAR(255)
 COLLATE latin1_bin,p2_id  INT(8) UNSIGNED,p2_namespace  INTEGER,p2_title 
VARCH
AR(255) COLLATE latin1_bin,value  VARCHAR(255) COLLATE latin1_bin,valueint
 INTE
GER,modified  ENUM('y', 'n') DEFAULT 'n' NOT NULL) TYPE=innodb"
from within function "DBHelper::setupTable".
MySQL returned error "1064: You have an error in your SQL syntax; check the
manu
al that corresponds to your MySQL server version for the right syntax to
use nea
r '-smwrpi.`smw_gardeningissues` (bot_id  VARCHAR(32) NOT NULL COLLATE
latin1_bi
n,g' at line 1 (localhost)"
}}}

suggested solution

 * SMW+ team write a patch:  add quote to database name (possibly change
include/SWM_DBHelper)
 * do not create a wiki database which contains '-'

Please use labels and text to provide additional information.

Original issue reported on code.google.com by liding...@gmail.com on 21 Jan 2009 at 4:28