Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / sybase_ct / tests / bug26407.phpt
blob35bf6df7ada3a70c727ec6d597ac20e07f0c8bda
1 --TEST--
2 Sybase-CT bug #26407 (Result set fetching broken around transactions)
3 --SKIPIF--
4 <?php require('skipif.inc'); ?>
5 --FILE--
6 <?php
7 /* This file is part of PHP test framework for ext/sybase_ct
8  *
9  * $Id$ 
10  */
12   require('test.inc');
14   $db= sybase_connect_ex();
16   // Create temporary table
17   $table= 'phpt_bug26407';
18   var_dump(sybase_query('create table #'.$table.' ( the_big_answer int )', $db));
20   // I
21   var_dump(sybase_select_ex($db, '
22     begin transaction
23       -- anything producing a result set here will fail;
24       -- however, print or update statements will work
25       select "foo" 
26     commit
27     -- anything afterwards will fail, too
28   '));  
30   // II
31   var_dump(sybase_select_ex($db, '
32     begin transaction
33       -- no result returned...
34       update #'.$table.' set the_big_answer=42
35     commit
36   '));
37   
38   // III
39   var_dump(sybase_select_ex($db, '
40     select "foo"
41     begin transaction
42       -- do anything, even return a result set
43     commit
44     select "bar"   
45   '));
47   sybase_close($db);
49 --EXPECTF--
50 bool(true)
51 >>> Query: 
52     begin transaction
53       -- anything producing a result set here will fail;
54       -- however, print or update statements will work
55       select "foo" 
56     commit
57     -- anything afterwards will fail, too
58   
59 <<< Return: resource
60 array(1) {
61   [0]=>
62   array(1) {
63     ["computed"]=>
64     string(3) "foo"
65   }
67 >>> Query: 
68     begin transaction
69       -- no result returned...
70       update #phpt_bug26407 set the_big_answer=42
71     commit
72   
73 <<< Return: boolean
74 bool(true)
75 >>> Query: 
76     select "foo"
77     begin transaction
78       -- do anything, even return a result set
79     commit
80     select "bar"   
81   
83 Notice: sybase_query(): Sybase:  Unexpected results, cancelling current in %stest.inc on line %d
84 <<< Return: resource
85 array(1) {
86   [0]=>
87   array(1) {
88     ["computed"]=>
89     string(3) "foo"
90   }