"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/adodb/adodb/tests/testgenid.php Source File", "datetime" => "Sat Dec 2 19:22:27 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>
00001 <?php 00002 /* 00003 V4.50 6 July 2004 00004 00005 Run multiple copies of this php script at the same time 00006 to test unique generation of id's in multiuser mode 00007 */ 00008 include_once('../adodb.inc.php'); 00009 $testaccess = true; 00010 include_once('testdatabases.inc.php'); 00011 00012 function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)") 00013 { 00014 $table = 'adodbseq'; 00015 00016 $db->Execute("drop table $table"); 00017 //$db->debug=true; 00018 00019 $ctr = 5000; 00020 $lastnum = 0; 00021 00022 while (--$ctr >= 0) { 00023 $num = $db->GenID($table); 00024 if ($num === false) { 00025 print "GenID returned false"; 00026 break; 00027 } 00028 if ($lastnum + 1 == $num) print " $num "; 00029 else { 00030 print " <font color=red>$num</font> "; 00031 flush(); 00032 } 00033 $lastnum = $num; 00034 } 00035 } 00036 ?>