Bug #65796 | mysql_real_connect generating crash when trying to reconnect in windows | ||
---|---|---|---|
Submitted: | 3 Jul 2012 13:52 | Modified: | 4 Jul 2012 13:23 |
Reporter: | Rituparna Kashyap | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S4 (Feature request) |
Version: | 5.5.25, 5.1.63 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | crash, mysq_real_connect, windows |
[3 Jul 2012 13:52]
Rituparna Kashyap
[3 Jul 2012 17:27]
MySQL Verification Team
I'm not sure if it will make any visible difference, but you should call mysql_close() directly after the first mysql_real_connect() fails.
[3 Jul 2012 20:11]
Sveta Smirnova
Thank you for the report. This is repeatable on Windows and is not repeatable on Linux. mysql_close does not help, but mysql_init does. My guess is MYSQL structure has some fields set after failed mysql_real_connect attempt. But application still should not crash.
[4 Jul 2012 13:23]
Rituparna Kashyap
As version 5.5.25 is pulled back, so I tried with 5.5.24 and this bug is reproducible for the same.
[28 Feb 2013 12:46]
Georgi Kodinov
Thank you for the reasonable feature request ! The mysql documentation (http://dev.mysql.com/doc/refman/5.1/en/mysql-real-connect.html) clearly states : "For the first parameter, specify the address of an existing MYSQL structure. Before calling mysql_real_connect(), call mysql_init() to initialize the MYSQL structure.". But I agree it can be a bit confusing, hence it's a nice feature to consider.
[28 Feb 2014 17:18]
Rafal Somla
Posted by developer: Passing over to Igor.