rem:  mSelectEventsByRange = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?)"); mSelectEventsByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?) LIMIT ?"); 
add:  mSelectEventsByRange = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_end >= ? AND time_start <= ?)"); mSelectEventsByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_end >= ? AND time_start <= ?) LIMIT ?"); 
context:     initDB: function () {        // these are columns that appear in all concrete items; SQLite could use        // an "extends" thing like postgresql has        const item_base_columns =            "hashid, time_created, last_modified, " +            "title, priority, flags, location, categories, " +            "alarm_data, alarm_time, " +            "recur_type, recur_interval, recur_data, recur_end, recur_flags";        try {            mDB.createTable ("cal_events",                             item_base_columns + ", " +                             "time_start, time_end");        } catch (e) { }        try {            mDB.createTable ("cal_todos",                             item_base_columns + ", " +                             "time_entry, time_due, time_completed, percent_complete");        } catch (e) { }        try {            mDB.createTable ("cal_recur_exceptions",                             "item_id, skip_date");        } catch (e) { }        try {            mDB.createTable ("cal_event_attendees",                             "event_id, attendee, attendee_status");        } catch (e) { }        try {            mDB.createTable ("cal_event_attachments",                             "event_id, attachment_type, attachment_data");        } catch (e) { }        try {            mDB.executeSimpleSQL ("CREATE INDEX cal_events_hash_idx ON cal_events.hashid");        } catch (e) { }        var qs;        // event statements        mSelectEventByHash = mDB.createStatement ("SELECT * FROM cal_events WHERE hashid = ? LIMIT 1");        mSelectEventByOid = mDB.createStatement ("SELECT * FROM cal_events WHERE oid = ? LIMIT 1");        // this needs to have the range bound like this: start, end, start, start, end, end        mSelectEventsByRange = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?)");        mSelectEventsByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_events WHERE (time_start >= ? AND time_end <= ?) OR (time_start <= ? AND time_end > ?) OR (time_start <= ? AND time_end <= ?) LIMIT ?");        mDeleteEventByHash = mDB.createStatement ("DELETE FROM cal_events WHERE hashid = ?");        qs = "?"; for (var i = 1; i < EV_COLUMN_COUNTER; i++) qs += ",?";        mInsertEvent = mDB.createStatement ("INSERT INTO cal_events VALUES (" + qs + ")");        // todo statements        mSelectTodoByHash = mDB.createStatement ("SELECT * FROM cal_todos WHERE hashid = ? LIMIT 1");        mSelectTodoByOid = mDB.createStatement ("SELECT * from cal_todos WHERE oid = ? LIMIT 1");        mSelectTodosByRange = mDB.createStatement ("SELECT * FROM cal_todos WHERE (time_entry >= ? AND time_entry <= time_end)");        mSelectTodosByRangeAndLimit = mDB.createStatement ("SELECT * FROM cal_todos WHERE (time_entry >= ? AND time_entry <= time_end) LIMIT ?");        mDeleteTodoByHash = mDB.createStatement ("DELETE FROM cal_todos WHERE hashid = ?");        qs = "?"; for (var i = 1; i < TODO_COLUMN_COUNTER; i++) qs += ",?";        mInsertTodo = mDB.createStatement ("INSERT INTO cal_todos VALUES (" + qs + ")");    },
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/3ed5153e77d21e9a1d4b8c6e12e1eb27561e61fc/calStorageCalendar.js/buggy/calendar/providers/storage/calStorageCalendar.js