# Tests that max_password_errors has no effect on login errors with
# passwordless plugins (Windows version / auth_named_pipe)

--source include/not_embedded.inc
--source include/have_auth_named_pipe.inc
if (`SELECT '$USERNAME' = 'nosuchuser'`) {
  skip skipped for nosuchuser;
}
set @old_max_password_errors=@@max_password_errors;
create user nosuchuser identified with 'named_pipe';

set global max_password_errors=1;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
error ER_ACCESS_DENIED_NO_PASSWORD_ERROR;
connect(pipe_con,localhost,nosuchuser,,,,,PIPE);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
error ER_ACCESS_DENIED_NO_PASSWORD_ERROR;
connect(pipe_con,localhost,nosuchuser,,,,,PIPE);

DROP USER nosuchuser;
FLUSH PRIVILEGES;
set global max_password_errors=@old_max_password_errors;
