select count now returns an int8. This fixes the broken 'Recent changes' pages.
[cocanwiki.git] / scripts / rebuild_links.ml
index 91d206e..34642c1 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: rebuild_links.ml,v 1.2 2004/09/28 11:28:39 rich Exp $
+ * $Id: rebuild_links.ml,v 1.4 2005/11/23 11:32:13 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   (* Estimate how many sections we will have to process. *)
   let sth =
     dbh#prepare_cached
-      "select count(c.id) from contents c, pages p
+      "select count(c.id)::int4 from contents c, pages p
         where c.pageid = p.id
           and p.hostid = ?
           and p.url is not null
@@ -82,7 +82,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   (* Finish off. *)
   dbh#commit ();
 
-  print_string r template_done#to_string
+  ignore (print_string r template_done#to_string)
 
 let () =
   register_script ~restrict:[CanManageSite] run