Author: jgolas
Description:
Running MediaWiki 1.8.2, PHP 5.1.6, MySql 5.0.2 and IIS 6 on Windows Server
- Client is running Firefox 1.5.0.7 on Windows XP Sp2. Whenever I try to
delete a page in MediaWiki, I get the following database error:
database query syntax error has occurred. This may indicate a bug in the
software. The last attempted database query was:
INSERT INTO `archive`
(ar_namespace,ar_title,ar_comment,ar_user,ar_user_text,ar_timestamp,ar_minor_edit,ar_rev_id,ar_text_id)
SELECT
page_namespace,page_title,rev_comment,rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_id,rev_text_id
FROM page,revision WHERE page_id = '1516' AND (page_id = rev_page)
from within function "Article::doDeleteArticle". MySQL returned error "1364:
Field 'ar_text' doesn't have a default value (localhost)".
When I installed MediaWiki, I had a problem generating the tables and found a
fix online that discussed changing many "not null default ''" lines to just "not
null". Anyway because of that it seems ar_text is current'y set to just "not
null" with no default value, and Mysql can't create a new row because of that.
When I try to assign a default value to ar_text (or even ar_flags) using either
MySql Query Browser or phpMyAdmin, I get "ar_text cannot have a default value".
I found a posting describing getting around this using phpMyAdmin but I couldn't
replicate it.
It seems the problem is either a MySQL bug (saw some mention of it), or
MediaWiki needs to write something to ar_text even if it isn't used. I did try
changing ar_text and then ar_flags to support null and that seemed to fix the
problem, although I'm not sure if it affects anything else (not a database
expert by any means). From what I researched ar_text is a legacy field that
still exists for backward compatibility or migration purposes.
Version: 1.8.x
Severity: normal
OS: Windows Server 2003
Platform: PC