Annotation of embedaddon/php/ext/mysqli/tests/mysqli_get_client_stats_implicit_free.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: mysqli_get_client_stats() - implicit_free_result
        !             3: --SKIPIF--
        !             4: <?PHP
        !             5: require_once('skipif.inc');
        !             6: require_once('skipifemb.inc');
        !             7: require_once('skipifconnectfailure.inc');
        !             8: if (!function_exists('mysqli_get_client_stats')) {
        !             9:        die("skip only available with mysqlnd");
        !            10: }
        !            11: ?>
        !            12: --INI--
        !            13: mysqlnd.collect_statistics=1
        !            14: mysqlnd.collect_memory_statistics=1
        !            15: --FILE--
        !            16: <?php
        !            17:        require_once('connect.inc');
        !            18:        require_once('table.inc');
        !            19: 
        !            20:        $stats = mysqli_get_client_stats();
        !            21:        printf("BEGINNING: implicit_free_result = %d\n",        $stats['implicit_free_result']);
        !            22: 
        !            23:        if (!$res = mysqli_query($link, 'SELECT id FROM test'))
        !            24:                printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
        !            25: 
        !            26:        mysqli_free_result($res);
        !            27:        mysqli_close($link);
        !            28: 
        !            29:        $after = mysqli_get_client_stats();
        !            30:        if ($after['implicit_free_result'] != $stats['implicit_free_result'])
        !            31:                printf("[002] Where is the missing mysqli_free_result() call? implicit_free_result has changed by %d.\n",
        !            32:                        $after['implicit_free_result'] - $stats['implicit_free_result']);
        !            33: 
        !            34:        $stats = $after;
        !            35:        printf("END: implicit_free_result = %d\n",      $stats['implicit_free_result']);
        !            36: 
        !            37:        print "done!";
        !            38: ?>
        !            39: --CLEAN--
        !            40: <?php
        !            41:        require_once("clean_table.inc");
        !            42: ?>
        !            43: --EXPECTF--
        !            44: BEGINNING: implicit_free_result = %d
        !            45: END: implicit_free_result = %d
        !            46: done!

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