[CWB] CQPweb Collocations SQL error (CQPweb 3.2.42)

Thilo Wiertz thilo.wiertz at geographie.uni-freiburg.de
Thu Dec 17 21:43:42 CET 2020


Dear Andrew,

I encounter an error trying to create collocations on CQPweb 3.2.42. I haven’t used our CQPweb install in a while and it is possible that the server environment (Mariadb version?) has changed. But this segment of the SQL statement also looks suspicious to me: "having LogLikelihood >=  and observed >= 5“ (missing value after LogLikelihood?). 

Thanks so much for your help!
Thilo

CQPweb encountered an error and could not continue.
An SQL query did not run successfully!

Original query: select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected, log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance , sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * ( IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) + IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) + IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) + IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) ) as LogLikelihood, freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item` and dist between -3 and 3 and freq_corpus_tagesschau_word.`freq` >= 5 group by `db_colloc_glri2o63ehp`.`word` having LogLikelihood >= and observed >= 5 order by significance desc LIMIT 0, 50 /* from User: thilo | Function: require() | 2020-Dec-17 21:35 */

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 'and observed >= 5 order by significance desc LIMIT 0, 50 /* from Use' at line 16

PHP debugging backtrace
array(4) {
  [1]=>
  array(4) {
    ["file"]=>
    string(43) "/var/www/html/diskurs/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(2291) "Original query: 

select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected,
			log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance ,
			sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * (
				IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
				IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) +
				IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
				IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0)
			) as LogLikelihood,
			freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count
			from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word
			where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item`
			and dist between -3 and 3
			
			and freq_corpus_tagesschau_word.`freq` >= 5
			group by `db_colloc_glri2o63ehp`.`word`
			having LogLikelihood >=  and observed >= 5
			order by significance desc
			LIMIT 0, 50
			 
	/* from User: thilo | Function: require() | 2020-Dec-17 21:35 */

"
        [2]=>
        string(242) "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 'and observed >= 5
			order by significance desc
			LIMIT 0, 50
			 
	/* from Use' at line 16 "
      }
      [1]=>
      NULL
      [2]=>
      NULL
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(37) "/var/www/html/diskurs/lib/sql-lib.php"
    ["line"]=>
    int(216)
    ["function"]=>
    string(18) "exiterror_sqlquery"
    ["args"]=>
    array(3) {
      [0]=>
      int(1064)
      [1]=>
      string(227) "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 'and observed >= 5
			order by significance desc
			LIMIT 0, 50
			 
	/* from Use' at line 16"
      [2]=>
      string(2271) "select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected,
			log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance ,
			sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * (
				IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
				IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) +
				IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
				IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0)
			) as LogLikelihood,
			freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count
			from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word
			where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item`
			and dist between -3 and 3
			
			and freq_corpus_tagesschau_word.`freq` >= 5
			group by `db_colloc_glri2o63ehp`.`word`
			having LogLikelihood >=  and observed >= 5
			order by significance desc
			LIMIT 0, 50
			 
	/* from User: thilo | Function: require() | 2020-Dec-17 21:35 */"
    }
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(44) "/var/www/html/diskurs/lib/collocation-ui.php"
    ["line"]=>
    int(512)
    ["function"]=>
    string(12) "do_sql_query"
    ["args"]=>
    array(1) {
      [0]=>
      string(2271) "select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected,
			log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance ,
			sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * (
				IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
				IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) +
				IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
				IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0)
			) as LogLikelihood,
			freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count
			from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word
			where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item`
			and dist between -3 and 3
			
			and freq_corpus_tagesschau_word.`freq` >= 5
			group by `db_colloc_glri2o63ehp`.`word`
			having LogLikelihood >=  and observed >= 5
			order by significance desc
			LIMIT 0, 50
			 
	/* from User: thilo | Function: require() | 2020-Dec-17 21:35 */"
    }
  }
  [4]=>
  array(4) {
    ["file"]=>
    string(41) "/var/www/html/diskurs/exe/collocation.php"
    ["line"]=>
    int(1)
    ["args"]=>
    array(1) {
      [0]=>
      string(44) "/var/www/html/diskurs/lib/collocation-ui.php"
    }
    ["function"]=>
    string(7) "require"
  }
}
CQPweb v3.2.42 © 2008-2020	Help! on CQPweb <https://diskurs.geographie.uni-freiburg.de/tagesschau/help.php?ui=hello>	You are logged in as user [thilo]
 




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20201217/d56e4120/attachment-0001.html>


More information about the CWB mailing list