Connectors, controversy and the LGPL
Licences and the MariaDB connectors
by Dj Walker-Morgan
With the release of LGPL licensed C and Java connectors for MariaDB and MySQL in November 2012, a number of questions were raised in the community over the drivers' provenance and appropriateness of the LGPL licence. The H went looking for answers...
In November 2012, Monty Program and SkySQL announced a C and Java connector for MariaDB, the fork of MySQL. The important difference with these connectors was that they were LGPL-licensed software and did not use the more restrictive GPL licence which applied to existing open source connectors from Oracle. The GPL licence on the Oracle drivers meant that anyone wanting to use the connectors with closed source software and distribute the resulting binary had to go to Oracle and get a commercial licence from them.
Many years ago, the MySQL C connector was available as LGPL code, but in order to derive more income from the connectors, it was switched to GPL/commercial dual licensing. The release of the LGPL drivers appeared to mark the end of a search started by Monty Program's Monty Widenius in 2010 to find a more permissively licensed set of client libraries to connect to MySQL and MariaDB. But while the announcement was welcomed by many, there was also some concern in the community about the provenance and legitimacy of the connectors.
The C connector appeared to have PHP/GPL dual-licensed code in it and some were suggesting the now LGPL-licensed code was actually based on GPL code. The Java connector was shown to be a fork of the BSD-licensed Drizzle Java connector and others felt the fork was detrimental to the development of Drizzle.
The concerns were such that SkySQL's CTO Ivan Zoratti responded in his blog. Zoratti explained that the C connector was actually a fork from the MySQL Client Library V3.23.58, a version which dated back to when the MySQL libraries were LGPL-licensed.
The Java connector was based on the Drizzle driver but SkySQL had to move from the stripped down basic JDBC interface of the Drizzle variant to something more fully featured. Zoratti documents the development process used, and features added in his blog posting. According to his comments though, the choice of licence was down to the company's lawyer, "and he recommended LGPL".
Mixing LGPL/PHP
The answers left many questions in the air though, and The H decided to dig deeper and talk with Monty Widenius and Kai Arno, VP SkySQL. We started with the C connector, which Widenius pointed out was under the LGPL because they had no choice – the original code was under the LGPL.
Arno, who described the additions as "melted in code that was released under the PHP licence and that licence is compatible with the LGPL", and said that in 2008, Sun's lawyers said that the licences were compatible. Widenius added that "The code was already used in OpenOffice and nobody had issues with it back then. It is quite clear the licence is compatible because open source licences are compatible. It is only when you go to more restrictive licences, GPL to BSD or PHP that it is not compatible in that direction. It is always compatible in the other direction".
Back in 2008, though, the issue was somewhat simpler as the code in question was all owned by Sun and by virtue of that, compatible. As a recipient of code under those licences, it gets trickier. The Free Software Foundation actually does not think the PHP licence is compatible with the GPL family of licences and explains that this is due to the restrictions on the use of the PHP name in derived products. It is unlikely that the MariaDB connector will ever use the PHP name, but licence compatibility does require that when differently licensed code is used that their licences do not put in conflicting requirements. The GPLv2 clause 6 and LGPL clause 10 require no further requirements to be imposed on the user of the code and the PHP licence's clauses 3 and 4 require that users cannot use the PHP name to promote or name derived products. But, whether anyone would pursue a case based around such a clash of licences is very debatable.
From BSD to LGPL
The choice of LGPL in the case of the Java connector was, said Arno, down to wanting to keep the story simple; both connectors would be LGPL as "we have issues when it comes to consistency. It's easier to explain that the connectors are using a particular licence, in this case LGPL and there's no difference between C and Java"; this, he says, is easier for users to remember. The other issue in the choice was "defending the work"; Arno notes that the BSD licence the original code was under allowed anyone to take the code and, close source it, relicense it or carry on with the BSD licence.
The H confirmed that SkySQL had contacted Marcus Eriksson, author of the DrizzleJDBC code and asked if he had any objections to the code being relicensed; he did not object. By using the LGPL for the connector and the subsequent work, Arno says the company is in a better place to defend the code: "others taking it as a commercial licence is considerably easier, or at least I would say doable whereas with BSD or PHP licences, anyone can take that code and build closed source extensions upon it". Widenius added this was a question of ideology and that "we don't want people to make closed source work off the code we produce."
The H moved on to the ethical issue that had been raised, in that the BSD work in DrizzleJDBC, which Eriksson is still working on, is cut off, by virtue of the one-way gate that is a BSD to GPL/LGPL relicense, from sharing in the improvements of the now copylefted work.
"When we took over the project there was one commit in one year, it was a dead project", said Arno, saying that because of that they appeared to feel there was no upstream to contribute to. But they conceded that the developers of the BSD code base could want access to features they had developed and, provided that they wanted the code to implement and not to just sit on the side to prove they could access it, developers of the BSD code can request code and SkySQL would see what they could do in terms of making that code available. As the owners of the changes, they are able to do this, though how the process will work in practice remains to be seen.