CUBRID Engine
latest
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
#include <sys/time.h>
#include "broker_config.h"
#include "broker_util.h"
#include "broker_shm.h"
#include "broker_filename.h"
#include "cas_protocol.h"
#include "cas_common.h"
#include "cubrid_getopt.h"
#include "cas_cci.h"
#include "ini_parser.h"
Go to the source code of this file.
Classes | |
struct | TESTER_INFO |
Macros | |
#define | TESTER_ERR_MSG_SIZE 1024 |
#define | TIME_BUF_SIZE 50 |
#define | MAX_DISPLAY_LENGTH 20 |
#define | DEFAULT_EMPTY_STRING "\0" |
#define | DEFAULT_CUB_USER_NAME "PUBLIC" |
#define | DEFAULT_ORACLE_USER_NAME "scott" |
#define | DEFAULT_ORACLE_PASSWORD "tiger" |
#define | DEFAULT_MYSQL_USER_NAME "root" |
#define | RESULT_FORMAT "%-15s" |
#define | SHARD_ID_FORMAT "%-10d" |
#define | STR_SHARD_ID_FORMAT "%-10s" |
#define | ROWCOUNT_FORMAT "%-15d" |
#define | QUERY_FORMAT "%s" |
#define | STR_ROWCOUNT_FORMAT "%-15s" |
#define | TIME_FORMAT "%-20s" |
#define | PRINT_CCI_ERROR(...) |
#define | PRINT_RESULT(...) |
#define | PRINT_TITLE(n, ...) |
Functions | |
static int | init_tester_info (char *broker_name) |
static void | init_default_conn_info (int appl_server_type) |
static int | get_master_shm_id (void) |
static void | get_time (struct timeval *start_time, char *time, int buf_len) |
static int | execute_test_with_query (int conn_handle, char *query, int shard_flag) |
static int | execute_test (int conn_handle, int shard_flag) |
static void | print_usage (void) |
static void | print_conn_result (char *broker_name, int conn_hd_id) |
static void | print_shard_result (void) |
static void | print_title (int shard_flag) |
static void | print_result (int row_count, int err_code, int shard_flag, int shard_id, char *time, char *query) |
static int | print_result_set (int req, T_CCI_ERROR *err_buf, T_CCI_COL_INFO *col_info, int col_count) |
static void | print_query_test_result (int ret) |
static void | print_line (const char *ch, int num) |
static void | free_br_tester_info (void) |
static bool | is_number_type (T_CCI_U_TYPE type) |
int | main (int argc, char *argv[]) |
Variables | |
static const char | SECTION_NAME [] = "broker" |
static FILE * | out_file_fp |
static char | tester_err_msg [TESTER_ERR_MSG_SIZE] |
TESTER_INFO | br_tester_info |
#define DEFAULT_CUB_USER_NAME "PUBLIC" |
Definition at line 61 of file broker_tester.c.
Referenced by init_default_conn_info().
#define DEFAULT_EMPTY_STRING "\0" |
Definition at line 60 of file broker_tester.c.
Referenced by init_default_conn_info().
#define DEFAULT_MYSQL_USER_NAME "root" |
Definition at line 64 of file broker_tester.c.
Referenced by init_default_conn_info().
#define DEFAULT_ORACLE_PASSWORD "tiger" |
Definition at line 63 of file broker_tester.c.
Referenced by init_default_conn_info().
#define DEFAULT_ORACLE_USER_NAME "scott" |
Definition at line 62 of file broker_tester.c.
Referenced by init_default_conn_info().
#define MAX_DISPLAY_LENGTH 20 |
Definition at line 58 of file broker_tester.c.
Referenced by print_result_set().
#define PRINT_CCI_ERROR | ( | ... | ) |
Definition at line 74 of file broker_tester.c.
Referenced by main(), print_result(), and print_result_set().
#define PRINT_RESULT | ( | ... | ) |
Definition at line 88 of file broker_tester.c.
Referenced by print_conn_result(), print_line(), print_query_test_result(), print_result(), print_result_set(), print_shard_result(), and print_title().
#define PRINT_TITLE | ( | n, | |
... | |||
) |
Definition at line 97 of file broker_tester.c.
Referenced by print_result_set(), and print_title().
#define QUERY_FORMAT "%s" |
Definition at line 70 of file broker_tester.c.
Referenced by print_result(), and print_title().
#define RESULT_FORMAT "%-15s" |
Definition at line 66 of file broker_tester.c.
Referenced by print_result(), and print_title().
#define ROWCOUNT_FORMAT "%-15d" |
Definition at line 69 of file broker_tester.c.
Referenced by print_result().
#define SHARD_ID_FORMAT "%-10d" |
Definition at line 67 of file broker_tester.c.
Referenced by print_result().
#define STR_ROWCOUNT_FORMAT "%-15s" |
Definition at line 71 of file broker_tester.c.
Referenced by print_title().
#define STR_SHARD_ID_FORMAT "%-10s" |
Definition at line 68 of file broker_tester.c.
Referenced by print_title().
#define TESTER_ERR_MSG_SIZE 1024 |
Definition at line 56 of file broker_tester.c.
#define TIME_BUF_SIZE 50 |
Definition at line 57 of file broker_tester.c.
Referenced by coerce_time_to_dbvalue(), coerce_timestamp_to_dbvalue(), csql_db_value_as_string(), db_value_get(), and execute_test_with_query().
#define TIME_FORMAT "%-20s" |
Definition at line 72 of file broker_tester.c.
Referenced by print_result(), and print_title().
|
static |
Definition at line 450 of file broker_tester.c.
References execute_test_with_query(), TESTER_INFO::input_file_name, NULL, p, print_title(), and trim().
Referenced by main().
|
static |
Definition at line 348 of file broker_tester.c.
References CUBRID_STMT_SELECT, get_time(), NULL, TESTER_INFO::num_shard, OFF, ON, print_result(), print_result_set(), TESTER_INFO::shard_flag, TESTER_INFO::single_shard, snprintf_dots_truncate, tester_err_msg, TIME_BUF_SIZE, and TESTER_INFO::verbose_mode.
Referenced by execute_test(), and main().
|
static |
Definition at line 769 of file broker_tester.c.
References TESTER_INFO::command, TESTER_INFO::db_name, TESTER_INFO::db_passwd, TESTER_INFO::db_user, FREE_MEM, TESTER_INFO::input_file_name, and TESTER_INFO::output_file_name.
Referenced by main().
|
static |
Definition at line 278 of file broker_tester.c.
References BROKER_PATH_MAX, envvar_get(), FID_CUBRID_BROKER_CONF, get_cubrid_file(), ini_findsec(), ini_gethex(), ini_parser_free(), ini_parser_load(), NULL, SECTION_NAME, and strncpy_bufsize.
Referenced by init_tester_info().
|
static |
Definition at line 326 of file broker_tester.c.
Referenced by execute_test_with_query().
|
static |
Definition at line 229 of file broker_tester.c.
References APPL_SERVER_CAS, APPL_SERVER_CAS_MYSQL, APPL_SERVER_CAS_ORACLE, TESTER_INFO::db_name, TESTER_INFO::db_passwd, TESTER_INFO::db_user, DEFAULT_CUB_USER_NAME, DEFAULT_EMPTY_STRING, DEFAULT_MYSQL_USER_NAME, DEFAULT_ORACLE_PASSWORD, DEFAULT_ORACLE_USER_NAME, FREE_MEM, NULL, and strdup().
Referenced by init_tester_info().
|
static |
Definition at line 151 of file broker_tester.c.
References t_broker_info::appl_server, t_shm_broker::br_info, TESTER_INFO::broker_port, TESTER_INFO::db_name, TESTER_INFO::db_passwd, TESTER_INFO::db_user, get_master_shm_id(), i, init_default_conn_info(), t_broker_info::name, NULL, t_shm_broker::num_broker, TESTER_INFO::num_shard, t_shm_shard_conn::num_shard_conn, ON, t_broker_info::port, t_broker_info::proxy_shm_id, t_broker_info::shard_db_name, t_broker_info::shard_db_password, t_broker_info::shard_db_user, TESTER_INFO::shard_flag, t_broker_info::shard_flag, shm_br, SHM_BROKER, SHM_MODE_MONITOR, SHM_PROXY, t_shm_proxy::shm_shard_conn, strdup(), uw_shm_detach(), and uw_shm_open().
Referenced by main().
|
static |
Definition at line 751 of file broker_tester.c.
Referenced by print_result_set().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 780 of file broker_tester.c.
References broker_name, BROKER_NAME_LEN, TESTER_INFO::broker_port, TESTER_INFO::command, TESTER_INFO::db_name, TESTER_INFO::db_passwd, TESTER_INFO::db_user, execute_test(), execute_test_with_query(), free_br_tester_info(), getopt(), init_tester_info(), TESTER_INFO::input_file_name, NULL, optarg, out_file_fp, TESTER_INFO::output_file_name, PRINT_CCI_ERROR, print_conn_result(), print_query_test_result(), print_shard_result(), print_title(), print_usage(), TESTER_INFO::shard_flag, TESTER_INFO::single_shard, strdup(), and TESTER_INFO::verbose_mode.
|
static |
Definition at line 550 of file broker_tester.c.
References TESTER_INFO::db_name, TESTER_INFO::db_user, and PRINT_RESULT.
Referenced by main().
|
static |
Definition at line 496 of file broker_tester.c.
References i, and PRINT_RESULT.
Referenced by print_result_set(), and print_title().
|
static |
Definition at line 566 of file broker_tester.c.
References PRINT_RESULT.
Referenced by main().
|
static |
Definition at line 600 of file broker_tester.c.
References ON, PRINT_CCI_ERROR, PRINT_RESULT, QUERY_FORMAT, RESULT_FORMAT, ROWCOUNT_FORMAT, SHARD_ID_FORMAT, tester_err_msg, and TIME_FORMAT.
Referenced by execute_test_with_query().
|
static |
Definition at line 636 of file broker_tester.c.
References FREE_MEM, i, is_number_type(), MAX_DISPLAY_LENGTH, NULL, PRINT_CCI_ERROR, print_line(), PRINT_RESULT, PRINT_TITLE, and strlen.
Referenced by execute_test_with_query().
|
static |
Definition at line 583 of file broker_tester.c.
References ON, PRINT_RESULT, and TESTER_INFO::shard_flag.
Referenced by main().
|
static |
Definition at line 527 of file broker_tester.c.
References ON, print_line(), PRINT_RESULT, PRINT_TITLE, QUERY_FORMAT, RESULT_FORMAT, STR_ROWCOUNT_FORMAT, STR_SHARD_ID_FORMAT, and TIME_FORMAT.
Referenced by execute_test(), and main().
|
static |
Definition at line 512 of file broker_tester.c.
Referenced by main().
TESTER_INFO br_tester_info |
Definition at line 127 of file broker_tester.c.
|
static |
Definition at line 108 of file broker_tester.c.
Referenced by main().
|
static |
Definition at line 106 of file broker_tester.c.
Referenced by get_master_shm_id().
|
static |
Definition at line 110 of file broker_tester.c.
Referenced by execute_test_with_query(), and print_result().