2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-01-19 16:32:12 +00:00

113 Commits

Author SHA1 Message Date
Anarthal (Rubén Pérez)
793b678287 Updated file copyrights to 2025 2025-02-11 20:42:41 +01:00
Anarthal (Rubén Pérez)
829dbf775c Connections now check for in-progress async operations and fail without UB
connection and any_connection now check whether there is an in-progress
async operation, and fail with client_errc::operation_in_progress if
there is one. This situation no longer triggers undefined behavior.
Refactored the internal sans-io algorithms

close #405
2025-02-05 20:15:54 +01:00
Anarthal (Rubén Pérez)
268aa33a84 Connections now support immediate executors
Immediate completions in connection and any_connection are now correctly
    dispatched to the token's immediate executor using asio::async_immediate
    instead of plain asio::post.
Added a section on executors in the reference docs of async functions in
    connection and any_connection
Disabled TSAN connection_pool_cancel_get_connection for libc++ builds

close #301
2024-10-03 20:19:51 +02:00
Anarthal (Rubén Pérez)
e39c978514 Removed the global io_context in tests
Now tests are independent of each other
Refactor common utilities for separate compilation
2024-09-28 19:36:43 +02:00
Anarthal (Rubén Pérez)
e72b4906af Removed connection_pool::async_get_connection timeout overloads
Please use asio::cancel_after, instead.
Replaced client_errc::timeout, client_errc::cancelled by
    client_errc::no_connection_available, client_errc::pool_cancelled
async_get_connection no longer uses the last connect error code as failure error code,
    but embeds this info in the output diagnostics

close #349
2024-09-26 08:30:52 +02:00
Anarthal (Rubén Pérez)
a84b774bef Per-operation cancellation for connection_pool
close #197
2024-09-21 21:10:31 +02:00
Anarthal (Rubén Pérez)
0f843cd963 Refactored connection_pool unit tests
Removed IoTraits
Removed mock_timer_service
Simplified connection_pool_impl unit tests
2024-09-16 17:32:41 +02:00
Anarthal (Rubén Pérez)
1f79e5ce3f connection_pool thread-safety is now more robust
Thread-safety is now achieved using pool_params::thread_safe.
Removed pool_executor_params::thread_safe
Unsafe pools now use the standard Asio semantics
Safe pools are now safe even if the handlers' associated executors point
    to a context different from the pool's context

close #268
2024-09-14 13:06:54 +02:00
Anarthal (Rubén Pérez)
95a9aa1068 Added with_diagnostics completion token
Made with_diagnostics(deferred) the default token for any_connection and
connection_pool.
throw_on_error is now marked as legacy.

close #329 
close #296
2024-08-13 10:48:49 +02:00
Anarthal (Rubén Pérez)
36dc47693e Async ops now support cancel_after and similar tokens
All initiations have now an associated executor.

close #330
2024-08-08 18:46:34 +02:00
Anarthal (Rubén Pérez)
a8c992dd95 as_netresult completion token for tests
Restructured handshake integration tests
Removed er_connection infrastructure
Reworked network_result
Greatly simplified integration tests
2024-07-23 18:27:30 +02:00
Anarthal (Rubén Pérez)
cf74314c4e Improved tracker_executor
Added the ability to detect the executor call stack and whether we're
running from an initiating function or not.
Integration tests now consistently check these two.
2024-07-15 12:26:47 +02:00
Anarthal (Rubén Pérez)
a918c6b6b5 Improved server feature detection for integration tests
Introduced BOOST_MYSQL_DISABLED_SERVER_FEATURES env var
Removed BOOST_MYSQL_NO_UNIX_SOCKET_TESTS env var
JSON tests in database_types are now actually run

close #29
2024-07-11 17:36:42 +02:00
Anarthal (Rubén Pérez)
d1f1219e4b Removed the pipeline static interface
close #288
2024-06-26 16:47:27 +02:00
Anarthal (Rubén Pérez)
1ad51fc579 Character set clean-up
character_set::name is now a const char*, since NULL characters are not
   allowed by MySQL
character_set::next_char doesn't need to be noexcept
Removed noexcepts from next_char functions
Internal refactor
2024-06-24 17:10:12 +02:00
Anarthal (Rubén Pérez)
80a86189e9 Support for ranges in client-side SQL formatting
close #280
2024-06-22 11:48:45 +02:00
Anarthal (Rubén Pérez)
9ba4f9dfed Pipeline API
Removed sansio_algorithm base class

close #75
2024-06-08 12:47:42 +02:00
Anarthal (Rubén Pérez)
c0f305d007 Added injection fuzzing to format_sql
CI refactor

close #215
2024-03-16 11:09:39 +01:00
Ruben Perez
d8b69d0e78 Bumped copyright to 2024 2024-02-18 12:48:14 +01:00
Ruben Perez
ce53f3e0c0 Support for BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
Fixed connection_pool to build under this macro
Fixed tests and examples to build under this macro
Added CIs for this macro

close #184
2024-02-16 17:27:31 +01:00
Ruben Perez
05640cb670 Warning cleanup
Builds no longer use -pedantic
B2 builds now use -Wextra
Fixed various warnings

close #186
2023-12-21 13:54:01 +01:00
Ruben Perez
bc5577ede5 Connection pool
Added any_connection and any_address
Added connection_pool and pooled_connection
Added thread_safety tests
Added defaults.hpp header

close 19
2023-12-20 18:46:31 +01:00
Ruben Perez
c35b404af7 Implementation now uses a sans-io strategy
close #179
2023-10-30 18:16:43 +01:00
Ruben Perez
c60de9cee4 Support for reset_connection
Refactored integration tests network functions

Close #141
2023-07-14 16:27:31 +02:00
Ruben Perez
2dcea3f5e7 Added sanitizer builds
Fixed problem with header-only builds where
    meta_check_context didn't include its .ipp file
Fixed integer overflow problems in datetime::datetime
Fixed NULL memcpy problem in serialization_context::write
Updated tested systems in README and intro

close #33
2023-06-24 22:41:49 +02:00
Ruben Perez
88fbe387ac Separate compilation
Separate compilation
Immediate completions are now posted through the I/O executor
Jamfiles now correctly requires C++11
Refactored the protocol and channel modules
Removed example on default completion tokens

close #23
close #112
2023-06-22 12:03:24 +02:00
Ruben Perez
b51115668d Added support for the static interface
Added support for the static interface
Statement execution now supports bool and optionals
Replaced the FieldLikeTuple and FieldLike concepts
    by WritableFieldTuple and WritableField
Added diagnostics::client_message
Solved a problem with blob types and stored procedures
    under MariaDB
Removed a troublesome assert in row_impl
Protected numeric_limits min/max from intrusive macros
Added C++11/14 order management examples
Documentation section collapsing
Test Jamfiles now show output only on failure

close #60
close #153
close #154
2023-05-22 14:05:12 +02:00
Ruben Perez
ed007e31ae Multi-resultset
Added support for running stored procedures that SELECT data
Added support for running multiple semicolon-separated queries
Added support for running stored procedures with OUT params
Added resultset and resultset_view
Fixed documentation typos and wording
Refactored object creation in tests

Close #133
Close #132
Close #8
2023-03-31 00:44:46 +02:00
Ruben Perez
643e39f85e JSON and TEXT fields with binary collations support.
JSON fields are now read as strings instead of blobs.
TEXT fields with binary collations (e.g. utf8_bin or
    the JSON type in MariaDB) are now read as strings instead of blobs.
Added the column_type::json type.
The CI script now loads all data into the databases. There is no
    longer need to rebuild DB containers when test data changes.
2023-03-04 10:21:36 +01:00
Ruben Perez
a477203765 row and rows correctly handle blobs now
Close #123
2023-02-25 18:14:41 +01:00
Ruben Perez
7c5c7a6cd4 Collations for MySQL and MariaDB are now independent.
The collation enum has been converted into plain integers.
Separate headers for MySQL and MariaDB collation IDs have been added.
A script to generate those headers from table dumps has been added.

Close #120
2023-02-20 02:18:44 +01:00
Ruben Perez
fb87e840f0 Separate mysql and mariadb error codes.
Separate error categories for common, mysql and mariadb codes.
DB "flavor" detection.
CI mechanism to run db-specific integration tests.
Recovered PCHs in cmake and made them more sane.

close #108
2023-02-20 00:42:14 +01:00
Ruben Perez
527df790f8 Future-proof renames
resultset has been renamed to results, to support multi-resultset
    without changing the API.
server_diagnostics has been renamed to diagnostics, allowing
    the library to emit future client diagnostics
server_error has been renamed to error_with_diagnostics
throw_on_error semantics have been simplified
field::emplace_xxx functions have been removed (redundant)
connection::read_one_row has been removed (redundant)

close #119
2023-02-15 19:44:32 +01:00
Ruben Perez
08420ebdb9 Prepared statements are no longer I/O objects.
Prepared statements are no longer I/O objects.
Closing a statement no longer resets it.
Statements are no longer required to be kept alive
    during async execution and close.
close #118
2023-02-15 12:56:57 +01:00
Ruben Perez
7280ad6ed9 B2 CIs now runs unit tests
Fixed problem that caused build failures under GCC11/C++17
Close #117
2023-02-08 18:30:01 +01:00
Ruben Perez
4962a64a87 Added ping support.
Integration tests network variant refactor.
close #62
2023-02-06 11:55:16 +01:00
Ruben Perez
e6bf59be8a Metadata strings are now read only when requested.
Added metadata_mode and the ability to not read metadata string fields.
buffer_params is now handled by connection's ctor instead of handshake.
Added CMake CI builds covering Release and MinSizeRel build types.
2023-01-21 15:47:11 +01:00
Ruben Perez
7f583f4409 Hide all internal API functions from public classes
Hide all internal API functions from public classes.
Removed operator<< for row and row_view.
Moved ssl_mode to a separate header file.
Changed metadata_collection_view to use boost::span.

Close #79
2023-01-18 12:14:31 +01:00
Ruben Perez
ac7285c621 server_diagnostics and client/server error categories.
Renamed error_info to server_diagnostics.
server_diagnostics::message is now correctly treated as user-supplied input
  (security fix). Added notes on examples on this.
Split server and client errors in different categories.
Added throw_on_error.
Added connection::rebind_executor.
Made error categories public.
Exception throwing now uses Boost.Exception.
Improved error handling in examples.
Updated Asio dependencies for stackful coroutines.

Close #64
Close #107
2023-01-17 19:41:21 +01:00
Ruben Perez
e2ac2b4acf Replaced utility->core string_view
Close #98
2022-12-31 19:45:06 +01:00
Ruben Perez
31bc3b9dac Copyright year bump 2022-12-31 16:28:59 +01:00
Ruben Perez
a975273490 Multi-function operations
Added proper support for multi-function operations, segregating
  the API in single-function and multi-function operations.
  Removed resultset as I/O object, the read_xxx owning functions
  and read_all.
Unit test infrastructure for async testing.
Reference types lifetime fixes.
Removed connection::valid.
Fixed a serialization bug for statements with no parameters.
Binary protocol strings now use the type recommended by MySQL.
Refactored Jamfile to match best practices.
Updated description in libraries.json.

Close #82
Close #81
Close #73
Close #59
Close #58
Close #53
Close #41
Close #22
2022-12-31 15:49:09 +01:00
Ruben Perez
a3c9844ef3 New blob, date and datetime types
Binary types now use the new blob and blob_view types
New date and datetime types that can handle invalid and zero date and datetimes
Protection against min and max macros
Improvements in field docs
Docs section on character sets
Introduced new collations with id from 250 to 309
database_types test full refactor

Close #104
Close #103
Close #95
Close #94
Close #91
Close #90
Close #85
Close #80
Close #77
2022-12-15 19:24:18 +01:00
Ruben Perez
0a77264f41 Fixed build errors on win c++20 2022-11-15 17:20:55 +01:00
Ruben Perez
d8feb066b6 Windows 32bit warning in create_message 2022-11-15 16:56:48 +01:00
Ruben Perez
36c8238f88 Failing regression for deferred tokens 2022-10-26 19:13:32 +02:00
Ruben Perez
a84551ae75 Moved asio.cpp 2022-10-26 17:18:21 +02:00
Ruben Perez
12ced14397 Fixed memcmp UB in tests 2022-10-23 21:54:04 +02:00
Ruben Perez
8abdd5bae5 gcc-6 fixes 2022-10-23 19:22:31 +02:00
Ruben Perez
acba241de0 Finished integ tests 2022-10-17 16:55:05 +02:00