Revision 75a8ceae src/CloudSupport/mysql_delegate_helper.c

View differences:

src/CloudSupport/mysql_delegate_helper.c
128 128
           "  cloud_key VARCHAR(255),"\
129 129
           "  cloud_value BLOB," \
130 130
           "  timestamp INT UNSIGNED," \
131
           "  counter INT UNSIGNED," \
131 132
           "  PRIMARY KEY (cloud_key))");
132 133
  error = mysql_query(mysql, query);
133 134
  if (error) {
......
257 258
int process_put_operation(struct mysql_cloud_context *ctx,
258 259
                          mysql_request_t *req)
259 260
{
260
  char raw_stmt[] = "INSERT INTO cloud(cloud_key,cloud_value,timestamp)" \
261
    "VALUES('%s', '%s', %ld) ON DUPLICATE KEY UPDATE "                  \
262
    "cloud_value='%s', timestamp=%ld";
261
  char raw_stmt[] = "INSERT INTO cloud(cloud_key,cloud_value,timestamp, counter)" \
262
    "VALUES('%s', '%s', %ld, 0) ON DUPLICATE KEY UPDATE "                  \
263
    "cloud_value='%s', timestamp=%ld, counter=counter+1";
263 264
  char *stmt;
264 265
  char *escaped_value;
265 266
  int stmt_length;

Also available in: Unified diff