24#ifndef SQL_SERVICE_CONTEXT_BASE_INCLUDE
25#define SQL_SERVICE_CONTEXT_BASE_INCLUDE
232 const char *
const message) = 0;
242 const char *
const sqlstate) = 0;
259 ->start_result_metadata(num_cols,
flags, resultcs);
270 ->end_result_metadata(server_status, warn_count);
326 ->get_string(value,
length, valuecs);
332 const char *
const message) {
334 ->handle_ok(server_status, statement_warn_count, affected_rows,
335 last_insert_id, message);
339 const char *
const err_msg,
340 const char *
const sqlstate) {
342 ->handle_error(sql_errno, err_msg, sqlstate);
Definition: sql_service_context_base.h:33
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:286
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:310
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:277
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:294
static void sql_abort_row(void *ctx)
Definition: sql_service_context_base.h:281
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:318
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:267
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:345
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:349
static int sql_get_longlong(void *ctx, longlong value, uint is_unsigned)
Definition: sql_service_context_base.h:298
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:306
static int sql_start_row(void *ctx)
Definition: sql_service_context_base.h:273
static int sql_field_metadata(void *ctx, struct st_send_field *field, const CHARSET_INFO *charset)
Definition: sql_service_context_base.h:262
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:323
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:314
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:302
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:338
static int sql_get_null(void *ctx)
Definition: sql_service_context_base.h:290
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:36
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:256
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:329
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:385
Definition: mysql_time.h:82
intg is the number of decimal digits (NOT number of decimal_digit_t's !) before the point frac is the...
Definition: decimal.h:52
Definition: service_command.h:328
Definition: service_command.h:45
unsigned int uint
Definition: uca9-dump.cc:75