Annotation of embedaddon/php/ext/sybase_ct/tests/bug28354.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Sybase-CT bug #28354 (sybase_free_result crash)
                      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: bug28354.phpt 236101 2007-05-22 11:35:47Z thekid $ 
                     10:  */
                     11: 
                     12:   require('test.inc');
                     13: 
                     14:   $db= sybase_connect_ex();
                     15:   sybase_set_message_handler('sybase_msg_handler');
                     16:   error_reporting(error_reporting() & !E_NOTICE);       // Suppress notices
                     17: 
                     18:   // Check if stored procedure already exists
                     19:   $sp_name= 'phpt_bug28354';
                     20:   var_dump(sybase_select_db(TEMPDB, $db));
                     21:   if (!sybase_select_single($db, 'select object_id("'.$sp_name.'")')) {
                     22:     echo "Stored procedure {$sp_name} not found, creating\n";
                     23:     var_dump(sybase_query('
                     24:       create proc '.$sp_name.' as begin
                     25:         select @@version
                     26:       end
                     27:     '));
                     28:   } else {
                     29:     echo "Stored procedure {$sp_name} found, using\n";
                     30:     var_dump(TRUE);
                     31:   }
                     32:   
                     33:   $r= sybase_query('exec '.$sp_name, $db);
                     34:   $i= 0;
                     35:   while ($row= sybase_fetch_row($r)) {
                     36:     var_dump($i++, $row[0]);
                     37:   }
                     38:   sybase_free_result($r);
                     39:   sybase_close($db);
                     40: ?>
                     41: --EXPECTF--
                     42: bool(true)
                     43: Stored procedure %s
                     44: bool(true)
                     45: int(0)
                     46: string(%d) "%s"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>