24#ifndef SQL_SERVICE_CONTEXT_BASE_INCLUDE
25#define SQL_SERVICE_CONTEXT_BASE_INCLUDE
232 virtual void handle_ok(uint server_status, uint statement_warn_count,
234 const char *
const message) = 0;
244 const char *
const sqlstate) = 0;
261 ->start_result_metadata(num_cols,
flags, resultcs);
272 ->end_result_metadata(server_status, warn_count);
328 ->get_string(value,
length, valuecs);
332 uint statement_warn_count,
ulonglong affected_rows,
334 const char *
const message) {
336 ->handle_ok(server_status, statement_warn_count, affected_rows,
337 last_insert_id, message);
341 const char *
const err_msg,
342 const char *
const sqlstate) {
344 ->handle_error(sql_errno, err_msg, sqlstate);
Definition: sql_service_context_base.h:35
virtual int start_row()=0
Indicates the beginning of a new row in the result set/metadata.
virtual int end_row()=0
Indicates end of the row in the result set/metadata.
static ulong sql_get_client_capabilities(void *ctx)
Definition: sql_service_context_base.h:288
virtual int get_null()=0
Getting data.
virtual void abort_row()=0
An error occurred during execution.
virtual void shutdown(int flag)=0
Session was shutdown while command was running.
virtual int get_datetime(const MYSQL_TIME *value, uint decimals)=0
Get DATETIME value from server.
virtual ulong get_client_capabilities()=0
Return client's capabilities (see mysql_com.h, CLIENT_*)
virtual int get_time(const MYSQL_TIME *value, uint decimals)=0
Get TIME value from server.
static int sql_get_date(void *ctx, const MYSQL_TIME *value)
Definition: sql_service_context_base.h:312
virtual int end_result_metadata(uint server_status, uint warn_count)=0
Indicates end of metadata for the result set.
static int sql_end_row(void *ctx)
Definition: sql_service_context_base.h:279
virtual void handle_ok(uint server_status, uint statement_warn_count, ulonglong affected_rows, ulonglong last_insert_id, const char *const message)=0
Getting execution status.
static int sql_get_integer(void *ctx, longlong value)
Definition: sql_service_context_base.h:296
static void sql_abort_row(void *ctx)
Definition: sql_service_context_base.h:283
virtual int get_integer(longlong value)=0
Get TINY/SHORT/LONG value from server.
static int sql_get_datetime(void *ctx, const MYSQL_TIME *value, uint decimals)
Definition: sql_service_context_base.h:320
Sql_service_context_base()=default
Sql_service_context_base constructor resets all variables.
virtual int get_double(double value, uint32 decimals)=0
static int sql_end_result_metadata(void *ctx, uint server_status, uint warn_count)
Definition: sql_service_context_base.h:269
virtual bool connection_alive()=0
Check if the connection is still alive.
static void sql_shutdown(void *ctx, int flag)
Definition: sql_service_context_base.h:347
virtual int start_result_metadata(uint num_cols, uint flags, const CHARSET_INFO *resultcs)=0
Getting metadata.
virtual ~Sql_service_context_base()=default
static bool sql_connection_alive(void *ctx)
Definition: sql_service_context_base.h:351
static int sql_get_longlong(void *ctx, longlong value, uint is_unsigned)
Definition: sql_service_context_base.h:300
virtual int get_string(const char *const value, size_t length, const CHARSET_INFO *const valuecs)=0
Get STRING value from server.
virtual int get_date(const MYSQL_TIME *value)=0
Get DATE value from server.
static int sql_get_double(void *ctx, double value, uint32 decimals)
Definition: sql_service_context_base.h:308
static int sql_start_row(void *ctx)
Definition: sql_service_context_base.h:275
static int sql_field_metadata(void *ctx, struct st_send_field *field, const CHARSET_INFO *charset)
Definition: sql_service_context_base.h:264
static int sql_get_string(void *ctx, const char *const value, size_t length, const CHARSET_INFO *const valuecs)
Definition: sql_service_context_base.h:325
virtual int get_decimal(const decimal_t *value)=0
Receive DECIMAL value from server.
static int sql_get_time(void *ctx, const MYSQL_TIME *value, uint decimals)
Definition: sql_service_context_base.h:316
virtual int field_metadata(struct st_send_field *field, const CHARSET_INFO *charset)=0
Field metadata is provided via this callback.
static int sql_get_decimal(void *ctx, const decimal_t *value)
Definition: sql_service_context_base.h:304
static void sql_handle_error(void *ctx, uint sql_errno, const char *const err_msg, const char *const sqlstate)
Definition: sql_service_context_base.h:340
static int sql_get_null(void *ctx)
Definition: sql_service_context_base.h:292
static const st_command_service_cbs sql_service_callbacks
The sql service callbacks that will call the below virtual methods.
Definition: sql_service_context_base.h:38
virtual void handle_error(uint sql_errno, const char *const err_msg, const char *const sqlstate)=0
Command ended with ERROR.
static int sql_start_result_metadata(void *ctx, uint num_cols, uint flags, const CHARSET_INFO *resultcs)
Definition: sql_service_context_base.h:258
virtual int get_longlong(longlong value, uint is_unsigned)=0
Get LONGLONG value from server.
static void sql_handle_ok(void *ctx, uint server_status, uint statement_warn_count, ulonglong affected_rows, ulonglong last_insert_id, const char *const message)
Definition: sql_service_context_base.h:331
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
long long int longlong
Definition: my_inttypes.h:55
uint32_t uint32
Definition: my_inttypes.h:67
constexpr value_type is_unsigned
Definition: classic_protocol_constants.h:273
const std::string charset("charset")
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Header file for the Command service.
Definition: m_ctype.h:421
Definition: mysql_time.h:82
Base struct used to represent decimal data type.
Definition: decimal.h:49
Definition: service_command.h:328
Definition: service_command.h:45