There are 2 log messages on this problem:

preg_match() [function.preg-match]: Compilation failed: internal error: previously-checked referenced subpattern not found at offset 389 in /usr/local/www/apache22/data/gelu-tur/includes/database.inc on line 347.

and

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 'LEFT JOIN i18n_blocks i18n ON (b.module = i18n.module AND b.delta = i18n.delta) ' at line 1 query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = 'garland' AND b.status = 1 AND (r.rid IN (2) OR r.rid IS NULL) LEFT JOIN i18n_blocks i18n ON (b.module = i18n.module AND b.delta = i18n.delta) WHERE (i18n.language ='en' OR i18n.language ='' OR i18n.language IS NULL) ORDER BY b.region, b.weight, b.module in /usr/local/www/apache22/data/gelu-tur/modules/block/block.module on line 456.

CommentFileSizeAuthor
#8 database.inc_.patch1.2 KBludek

Comments

dobeerman’s picture

subscribe

drsnuggles’s picture

Priority: Normal » Major

I'm subscribing as well. My site is unusable until this error is solved. Related issue: http://drupal.org/node/1286046

rasved’s picture

Priority: Major » Critical

I second the problem here.

I get the same errors/warnings with fully updated Drupal (6.22).

Elevated to critical, since I have running sites which suddenly stopped working!!

R

dudett’s picture

In the link drsnuggles provided

I'm subscribing as well. My site is unusable until this error is solved. Related issue: http://drupal.org/node/1286046

there's a temporary solution

Problem is solved after upgrade PCRE library (PCRE - Perl Compatible Regular Expressions) from version 8.02 to the last version 8.13 (hosting admin remake PHP-module php52-pcre with shared library pcre-8.13_1)

On freebsd, php52-pcre uses the apache22 bundled pcre lib provided by the pcre package. I had the most recent version of pcre-8.20 installed and I had that problem. I managed to find older versions of pcre, specifically pcre-8.10 and pcre-8.12 for freebsd, and both these packages solve the problem.

So, until maintainers will change the $pattern regex that will be compatible with the latest version of pcre, there's no other option besides using an older version of pcre.

jose reyero’s picture

From what I've read it seems we can conclude:

1. This has been introduced by an upgrade of the PHP PCRE library (8.02?)

2. This causes PCRE expression in db_rewrite_sql() to fail, which will cause the error to be logged in most cases. But if this hook is used to actually alter the query, like i18n does, the resulting query may be wrong and cause an SQL error.

3. This can be fixed by upgrading php-pcre to latest version (8.13)

So maybe we should be moving this issue to Drupal core as it is not i18n specific (though i18n is one of the few modules that implement this hook).

fls’s picture

On freebsd, php52-pcre uses the apache22 bundled pcre lib provided by the pcre package. I had the most recent version of pcre-8.20 installed and I had that problem. I managed to find older versions of pcre, specifically pcre-8.10 and pcre-8.12 for freebsd, and both these packages solve the problem.

Same here with FreeBSD 8.2-STABLE, apache-2.2.21 and php-5.2.17. A port downgrade of /usr/ports/devel/pcre from pcre-8.20 to pcre-8.12 solved the problem --for now.

jose reyero’s picture

Status: Active » Closed (works as designed)

So it seems clear it is a pcre library issue, nothing to do here.

See comments above about how to fix it.

ludek’s picture

StatusFileSize
new1.2 KB

I have this issue on freebsd 7.3 and php 5.2. The test server with freebsd 8.1 and php 5.3 is working properly.

because latest freebsd packages require newer pcre library than 8.12, I patched db_rewrite_sql to use drupal 5 code if preg_match failed. It's not perfect solution but it works for me.

drifter’s picture

Issue summary: View changes

Thanks ludek, your temporary fix still works.