switch INSERT to REPLACE when adding math equations to help work around race condition
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 25 Jun 2003 08:27:16 +0000 (08:27 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 25 Jun 2003 08:27:16 +0000 (08:27 +0000)
includes/OutputPage.php

index 283dcdf..d09dcdd 100644 (file)
@@ -93,7 +93,7 @@ function renderMath( $tex )
 
        $outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
 
-       $sql = "INSERT INTO math VALUES ('".$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html.", ".$sql_mathml.")";
+       $sql = "REPLACE INTO math VALUES ('".$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html.", ".$sql_mathml.")";
        
        $res = wfQuery( $sql, $fname );
        # we don't really care if it fails