1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-09-13 21:02:01 +03:00

154 Commits

Author SHA1 Message Date
Kristian Nielsen
879fcab625 Remove obsolete reference to my_context.c which was renamed to ma_context.c
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2025-02-05 13:26:43 +01:00
Sergei Golubchik
6c0e755edf fix compilation errors with -flto
declare plugin structures using their correct type.
Fixes errors like

./libmariadb/libmariadb/ma_client_plugin.c:86:39: error: type of ‘pvio_socket_client_plugin’ does not match original declaration [-Werror=lto-type-mismatch]
./libmariadb/plugins/pvio/pvio_socket.c:141:21: note: type ‘struct MARIADB_PVIO_PLUGIN’ should match type ‘struct st_mysql_client_plugin’

Approved by: Georg Richter <georg@mariadb.com>
2024-10-17 10:02:07 +02:00
Kristian Nielsen
da0a01367c Implement boost::context as a fallback for non-blocking API support
The non-blocking API has native (assembler) implementations for x86_64,
i386, and (with recent patch) aarch64; these implementations are the most
efficient. For other architectures, a fallback to ucontext is supported.

But ucontext is not the most efficient, and it is not available on all
platforms (it has been deprecated in POSIX). The boost::context library
provides an alternative fallback that is available on more architectures and
should be more efficient than ucontext (if still not quite as fast as the
native support).

This patch adds a CMake option -DWITH_BOOST_CONTEXT=ON that adds
boost::context as a dependency of libmariadb to provide a fallback on
non-natively supported architectures. Boost::context is preferred over
ucontext when both are available.

The option is off by default and must be explicitly enabled by the
user. This avoids introducing a C++ dependency (including dependency
on a C++ compiler and on libstdc++) unless explicitly requested by the
user (libmariadb is otherwise C-only).

Tested-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-09-27 15:33:43 +02:00
Sergei Golubchik
f6e99af056 Revert "self-signed certificate verification", it's 3.4 feature
This reverts 395641549ac7..536d9e2b9e5b, in particular:

8dffd56936 MDEV-31857 enable MYSQL_OPT_SSL_VERIFY_SERVER_CERT by default
a99570c118 MDEV-31855 SSL cert validation protocol extension
9aa15e72a7 TLS fingerprint

and related commits
2024-02-19 11:16:26 +01:00
Georg Richter
9aa15e72a7 TLS fingerprint
Beside SHA1 fingerprint hash, Connector/C now also supports
SHA224 (OpenSSL and GnuTLS only), SHA256, SHA384 and SHA512
fingerprint hashes.
2024-02-04 22:17:22 +01:00
Georg Richter
ece593f571 Merge branch '3.3-rpl' into 3.3 2023-02-21 17:11:56 +01:00
Georg Richter
4dca917b7e Added support for all (?) events
- All (MariaDB and MySQL) events are now supported
- Added new api functions:
  - mariadb_rpl_error: returns error message
  - mariadb_rpl_errno: returns error number
  - mariadb_rpl_extract_rows: extract values of
    ROW_EVENTS
- Added decryption support
- Added uncompression
  -
2022-09-26 09:20:07 +02:00
Georg Richter
0682f2284c Merge branch '3.1' into 3.3 2022-08-03 11:59:57 +02:00
Georg Richter
630919e1d0 MSVC Build: treat warning as errors
Added option /WX which returns warnings
as errors, except for budled zlib.
2022-08-03 11:46:35 +02:00
Georg Richter
3230e75646 Fix for CONC-601:
zconf.h is no longer in zlib but will be generated via
zconf.h.cmakein. This fixes build error on MacOS when using
bundled zlib library.
2022-06-21 11:17:56 +02:00
Georg Richter
77a1f79754 Merge branch '3.2' into 3.3 2022-05-31 08:11:02 +02:00
Georg Richter
899f678632 Merge branch '3.1' into 3.2 2022-05-31 08:03:27 +02:00
Georg Richter
02a2be0cbe Fix build of static plugins
When building a plugin statically include directories
have to be set when building libmariadb.
2022-05-31 07:50:57 +02:00
Georg Richter
5e94e7c27f Merge branch '3.2' into 3.3 2022-05-19 16:44:12 +02:00
Georg Richter
497d463d9c Merge branch '3.1' into 3.2 2022-05-19 16:38:41 +02:00
Vladislav Vaintroub
12b9ae7fd8 MDEV-28581 - libmariadb.dll is no longer inside MSI
Fix regression introduced in MDEV-27109 in patch dde7deee51
The NAMELINK stuff apparently does not work where it does not make sense
2022-05-16 20:30:39 +02:00
Georg Richter
00e5eaf403 Merge branch '3.2' into 3.3 2022-04-20 18:55:58 +02:00
Georg Richter
3ba4c4a613 Merge branch '3.1' into 3.2 2022-04-20 18:55:05 +02:00
Georg Richter
d706eaf90a PR 172
Fix Sigbus when calling mysql_real_connect_start on ARM/MacOS
2022-03-03 06:43:21 +01:00
Georg Richter
340f920fe7 Fix for static windows library (mariadbclient):
For static library don't build internal zlib as library, but
add sources to object library.
2022-02-10 15:08:59 +01:00
Georg Richter
770cf2286a CONC-575: Support for MySQL zstd compression
ZSTD compression is now supported for connections
to a MySQL Server 8.0.

Compression algorithms are supported via compression
plugins, which can be found in plugins/compress.
2022-01-25 05:02:33 +01:00
Georg Richter
3fe2f50545 Merge branch '3.1' into 3.2 2022-01-25 03:51:45 +01:00
Sergei Golubchik
dde7deee51 MDEV-27109 mysql_config mariadb_config lists non existant -lmariadb
create libmariadb.a as a symlink to libmariadbclient.a

put libmariadb.so in Development not in SharedLibraries
2022-01-14 22:13:34 +01:00
Sergei Krivonos
899d2d2666 Xcode compatibility update 2021-10-15 11:31:32 +03:00
Sergei Krivonos
a65f9e54bc Xcode compatibility update 2021-09-30 02:49:36 +03:00
Georg Richter
7e39b85ab1 CONC-554: man pages for Connector/C
man pages for Connector/C can be found in the man subdirectory
of Connector/C source tree.

The man pages are created from the Connector/C wiki using pandoc
utility and the create_man python script.
2021-06-08 17:37:58 +02:00
Vladislav Vaintroub
9b3058495a portability - fix ARM64 cross-compilation 2021-06-06 22:19:17 +02:00
Georg Richter
d19c7c6926 Fix for CONC-543 (hash functions conflict with GnuTLS)
To allow static linking with GnuTLS hash lookup functions are now
prefixed with ma_hashtbl_. The files hash.c and hash.h were renamed
to ma_hashtbl.c and ma_hashtbl.h
2021-04-13 21:34:29 +02:00
Georg Richter
c23ecca2a8 Fix for CONC-475:
The function mariadb_rpl_init_ex was not listed in the the list
of exported replication/binlog API functions.
2021-03-15 07:18:43 +01:00
Vladislav Vaintroub
fc431a035a Support MSVC ASAN 2021-03-12 00:29:16 +01:00
Georg Richter
828f37eefa Merge pull request #148 from EGuesnet/AIX2
AIX build
2020-09-13 15:47:41 +02:00
Etienne Guesnet
63c3ca5ec4 Do not build static and shared library with the same name on AIX 2020-09-11 17:03:23 +02:00
Georg Richter
f3ed42f877 Fix for MDEV-18818:
When C/C is built within server, the server already sets ZLIB_FOUND
and ZLIB_LIBRARY/INCLUDEDIR. In that case we need to link against the
ZLIB_LIBRARY but we don't add it to the required system libraries.
2020-09-03 17:34:55 +02:00
Georg Richter
49be7b28b6 Merge pull request #124 from EGuesnet/AIX
[CONC-430] Compilation on AIX
2020-08-13 14:38:48 +02:00
Otto Kekäläinen
3740f7d9fe Add support for kFreeBSD builds
Upstreamed from
https://salsa.debian.org/mariadb-team/mariadb-10.4/-/blob/master/debian/patches/libmariadb-kfreebsd.patch
2020-06-14 15:30:56 +03:00
Vladislav Vaintroub
cbff6bca03 CMake : do not use transitive linking for shared client library 2020-04-16 12:40:08 +02:00
Alexander Barkov
6632cb69d7 MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY 2020-03-10 17:02:59 +04:00
EGuesnet
5bd45f56d1 iconv does not support LIBICONV_PLUG flag on AIX 2020-01-23 11:38:30 +01:00
Vladislav Vaintroub
63df45ce3d CONC-447 ERROR 2026 (HY000): SSL connection error: Certificate signature check failed
Implement proper verification for server certificate chain,
with refactoring of the certificate stuff.

If custom CA and CRL certs are given, load them into in-memory store, and
use CertVerifyCertificateChainPolicy() to verify the certificate chain.

There are minor errors fixed, such as
- now there is a support for private keys encoded as BEGIN/END PRIVATE KEY
in PEM, instead of only BEGIN/END RSA PRIVATE KEY
- memory leak around CryptAcquireContext() is fixed i.e when client loads
private key, it previously did never released it, not even when connection
ended.

The handling of certificates moved into schannel_certs.c from various places
2019-12-08 18:07:48 +01:00
Georg Richter
261a5c4355 Fix for CONC-437: attempt to reassign symbol 'mysql_get_timeout_value' of version 'libmysqlclient_18' to version 'libmariadb_3'
Removed mysql_get_timeout_value/ms functions from dynamic column api symbols.
2019-09-15 14:07:53 +02:00
Marko Mäkelä
b047abe214 Relax the linker config for all sanitizers 2019-08-19 17:00:13 +03:00
Sergei Golubchik
4aad20db15 Merge tag 'v3.0.9' into 3.1 2019-02-18 20:16:23 +01:00
Georg Richter
02e7d5654d Crude "auto-load-data-local-infile" mode
Disable LOAD DATA LOCAL INFILE suport by default and
auto-enable it for the duration of one query, if the query
string starts with the word "load". In all other cases the application
should enable LOAD DATA LOCAL INFILE support explicitly.

(Based on Sergei Golubchiks 5.5 server patch)
2019-02-05 07:19:36 +01:00
Inada Naoki
5764fba7a6 Don't install pdb files for Release build 2019-01-18 20:50:13 +09:00
Samuel Thibault
a71ec85fbc Tune symbol visibility on GNU/Hurd too 2019-01-04 01:33:56 +01:00
Georg Richter
212a9f6519 Fixed prototype for ps callback functions
Connectori/Python callback fixes
2018-12-05 13:40:58 +01:00
Georg Richter
1888c141f7 Manual merge from CONC-325 branch: Initial implementation for binlog/replication API 2018-12-02 18:28:38 +01:00
Georg Richter
f52248881f Fix for ASAN/TSAN build 2018-11-08 15:50:02 +01:00
Sergei Golubchik
0e0bf9aa49 Merge tag 'v3.0.6' into 10.3-server 2018-08-10 15:01:16 +02:00
Georg Richter
eb64582b68 Debian layout changes/fixes 2018-07-25 09:33:53 +02:00