Summary: | rewrite mysql connector to use mariadb client library | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Michael Meeks <michael.meeks> |
Component: | Libreoffice | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | 1920119, anthony, causb, gerry.treppel, iplaw67, libreoffice, lionel, michael.meeks, serval2412 |
Version: | Master old -3.6 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | EasyHack DifficultyInteresting SkillCpp TopicCleanup SkillSQL | ||
i915 platform: | i915 features: |
Description
Michael Meeks
2012-02-18 11:52:58 UTC
Just some questions about Mysql/MariaDB : 1) - do we want to replace Mysql connector by MariaDB connector or do we want both ? 2 things in mind : a) should the bugs concerning Mysql connector should be still investigated ? b) If we only keep MariaDB, with the time there'll api/compatibility pb to connect Mysql DB. 2) Could MariaDB connector licence be a pb for LO ? (http://kb.askmonty.org/en/what-is-mariadb-53 indicates CC BY-SA / Gnu FDL). (In reply to comment #1) > 1) > - do we want to replace Mysql connector by MariaDB connector or do we want both > ? 2 things in mind : > a) should the bugs concerning Mysql connector should be still investigated ? > b) If we only keep MariaDB, with the time there'll api/compatibility pb to > connect Mysql DB. No, a single connector should suffice. The MariaDB guys commit to maintaining on-the-wire binary compatibility. That is, linking to the MariaDB client library, one can connect to MySQL. > 2) Could MariaDB connector licence be a pb for LO ? > (http://kb.askmonty.org/en/what-is-mariadb-53 indicates CC BY-SA / Gnu FDL). That's the licence of the webpage itself. Das Dreifach-Date Looking for database easyhacks, I found this (not as easy as it seems for me :-) BUT. A cursory glance implies it has been rebased to the ASL and as such is now MPL-licenced. And I think the original problem is it was (L)GPL of the wrong sort? The MariaDB connector says it is LGPL 2.1+. Anyways, does that mean this bug is now moot and can be closed thanks to the licence change of the LO code? If so, do I just change status to resolved? Anthony: I think it's a bit more complicate, see http://nabble.documentfoundation.org/Bug-59481-FILEOPEN-Linux-rpm-Native-MySQL-connector-aoo-my-sdbc-1-1-0-didn-t-work-any-more-with-LO-40-tp4030195p4030866.html Julien: Ah, I think I've sussed what you're saying. At present the existing C++ connector talks to the MySQL GPL'd connector. We can't incorporate and distribute the MySQL code. But if we change it to a C api, we can incorporate and distribute the MariaDB LGPL connector. Okay. As a good post-relational-database and (if rusty) C programmer, I'm looking at db easyhacks to try and get into working on the lo codebase. But I'm in a bit over my depth with the C++. Is there anywhere I can get a LOT of handholding to start with without annoying the regular devs? Or am I best just struggling on chatzilla in the dev forum anyway? Anthony: I'm not a core dev but if you want to hack, you should start by this page: https://wiki.documentfoundation.org/Development You must know that most of LO is in C++ but there is also C, Python, Java, assembly and Perl. About getting help, a good link here (for users and devs): http://www.libreoffice.org/get-help/ (In reply to comment #6) > As a good post-relational-database and (if rusty) C programmer, I'm looking > at db easyhacks to try and get into working on the lo codebase. But I'm in a > bit over my depth with the C++. Is there anywhere I can get a LOT of > handholding to start with without annoying the regular devs? Or am I best > just struggling on chatzilla in the dev forum anyway? "Without annoying the regular devs" I'm not sure, but we as a bunch are usually willing to invest time into getting a new contributor :) In the past, Fridrich (which I just added to CC) orally expressed some interest in getting into this bug. He has the C++ knowledge, but lacks the relational/SQL database knowledge, which you have, so maybe the two of you would make a good team to collaborate on this bug. I'll be available for any issue/question you two may have while working on this bug. As to MariaDB/MySQL-specific knowledge, such as "how to list all tables", "how to list all columns of a table and their type", "how to get the current user's permissions on this table", etc, I see two roads to getting it: 1) Take it from the JDBC connector https://kb.askmonty.org/en/mariadb-faq-is-there-any-java-connector-for-mariadb-than-the-one-from-mysql/ As the LibreOffice (SDBC(X)) connector is supposed to implement a JDBC-like interface for the LibreOffice dbms-independent code, this could be a good match. 2) Try to get some MariaDB guy as an oracle for that kind of questions (sometimes the answer will be "the C api has a list_tables call", sometimes the answer will be "execute this SQL: SELECT table_name FROM information_schema.tables, or SELECT table_name FROM mysql.tables WHERE tables.database='THE_SCHEMA_YOU_WANT'" or some such. Lionel, Anthony: Yes, I am thrilled by the possibility to see that done. Nevertheless, since FOSDEM where we discussed it with Lionel, I did not have time to put myself on it. I had many little issues in Visio and CorelDraw importers that were eating my time. I propose the following: 1) first to replace the mysqlc library with mariadb c library, leaving in the cpp layer; 2) rewrite the cpp layer using the lgpl-ed jdbc connector to mariadb and the knowledge embedded in it. I am ready to find some time to get the (1) done soon-ish. Okay. I'm digging into this (and getting myself thoroughly confused :-). I've downloaded the MariaDB source and am digging into it. I've also read the readme in LO in the mysqlc directory. The readme says you need to pull in libmysql and libmysqlcppcon - I guess the idea behind this bug is to use MariaDB's libmysql rather than MySQL's libmysqlcppcon? OUCH! Because if, as I think, we want to try and remove all GPL-only code, then this is a waste of time. Because I've been looking at the source of libmysql in MariaDB and the headers say GPL. Okay, the EXCEPTIONS-CLIENT file applies, which allows FLOSS code under GPL-incompatible licences to be linked, but this will then blow up with a vengeance if somebody wants to take advantage of the MPL and mix it with closed code! What next? Hi Anthony, > The readme says you need to pull in libmysql and libmysqlcppcon - > I guess the idea behind this bug is to use MariaDB's libmysql > rather than MySQL's libmysqlcppcon? OUCH! That's right. So the hope is to use this guy: https://kb.askmonty.org/en/mariadb-client-library-for-c/ instead (I think) - which is (last I looked) LGPL licensed. That should replace the libmysql I believe without the compound oddness issue, and let us distribute it [ as/when we've nailed libmysqlcppcon ]. Thanks so much for digging into this though ! :-) (In reply to comment #10) > I've also read the readme in LO in the mysqlc directory. I've recently significantly updated it; make sure to read the one in the master branch, not the stable (libreoffice-4-0) branch. See e.g. http://cgit.freedesktop.org/libreoffice/core/plain/mysqlc/README > The readme says you need to pull in libmysql and libmysqlcppcon - I guess > the idea behind this bug is to use MariaDB's libmysql rather than MySQL's > libmysqlcppcon? (...) I've been looking at the source of libmysql > in MariaDB and the headers say GPL. The idea is to use the MariaDB Client Library for C, which is LGPL-licensed, not GPL. It has the same API as libmysql (which is GPL-licensed), though. And yes, the idea is to remove libmysqlcppconn from the picture. MariaDB Client Library for C: https://kb.askmonty.org/en/mariadb-client-library-for-c/ It is a separate download, not part of the MariaDB server sources (and it is distinct from the copy/fork of libmysql that is in the MariaDB server sources). OK, I just switched LO to use libmariadb and I added a libmariadb module where a static library (lib)mariadblib is built in case internal mariadb is requiered. There is still the mysqlcppconn in the play in this scenario, so whoever wants can try to ditch it out by rewriting using the way Lionel outlined. There is now a C++ connector for MariaDB. Dunno if it is in an usable state yet, but we could consider being the "launch customer" for it. See https://kb.askmonty.org/en/c-client-library-mariadb/ There is also this older C++ MySQL API wrapper: http://tangentsoft.net/mysql++/ Does not seem extremely active, but there is a commit to their SVN "7 weeks ago", so not dead :) adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details I've started working on this. At the moment I am investigating the codebase and how much it depends on the MySQL C++ Library. good to see somebody interested in this! by the way i notice a ridiculously large patch in external/libmariadb; probably there's a new release by now that would include that, if anybody has time to upgrade the bundled libmariadb :) Sorry, I can no longer work on this (school summer holidays are ending). Hopefully, at some time in the future, I will be able to work on it. Adding self to CC if not already on |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.