A cron run results in a host of these errors.
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
'301029995664 WHERE word = 'leslie''
at line 1 query:
UPDATE search_total SET count = 0,301029995664 WHERE word = 'leslie' i /web/www.mysite.com/www/modules/search/search.module on line 288.
The line in question is a part of function search_update_totals() and reads
db_query("UPDATE {search_total} SET count = %f WHERE word = '%s'", $total, $word);
<code>
where $total is
<code>
$total = db_result(db_query("SELECT SUM(score) FROM {search_index} WHERE word = '%s'", $word));
// Apply Zipf's law to equalize the probability distribution
$total = log10(1 + 1/(max(1, $total)));
$total is, apparently, a number.
Comments
Comment #1
damien tournoud commentedPlease find out if a module in your installation is calling set_locale().
Comment #2
MauMauA node (content type: page) is calling
setlocale(LC_ALL, 'danish');
to display a date.
So yes, set_locale is run.
Comment #3
MauMauI wondered what was being written to search_total.
So I put
$$watchdog('SearchDebug', $word . ' ' . $total);
just before line 288.
Starting out everything is fine and dandy in the dblog:
Then suddendly it goes awry. Drupal tries to write to search_total but gets an error:
The error will typically look like:
So, what do we know?
$total is 0,301029995664
$word is enjoyed
the line in question reads:
db_query("UPDATE {search_total} SET count = %f WHERE word = '%s'", $total, $word);
Maybe the error hasn't got much to do with the oddly placed '
Comment #4
MauMauCould &helllip;
be the culprit?
The behaviour of search is this:
It runs fine and indexes correctly.
80% through the php-errors turn up, the mismatched '.
At 92% everything gets stuck and Search provokes an immediate cron timeout.
It's rather hard to find out at which node it get's stuck. But maybe … and set_locale is bringing some strange Search module error to light?
MySQl is 5.0.67, PHP is 5.2.6, Apache s 1.3.41 (Unix)
Comment #5
MauMauTaking a clue from
http://chirale.wordpress.com/2009/07/10/cron-cannot-run-on-drupal-the-dr...
I removed the one node containing a drupal_goto
And voila! Everything indexed well.
The Search-module apparently has an inability to parse drupal_goto's correctly.
There is a quickfix at
http://drupal.org/node/102138#comment-1688632
And a good discussion by competent people at
http://drupal.org/node/286263
I'm closing this one.