[MDEV-23732] Build fails with lastest C/C 3.1 Created: 2020-09-14  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File mysql_version.patch    
Issue Links:
Relates
relates to CONC-498 mysql.h missing #include "mysql_versi... Closed

 Description   

MYSQL_PORT and MYSQL_UNIX_ADDR are documented parts of C API and need to be defined in Connector/C.

Since both definitions also exist in mysql_version.h, build will break.



 Comments   
Comment by Sergei Golubchik [ 2020-09-14 ]

georg, I think a better fix would be to make sure mysql.cc and other clients include mysql_version.h before Connector/C headers, this way we'll know they use server declarations as they did before. And not just randomly server or Connector/C declarations depending on what header happened to be included first.

Comment by Georg Richter [ 2020-09-14 ]

serg I think it would be better to build Connector/C inside server with -DMARIADB_PORT and -DMARIADB_UNIX_ADDR to be sure that they have the same values.
Client programs should use client include files and libraries: mysql_version.h belongs to server, not to client.

Comment by Sergei Golubchik [ 2020-09-14 ]

Yes, this is even better. And then we won't need this patch for mysql_version.h.in, as I'd rather get a compiler error when definitions differ.

Generated at Thu Feb 08 09:24:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.