[MDEV-13773] client packages need my_global.h and/or my_config.h Created: 2017-09-08 Updated: 2017-09-18 Resolved: 2017-09-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Packaging |
| Affects Version/s: | 10.2.8 |
| Fix Version/s: | 10.2.9 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
after They shouldn't need them and mysql-python doesn't really use the included file, but some might use them and they need time to be fixed. Possible solution, install headers, like
|
| Comments |
| Comment by Brian Evans [ 2017-09-08 ] | |||||||||||||||||||||
|
Suggest symlinking compatible components to their libmysqlclient equivalents The following exist in popular software (like Ruby's mysql2 connector) mysql_version.h -> mariadb_version.h | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-11 ] | |||||||||||||||||||||
|
Failing client ebuilds in gentoo (incomplete list as of now):
| |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-11 ] | |||||||||||||||||||||
|
Btw, mysqlclient-1.3.12 seems to be fixed | |||||||||||||||||||||
| Comment by Alexey Kopytov [ 2017-09-14 ] | |||||||||||||||||||||
|
sysbench also includes mysql_version.h. And the only reason for that was compatibility with MariaDB 10.2. Starting from MariaDB 10.2 it is insufficient to include mysql.h to have MYSQL_VERSION_ID defined, that's why sysbench also includes mysql_version.h, which breaks MariaDB compatibility again in 10.2.8. As I understand, 10.2.9 will include a compatibility header throwing a compile-time warning. Which leaves me wondering what's the correct AND portable way to have MYSQL_VERSION_ID defined? | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-14 ] | |||||||||||||||||||||
|
It's a warning saying "Don't include this file directly, include <mysql.h>" | |||||||||||||||||||||
| Comment by Alexey Kopytov [ 2017-09-14 ] | |||||||||||||||||||||
|
OK, after looking more into it, here's the code in sysbench that required including mysql_version.h:
I.e. due to MySQL-specific issues, I must be able to tell between MariaDB and MySQL. So I thought using MARIADB_BASE_VERSION for that purpose was a good idea. And it was until MariaDB 10.2, which requires including mysql_version.h, including mysql.h is not enough. Is there a better way to do it? | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-14 ] | |||||||||||||||||||||
|
I see. First, your mysql_version.h include is redundant. In
you can safely drop the second line, because mysql.h includes mysql_version.h anyway. That's what I meant by "it's always sufficient". In libmysqlclient, it includes mysql_version.h, in libmariadb mysql_version.h is renamed and mysql.h includes the renamed file. Now, the problem is that libmariadb headers don't define MARIADB_BASE_VERSION. I will fix that. And you'll be able to include only mysql.h — which will work in any MariaDB or MySQL version, and test for MARIADB_BASE_VERSION as before. I've tested that with these changes sysbench (latest from github) builds fine. | |||||||||||||||||||||
| Comment by Alexey Kopytov [ 2017-09-15 ] | |||||||||||||||||||||
|
Thanks! So I have the following choices: 1. Leave everything as is. This will work for MariaDB < 10.2.8, not work for MariaDB = 10.2.8, will work with a warning for MariaDB > 10.2.8 2. Remove the redundant #include <mysql_version.h> line. This will work for MariaDB 10.2.8, will break 10.2.x, where x < 8 3. Do some configure-time pushups to test for server/mysql_version.h availability, and if available, include that one instead of just mysql_version.h. Which will apparently work everywhere. It looks like #3, as ugly as it is, provides better compatibility. | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-15 ] | |||||||||||||||||||||
|
Oh, right. Then the easiest fix would be this:
As far as I understand it should work for all MariaDB and MySQL versions. | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-16 ] | |||||||||||||||||||||
|
kaamos, could you, please, confirm that the patch above worked for you? If not — I'll try to come up with something that does. | |||||||||||||||||||||
| Comment by Alexey Kopytov [ 2017-09-17 ] | |||||||||||||||||||||
|
@serg, sorry, I missed the last 2 comments (no emails, not even in the spam folder), so I implemented #3 from my list. I tested your patch just now and it works with MySQL, MariaDB 10.1 and MariaDB 10.2.8. I'm going to replace my (ugly) fix with yours. Thanks a lot! | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-18 ] | |||||||||||||||||||||
|
Thanks! Pushed. |