From 950184a2c6b6798428133d7eddb8a364e141e6e6 Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Thu, 13 Nov 2025 10:47:17 +0200 Subject: [PATCH] Return parse error if NULLS LAST used in ORDER BY we don't support this yet, so let's not silently ignore it either --- core/translate/select.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/translate/select.rs b/core/translate/select.rs index 19e343e87..7c024cb61 100644 --- a/core/translate/select.rs +++ b/core/translate/select.rs @@ -182,6 +182,13 @@ fn prepare_one_select_plan( query_destination: QueryDestination, connection: &Arc, ) -> Result { + if order_by + .iter() + .filter_map(|o| o.nulls) + .any(|n| n == ast::NullsOrder::Last) + { + crate::bail_parse_error!("NULLS LAST is not supported yet in ORDER BY"); + } match select { ast::OneSelect::Select { mut columns,