Mantis - Quercus
Viewing Issue Advanced Details
1849 minor always 07-04-07 07:02 07-09-07 14:17
sam  
sam  
normal  
closed 3.1.1  
fixed  
none    
none 3.1.2  
0001849: Postgres/MediaWiki issue method call 'getText' is not allowed for a null value
(rep by G Cox)

(same as http://bugs.caucho.com/view.php?id=1734 [^] with more specific details for configuration to reproduce)

mediawiki 1.10
postgres 8.2.3
postgresql-8.2-505.jdbc4.jar

18:49:01.339 com.caucho.quercus.QuercusErrorException:
/home/foo/web/war/amm-wiki/includes/SpecialSearch.php:324: Fatal
Error: Method call 'getText' is not allowed for a null value.
18:49:01.339 at com.caucho.quercus.env.Env.error(Env.java:4061)
18:49:01.339 at com.caucho.quercus.env.Env.error(Env.java:3972)
18:49:01.339 at com.caucho.quercus.env.Env.error(Env.java:3699)
18:49:01.339 at
com.caucho.quercus.env.Value.errorNoMethod(Value.java:1406)
18:49:01.339 at
com.caucho.quercus.env.Value.errorNoMethod(Value.java:1400)
18:49:01.339 at
com.caucho.quercus.env.Value.callMethod(Value.java:940)
18:49:01.339 at
com.caucho.quercus.env.Value.callMethod(Value.java:907)
18:49:01.339 at
com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java:104)
18:49:01.339 at com.caucho.quercus.expr.Expr.evalCopy(Expr.java:391)
18:49:01.339 at
com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:77)
18:49:01.339 at
com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)

Searching for something which is absent works ok -- it's just when
one searches for a hit that you get it.

In my resin-web.xml I have

    <!-- -->
    <database jndi-name='jdbc/postgres/mediawiki'>
        <driver type='org.postgresql.Driver'
url='jdbc:postgresql://localhost:5432/db_mediawiki' [^] user='u_mediawiki'
password='xxx'/>
    </database>

    <!-- -->
    <servlet-mapping url-pattern="*.php"
servlet-class="com.caucho.quercus.servlet.QuercusServlet">
        <init>
            <script-encoding>iso-8859-1</script-encoding>
        </init>
    </servlet-mapping>


Notes
(0002102)
sam   
07-09-07 10:23   
The MediaWiki installation procedure will fail with an error about string unterminated $mw$ with older versions of the postgresql-jdbc driver, the minimum version requirement for the driver is postgresql-8.2-505.jdbc3.jar
(0002103)
sam   
07-09-07 12:19   
For older versions of Postgres, MediaWiki causes an error:

webapps/mediawiki-1.10.0/includes/DatabasePostgres.php:496: Warning: Query failed: ERROR: unrecognized normalization method: 5 [pg_query]

This is not a Quercus bug, it is an incompatability between MediaWiki 1.10.0 and older versions of Postgres.

The solution is to modify the includes/SearchPostgres.php file, line 144, and change the "5" to a "1":

"rank($fulltext, to_tsquery('default',$searchstring),1) AS score ".
(0002104)
sam   
07-09-07 13:38   
pg_fetch_object needs to return false at end of results, was returning NULL.