daniela         Sat Jun 14 12:45:38 2003 EDT

  Modified files:              
    /php4/ext/interbase/tests   interbase.inc 005.phpt 
  Log:
  Added test for IBASE_REC_VERSION/IBASE_REC_NO_VERSION trans constants
  
  
Index: php4/ext/interbase/tests/interbase.inc
diff -u php4/ext/interbase/tests/interbase.inc:1.3 
php4/ext/interbase/tests/interbase.inc:1.4
--- php4/ext/interbase/tests/interbase.inc:1.3  Wed Apr 30 06:42:24 2003
+++ php4/ext/interbase/tests/interbase.inc      Sat Jun 14 12:45:38 2003
@@ -1,6 +1,6 @@
 <?php
 
-/* $Id: interbase.inc,v 1.3 2003/04/30 10:42:24 sniper Exp $ */
+/* $Id: interbase.inc,v 1.4 2003/06/14 16:45:38 daniela Exp $ */
 /* used in tests */
 
 srand((double)microtime()*1000000);
@@ -57,6 +57,19 @@
        }
        echo "---\n";
 }
+
+function out_result_trap_error($result, $table_name = "")
+{  
+   echo "--- $table_name ---\n";
+   while ($r = @ibase_fetch_assoc($result)){
+      while (list($k, $v) = each($r) ){
+         echo "$r[$k]\t";
+      }
+      echo "\n";
+   }
+   echo "errmsg [" . ibase_errmsg() . "]\t\n";
+   echo "---\n";
+} 
 
 /* M/D/Y H:M:S */
 function rand_datetime()
Index: php4/ext/interbase/tests/005.phpt
diff -u php4/ext/interbase/tests/005.phpt:1.3 php4/ext/interbase/tests/005.phpt:1.4
--- php4/ext/interbase/tests/005.phpt:1.3       Fri Apr 25 11:43:28 2003
+++ php4/ext/interbase/tests/005.phpt   Sat Jun 14 12:45:38 2003
@@ -108,7 +108,8 @@
     
        $tr_1 = ibase_trans();  /* this default transaction also */
        $tr_2 = ibase_trans(IBASE_READ);
-       $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITTED);
+       $tr_3 = ibase_trans(IBASE_READ+IBASE_COMMITTED+IBASE_REC_VERSION+IBASE_WAIT);  
  
+       $tr_4 = 
ibase_trans(IBASE_READ+IBASE_COMMITTED+IBASE_REC_NO_VERSION+IBASE_NOWAIT);      
     
        $res = ibase_query("select * from test5");
     
@@ -139,6 +140,10 @@
     
     ibase_commit($tr_1);
 
+       $tr_1 = ibase_trans();
+        ibase_query($tr_1, "insert into test5 (i) values (5)");
+       
+       /* tr_2 is IBASE_READ + IBASE_CONCURRENCY + IBASE_WAIT */
        $res = ibase_query($tr_2, "select * from test5");
     
     echo "one row in second transaction\n";
@@ -146,6 +151,7 @@
 
     ibase_free_result($res);
 
+       /* tr_3 is IBASE_COMMITTED + IBASE_REC_VERSION + IBASE_WAIT */
        $res = ibase_query($tr_3, "select * from test5");
     
     echo "three rows in third transaction\n";
@@ -153,6 +159,15 @@
 
     ibase_free_result($res);
 
+       /* tr_4 IBASE_COMMITED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */
+       $res = ibase_query($tr_4, "select * from test5");
+   
+        echo "three rows in fourth transaction with deadlock\n";
+    out_result_trap_error($res,"test5");
+
+    ibase_free_result($res); 
+ 
+        ibase_rollback($tr_1);
     ibase_close();
 /*
 transactions on second link
@@ -246,6 +261,13 @@
 2      
 3      
 4      
+---
+three rows in fourth transaction with deadlock
+--- test5 ---
+2      
+3      
+4      
+errmsg [lock conflict on no wait transaction deadlock ]        
 ---
 three rows
 --- test5 ---



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to