select count now returns an int8. This fixes the broken 'Recent changes' pages.
[cocanwiki.git] / scripts / recent.ml
index f77645c..94afb98 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: recent.ml,v 1.9 2004/10/21 18:35:01 rich Exp $
+ * $Id: recent.ml,v 1.10 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
@@ -36,7 +36,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   let template = get_template dbh hostid "recent.html" in
 
   (* Count the number of changes. *)
-  let sth = dbh#prepare_cached "select count(*) from pages where hostid = ?" in
+  let sth = dbh#prepare_cached
+    "select count(*)::int4 from pages where hostid = ?" in
   sth#execute [`Int hostid];
   let count = sth#fetch1int () in