r20313 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20312‎ | r20313 | r20314 >
Date:18:50, 10 March 2007
Author:river
Status:old
Tags:
Comment:
ERROR: null value in column "ar_deleted" violates not-null constraint in /var/www/html/wiki-pg/includes/DatabasePostgres.php on line 402
- coalesce NEW.ar_deleted in archive_insert rule, because MW might not specify it and the default doesn't take effect
Modified paths:
  • /trunk/phase3/maintenance/postgres/archives/patch-archive2-ar_deleted.sql (modified) (history)
  • /trunk/phase3/maintenance/postgres/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/postgres/archives/patch-archive2-ar_deleted.sql
@@ -12,7 +12,6 @@
1313 DO INSTEAD INSERT INTO archive2 VALUES (
1414 NEW.ar_namespace, NEW.ar_title, NEW.ar_text, NEW.ar_comment, NEW.ar_user, NEW.ar_user_text,
1515 TO_TIMESTAMP(NEW.ar_timestamp, 'YYYYMMDDHH24MISS'),
16 - NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id, NEW.ar_deleted
 16+ NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id,
 17+ COALESCE(NEW.ar_deleted, 0) -- ar_deleted is not always specified
1718 );
18 -
19 -
Index: trunk/phase3/maintenance/postgres/tables.sql
@@ -152,7 +152,8 @@
153153 DO INSTEAD INSERT INTO archive2 VALUES (
154154 NEW.ar_namespace, NEW.ar_title, NEW.ar_text, NEW.ar_comment, NEW.ar_user, NEW.ar_user_text,
155155 TO_TIMESTAMP(NEW.ar_timestamp, 'YYYYMMDDHH24MISS'),
156 - NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id
 156+ NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id,
 157+ COALESCE(NEW.ar_deleted, 0) -- NEW.ar_deleted might be unspecified (NULL)
157158 );
158159
159160 CREATE RULE archive_delete AS ON DELETE TO archive