Revision 50d0a6b4 src/sql/LogDB.cc

View differences:

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