CUBRID Engine
latest
|
Go to the source code of this file.
Definition at line 236 of file shard_parser.c.
References p.
Referenced by sp_check_end_of_hint(), sp_get_bind_type_and_value(), sp_get_hint_arg(), sp_get_hint_type(), sp_is_pair_token(), and sp_make_sp_value().
|
static |
Definition at line 387 of file shard_parser.c.
References sp_parser_hint::bind_type, sp_parser_hint_list::head, sp_parser_ctx::list_a, sp_parser_ctx::list_t, sp_parser_hint::next_a, sp_parser_hint::next_t, NULL, sp_parser_hint_list::size, and sp_parser_hint_list::tail.
Referenced by sp_process_token().
Definition at line 649 of file shard_parser.c.
References ER_SP_INVALID_HINT, left_trim(), and NO_ERROR.
Referenced by shard_stmt_change_shard_val_to_id(), and sp_process_token().
|
inlinestatic |
Definition at line 786 of file shard_parser.c.
References sp_parser_ctx::cursor, sp_parser_ctx::prv_cursor, sp_cursor::token, and TT_NONE.
Referenced by sp_get_bind_type_and_value(), and sp_parse_sql_internal().
SP_PARSER_CTX* sp_create_parser | ( | const char * | sql_stmt | ) |
Definition at line 63 of file shard_parser.c.
References sp_parser_ctx::bind_count, BT_DYNAMIC, BT_STATIC, sp_parser_ctx::cursor, sp_parser_ctx::is_select, sp_parser_ctx::list_a, sp_parser_ctx::list_t, NULL, sp_parser_ctx::operator_, sp_cursor::pos, PROXY_LOG, PROXY_LOG_MODE_ERROR, sp_parser_ctx::prv_cursor, sp_init_praser_hint_list(), sp_parser_ctx::sql_stmt, strdup(), sp_cursor::token, and TT_NONE.
Referenced by shard_stmt_new_internal().
SP_PARSER_HINT* sp_create_parser_hint | ( | void | ) |
Definition at line 333 of file shard_parser.c.
References sp_parser_hint::arg, sp_parser_hint::bind_position, sp_parser_hint::bind_type, BT_DYNAMIC, BT_STATIC, error(), sp_parser_hint::hint_type, HT_NONE, sp_parser_hint::next_a, sp_parser_hint::next_t, NO_ERROR, NULL, PROXY_LOG, PROXY_LOG_MODE_ERROR, sp_free_parser_hint(), sp_init_sp_value(), and sp_parser_hint::value.
Referenced by shard_stmt_change_shard_val_to_id(), and sp_process_token().
void sp_destroy_parser | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 116 of file shard_parser.c.
References NULL, sp_free_parser_hint_from_ctx(), and sp_parser_ctx::sql_stmt.
Referenced by shard_stmt_destroy(), and shard_stmt_free().
void sp_free_parser_hint | ( | SP_PARSER_HINT * | hint_p | ) |
Definition at line 416 of file shard_parser.c.
References sp_parser_hint::arg, NULL, sp_free_sp_value(), and sp_parser_hint::value.
Referenced by shard_stmt_change_shard_val_to_id(), sp_create_parser_hint(), sp_free_parser_hint_from_ctx(), and sp_process_token().
|
static |
Definition at line 474 of file shard_parser.c.
References NULL, sp_free_parser_hint(), sp_get_first_hint(), and sp_get_next_hint().
Referenced by sp_destroy_parser().
|
static |
Definition at line 262 of file shard_parser.c.
References NULL, sp_value::string, and sp_value::value_ex.
Referenced by sp_free_parser_hint().
|
static |
Definition at line 749 of file shard_parser.c.
References sp_parser_ctx::bind_count, sp_parser_hint::bind_position, sp_parser_hint::bind_type, BT_DYNAMIC, sp_parser_ctx::cursor, error(), left_trim(), NO_ERROR, sp_cursor::pos, sp_copy_cursor_to_prv(), sp_get_int_bind_value(), and sp_get_string_bind_value().
Referenced by sp_process_token().
int sp_get_dynamic_hint_count | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 149 of file shard_parser.c.
References BT_DYNAMIC, sp_parser_ctx::list_t, and sp_parser_hint_list::size.
SP_PARSER_HINT* sp_get_first_dynamic_hint | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 179 of file shard_parser.c.
References BT_DYNAMIC, sp_parser_hint_list::head, and sp_parser_ctx::list_t.
SP_PARSER_HINT* sp_get_first_hint | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 155 of file shard_parser.c.
References sp_parser_hint_list::head, and sp_parser_ctx::list_a.
Referenced by proxy_get_shard_id(), proxy_update_shard_stats(), shard_stmt_get_hint_type(), shard_stmt_set_hint_list(), and sp_free_parser_hint_from_ctx().
SP_PARSER_HINT* sp_get_first_static_hint | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 167 of file shard_parser.c.
References BT_STATIC, sp_parser_hint_list::head, and sp_parser_ctx::list_t.
const char* sp_get_hint_arg | ( | const char * | sql, |
SP_PARSER_HINT * | hint_p, | ||
int * | error | ||
) |
Definition at line 610 of file shard_parser.c.
References sp_parser_hint::arg, ER_SP_INVALID_HINT, sp_parser_hint::hint_type, HT_ID, HT_VAL, left_trim(), NO_ERROR, p, sp_get_token_type(), sp_is_pair_token(), sp_make_sp_value(), and TT_LEFT_BRAKET.
Referenced by shard_stmt_change_shard_val_to_id(), and sp_process_token().
char* sp_get_hint_key | ( | SP_PARSER_HINT * | hint_p | ) |
Definition at line 191 of file shard_parser.c.
References sp_parser_hint::arg, sp_value::string, and sp_value::value.
const char* sp_get_hint_type | ( | const char * | sql, |
SP_HINT_TYPE * | hint_type | ||
) |
Definition at line 575 of file shard_parser.c.
References HT_ALL, HT_ID, HT_KEY, HT_NONE, HT_VAL, and left_trim().
Referenced by shard_stmt_rewrite_sql(), and sp_process_token().
|
static |
Definition at line 813 of file shard_parser.c.
References sp_parser_ctx::cursor, p, sp_cursor::pos, sp_make_int_sp_value_from_string(), sp_parser_hint::value, and while().
Referenced by sp_get_bind_type_and_value().
SP_PARSER_HINT* sp_get_next_dynamic_hint | ( | SP_PARSER_HINT * | hint_p | ) |
Definition at line 185 of file shard_parser.c.
References BT_DYNAMIC, and sp_parser_hint::next_t.
SP_PARSER_HINT* sp_get_next_hint | ( | SP_PARSER_HINT * | hint_p | ) |
Definition at line 161 of file shard_parser.c.
References sp_parser_hint::next_a.
Referenced by proxy_get_shard_id(), shard_stmt_set_hint_list(), and sp_free_parser_hint_from_ctx().
SP_PARSER_HINT* sp_get_next_static_hint | ( | SP_PARSER_HINT * | hint_p | ) |
Definition at line 173 of file shard_parser.c.
References BT_STATIC, and sp_parser_hint::next_t.
const char* sp_get_sql_stmt | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 197 of file shard_parser.c.
References sp_parser_ctx::sql_stmt.
Referenced by shard_stmt_del_statement_from_map(), shard_stmt_find_by_sql(), and shard_stmt_put_statement_to_map().
int sp_get_static_hint_count | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 143 of file shard_parser.c.
References BT_STATIC, sp_parser_ctx::list_t, and sp_parser_hint_list::size.
|
static |
Definition at line 794 of file shard_parser.c.
References sp_parser_ctx::cursor, ER_SP_INVALID_SYNTAX, NULL, p, sp_cursor::pos, sp_make_string_sp_value(), sp_parser_hint::value, and while().
Referenced by sp_get_bind_type_and_value().
Definition at line 489 of file shard_parser.c.
References p, TT_ASSIGN_OP, TT_BIND_CHAR, TT_C_COMMENT, TT_C_COMMENT_END, TT_CPP_COMMENT, TT_CSQL_COMMENT, TT_DOUBLE_QUOTED, TT_HINT, TT_IN_OP, TT_LEFT_BRAKET, TT_NEWLINE, TT_NONE, TT_RIGHT_BRAKET, TT_SINGLE_QUOTED, and TT_WHITESPACE.
Referenced by shard_stmt_rewrite_sql(), sp_get_hint_arg(), sp_make_sp_value(), and sp_parse_sql_internal().
int sp_get_total_hint_count | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 137 of file shard_parser.c.
References sp_parser_ctx::list_a, and sp_parser_hint_list::size.
|
static |
Definition at line 379 of file shard_parser.c.
References sp_parser_hint_list::head, NULL, sp_parser_hint_list::size, and sp_parser_hint_list::tail.
Referenced by sp_create_parser().
|
static |
Definition at line 250 of file shard_parser.c.
References sp_value::integer, sp_value::length, NO_ERROR, NULL, sp_value::string, sp_value::type, sp_value::value, sp_value::value_arr, sp_value::value_ex, and VT_INTEGER.
Referenced by sp_create_parser_hint().
Definition at line 852 of file shard_parser.c.
References TT_ASSIGN_OP, TT_BIND_CHAR, TT_C_COMMENT_END, TT_IN_OP, TT_LEFT_BRAKET, TT_NEWLINE, TT_NONE, TT_RIGHT_BRAKET, TT_SHARD_HINT, and TT_WHITESPACE.
Referenced by shard_stmt_rewrite_sql(), and sp_parse_sql_internal().
bool sp_is_hint_static | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 131 of file shard_parser.c.
References BT_STATIC, sp_parser_ctx::list_a, sp_parser_ctx::list_t, and sp_parser_hint_list::size.
Referenced by fn_proxy_client_prepare().
Definition at line 203 of file shard_parser.c.
References left_trim(), TT_ASSIGN_OP, TT_BIND_CHAR, TT_C_COMMENT, TT_C_COMMENT_END, TT_CPP_COMMENT, TT_CSQL_COMMENT, TT_DOUBLE_QUOTED, TT_HINT, TT_IN_OP, TT_LEFT_BRAKET, TT_NEWLINE, TT_NONE, TT_RIGHT_BRAKET, TT_SHARD_HINT, TT_SINGLE_QUOTED, and TT_WHITESPACE.
Referenced by shard_stmt_rewrite_sql(), sp_get_hint_arg(), and sp_parse_sql_internal().
Definition at line 840 of file shard_parser.c.
References TT_C_COMMENT_END.
Referenced by sp_parse_sql_internal().
|
static |
Definition at line 827 of file shard_parser.c.
References ER_SP_INVALID_SYNTAX, sp_parser_hint::hint_type, HT_KEY, sp_parser_ctx::is_select, NO_ERROR, sp_parser_ctx::operator_, TT_ASSIGN_OP, and TT_IN_OP.
Referenced by sp_process_token().
|
static |
Definition at line 316 of file shard_parser.c.
References ER_SP_INVALID_HINT, sp_value::integer, NO_ERROR, parse_bigint(), sp_value::type, and VT_INTEGER.
Referenced by sp_get_int_bind_value(), and sp_make_sp_value().
Definition at line 271 of file shard_parser.c.
References left_trim(), p, sp_get_token_type(), sp_make_int_sp_value_from_string(), sp_make_string_sp_value(), TT_DOUBLE_QUOTED, and TT_SINGLE_QUOTED.
Referenced by sp_get_hint_arg().
Definition at line 292 of file shard_parser.c.
References ER_SP_INVALID_HINT, ER_SP_OUT_OF_MEMORY, sp_value::length, NO_ERROR, NULL, SP_VALUE_INIT_SIZE, sp_value::string, sp_value::type, sp_value::value, sp_value::value_ex, and VT_STRING.
Referenced by sp_get_string_bind_value(), and sp_make_sp_value().
int sp_parse_sql | ( | SP_PARSER_CTX * | parser_p | ) |
Definition at line 96 of file shard_parser.c.
References sp_parser_ctx::cursor, ER_SP_INVALID_SYNTAX, error(), NO_ERROR, PROXY_LOG, PROXY_LOG_MODE_ERROR, sp_parse_sql_internal(), sp_cursor::token, and TT_NONE.
Referenced by shard_stmt_set_hint_list().
|
static |
Definition at line 426 of file shard_parser.c.
References sp_parser_ctx::cursor, ER_SP_INVALID_SYNTAX, error(), NO_ERROR, sp_cursor::pos, sp_copy_cursor_to_prv(), sp_get_token_type(), sp_is_exist_pair_token(), sp_is_pair_token(), sp_is_start_token(), sp_process_token(), sp_cursor::token, TT_CPP_COMMENT, TT_CSQL_COMMENT, and TT_NONE.
Referenced by sp_parse_sql().
|
static |
Definition at line 666 of file shard_parser.c.
References sp_parser_ctx::bind_count, sp_parser_ctx::cursor, ER_SP_OUT_OF_MEMORY, error(), sp_parser_hint::hint_type, HT_KEY, HT_NONE, NO_ERROR, NULL, sp_parser_ctx::operator_, sp_cursor::pos, sp_append_parser_hint_to_ctx(), sp_check_end_of_hint(), sp_create_parser_hint(), sp_free_parser_hint(), sp_get_bind_type_and_value(), sp_get_hint_arg(), sp_get_hint_type(), sp_is_valid_hint(), sp_cursor::token, TT_ASSIGN_OP, TT_BIND_CHAR, TT_HINT, TT_IN_OP, TT_NONE, TT_RIGHT_BRAKET, and TT_SHARD_HINT.
Referenced by sp_parse_sql_internal().