← Back to team overview

maria-discuss team mailing list archive

Re: client library shared library version changed in 5.5.10


> -----Original Message-----
> From: Sergei Golubchik [mailto:serg@xxxxxxxxxxxx]
> Sent: Sonntag, 27. März 2011 21:26
> To: monty@xxxxxxxxxxxx
> Cc: MARK CALLAGHAN; maria-discuss@xxxxxxxxxxxxxxxxxxx;
> wlad@xxxxxxxxxxxxxxxx
> Subject: Re: [Maria-discuss] client library shared library version changed
> 5.5.10
> Hi, Monty!
> On Mar 18, Michael Widenius wrote:
> > >>>>> "MARK" == MARK CALLAGHAN <mdcallag@xxxxxxxxx> writes:
> >
> > > I think there was discussion about how client library shared library
> > > versions during the Lisbon meeting.
> >
> > >> From http://dev.mysql.com/doc/refman/5.5/en/news-5-5-10.html
> > >>>>
> > > Incompatible Change: The shared library version of the client library
> > > was increased to 18 to reflect ABI changes, and avoid compatibility
> > > problems with the client library in MySQL 5.1. Note that this is an
> > > incompatible change between 5.5.10 and earlier 5.5 versions, so client
> > > programs that use the 5.5 client library should be recompiled against
> > > the 5.5.10 client library.
> >
> > Serg, as you have now probably have full insight into the MariaDB 5.5
> > code, is it possible to keep the API compatible with MariaDB 5.1 /
> > MySQL 5.1 to not force all applications to have to be recompiled when
> > upgrading to 5.5 ?
> The API incompatibility was caused by migration to CMake.
> If you want to keep libraries compatible, if's something that Wlad may
> need to look into.

I do not really think it was CMake that broke it.  The "official" ABI has
not changed, however some people claim that API and ABI are 2 different
things ;)

For 5.5  the discussion starts here http://bugs.mysql.com/bug.php?id=59078
([9 Feb 2:26] Clint Byrum, IIRC he works for Debian). His argument that ABI
has changed "dramatically" is  that for example an exported symbol named
TERMINATE has  gone, while new symbols PSI_hook and PSI_server were added.
He uses "nm" for his argumentation.

Clint's claim is that every time an exported symbol is changed/removed or
added, shared library version must be bumped. Unix linkers  export every
global function and variable  by default. Which means, if one renames a
global variable as part of cleanup, the ABI is changed.  Changes like that
can happen really in any point  release, so I see no other way to maintain
the 100% ABI  compatibility, rather than restricting  visibility  to only
symbols defined by client API (i.e mysql_xxx stuff) . On some Unixes, it is
possible to do with  linker version script .On Windows symbols were
restricted to the official API from the start on , using with the .def file.

This would be a clean solution from my point of view. However, should we go
for it,  this would result in incompatibilities with Oracle's MySQL, and
this has to be worked out somehow (best thing is probably contribute
visibility-restricting patch, if they are at all interested) . Besides ,
Unix users  need to be warned that shared and static library are not
interchangeable and that it will not be possible to access e.g
mysys/strings/dbug functionality using the shared library. Hopefully most of
the programs are written using officially documented client API functions,
so there won't be many surprises.


Follow ups