]> granicus.if.org Git - php/commitdiff
a better habitat
authorAndrey Hristov <andrey@php.net>
Thu, 27 Jan 2011 18:51:12 +0000 (18:51 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 27 Jan 2011 18:51:12 +0000 (18:51 +0000)
ext/mysqlnd/mysqlnd_auth.c

index f014a4e908d177ca63caa7e0fcaa227157e56766..56f821232ad32d3bfbe7dbfd4788226b8687082a 100644 (file)
@@ -110,6 +110,9 @@ mysqlnd_auth_handshake(MYSQLND * conn,
                        goto end;
                }
        }
+       if (use_full_blown_auth_packet == TRUE) {
+               conn->charset = mysqlnd_find_charset_nr(auth_packet->charset_no);
+       }
 
        if (FAIL == PACKET_READ(auth_resp_packet, conn) || auth_resp_packet->response_code >= 0xFE) {
                if (auth_resp_packet->response_code == 0xFE) {
@@ -141,9 +144,6 @@ mysqlnd_auth_handshake(MYSQLND * conn,
        }
 
        SET_NEW_MESSAGE(conn->last_message, conn->last_message_len, auth_resp_packet->message, auth_resp_packet->message_len, conn->persistent);
-       if (use_full_blown_auth_packet == TRUE) {
-               conn->charset = mysqlnd_find_charset_nr(auth_packet->charset_no);
-       }
        ret = PASS;
 end:
        PACKET_FREE(change_auth_resp_packet);