diff options
| author | Daniela Mariaschi <daniela@php.net> | 2003-06-14 16:45:38 +0000 |
|---|---|---|
| committer | Daniela Mariaschi <daniela@php.net> | 2003-06-14 16:45:38 +0000 |
| commit | 62030583811ad75f72312169b439303646eea39e (patch) | |
| tree | bc1429325fd0d7e0bd11fb13a6fa010c8b7d669f | |
| parent | e8e4db8581f574daca647e3d286795ea07951e30 (diff) | |
| download | php-git-62030583811ad75f72312169b439303646eea39e.tar.gz | |
Added test for IBASE_REC_VERSION/IBASE_REC_NO_VERSION trans constants
| -rw-r--r-- | ext/interbase/tests/005.phpt | 24 | ||||
| -rwxr-xr-x | ext/interbase/tests/interbase.inc | 13 |
2 files changed, 36 insertions, 1 deletions
diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt index cf86ca5c8a..988b7536ed 100644 --- a/ext/interbase/tests/005.phpt +++ b/ext/interbase/tests/005.phpt @@ -108,7 +108,8 @@ three transaction on default link $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 @@ three transaction on default link 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 @@ three transaction on default link 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 @@ three transaction on default link 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 @@ -247,6 +262,13 @@ three rows in third transaction 3 4 --- +three rows in fourth transaction with deadlock +--- test5 --- +2 +3 +4 +errmsg [lock conflict on no wait transaction deadlock ] +--- three rows --- test5 --- 2 diff --git a/ext/interbase/tests/interbase.inc b/ext/interbase/tests/interbase.inc index df708deca2..260ef00622 100755 --- a/ext/interbase/tests/interbase.inc +++ b/ext/interbase/tests/interbase.inc @@ -58,6 +58,19 @@ function out_result($result, $table_name = "") 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() { |
