Lines Matching refs:conn
34 mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn, in mysqlnd_auth_handshake() argument
61 auth_resp_packet = conn->protocol->m.get_auth_response_packet(conn->protocol, FALSE TSRMLS_CC); in mysqlnd_auth_handshake()
64 SET_OOM_ERROR(*conn->error_info); in mysqlnd_auth_handshake()
69 …change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE … in mysqlnd_auth_handshake()
71 SET_OOM_ERROR(*conn->error_info); in mysqlnd_auth_handshake()
78 if (!PACKET_WRITE(change_auth_resp_packet, conn)) { in mysqlnd_auth_handshake()
79 CONN_SET_STATE(conn, CONN_QUIT_SENT); in mysqlnd_auth_handshake()
80 SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); in mysqlnd_auth_handshake()
84 auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC); in mysqlnd_auth_handshake()
107 if (!PACKET_WRITE(auth_packet, conn)) { in mysqlnd_auth_handshake()
112 conn->charset = mysqlnd_find_charset_nr(auth_packet->charset_no); in mysqlnd_auth_handshake()
115 if (FAIL == PACKET_READ(auth_resp_packet, conn) || auth_resp_packet->response_code >= 0xFE) { in mysqlnd_auth_handshake()
120 SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd); in mysqlnd_auth_handshake()
135 …strlcpy(conn->error_info->sqlstate, auth_resp_packet->sqlstate, sizeof(conn->error_info->sqlstate)… in mysqlnd_auth_handshake()
138 …SET_CLIENT_ERROR(*conn->error_info, auth_resp_packet->error_no, UNKNOWN_SQLSTATE, auth_resp_packet… in mysqlnd_auth_handshake()
143 …SET_NEW_MESSAGE(conn->last_message, conn->last_message_len, auth_resp_packet->message, auth_resp_p… in mysqlnd_auth_handshake()
156 mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn, in mysqlnd_auth_change_user() argument
175 const MYSQLND_CHARSET * old_cs = conn->charset; in mysqlnd_auth_change_user()
182 chg_user_resp = conn->protocol->m.get_change_user_response_packet(conn->protocol, FALSE TSRMLS_CC); in mysqlnd_auth_change_user()
185 SET_OOM_ERROR(*conn->error_info); in mysqlnd_auth_change_user()
190 …change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE … in mysqlnd_auth_change_user()
192 SET_OOM_ERROR(*conn->error_info); in mysqlnd_auth_change_user()
199 if (!PACKET_WRITE(change_auth_resp_packet, conn)) { in mysqlnd_auth_change_user()
200 CONN_SET_STATE(conn, CONN_QUIT_SENT); in mysqlnd_auth_change_user()
201 SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); in mysqlnd_auth_change_user()
205 auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC); in mysqlnd_auth_change_user()
208 SET_OOM_ERROR(*conn->error_info); in mysqlnd_auth_change_user()
223 if (conn->m->get_server_version(conn TSRMLS_CC) >= 50123) { in mysqlnd_auth_change_user()
224 auth_packet->charset_no = conn->charset->nr; in mysqlnd_auth_change_user()
227 if (!PACKET_WRITE(auth_packet, conn)) { in mysqlnd_auth_change_user()
228 CONN_SET_STATE(conn, CONN_QUIT_SENT); in mysqlnd_auth_change_user()
229 … SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone); in mysqlnd_auth_change_user()
234 ret = PACKET_READ(chg_user_resp, conn); in mysqlnd_auth_change_user()
235 COPY_CLIENT_ERROR(*conn->error_info, chg_user_resp->error_info); in mysqlnd_auth_change_user()
241 SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd); in mysqlnd_auth_change_user()
256 if (conn->error_info->error_no) { in mysqlnd_auth_change_user()
263 …if (conn->m->get_server_version(conn TSRMLS_CC) > 50113L &&conn->m->get_server_version(conn TSRMLS… in mysqlnd_auth_change_user()
264 …MYSQLND_PACKET_OK * redundant_error_packet = conn->protocol->m.get_ok_packet(conn->protocol, FALSE… in mysqlnd_auth_change_user()
266 PACKET_READ(redundant_error_packet, conn); in mysqlnd_auth_change_user()
268 …DBG_INF_FMT("Server is %u, buggy, sends two ERR messages", conn->m->get_server_version(conn TSRMLS… in mysqlnd_auth_change_user()
270 SET_OOM_ERROR(*conn->error_info); in mysqlnd_auth_change_user()
277 tmp = mnd_pestrndup(user, user_len, conn->persistent); in mysqlnd_auth_change_user()
278 if (conn->user) { in mysqlnd_auth_change_user()
279 mnd_pefree(conn->user, conn->persistent); in mysqlnd_auth_change_user()
281 conn->user = tmp; in mysqlnd_auth_change_user()
283 tmp = mnd_pestrdup(passwd, conn->persistent); in mysqlnd_auth_change_user()
284 if (conn->passwd) { in mysqlnd_auth_change_user()
285 mnd_pefree(conn->passwd, conn->persistent); in mysqlnd_auth_change_user()
287 conn->passwd = tmp; in mysqlnd_auth_change_user()
289 if (conn->last_message) { in mysqlnd_auth_change_user()
290 mnd_pefree(conn->last_message, conn->persistent); in mysqlnd_auth_change_user()
291 conn->last_message = NULL; in mysqlnd_auth_change_user()
293 memset(conn->upsert_status, 0, sizeof(*conn->upsert_status)); in mysqlnd_auth_change_user()
295 if (conn->m->get_server_version(conn TSRMLS_CC) < 50123) { in mysqlnd_auth_change_user()
296 ret = conn->m->set_charset(conn, old_cs->name TSRMLS_CC); in mysqlnd_auth_change_user()
301 SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd); in mysqlnd_auth_change_user()
361 MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, in mysqlnd_native_auth_get_auth_data() argument
373 …SET_CLIENT_ERROR(*conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "The server sent wrong … in mysqlnd_native_auth_get_auth_data()
419 MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, in mysqlnd_pam_auth_get_auth_data() argument