[CWB] SQL Syntax error when installing new corpus
Hardie, Andrew
a.hardie at lancaster.ac.uk
Thu Nov 7 09:52:12 CET 2019
"index" is an SQL keyword, you can't use it as the name of a p-attribute.
This is something that is not documented, sorry, as it's an oversight rather than part of the design.
I'm in the process of fixing it for the 3.3 version. I'll patch 3.2 as much as I can buy you might still run into problems. Anyway, setup will work from the next commit.
best
Andrew
________________________________
From: cwb-bounces at sslmit.unibo.it <cwb-bounces at sslmit.unibo.it> on behalf of D. Yuan <yuyuan97 at 163.com>
Sent: Thursday, 7 November 2019, 6:31 am
To: cwb at sslmit.unibo.it
Subject: [External Sender] Re: [CWB] SQL Syntax error when installing new corpus
Hi, Andrew,
Thank you very much for the tips of enlarging SQL database size. Here is attached the full message in the following. Sorry for the confusion. I kept only part of the original message because they are similar and I thought a snippet of it would be suffice.
Best,
D.
An SQL query did not run successfully!
Original query: CREATE TABLE __tempfreq_mencow ( freq int(11) unsigned default NULL, word varchar(255) NOT NULL, dependency varchar(255) NOT NULL, headindex varchar(255) NOT NULL, index varchar(255) NOT NULL, lemma varchar(255) NOT NULL, morphology varchar(255) NOT NULL, namedentity varchar(255) NOT NULL, pos varchar(255) NOT NULL, possimple varchar(255) NOT NULL, key (word), key (dependency), key (headindex), key (index), key (lemma), key (morphology), key (namedentity), key (pos), key (possimple) ) CHARACTER SET utf8 COLLATE utf8_general_ci /* from User: user | Function: corpus_make_freqtables() | 2019-Nov-07 12:51 */
Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(255) NOT NULL, lemma varchar(255) NOT NULL, morphology varchar(255' at line 6
PHP debugging backtrace
array(6) {
[1]=>
array(4) {
["file"]=>
string(42) "/var/www/html/CQPweb/lib/exiterror-lib.php"
["line"]=>
int(367)
["function"]=>
string(9) "exiterror"
["args"]=>
array(3) {
[0]=>
array(3) {
[0]=>
string(38) "An SQL query did not run successfully!"
[1]=>
string(702) "Original query:
CREATE TABLE __tempfreq_mencow (
freq int(11) unsigned default NULL,
word varchar(255) NOT NULL,
dependency varchar(255) NOT NULL,
headindex varchar(255) NOT NULL,
index varchar(255) NOT NULL,
lemma varchar(255) NOT NULL,
morphology varchar(255) NOT NULL,
namedentity varchar(255) NOT NULL,
pos varchar(255) NOT NULL,
possimple varchar(255) NOT NULL,
key (word),
key (dependency),
key (headindex),
key (index),
key (lemma),
key (morphology),
key (namedentity),
key (pos),
key (possimple)
) CHARACTER SET utf8 COLLATE utf8_general_ci
/* from User: user | Function: corpus_make_freqtables() | 2019-Nov-07 12:51 */
"
[2]=>
string(241) "Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(255) NOT NULL,
lemma varchar(255) NOT NULL,
morphology varchar(255' at line 6 "
}
[1]=>
NULL
[2]=>
NULL
}
}
[2]=>
array(4) {
["file"]=>
string(36) "/var/www/html/CQPweb/lib/sql-lib.php"
["line"]=>
int(213)
["function"]=>
string(18) "exiterror_sqlquery"
["args"]=>
array(3) {
[0]=>
int(1064)
[1]=>
string(226) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(255) NOT NULL,
lemma varchar(255) NOT NULL,
morphology varchar(255' at line 6"
[2]=>
string(682) "CREATE TABLE __tempfreq_mencow (
freq int(11) unsigned default NULL,
word varchar(255) NOT NULL,
dependency varchar(255) NOT NULL,
headindex varchar(255) NOT NULL,
index varchar(255) NOT NULL,
lemma varchar(255) NOT NULL,
morphology varchar(255) NOT NULL,
namedentity varchar(255) NOT NULL,
pos varchar(255) NOT NULL,
possimple varchar(255) NOT NULL,
key (word),
key (dependency),
key (headindex),
key (index),
key (lemma),
key (morphology),
key (namedentity),
key (pos),
key (possimple)
) CHARACTER SET utf8 COLLATE utf8_general_ci
/* from User: user | Function: corpus_make_freqtables() | 2019-Nov-07 12:51 */"
}
}
[3]=>
array(4) {
["file"]=>
string(42) "/var/www/html/CQPweb/lib/freqtable-lib.php"
["line"]=>
int(93)
["function"]=>
string(12) "do_sql_query"
["args"]=>
array(1) {
[0]=>
string(682) "CREATE TABLE __tempfreq_mencow (
freq int(11) unsigned default NULL,
word varchar(255) NOT NULL,
dependency varchar(255) NOT NULL,
headindex varchar(255) NOT NULL,
index varchar(255) NOT NULL,
lemma varchar(255) NOT NULL,
morphology varchar(255) NOT NULL,
namedentity varchar(255) NOT NULL,
pos varchar(255) NOT NULL,
possimple varchar(255) NOT NULL,
key (word),
key (dependency),
key (headindex),
key (index),
key (lemma),
key (morphology),
key (namedentity),
key (pos),
key (possimple)
) CHARACTER SET utf8 COLLATE utf8_general_ci
/* from User: user | Function: corpus_make_freqtables() | 2019-Nov-07 12:51 */"
}
}
[4]=>
array(4) {
["file"]=>
string(39) "/var/www/html/CQPweb/lib/corpus-lib.php"
["line"]=>
int(1005)
["function"]=>
string(22) "corpus_make_freqtables"
["args"]=>
array(1) {
[0]=>
string(6) "mencow"
}
}
[5]=>
array(4) {
["file"]=>
string(41) "/var/www/html/CQPweb/lib/metadata-act.php"
["line"]=>
int(193)
["function"]=>
string(30) "setup_all_corpus_freqlist_data"
["args"]=>
array(1) {
[0]=>
string(6) "mencow"
}
}
[6]=>
array(4) {
["file"]=>
string(41) "/var/www/html/CQPweb/exe/metadata-act.php"
["line"]=>
int(1)
["args"]=>
array(1) {
[0]=>
string(41) "/var/www/html/CQPweb/lib/metadata-act.php"
}
["function"]=>
string(7) "require"
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20191107/05d8abd9/attachment.html>
More information about the CWB
mailing list