source: branches/comu-ver2/data/module/adodb/tests/testgenid.php @ 18701

Revision 18701, 732 bytes checked in by nanasess, 14 years ago (diff)

Copyright の更新(#601)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/x-httpd-php
Line 
1<?php
2/*
3    V4.50 6 July 2004
4   
5    Run multiple copies of this php script at the same time
6    to test unique generation of id's in multiuser mode
7*/
8include_once('../adodb.inc.php');
9$testaccess = true;
10include_once('testdatabases.inc.php');
11
12function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
13{
14    $table = 'adodbseq';
15   
16    $db->Execute("drop table $table");
17    //$db->debug=true;
18   
19    $ctr = 5000;
20    $lastnum = 0;
21   
22    while (--$ctr >= 0) {
23        $num = $db->GenID($table);
24        if ($num === false) {   
25            print "GenID returned false";
26            break;
27        }
28        if ($lastnum + 1 == $num) print " $num ";
29        else {
30            print " <font color=red>$num</font> ";
31            flush();
32        }
33        $lastnum = $num;
34    }
35}
36?>
Note: See TracBrowser for help on using the repository browser.