Mailzu - There was an error executing your query - after 2.7.0 SQL changes

Gary V mr88talent at gmail.com
Sun Nov 27 19:23:31 CET 2011


On Sun, Nov 27, 2011 at 11:01 AM, Gary V wrote:
> I updated an SQL database per release notes in 2.7.0
> http://www.amavis.org/release-notes.txt :
>
>  The following SQL directives can be used to add these new fields:
>    ALTER TABLE msgrcpt ADD rseqnum     integer  DEFAULT 0   NOT NULL;
>    ALTER TABLE msgrcpt ADD content     char(1)  DEFAULT ' ' NOT NULL;
>    ALTER TABLE msgrcpt ADD is_local    char(1)  DEFAULT ' ' NOT NULL;
>    ALTER TABLE msgs    ADD originating char(1)  DEFAULT ' ' NOT NULL;
>
> and now when initially logging into Malzu, I was getting an error on
> the Summary page "There was an error executing your query:". I looked
> in the mailzu log and executed the query manually and got:
>
> ERROR 1052 (23000): Column 'content' in field list is ambiguous
>
> So, for the benefit of others,  the fix was to make it unambiguous in
> DBEngine.class.php - also one other small fix is included here:
>
> cp DBEngine.class.php DBEngine.class.php.original
>
> sed -i 's/dbtype/dbType/' DBEngine.class.php
> sed -i 's/COUNT(content)/COUNT(msgs.content)/' DBEngine.class.php
> sed -i 's/WHERE content=/WHERE msgs.content=/' DBEngine.class.php
>

Any query where 'content' is used will give the error in MySQL. I
noticed there are a lot of examples of queries that use the plain
'content' field in both http://www.amavis.org/README.sql-mysql.txt and
http://www.amavis.org/README.sql-pg.txt. It appears that neither of
these documents were updated to reflect the changes mentioned in
release notes. Possibly an unfortunate choice of field name was added
to msgrcpt?

-- 
Gary V


More information about the amavis-users mailing list