Skip to content

File shard_parser.h

FileList > broker > shard_parser.h

Go to the source code of this file

  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include <ctype.h>
  • #include "system.h"
  • #include "error_code.h"

Classes

Type Name
struct sp_cursor
struct sp_parser_ctx
struct sp_parser_hint
struct sp_parser_hint_list
struct sp_value

Public Types

Type Name
typedef enum sp_bind_type SP_BIND_TYPE
typedef struct sp_cursor SP_CURSOR
typedef enum sp_hint_type SP_HINT_TYPE
typedef struct sp_parser_ctx SP_PARSER_CTX
typedef struct sp_parser_hint SP_PARSER_HINT
typedef struct sp_parser_hint_list SP_PARSER_HINT_LIST
typedef enum sp_token SP_TOKEN
typedef struct sp_value SP_VALUE
typedef enum sp_value_type SP_VALUE_TYPE
enum sp_bind_type
enum sp_error_code
enum sp_hint_type
enum sp_token
enum sp_value_type

Public Functions

Type Name
const char * sp_check_end_of_hint (const char * sql, int * error)
SP_PARSER_CTX * sp_create_parser (const char * sql_stmt)
SP_PARSER_HINT * sp_create_parser_hint (void)
void sp_destroy_parser (SP_PARSER_CTX * parser_p)
void sp_free_parser_hint (SP_PARSER_HINT * hint_p)
int sp_get_dynamic_hint_count (SP_PARSER_CTX * parser_p)
SP_PARSER_HINT * sp_get_first_dynamic_hint (SP_PARSER_CTX * parser_p)
SP_PARSER_HINT * sp_get_first_hint (SP_PARSER_CTX * parser_p)
SP_PARSER_HINT * sp_get_first_static_hint (SP_PARSER_CTX * parser_p)
const char * sp_get_hint_arg (const char * sql, SP_PARSER_HINT * hint_p, int * error)
char * sp_get_hint_key (SP_PARSER_HINT * hint_p)
const char * sp_get_hint_type (const char * sql, SP_HINT_TYPE * hint_type)
SP_PARSER_HINT * sp_get_next_dynamic_hint (SP_PARSER_HINT * hint_p)
SP_PARSER_HINT * sp_get_next_hint (SP_PARSER_HINT * hint_p)
SP_PARSER_HINT * sp_get_next_static_hint (SP_PARSER_HINT * hint_p)
const char * sp_get_sql_stmt (SP_PARSER_CTX * parser_p)
int sp_get_static_hint_count (SP_PARSER_CTX * parser_p)
const char * sp_get_token_type (const char * sql, SP_TOKEN * token)
int sp_get_total_hint_count (SP_PARSER_CTX * parser_p)
bool sp_is_exist_pair_token (SP_TOKEN token)
bool sp_is_hint_static (SP_PARSER_CTX * parser_p)
bool sp_is_pair_token (SP_TOKEN start_token, SP_TOKEN end_token)
int sp_parse_sql (SP_PARSER_CTX * parser_p)

Macros

Type Name
define SHARD_KEY_LENGTH 128
define SP_VALUE_INIT_SIZE 50

Public Types Documentation

typedef SP_BIND_TYPE

typedef enum sp_bind_type SP_BIND_TYPE;

typedef SP_CURSOR

typedef struct sp_cursor SP_CURSOR;

typedef SP_HINT_TYPE

typedef enum sp_hint_type SP_HINT_TYPE;

typedef SP_PARSER_CTX

typedef struct sp_parser_ctx SP_PARSER_CTX;

typedef SP_PARSER_HINT

typedef struct sp_parser_hint SP_PARSER_HINT;

typedef SP_PARSER_HINT_LIST

typedef struct sp_parser_hint_list SP_PARSER_HINT_LIST;

typedef SP_TOKEN

typedef enum sp_token SP_TOKEN;

typedef SP_VALUE

typedef struct sp_value SP_VALUE;

typedef SP_VALUE_TYPE

typedef enum sp_value_type SP_VALUE_TYPE;

enum sp_bind_type

enum sp_bind_type {
    BT_STATIC,
    BT_DYNAMIC
};

enum sp_error_code

enum sp_error_code {
    ER_SP_OUT_OF_MEMORY = -1,
    ER_SP_NOT_FOUND_HINT = -2,
    ER_SP_INVALID_HINT = -3,
    ER_SP_INVALID_SYNTAX = -4,
    ER_SP_DUPLICATED_HINT = -5
};

enum sp_hint_type

enum sp_hint_type {
    HT_INVAL = -1,
    HT_NONE,
    HT_KEY,
    HT_VAL,
    HT_ALL,
    HT_ID,
    HT_EOF
};

enum sp_token

enum sp_token {
    TT_NONE,
    TT_SINGLE_QUOTED,
    TT_DOUBLE_QUOTED,
    TT_CSQL_COMMENT,
    TT_CPP_COMMENT,
    TT_WHITESPACE,
    TT_NEWLINE,
    TT_C_COMMENT,
    TT_C_COMMENT_END,
    TT_HINT,
    TT_SHARD_HINT,
    TT_ASSIGN_OP,
    TT_IN_OP,
    TT_LEFT_BRAKET,
    TT_RIGHT_BRAKET,
    TT_BIND_CHAR
};

enum sp_value_type

enum sp_value_type {
    VT_INTEGER,
    VT_STRING
};

Public Functions Documentation

function sp_check_end_of_hint

const  char * sp_check_end_of_hint (
    const  char * sql,
    int * error
) 

function sp_create_parser

SP_PARSER_CTX * sp_create_parser (
    const  char * sql_stmt
) 

function sp_create_parser_hint

SP_PARSER_HINT * sp_create_parser_hint (
    void
) 

function sp_destroy_parser

void sp_destroy_parser (
    SP_PARSER_CTX * parser_p
) 

function sp_free_parser_hint

void sp_free_parser_hint (
    SP_PARSER_HINT * hint_p
) 

function sp_get_dynamic_hint_count

int sp_get_dynamic_hint_count (
    SP_PARSER_CTX * parser_p
) 

function sp_get_first_dynamic_hint

SP_PARSER_HINT * sp_get_first_dynamic_hint (
    SP_PARSER_CTX * parser_p
) 

function sp_get_first_hint

SP_PARSER_HINT * sp_get_first_hint (
    SP_PARSER_CTX * parser_p
) 

function sp_get_first_static_hint

SP_PARSER_HINT * sp_get_first_static_hint (
    SP_PARSER_CTX * parser_p
) 

function sp_get_hint_arg

const  char * sp_get_hint_arg (
    const  char * sql,
    SP_PARSER_HINT * hint_p,
    int * error
) 

function sp_get_hint_key

char * sp_get_hint_key (
    SP_PARSER_HINT * hint_p
) 

function sp_get_hint_type

const  char * sp_get_hint_type (
    const  char * sql,
    SP_HINT_TYPE * hint_type
) 

function sp_get_next_dynamic_hint

SP_PARSER_HINT * sp_get_next_dynamic_hint (
    SP_PARSER_HINT * hint_p
) 

function sp_get_next_hint

SP_PARSER_HINT * sp_get_next_hint (
    SP_PARSER_HINT * hint_p
) 

function sp_get_next_static_hint

SP_PARSER_HINT * sp_get_next_static_hint (
    SP_PARSER_HINT * hint_p
) 

function sp_get_sql_stmt

const  char * sp_get_sql_stmt (
    SP_PARSER_CTX * parser_p
) 

function sp_get_static_hint_count

int sp_get_static_hint_count (
    SP_PARSER_CTX * parser_p
) 

function sp_get_token_type

const  char * sp_get_token_type (
    const  char * sql,
    SP_TOKEN * token
) 

function sp_get_total_hint_count

int sp_get_total_hint_count (
    SP_PARSER_CTX * parser_p
) 

function sp_is_exist_pair_token

bool sp_is_exist_pair_token (
    SP_TOKEN token
) 

function sp_is_hint_static

bool sp_is_hint_static (
    SP_PARSER_CTX * parser_p
) 

function sp_is_pair_token

bool sp_is_pair_token (
    SP_TOKEN start_token,
    SP_TOKEN end_token
) 

function sp_parse_sql

int sp_parse_sql (
    SP_PARSER_CTX * parser_p
) 

Macro Definition Documentation

define SHARD_KEY_LENGTH

#define SHARD_KEY_LENGTH `128`

define SP_VALUE_INIT_SIZE

#define SP_VALUE_INIT_SIZE `50`


The documentation for this class was generated from the following file cubrid/src/broker/shard_parser.h