[CONC-362] mysql_close() behaviour change leading to connection error in some cases Created: 2018-09-14 Updated: 2018-09-15 Resolved: 2018-09-15 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | 3.0.6 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Oleg Pereverzev | Assignee: | Georg Richter |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Tested on: Arch Linux x86_64, Ubuntu 18.04 |
||
| Description |
|
Hi. libmariadb (MariaDB Connector/C) version 3 (tested on 3.0.3 and 3.0.6) has somehow changed behaviour of mysql_close() rendering our code to fail at mysql_real_connect() with error: Lost connection to MySQL server at 'reading authorization packet', system error: 11 Same code works with libmariadb (MariaDB Connector/C) version 2, libmariadbclient (MariaDB database client library) and libmysqlclient (MySQL database client library). In case of failure (version 3) it seems that connection is made, server greating is read and nothing else happens until server times out and closes connection. Here is strace output:
Here is stripped code block:
Generaly there are such flows: First query (does not work in 3.x):
Next query same connect:
Next query new connect (does not work in 3.x):
Next query new connect (does work in 3.x with uncommented block):
This change may break other code as ours. |
| Comments |
| Comment by Georg Richter [ 2018-09-15 ] |
|
You cannot call mysql_real_connect after mysql_close(). mysql_close() doesn't close the connection only, it also frees memory which was allocated by mysql_init(). See also |