Annotation of embedaddon/php/ext/mysql/tests/bug51242.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #51242 (Empty mysql.default_port does not default to 3306 anymore, but 0)
! 3: --INI--
! 4: mysql.default_port=
! 5: mysql.default_socket=/this/does/not/really/need/to/exist
! 6: --SKIPIF--
! 7: <?php
! 8: require_once('skipif.inc');
! 9: require_once('skipifnotmysqlnd.inc');
! 10:
! 11: // Specific to this bug: we need to be able to connect via TCP. We'll use
! 12: // 127.0.0.1:3306 as a (hopefully) moderately sensible default if the hostname
! 13: // is actually specified as localhost.
! 14: if ($host == 'localhost') {
! 15: $host = '127.0.0.1';
! 16: }
! 17:
! 18: if (!@mysql_connect("$host:3306", $user, $passwd)) {
! 19: die("skip mysql not available at $host:3306");
! 20: }
! 21: ?>
! 22: --FILE--
! 23: <?php
! 24: require_once('connect.inc');
! 25:
! 26: if ($host == 'localhost') {
! 27: $host = '127.0.0.1';
! 28: }
! 29:
! 30: if ($link = my_mysql_connect($host, $user, $passwd, $db, null, $socket)) {
! 31: var_dump($link);
! 32: } else {
! 33: printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
! 34: $host, $user, $db, null, $socket);
! 35: }
! 36: ?>
! 37: --EXPECTF--
! 38: resource(%d) of type (mysql link)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>