Revision 50d0a6b4

View differences:

src/raft/FedReplicaManager.cc
24 24

  
25 25
const char * FedReplicaManager::table = "fed_logdb";
26 26

  
27
const char * FedReplicaManager::db_names = "log_index, sql";
27
const char * FedReplicaManager::db_names = "log_index, sqlcmd";
28 28

  
29 29
const char * FedReplicaManager::db_bootstrap = "CREATE TABLE IF NOT EXISTS "
30
        "fed_logdb (log_index INTEGER PRIMARY KEY, sql MEDIUMTEXT)";
30
        "fed_logdb (log_index INTEGER PRIMARY KEY, sqlcmd MEDIUMTEXT)";
31 31

  
32 32
const time_t FedReplicaManager::xmlrpc_timeout_ms = 10000;
33 33

  
......
355 355

  
356 356
    single_cb<std::string> cb;
357 357

  
358
    oss << "SELECT sql FROM fed_logdb WHERE log_index = " << index;
358
    oss << "SELECT sqlcmd FROM fed_logdb WHERE log_index = " << index;
359 359

  
360 360
    cb.set_callback(&sql);
361 361

  
......
394 394

  
395 395
    single_cb<unsigned int> cb;
396 396

  
397
    oss << "SELECT sql FROM fed_logdb WHERE log_index = -1";
397
    oss << "SELECT sqlcmd FROM fed_logdb WHERE log_index = -1";
398 398

  
399 399
    cb.set_callback(&index);
400 400

  
src/sql/LogDB.cc
25 25

  
26 26
const char * LogDB::table = "logdb";
27 27

  
28
const char * LogDB::db_names = "log_index, term, sql, timestamp";
28
const char * LogDB::db_names = "log_index, term, sqlcmd, timestamp";
29 29

  
30 30
const char * LogDB::db_bootstrap = "CREATE TABLE IF NOT EXISTS "
31
    "logdb (log_index INTEGER PRIMARY KEY, term INTEGER, sql MEDIUMTEXT, "
31
    "logdb (log_index INTEGER PRIMARY KEY, term INTEGER, sqlcmd MEDIUMTEXT, "
32 32
    "timestamp INTEGER)";
33 33

  
34 34
/* -------------------------------------------------------------------------- */
......
173 173
        prev_index = 0;
174 174
    }
175 175

  
176
    oss << "SELECT c.log_index, c.term, c.sql, c.timestamp, p.log_index, p.term"
176
    oss << "SELECT c.log_index, c.term, c.sqlcmd,"
177
        << " c.timestamp, p.log_index, p.term"
177 178
        << " FROM logdb c, logdb p WHERE c.log_index = " << index
178 179
        << " AND p.log_index = " << prev_index;
179 180

  
......
208 209

  
209 210
    single_cb<std::string> cb;
210 211

  
211
    oss << "SELECT sql FROM logdb WHERE log_index = -1 AND term = -1";
212
    oss << "SELECT sqlcmd FROM logdb WHERE log_index = -1 AND term = -1";
212 213

  
213 214
    cb.set_callback(&raft_xml);
214 215

  
......
238 239
        return -1;
239 240
    }
240 241

  
241
    oss << "UPDATE logdb SET sql ='" << sql_db << "' WHERE log_index = -1";
242
    oss << "UPDATE logdb SET sqlcmd ='" << sql_db << "' WHERE log_index = -1";
242 243

  
243 244
    db->free_str(sql_db);
244 245

  

Also available in: Unified diff