5
#include "pool_proto_modules.h"
6
#include "pool_timestamp.h"
7
#include "parser/parser.h"
9
/* for get_current_timestamp() (MASTER() macro) */
10
POOL_REQUEST_INFO _req_info;
11
POOL_REQUEST_INFO *Req_info = &_req_info;
12
int selected_slot = 0; /* selected DB node */
13
int in_load_balance = 1; /* non 0 if in load balance mode */
14
POOL_CONFIG _pool_config;
15
POOL_CONFIG *pool_config = &_pool_config;
44
pool_create_relcache(int cachesize, char *sql, func_ptr register_func, func_ptr unregister_func, bool issessionlocal)
46
return (POOL_RELCACHE *) 1;
50
pool_search_relcache(POOL_RELCACHE *relcache, POOL_CONNECTION_POOL *backend, char *table)
52
if (strcmp(table, "\"rel1\"") == 0)
53
return (void *) &(rc[0]);
55
return (void *) &(rc[1]);
59
do_query(POOL_CONNECTION *backend, char *query, POOL_SELECT_RESULT **result, int major) {
60
static POOL_SELECT_RESULT res;
61
static char *data[1] = {
62
"2009-01-01 23:59:59.123456+09"
73
main(int argc, char **argv)
79
POOL_CONNECTION_POOL backend;
80
POOL_CONNECTION_POOL_SLOT slot;
81
backend.slots[0] = &slot;
83
pool_config->replication_enabled = 1;
87
fprintf(stderr, "./timestmp-test query\n");
91
tree = raw_parser(argv[1]);
94
printf("syntax error: %s\n", argv[1]);
100
portal.num_tsparams = 0;
101
Node *node = (Node *) lfirst(l);
102
query = rewrite_timestamp(&backend, node, false, &portal);
104
printf("%s\n", query);
106
printf("%s\n", argv[1]);
113
void child_exit(int code) { exit (code); }
114
void pool_error(const char *fmt,...) {}
115
void pool_debug(const char *fmt,...) {}
116
void pool_log(const char *fmt,...) {}
117
void free_select_result(POOL_SELECT_RESULT *result) {}