xref: /PHP-5.5/ext/sybase_ct/tests/bug27843.phpt (revision 6218d2d9)
1--TEST--
2Sybase-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 *
9 * $Id$
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--
42bool(true)
43Stored procedure %s
44bool(true)
45>>> Query: exec phpt_bug27843
46<<< Return: resource
47array(1) {
48  [0]=>
49  array(1) {
50    ["computed"]=>
51    int(1)
52  }
53}
54bool(true)
55