mysql_init() is not called in worker thread
rtsisyk opened this issue · 1 comments
Sunday, October 4, 2015 11:25 AM -06:00 from Peter Gulutzan < pgulutzan@ocelot.ca >:
Regarding the crash described earlier:
I looked at the file driver.c in your repository
https://github.com/tarantool/mysql/blob/master/mysql/driver.c
line 316 which looks like this:
"
mysql_real_connect(mysql, host, user, password, db, iport, usocket,
CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS);
"
I changed it to this:
"
mysql_init(mysql);
mysql_real_connect(mysql, host, user, password, db, iport, usocket,
CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS);
coio_call() uses random threads for each call. mysql_init() is only called once in the first thread.
Probably we should use the single thread for all mysql operations.
Already fixed.