← Back to team overview

maria-developers team mailing list archive

Re: Freeing options & wrappers.


Hi, Kristian.

On 16.08.2016 16:23, Kristian Nielsen wrote:
Oleksandr Byelkin <sanja@xxxxxxxxxxxxxxxx> writes:

Making something more I think do not worth it because:
1) in 10.2 C/C will replace the library and it has no the problem
But Connector-C should have exactly the same problem. If it frees the
options on failed connect, it will break async API. If it does not, code
that skips mysql_close() will leak. How does C/C solve this problem?
If we are making any changes in 10.0, we should preferably make things work
the same as they will work in 10.2.
Don't it has rewritten async operation? (at least I got such impression).
My understanding is that Georg implemented all the async API also in
connector-c. It should be using much the same code (mysql_async.c and

But this is not about the implementation. This is about the semantics of how
libmysqlclient works. My understanding is that connector-c is supposed to be
binary compatible with libmysqlclient.so?

So either connector-c removes any mysql_options() set when
mysql_real_connect() fails without CLIENT_REMEMBER_OPTIONS. Or it does
not. In the former case, there is the problem with MYSQL_OPT_NONBLOCK. In
the latter case, the problem with leak when mysql_close() is not called.

I really think you need to understand the problem fully, including how this
is going to work in 10.2, before you make any changes to how the client
library works...
OK, I checked sources of the connector, ad did not see how it can work, so build and test the test program, it also has the problem (so user just probably tested old version)

  - Kristian.

Follow ups