Annotation of embedaddon/php/ext/mysqli/tests/bug54221.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #54221 mysqli::get_warnings segfault when used in multi queries
! 3: --SKIPIF--
! 4: <?php
! 5: require_once('skipif.inc');
! 6: require_once('skipifconnectfailure.inc');
! 7: ?>
! 8: --INI--
! 9: mysqli.max_links = 1
! 10: mysqli.allow_persistent = Off
! 11: mysqli.max_persistent = 0
! 12: mysqli.reconnect = Off
! 13: --FILE--
! 14: <?php
! 15: include ("connect.inc");
! 16:
! 17: $link = mysqli_init();
! 18: if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
! 19: printf("[002] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
! 20: }
! 21:
! 22: $create = "CREATE TEMPORARY TABLE IF NOT EXISTS t54221(a int)";
! 23:
! 24: $query = "$create;$create;$create;";
! 25: if ($link->multi_query($query)) {
! 26: do {
! 27: $sth = $link->store_result();
! 28:
! 29: if ($link->warning_count) {
! 30: $warnings = $link->get_warnings();
! 31: if ($warnings) {
! 32: do {
! 33: echo "Warning: ".$warnings->errno.": ".$warnings->message."\n";
! 34: } while ($warnings->next());
! 35: }
! 36: }
! 37: } while ($link->more_results() && $link->next_result());
! 38: }
! 39:
! 40: mysqli_close($link);
! 41:
! 42: print "done!";
! 43: ?>
! 44: --EXPECTF--
! 45: Warning: :
! 46: Warning: 1050: Table 't54221' already exists
! 47: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>