This should have been allowed since in memory query cache was born.
pool_config->memqcache_method = "shmem";
pool_config->memqcache_memcached_host = "localhost";
pool_config->memqcache_memcached_port = 11211;
- pool_config->memqcache_total_size = 67108864;
+ pool_config->memqcache_total_size = (int64)67108864;
pool_config->memqcache_max_num_cache = 1000000;
pool_config->memqcache_expire = 0;
pool_config->memqcache_auto_cache_invalidation = 1;
}
else if (!strcmp(key, "memqcache_total_size") && CHECK_CONTEXT(INIT_CONFIG, context))
{
- int v = atoi(yytext);
+ int64 v = atoll(yytext);
if (token != POOL_INTEGER || v < 0)
{
pool_config->memqcache_method = "shmem";
pool_config->memqcache_memcached_host = "localhost";
pool_config->memqcache_memcached_port = 11211;
- pool_config->memqcache_total_size = 67108864;
+ pool_config->memqcache_total_size = (int64)67108864;
pool_config->memqcache_max_num_cache = 1000000;
pool_config->memqcache_expire = 0;
pool_config->memqcache_auto_cache_invalidation = 1;
}
else if (!strcmp(key, "memqcache_total_size") && CHECK_CONTEXT(INIT_CONFIG, context))
{
- int v = atoi(yytext);
+ int64 v = atoll(yytext);
if (token != POOL_INTEGER || v < 0)
{
char *memqcache_method; /* Cache store method. Either 'shmem'(shared memory) or 'memcached'. 'shmem' by default */
char *memqcache_memcached_host; /* Memcached host name. Mandatory if memqcache_method=memcached. */
int memqcache_memcached_port; /* Memcached port number. Mandatory if memqcache_method=memcached. */
- int memqcache_total_size; /* Total memory size in bytes for storing memory cache. Mandatory if memqcache_method=shmem. */
+ int64 memqcache_total_size; /* Total memory size in bytes for storing memory cache. Mandatory if memqcache_method=shmem. */
int memqcache_max_num_cache; /* Total number of cache entries. Mandatory if memqcache_method=shmem. */
int memqcache_expire; /* Memory cache entry life time specified in seconds. 60 by default. */
int memqcache_auto_cache_invalidation; /* If true, invalidation of query cache is triggered by corresponding */
*/
size_t pool_shared_memory_cache_size(void)
{
- int num_blocks;
+ int64 num_blocks;
size_t size;
if (pool_config->memqcache_maxcache > pool_config->memqcache_cache_block_size)
if (num_blocks == 0)
ereport(FATAL,
(errmsg("invalid memory cache configuration"),
- errdetail("memqcache_total_size %d should be greater or equal to memqcache_cache_block_size %d",
+ errdetail("memqcache_total_size %ld should be greater or equal to memqcache_cache_block_size %d",
pool_config->memqcache_total_size,
pool_config->memqcache_cache_block_size)));
ereport(LOG,
(errmsg("memory cache initialized"),
- errdetail("memcache blocks :%d",num_blocks)));
+ errdetail("memcache blocks :%ld",num_blocks)));
/* Remember # of blocks */
pool_set_memqcache_blocks(num_blocks);
size = pool_config->memqcache_cache_block_size * num_blocks;