summary refs log tree commit diff
path: root/litterbox.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-30 22:24:44 -0500
committerJune McEnroe <june@causal.agency>2019-12-30 22:24:44 -0500
commitd7f2a52abfefbe2a794a13b98645400143b475ee (patch)
treecf9062820c427fb8d889b2a31727a6fa0d47a998 /litterbox.c
parentUse X macro for Type enum (diff)
downloadlitterbox-d7f2a52abfefbe2a794a13b98645400143b475ee.tar.gz
litterbox-d7f2a52abfefbe2a794a13b98645400143b475ee.zip
Order results by ID in outer query in litterbox
Diffstat (limited to 'litterbox.c')
-rw-r--r--litterbox.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/litterbox.c b/litterbox.c
index 3ede752..af531ff 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -216,7 +216,8 @@ static void querySearch(struct Message *msg) {
 					ELSE names.user
 				END,
 				events.target,
-				highlight(search, 6, :bold, :bold)
+				highlight(search, 6, :bold, :bold),
+				events.event
 			FROM events
 			JOIN contexts ON contexts.context = events.context
 			JOIN names ON names.name = events.name
@@ -227,7 +228,7 @@ static void querySearch(struct Message *msg) {
 			ORDER BY events.time DESC, events.event DESC
 			LIMIT :limit
 		)
-		SELECT * FROM results ORDER BY context, time;
+		SELECT * FROM results ORDER BY context, time, event;
 	);
 	dbPersist(&stmt, sql);
 	dbBindText(stmt, ":bold", "\2");