Annotation of embedaddon/php/ext/sybase_ct/tests/bug27843.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Sybase-CT bug #27843 (notices when query is a stored procedure)
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: *
1.1.1.2 ! misho 9: * $Id$
1.1 misho 10: */
11:
12: require('test.inc');
13:
14: $db= sybase_connect_ex();
15:
16: // Check if stored procedure already exists
17: $sp_name= 'phpt_bug27843';
18: var_dump(sybase_select_db(TEMPDB, $db));
19: if (!sybase_select_single($db, 'select object_id("'.$sp_name.'")')) {
20: echo "Stored procedure {$sp_name} not found, creating\n";
21: var_dump(sybase_query('
22: create proc '.$sp_name.'
23: as
24: begin
25: select 1
26: end
27: '));
28: } else {
29: echo "Stored procedure {$sp_name} found, using\n";
30: var_dump(TRUE);
31: }
32:
33: // Execute stored procedure
34: var_dump(sybase_select_ex($db, 'exec '.$sp_name));
35:
36: // Clean up after ourselves
37: var_dump(sybase_query('drop proc '.$sp_name, $db));
38:
39: sybase_close($db);
40: ?>
41: --EXPECTF--
42: bool(true)
43: Stored procedure %s
44: bool(true)
45: >>> Query: exec phpt_bug27843
46: <<< Return: resource
47: array(1) {
48: [0]=>
49: array(1) {
50: ["computed"]=>
51: int(1)
52: }
53: }
54: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>