For the complete documentation index, see llms.txt. This page is also available as Markdown.

mysql_send_query

mysql_send_query dispatches a query asynchronously on a MariaDB connection; each call must be followed by mysql_read_query_result to consume the response.

Syntax

int mysql_send_query(MYSQL * mysql,
                     const char * query,
                     unsigned long length);

Parameters

Returns zero on success, otherwise non-zero.

Description

mysql_send_query() executes a SQL statement without waiting for the Server OK packet and/or resultset. The main purpose of this function is to perform batch execution of DML statements.

  • The OK and result set package need to be retrieved by mysql_read_query_result() function

  • mysql_send_query() can be used for semi asynchronous operation. While the function itself is blocking, an event driven application can do other tasks until result set is available.

Example

For an example how to use 'mysql_send_query()` in an event driven model, please check Jan Kneschke's article "Async MySQL Queries with C-API".

See Also

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?