Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2012-2013 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | * Zhenkai Zhu <zhenkai@cs.ucla.edu> |
| 20 | */ |
| 21 | |
| 22 | #include "action-log.h" |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 23 | #include <action-item.pb.h> |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 24 | |
| 25 | using namespace boost; |
| 26 | using namespace std; |
| 27 | |
| 28 | ActionLog::ActionLog (const std::string &path, const std::string &localName) |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 29 | : SyncLog (path, localName) |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 30 | { |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 31 | int res = sqlite3_create_function (m_db, "apply_action", -1, SQLITE_ANY, reinterpret_cast<void*> (this), |
| 32 | ActionLog::apply_action_xFun, |
| 33 | 0, 0); |
| 34 | if (res != SQLITE_OK) |
| 35 | { |
| 36 | BOOST_THROW_EXCEPTION (Error::Db () |
| 37 | << errmsg_info_str ("Cannot create function ``apply_action''")); |
| 38 | } |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 39 | } |
| 40 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 41 | tuple<sqlite3_int64, sqlite3_int64, sqlite3_int64, string> |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 42 | ActionLog::GetExistingRecord (const std::string &filename) |
| 43 | { |
| 44 | // check if something already exists |
| 45 | sqlite3_stmt *stmt; |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 46 | int res = sqlite3_prepare_v2 (m_db, "SELECT a.version,a.device_id,a.seq_no,a.action,s.device_name " |
| 47 | "FROM ActionLog a JOIN SyncNodes s ON s.device_id = a.device_id " |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 48 | "WHERE filename=? ORDER BY a.version DESC LIMIT 1", -1, &stmt, 0); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 49 | |
| 50 | if (res != SQLITE_OK) |
| 51 | { |
| 52 | BOOST_THROW_EXCEPTION (Error::Db () |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 53 | << errmsg_info_str ("Some error with GetExistingRecord")); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 54 | } |
| 55 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 56 | // with parent with version number + 1 |
| 57 | sqlite3_int64 version = 0; |
| 58 | sqlite3_int64 parent_device_id = -1; |
| 59 | sqlite3_int64 parent_seq_no = -1; |
| 60 | string parent_device_name; |
| 61 | |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 62 | sqlite3_bind_text (stmt, 1, filename.c_str (), filename.size (), SQLITE_STATIC); |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 63 | if (sqlite3_step (stmt) == SQLITE_ROW) |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 64 | { |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 65 | version = sqlite3_column_int64 (stmt, 0) + 1; |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 66 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 67 | if (sqlite3_column_int (stmt, 3) == 0) // prevent "linking" if the file was previously deleted |
| 68 | { |
| 69 | parent_device_id = sqlite3_column_int64 (stmt, 1); |
| 70 | parent_seq_no = sqlite3_column_int64 (stmt, 2); |
| 71 | parent_device_name = string(reinterpret_cast<const char*> (sqlite3_column_text (stmt, 4))); |
| 72 | } |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 73 | } |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 74 | |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 75 | sqlite3_finalize (stmt); |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 76 | return make_tuple (version, parent_device_id, parent_seq_no, parent_device_name); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 77 | } |
| 78 | |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 79 | // local add action. remote action is extracted from content object |
| 80 | void |
| 81 | ActionLog::AddActionUpdate (const std::string &filename, |
| 82 | const Hash &hash, |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 83 | time_t atime, time_t mtime, time_t ctime, |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 84 | int mode) |
| 85 | { |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 86 | sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 87 | |
| 88 | sqlite3_int64 seq_no = GetNextLocalSeqNo (); |
| 89 | sqlite3_int64 version = 0; |
| 90 | sqlite3_int64 parent_device_id = -1; |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 91 | string parent_device_name; |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 92 | sqlite3_int64 parent_seq_no = -1; |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 93 | |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 94 | sqlite3_int64 action_time = time (0); |
| 95 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 96 | tie (version, parent_device_id, parent_seq_no, parent_device_name) = GetExistingRecord (filename); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 97 | |
| 98 | sqlite3_stmt *stmt; |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 99 | int res = sqlite3_prepare_v2 (m_db, "INSERT INTO ActionLog " |
| 100 | "(device_id, seq_no, action, filename, version, action_timestamp, " |
| 101 | "file_hash, file_atime, file_mtime, file_ctime, file_chmod, " |
| 102 | "parent_device_id, parent_seq_no) " |
| 103 | "VALUES (?, ?, ?, ?, ?, datetime(?, 'unixepoch')," |
| 104 | " ?, datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), ?," |
| 105 | " ?, ?);", -1, &stmt, 0); |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 106 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 107 | // cout << "INSERT INTO ActionLog " |
| 108 | // "(device_id, seq_no, action, filename, version, action_timestamp, " |
| 109 | // "file_hash, file_atime, file_mtime, file_ctime, file_chmod, " |
| 110 | // "parent_device_id, parent_seq_no) " |
| 111 | // "VALUES (?, ?, ?, ?, ?, datetime(?, 'unixepoch')," |
| 112 | // " ?, datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), ?," |
| 113 | // " ?, ?)" << endl; |
| 114 | |
| 115 | if (res != SQLITE_OK) |
| 116 | { |
| 117 | BOOST_THROW_EXCEPTION (Error::Db () |
| 118 | << errmsg_info_str (sqlite3_errmsg (m_db)) |
| 119 | ); |
| 120 | // << errmsg_info_str ("Some error with prepare AddActionUpdate")); |
| 121 | } |
| 122 | |
| 123 | |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 124 | sqlite3_bind_int64 (stmt, 1, m_localDeviceId); |
| 125 | sqlite3_bind_int64 (stmt, 2, seq_no); |
| 126 | sqlite3_bind_int (stmt, 3, 0); |
| 127 | sqlite3_bind_text (stmt, 4, filename.c_str (), filename.size (), SQLITE_TRANSIENT); |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 128 | sqlite3_bind_int64 (stmt, 5, version); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 129 | sqlite3_bind_int64 (stmt, 6, action_time); |
| 130 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 131 | sqlite3_bind_blob (stmt, 7, hash.GetHash (), hash.GetHashBytes (), SQLITE_TRANSIENT); |
| 132 | |
| 133 | sqlite3_bind_int64 (stmt, 8, atime); |
| 134 | sqlite3_bind_int64 (stmt, 9, mtime); |
| 135 | sqlite3_bind_int64 (stmt, 10, ctime); |
| 136 | sqlite3_bind_int (stmt, 11, mode); |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 137 | |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 138 | if (parent_device_id > 0 && parent_seq_no > 0) |
| 139 | { |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 140 | sqlite3_bind_int64 (stmt, 12, parent_device_id); |
| 141 | sqlite3_bind_int64 (stmt, 13, parent_seq_no); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 142 | } |
| 143 | else |
| 144 | { |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 145 | sqlite3_bind_null (stmt, 12); |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 146 | sqlite3_bind_null (stmt, 13); |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | sqlite3_step (stmt); |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 150 | |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 151 | // missing part: creating ContentObject for the action !!! |
| 152 | |
| 153 | ActionItem item; |
| 154 | item.set_action (ActionItem::UPDATE); |
| 155 | item.set_filename (filename); |
| 156 | item.set_version (version); |
| 157 | item.set_timestamp (action_time); |
| 158 | item.set_file_hash (hash.GetHash (), hash.GetHashBytes ()); |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 159 | item.set_atime (atime); |
| 160 | item.set_mtime (mtime); |
| 161 | item.set_ctime (ctime); |
| 162 | item.set_mode (mode); |
| 163 | |
| 164 | if (parent_device_id > 0 && parent_seq_no > 0) |
| 165 | { |
| 166 | item.set_parent_device_name (parent_device_name); |
| 167 | item.set_parent_seq_no (parent_seq_no); |
| 168 | } |
| 169 | |
| 170 | // assign name to the action, serialize action, and create content object |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame] | 171 | |
| 172 | sqlite3_finalize (stmt); |
| 173 | |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 174 | sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0); |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | void |
| 178 | ActionLog::AddActionMove (const std::string &oldFile, const std::string &newFile) |
| 179 | { |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 180 | // not supported yet |
| 181 | BOOST_THROW_EXCEPTION (Error::Db () |
| 182 | << errmsg_info_str ("Move operation is not yet supported")); |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | void |
| 186 | ActionLog::AddActionDelete (const std::string &filename) |
| 187 | { |
Alexander Afanasyev | b6bc01a | 2013-01-02 23:34:20 -0800 | [diff] [blame] | 188 | sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0); |
| 189 | |
| 190 | sqlite3_int64 version = 0; |
| 191 | sqlite3_int64 parent_device_id = -1; |
| 192 | string parent_device_name; |
| 193 | sqlite3_int64 parent_seq_no = -1; |
| 194 | |
| 195 | sqlite3_int64 action_time = time (0); |
| 196 | |
| 197 | tie (version, parent_device_id, parent_seq_no, parent_device_name) = GetExistingRecord (filename); |
| 198 | if (parent_device_id < 0) // no records exist or file was already deleted |
| 199 | { |
| 200 | sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0); |
| 201 | return; |
| 202 | } |
| 203 | |
| 204 | sqlite3_int64 seq_no = GetNextLocalSeqNo (); |
| 205 | |
| 206 | sqlite3_stmt *stmt; |
| 207 | sqlite3_prepare_v2 (m_db, "INSERT INTO ActionLog " |
| 208 | "(device_id, seq_no, action, filename, version, action_timestamp, " |
| 209 | "parent_device_id, parent_seq_no) " |
| 210 | "VALUES (?, ?, ?, ?, ?, datetime(?, 'unixepoch')," |
| 211 | " ?, ?)", -1, &stmt, 0); |
| 212 | |
| 213 | sqlite3_bind_int64 (stmt, 1, m_localDeviceId); |
| 214 | sqlite3_bind_int64 (stmt, 2, seq_no); |
| 215 | sqlite3_bind_int (stmt, 3, 1); |
| 216 | sqlite3_bind_text (stmt, 4, filename.c_str (), filename.size (), SQLITE_TRANSIENT); |
| 217 | sqlite3_bind_int64 (stmt, 5, version); |
| 218 | sqlite3_bind_int64 (stmt, 6, action_time); |
| 219 | |
| 220 | sqlite3_bind_int64 (stmt, 7, parent_device_id); |
| 221 | sqlite3_bind_int64 (stmt, 8, parent_seq_no); |
| 222 | |
| 223 | sqlite3_step (stmt); |
| 224 | |
| 225 | // missing part: creating ContentObject for the action !!! |
| 226 | |
| 227 | ActionItem item; |
| 228 | item.set_action (ActionItem::UPDATE); |
| 229 | item.set_filename (filename); |
| 230 | item.set_version (version); |
| 231 | item.set_timestamp (action_time); |
| 232 | item.set_parent_device_name (parent_device_name); |
| 233 | item.set_parent_seq_no (parent_seq_no); |
| 234 | |
| 235 | // assign name to the action, serialize action, and create content object |
| 236 | |
| 237 | sqlite3_finalize (stmt); |
| 238 | |
| 239 | sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0); |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 240 | } |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 241 | |
| 242 | |
| 243 | void |
| 244 | ActionLog::apply_action_xFun (sqlite3_context *context, int argc, sqlite3_value **argv) |
| 245 | { |
| 246 | ActionLog *the = reinterpret_cast<ActionLog*> (sqlite3_user_data (context)); |
| 247 | |
Alexander Afanasyev | a2f77e9 | 2013-01-03 22:46:52 -0800 | [diff] [blame^] | 248 | if (argc != 8) |
| 249 | { |
| 250 | sqlite3_result_error (context, "``apply_action'' expects 8 arguments", -1); |
| 251 | return; |
| 252 | } |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 253 | |
Alexander Afanasyev | a2f77e9 | 2013-01-03 22:46:52 -0800 | [diff] [blame^] | 254 | // cout << "apply_function called with " << argc << endl; |
| 255 | |
| 256 | // cout << "device_name: " << sqlite3_value_text (argv[0]) << endl; |
| 257 | // cout << "action: " << sqlite3_value_int (argv[1]) << endl; |
| 258 | // cout << "filename: " << sqlite3_value_text (argv[2]) << endl; |
| 259 | |
| 260 | string device_name = reinterpret_cast<const char*> (sqlite3_value_text (argv[0])); |
| 261 | int action = sqlite3_value_int (argv[1]); |
| 262 | string filename = reinterpret_cast<const char*> (sqlite3_value_text (argv[2])); |
| 263 | |
| 264 | if (action == 0) // update |
| 265 | { |
| 266 | Hash hash (sqlite3_value_blob (argv[3]), sqlite3_value_bytes (argv[3])); |
| 267 | time_t atime = static_cast<time_t> (sqlite3_value_int64 (argv[4])); |
| 268 | time_t mtime = static_cast<time_t> (sqlite3_value_int64 (argv[5])); |
| 269 | time_t ctime = static_cast<time_t> (sqlite3_value_int64 (argv[6])); |
| 270 | int mode = sqlite3_value_int (argv[7]); |
| 271 | |
| 272 | cout << "Update " << filename << " " << atime << " " << mtime << " " << ctime << endl; |
| 273 | |
| 274 | sqlite3_stmt *stmt; |
| 275 | sqlite3_prepare_v2 (the->m_db, "UPDATE FileState " |
| 276 | "SET file_hash=?," |
| 277 | "file_atime=datetime(?, 'unixepoch')," |
| 278 | "file_mtime=datetime(?, 'unixepoch')," |
| 279 | "file_ctime=datetime(?, 'unixepoch')," |
| 280 | "file_chmod=? " |
| 281 | "WHERE type=0 AND filename=?", -1, &stmt, 0); |
| 282 | |
| 283 | sqlite3_bind_blob (stmt, 1, hash.GetHash (), hash.GetHashBytes (), SQLITE_TRANSIENT); |
| 284 | sqlite3_bind_int64 (stmt, 2, atime); |
| 285 | sqlite3_bind_int64 (stmt, 3, mtime); |
| 286 | sqlite3_bind_int64 (stmt, 4, ctime); |
| 287 | sqlite3_bind_int (stmt, 5, mode); |
| 288 | sqlite3_bind_text (stmt, 6, filename.c_str (), -1, SQLITE_TRANSIENT); |
| 289 | |
| 290 | sqlite3_step (stmt); |
| 291 | sqlite3_finalize (stmt); |
| 292 | |
| 293 | int affected_rows = sqlite3_changes (the->m_db); |
| 294 | if (affected_rows == 0) // file didn't exist |
| 295 | { |
| 296 | sqlite3_stmt *stmt; |
| 297 | sqlite3_prepare_v2 (the->m_db, "INSERT INTO FileState " |
| 298 | "(type,filename,file_hash,file_atime,file_mtime,file_ctime,file_chmod) " |
| 299 | "VALUES (0, ?, ?, " |
| 300 | "datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), ?)", -1, &stmt, 0); |
| 301 | |
| 302 | sqlite3_bind_text (stmt, 1, filename.c_str (), -1, SQLITE_TRANSIENT); |
| 303 | sqlite3_bind_blob (stmt, 2, hash.GetHash (), hash.GetHashBytes (), SQLITE_TRANSIENT); |
| 304 | sqlite3_bind_int64 (stmt, 3, atime); |
| 305 | sqlite3_bind_int64 (stmt, 4, mtime); |
| 306 | sqlite3_bind_int64 (stmt, 5, ctime); |
| 307 | sqlite3_bind_int (stmt, 6, mode); |
| 308 | |
| 309 | sqlite3_step (stmt); |
| 310 | sqlite3_finalize (stmt); |
| 311 | } |
| 312 | } |
| 313 | else if (action == 1) // delete |
| 314 | { |
| 315 | sqlite3_stmt *stmt; |
| 316 | sqlite3_prepare_v2 (the->m_db, "DELETE FROM FileState WHERE type=0 AND filename=?", -1, &stmt, 0); |
| 317 | sqlite3_bind_text (stmt, 1, filename.c_str (), -1, SQLITE_STATIC); |
| 318 | |
| 319 | cout << "Delete " << filename << endl; |
| 320 | |
| 321 | sqlite3_step (stmt); |
| 322 | sqlite3_finalize (stmt); |
| 323 | } |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 324 | |
| 325 | sqlite3_result_null (context); |
| 326 | } |