[MDEV-15520] Header mismatch on Windows distribution Created: 2018-03-09  Updated: 2018-03-09

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.2.13
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Ariel Silva Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows 10.0.16299 x64


Attachments: File errmsg.diff    

 Description   

Headers installed with MSI package (checked with errmsg.h, there could be more) don't match official sources (https://github.com/MariaDB/server)

Attached diff of the affected file

Most importantly the version installed does lack some CR_ defs



 Comments   
Comment by Ariel Silva [ 2018-03-09 ]

Apparently it's pulling the headers from Connector-C (https://github.com/MariaDB/mariadb-connector-c/blob/master/include/errmsg.h) instead of MariaDB (https://github.com/MariaDB/server/blob/10.2/include/errmsg.h)

EDIT: apparently the MariaDB servers are on include/server; still this doesn't match mysql distribution and projects that rely on this to be compatible with mysql will fail to compile

Comment by Vladislav Vaintroub [ 2018-03-09 ]

I do not think it is an official API header file, or is it? Do you have links to (MariaDB or MySQL) documentation of the constants you miss?

Comment by Ariel Silva [ 2018-03-09 ]

It's not a problem of the repos themselves, but rather distribution issue

eg. with mysql.h: repo version is https://github.com/MariaDB/server/blob/10.2/include/mysql.h
This one has #include "mysql_version.h"

on the unzipped windows distribution is located at include/mysql/server/mysql.h instead of include/mysql.h. The one at include/mysql/mysql.h is actually Connector-C version of the header file

Comment by Vladislav Vaintroub [ 2018-03-09 ]

No, there is no distribution issue. We build and distribute Connector/C since 10.2 . This is our client library. Client tools all are built with Connector/C.

We also, unfortunately, still, maintain a "private" libmysqlclient, as part of the server. (Mostly) single user of that is replication, and replication uses a lot of internals that are different from C/C. https://github.com/MariaDB/server/blob/10.2/include/mysql.h is the internal header, the one that users should not see, the one that was not used for building client library.

Comment by Vladislav Vaintroub [ 2018-03-09 ]

Can i ask again, what are the CR_xxx constants you miss, and could you point me to their documentation?

Comment by Ariel Silva [ 2018-03-09 ]

Missing from errmsg.h:

#define CR_EMBEDDED_CONNECTION 2021
#define CR_PROBE_SLAVE_STATUS 2022
#define CR_PROBE_SLAVE_HOSTS 2023
#define CR_PROBE_SLAVE_CONNECT 2024
#define CR_PROBE_MASTER_CONNECT 2025
#define CR_WRONG_LICENSE 2028
#define CR_NULL_POINTER 2029
#define CR_DATA_TRUNCATED 2032
#define CR_NO_PARAMETERS_EXISTS 2033
2038 renamed (was CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR defined as CR_SHARED_MEMORY_CONNECT_ERROR)
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
#define CR_SHARED_MEMORY_MAP_ERROR 2043
#define CR_SHARED_MEMORY_EVENT_ERROR 2044
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
#define CR_CONN_UNKNOW_PROTOCOL 2047
#define CR_INVALID_CONN_HANDLE 2048
#define CR_FETCH_CANCELED 2050
#define CR_NO_RESULT_SET 2053

Documentation: https://dev.mysql.com/doc/dev/mysql-server/8.0.0/errmsg_8h.html

Comment by Vladislav Vaintroub [ 2018-03-09 ]

I do not think this is the official documentation, just Doxygen annotated source code.
this actually might be closer https://dev.mysql.com/doc/refman/5.7/en/error-messages-client.htm.

georg, can you check and fix Missing definitions ?
arsilva. Apparently, our connector does not throw these errors,and maybe your project should also be prepared that some of the definitions are not there, with #ifdefs. It is very sparsely documented stuff.

Comment by Georg Richter [ 2018-03-09 ]

The missing error codes are not used by MariaDB Connector/C, but also several of them are not used (or not used anymore) by libmysql (Oracle).

Oracle cleaned up server error messages in recent MySQL versions, but obviously not client error messages.

I understand that some client applications will bot build correctly due to missing defines, so we will add the missing definitions (but not the error message itself).

Generated at Thu Feb 08 08:21:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.