diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index 8910ab63e..b373f66b1 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -1004,7 +1004,7 @@ bool MySQL_Protocol::generate_pkt_initial_handshake(bool send, void **ptr, unsig //srand(pthread_self()); //uint32_t thread_id=rand()%100000; uint32_t thread_id=__sync_fetch_and_add(&glovars.thread_id,1); - if (_thread_id==0) { + if (thread_id==0) { thread_id=__sync_fetch_and_add(&glovars.thread_id,1); // again! } *_thread_id=thread_id;