CUBRID Engine  latest
db_query.h File Reference
#include "config.h"
#include "error_manager.h"
#include "class_object.h"
#include "cursor.h"
Include dependency graph for db_query.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  db_query_type
 
struct  db_select_result
 
struct  db_call_result
 
struct  db_objfetch_result
 
struct  db_get_result
 
struct  db_query_tplpos
 
struct  db_query_result
 
struct  db_executed_statement_type
 
struct  db_prepare_info
 

Typedefs

typedef struct db_select_result DB_SELECT_RESULT
 
typedef struct db_call_result DB_CALL_RESULT
 
typedef struct db_objfetch_result DB_OBJFETCH_RESULT
 
typedef struct db_get_result DB_GET_RESULT
 
typedef struct db_query_tplpos DB_QUERY_TPLPOS
 
typedef struct db_executed_statement_type DB_EXECUTED_STATEMENT_TYPE
 
typedef struct db_prepare_info DB_PREPARE_INFO
 

Enumerations

enum  COL_VISIBLE_TYPE { OID_COLUMN, USER_COLUMN, SYSTEM_ADDED_COLUMN }
 
enum  DB_RESULT_TYPE {
  T_SELECT = 1, T_CALL, T_OBJFETCH, T_GET,
  T_CACHE_HIT
}
 
enum  DB_RESULT_STATUS { T_OPEN = 1, T_CLOSED }
 

Functions

SM_DOMAINdb_query_format_src_domain (DB_QUERY_TYPE *query_type)
 
int db_execute_with_values (const char *CSQL_query, DB_QUERY_RESULT **result, DB_QUERY_ERROR *query_error, int arg_count, DB_VALUE *vals)
 
int db_query_seek_tuple (DB_QUERY_RESULT *result, int offset, int seek_mode)
 
DB_QUERY_TPLPOSdb_query_get_tplpos (DB_QUERY_RESULT *result)
 
int db_query_set_tplpos (DB_QUERY_RESULT *result, DB_QUERY_TPLPOS *tplpos)
 
void db_query_free_tplpos (DB_QUERY_TPLPOS *tplpos)
 
int db_query_get_tuple_object (DB_QUERY_RESULT *result, int index, DB_OBJECT **object)
 
int db_query_get_tuple_object_by_name (DB_QUERY_RESULT *result, char *column_name, DB_OBJECT **object)
 
int db_query_get_value_to_space (DB_QUERY_RESULT *result, int index, unsigned char *ptr, int maxlength, bool *truncated, DB_TYPE user_type, bool *null_flag)
 
int db_query_get_value_to_pointer (DB_QUERY_RESULT *result, int index, unsigned char **ptr, DB_TYPE user_type, bool *null_flag)
 
bool db_is_client_cache_reusable (DB_QUERY_RESULT *result)
 
int db_query_get_cache_time (DB_QUERY_RESULT *result, CACHE_TIME *cache_time)
 
DB_QUERY_TYPEdb_cp_query_type (DB_QUERY_TYPE *query_type, int copy_only_user)
 
DB_QUERY_TYPEdb_alloc_query_format (int cnt)
 
void db_free_query_format (DB_QUERY_TYPE *q)
 
DB_QUERY_RESULTdb_get_db_value_query_result (DB_VALUE *var)
 
void db_free_query_result (DB_QUERY_RESULT *r)
 
DB_QUERY_RESULTdb_alloc_query_result (DB_RESULT_TYPE r_type, int col_cnt)
 
void db_init_query_result (DB_QUERY_RESULT *r, DB_RESULT_TYPE r_type)
 
int db_query_end (DB_QUERY_RESULT *result)
 
int db_query_end_internal (DB_QUERY_RESULT *result, bool notify_server)
 
void db_clear_client_query_result (int notify_server, bool end_holdable)
 
void db_init_prepare_info (DB_PREPARE_INFO *info)
 
int db_pack_prepare_info (const DB_PREPARE_INFO *info, char **buffer)
 
int db_unpack_prepare_info (DB_PREPARE_INFO *info, char *buffer)
 
void db_set_execution_plan (char *plan, int length)
 
char * db_get_execution_plan (void)
 
void db_free_execution_plan (void)
 

Typedef Documentation

Definition at line 132 of file db_query.h.

typedef struct db_get_result DB_GET_RESULT

Definition at line 140 of file db_query.h.

Enumeration Type Documentation

Enumerator
OID_COLUMN 
USER_COLUMN 
SYSTEM_ADDED_COLUMN 

Definition at line 45 of file db_query.h.

Enumerator
T_OPEN 
T_CLOSED 

Definition at line 110 of file db_query.h.

Enumerator
T_SELECT 
T_CALL 
T_OBJFETCH 
T_GET 
T_CACHE_HIT 

Definition at line 107 of file db_query.h.

Function Documentation

void db_clear_client_query_result ( int  notify_server,
bool  end_holdable 
)

Definition at line 1208 of file db_query.c.

References db_query_end_internal(), NULL, Qres_table, and T_SELECT.

Referenced by tran_2pc_prepare(), tran_2pc_prepare_global_tran(), tran_abort(), tran_abort_only_client(), and tran_commit().

Here is the caller graph for this function:

int db_execute_with_values ( const char *  CSQL_query,
DB_QUERY_RESULT **  result,
DB_QUERY_ERROR query_error,
int  arg_count,
DB_VALUE vals 
)
void db_free_execution_plan ( void  )

Definition at line 3638 of file db_query.c.

References db_Execution_plan, db_Execution_plan_length, free_and_init, and NULL.

Referenced by db_shutdown().

Here is the caller graph for this function:

char* db_get_execution_plan ( void  )

Definition at line 3621 of file db_query.c.

References db_Execution_plan, and NULL.

Referenced by fn_execute_array(), and fn_execute_internal().

Here is the caller graph for this function:

bool db_is_client_cache_reusable ( DB_QUERY_RESULT result)

Definition at line 3432 of file db_query.c.

int db_query_end ( DB_QUERY_RESULT result)

Definition at line 3362 of file db_query.c.

SM_DOMAIN* db_query_format_src_domain ( DB_QUERY_TYPE query_type)

Definition at line 1675 of file db_query.c.

References CHECK_1ARG_NULL, and db_query_type::src_domain.

Referenced by db_query_format_class_name(), and db_query_format_is_non_null().

Here is the caller graph for this function:

void db_query_free_tplpos ( DB_QUERY_TPLPOS tplpos)

Definition at line 2858 of file db_query.c.

References free_and_init.

Referenced by db_query_seek_tuple().

Here is the caller graph for this function:

int db_query_get_cache_time ( DB_QUERY_RESULT result,
CACHE_TIME cache_time 
)

Definition at line 3451 of file db_query.c.

int db_query_get_tuple_object ( DB_QUERY_RESULT result,
int  index,
DB_OBJECT **  object 
)
int db_query_get_tuple_object_by_name ( DB_QUERY_RESULT result,
char *  column_name,
DB_OBJECT **  object 
)
int db_query_get_value_to_pointer ( DB_QUERY_RESULT result,
int  index,
unsigned char **  ptr,
DB_TYPE  user_type,
bool null_flag 
)
int db_query_get_value_to_space ( DB_QUERY_RESULT result,
int  index,
unsigned char *  ptr,
int  maxlength,
bool truncated,
DB_TYPE  user_type,
bool null_flag 
)
int db_query_seek_tuple ( DB_QUERY_RESULT result,
int  offset,
int  seek_mode 
)

Definition at line 2455 of file db_query.c.

void db_set_execution_plan ( char *  plan,
int  length 
)