diff options
| author | Cassio de Campos <cassiopc@gmail.com> | 2017-11-01 16:12:57 +0000 |
|---|---|---|
| committer | Cassio de Campos <cassiopc@gmail.com> | 2017-11-01 16:12:57 +0000 |
| commit | baeda9dea2639a9f717c6e851ee57be58f92f6f6 (patch) | |
| tree | 0e6fa5f44b31fbd867dc083c18d613f490c39a30 /src/db.php | |
| parent | f8d1ffa7c08687efd80c0e6fc2bdfd02b7d4e950 (diff) | |
| download | boca-baeda9dea2639a9f717c6e851ee57be58f92f6f6.tar.gz boca-baeda9dea2639a9f717c6e851ee57be58f92f6f6.zip | |
transactions fixed to speed up
Diffstat (limited to 'src/db.php')
| -rw-r--r-- | src/db.php | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -33,28 +33,28 @@ function DB_lo_open($conn, $file, $mode) { else return pg_lo_open ($conn, $file, $mode); } -function DB_lo_read_tobrowser($contest,$id) { - $str = DB_lo_read($contest,$id); - echo $str; - return true; +function DB_lo_read_tobrowser($contest,$id,$c=null) { + $str = DB_lo_read($contest,$id,-1,$c); + echo $str; + return true; } -function DB_lo_read($contest,$id,$s=-1) { +function DB_lo_read($contest,$id,$s=-1,$c=null) { if (strcmp(phpversion(),'4.2.0')<0) { if($s<0) { $str=''; - while (($buf = pg_loread ($id, 100000)) != false) $str .= $buf; + while (($buf = pg_loread ($id, 1000000)) != false) $str .= $buf; } else $str = pg_loread ($id, $s); } else { if($s<0) { $str=''; - while (($buf = pg_lo_read ($id, 100000)) != false) $str .= $buf; + while (($buf = pg_lo_read ($id, 1000000)) != false) $str .= $buf; } else $str = pg_lo_read ($id, $s); } - if(($str2 = DB_unlock($contest,$str))===false) return $str; + if(($str2 = DB_unlock($contest,$str,$c))===false) return $str; return $str2; } function DB_unlock($contest,$str,$c=null) { @@ -296,7 +296,7 @@ function DBcrc($contest,$id, $c=null) { // just to return a unique string that will not match any other... return "no-HASH-" . rand() . "-" . rand() . "-" . time(); } - $str = DB_lo_read($contest,$f); + $str = DB_lo_read($contest,$f,-1,$c); DB_lo_close($f); if($docommit) DBExec($c, "commit work", "DBcrc(commit)"); |