/[pgmemcache]/trunk/pgmemcache.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/pgmemcache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Thu Jul 20 09:57:48 2006 UTC revision 5 by dpavlin, Thu Jul 20 10:09:18 2006 UTC
# Line 34  Line 34 
34  #include "lib/stringinfo.h"  #include "lib/stringinfo.h"
35  #include "utils/datetime.h"  #include "utils/datetime.h"
36  #include "utils/palloc.h"  #include "utils/palloc.h"
37    #include "utils/memutils.h"
38    
39  #include "pgmemcache.h"  #include "pgmemcache.h"
40    
# Line 470  memcache_set_cmd(int type, PG_FUNCTION_A Line 471  memcache_set_cmd(int type, PG_FUNCTION_A
471        timestamptz = PG_GETARG_TIMESTAMPTZ(2);        timestamptz = PG_GETARG_TIMESTAMPTZ(2);
472    
473        /* convert to timestamptz to produce consistent results */        /* convert to timestamptz to produce consistent results */
474        if (timestamp2tm(timestamptz, NULL, &tm, &fsec, NULL) !=0)        if (timestamp2tm(timestamptz, NULL, &tm, &fsec, NULL, NULL) !=0)
475          ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),          ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
476                          errmsg("timestamp out of range")));                          errmsg("timestamp out of range")));
477    
# Line 640  memcache_stats(PG_FUNCTION_ARGS) { Line 641  memcache_stats(PG_FUNCTION_ARGS) {
641    appendStringInfo(str, "uptime: %llu\n", (uint64)stats->uptime);    appendStringInfo(str, "uptime: %llu\n", (uint64)stats->uptime);
642    appendStringInfo(str, "time: %llu\n", (uint64)stats->time);    appendStringInfo(str, "time: %llu\n", (uint64)stats->time);
643    appendStringInfo(str, "version: %s\n", stats->version);    appendStringInfo(str, "version: %s\n", stats->version);
644    appendStringInfo(str, "rusage_user: %u.%us\n", stats->rusage_user.tv_sec, stats->rusage_user.tv_usec);    appendStringInfo(str, "rusage_user: %u.%us\n", (uint)stats->rusage_user.tv_sec, (uint)stats->rusage_user.tv_usec);
645    appendStringInfo(str, "rusage_system: %u.%us\n", stats->rusage_system.tv_sec, stats->rusage_system.tv_usec);    appendStringInfo(str, "rusage_system: %u.%us\n", (uint)stats->rusage_system.tv_sec, (uint)stats->rusage_system.tv_usec);
646    appendStringInfo(str, "curr_items: %u\n", stats->curr_items);    appendStringInfo(str, "curr_items: %u\n", stats->curr_items);
647    appendStringInfo(str, "total_items: %llu\n", stats->total_items);    appendStringInfo(str, "total_items: %llu\n", stats->total_items);
648    appendStringInfo(str, "bytes: %llu\n", stats->bytes);    appendStringInfo(str, "bytes: %llu\n", stats->bytes);
# Line 699  memcache_stat(PG_FUNCTION_ARGS) { Line 700  memcache_stat(PG_FUNCTION_ARGS) {
700    else if (pg_strncasecmp("version", VARDATA(stat), stat_len) == 0)    else if (pg_strncasecmp("version", VARDATA(stat), stat_len) == 0)
701      appendStringInfo(str, "%s", stats->version);      appendStringInfo(str, "%s", stats->version);
702    else if (pg_strncasecmp("rusage_user", VARDATA(stat), stat_len) == 0)    else if (pg_strncasecmp("rusage_user", VARDATA(stat), stat_len) == 0)
703      appendStringInfo(str, "%u.%u", stats->rusage_user.tv_sec, stats->rusage_user.tv_usec);      appendStringInfo(str, "%u.%u", (uint)stats->rusage_user.tv_sec, (uint)stats->rusage_user.tv_usec);
704    else if (pg_strncasecmp("rusage_system", VARDATA(stat), stat_len) == 0)    else if (pg_strncasecmp("rusage_system", VARDATA(stat), stat_len) == 0)
705      appendStringInfo(str, "%u.%u", stats->rusage_system.tv_sec, stats->rusage_system.tv_usec);      appendStringInfo(str, "%u.%u", (uint)stats->rusage_system.tv_sec, (uint)stats->rusage_system.tv_usec);
706    else if (pg_strncasecmp("curr_items", VARDATA(stat), stat_len) == 0)    else if (pg_strncasecmp("curr_items", VARDATA(stat), stat_len) == 0)
707      appendStringInfo(str, "%u", stats->curr_items);      appendStringInfo(str, "%u", stats->curr_items);
708    else if (pg_strncasecmp("total_itmes", VARDATA(stat), stat_len) == 0)    else if (pg_strncasecmp("total_itmes", VARDATA(stat), stat_len) == 0)

Legend:
Removed from v.4  
changed lines
  Added in v.5

  ViewVC Help
Powered by ViewVC 1.1.26