We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52a0dbf commit 2f76026Copy full SHA for 2f76026
history.go
@@ -83,13 +83,13 @@ func (h *history) addCommand(command string) error {
83
func (h *history) getRecentCommand(prefix string, index uint32) (string, error) {
84
var command string
85
86
- // Searching for commands matching the prefix using BETWEEN
+ // Searching for commands matching the prefix using comparisons
87
// is much better than using LIKE because it is case sensitive,
88
// doesn't require escaping, and makes use of the index.
89
err := h.QueryRow(`
90
91
SELECT command FROM history
92
- WHERE command BETWEEN ? AND ?
+ WHERE command > ? AND command <= ?
93
ORDER BY time DESC, rowid
94
LIMIT 1 OFFSET ?;
95
0 commit comments