1--TEST--
2mysql_[p]connect() - safe_mode
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7$link = @mysql_connect("", "", "", true);
8if ($link)
9	die("skip Test cannot be run if annonymous connections are allowed");
10?>
11--INI--
12sql.safe_mode=1
13--FILE--
14<?php
15require_once('connect.inc');
16if ($socket)
17	$host = sprintf("%s:%s", $host, $socket);
18else if ($port)
19	$host = sprintf("%s:%s", $host, $port);
20
21if ($link = mysql_connect($host, $user, $passwd, true)) {
22	printf("[001] Safe mode not working properly?\n");
23	mysql_close($link);
24}
25
26if ($link = mysql_pconnect($host, $user, $passwd)) {
27	printf("[002] Safe mode not working properly?\n");
28	mysql_close($link);
29}
30print "done!\n";
31?>
32--EXPECTF--
33Notice: mysql_connect(): SQL safe mode in effect - ignoring host/user/password information in %s on line %d
34
35Warning: mysql_connect(): Access denied for user '%s'@'%s' (using password: NO) in %s on line %d
36
37Notice: mysql_pconnect(): SQL safe mode in effect - ignoring host/user/password information in %s on line %d
38
39Warning: mysql_pconnect(): Access denied for user '%s'@'%s' (using password: NO) in %s on line %d
40done!