STET

agent_patch

runs/2026-02-28__18-27-22__gpt-5-1-codex-mini/flux-pr-1501/flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/agent-logs/agent.patch

27705 bytes

Back to adjudication
diff --git a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/ast/mod.rs b/app/src/ast/mod.rs
index 81bddcd..efb815b 100644
--- a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/ast/mod.rs
+++ b/app/src/ast/mod.rs
@@ -2780,34 +2780,30 @@ pub enum Statement {
         full: bool,
         #[cfg_attr(feature = "visitor", visit(with = "visit_relation"))]
         table_name: ObjectName,
-        filter: Option<ShowStatementFilter>,
+        options: ShowStatementOptions,
     },
     /// ```sql
     /// SHOW DATABASES [LIKE 'pattern']
     /// ```
-    ShowDatabases { filter: Option<ShowStatementFilter> },
+    ShowDatabases { options: ShowStatementOptions },
     /// ```sql
     /// SHOW SCHEMAS [LIKE 'pattern']
     /// ```
-    ShowSchemas { filter: Option<ShowStatementFilter> },
+    ShowSchemas { options: ShowStatementOptions },
     /// ```sql
     /// SHOW TABLES
     /// ```
     ShowTables {
         extended: bool,
         full: bool,
-        clause: Option<ShowClause>,
-        db_name: Option<Ident>,
-        filter: Option<ShowStatementFilter>,
+        options: ShowStatementOptions,
     },
     /// ```sql
     /// SHOW VIEWS
     /// ```
     ShowViews {
         materialized: bool,
-        clause: Option<ShowClause>,
-        db_name: Option<Ident>,
-        filter: Option<ShowStatementFilter>,
+        options: ShowStatementOptions,
     },
     /// ```sql
     /// SHOW COLLATION
@@ -4388,7 +4384,7 @@ impl fmt::Display for Statement {
                 extended,
                 full,
                 table_name,
-                filter,
+                options,
             } => {
                 write!(
                     f,
@@ -4397,31 +4393,23 @@ impl fmt::Display for Statement {
                     full = if *full { "FULL " } else { "" },
                     table_name = table_name,
                 )?;
-                if let Some(filter) = filter {
-                    write!(f, " {filter}")?;
-                }
+                write!(f, "{options}")?;
                 Ok(())
             }
-            Statement::ShowDatabases { filter } => {
+            Statement::ShowDatabases { options } => {
                 write!(f, "SHOW DATABASES")?;
-                if let Some(filter) = filter {
-                    write!(f, " {filter}")?;
-                }
+                write!(f, "{options}")?;
                 Ok(())
             }
-            Statement::ShowSchemas { filter } => {
+            Statement::ShowSchemas { options } => {
                 write!(f, "SHOW SCHEMAS")?;
-                if let Some(filter) = filter {
-                    write!(f, " {filter}")?;
-                }
+                write!(f, "{options}")?;
                 Ok(())
             }
             Statement::ShowTables {
                 extended,
                 full,
-                clause: show_clause,
-                db_name,
-                filter,
+                options,
             } => {
                 write!(
                     f,
@@ -4429,37 +4417,19 @@ impl fmt::Display for Statement {
                     extended = if *extended { "EXTENDED " } else { "" },
                     full = if *full { "FULL " } else { "" },
                 )?;
-                if let Some(show_clause) = show_clause {
-                    write!(f, " {show_clause}")?;
-                }
-                if let Some(db_name) = db_name {
-                    write!(f, " {db_name}")?;
-                }
-                if let Some(filter) = filter {
-                    write!(f, " {filter}")?;
-                }
+                write!(f, "{options}")?;
                 Ok(())
             }
             Statement::ShowViews {
                 materialized,
-                clause: show_clause,
-                db_name,
-                filter,
+                options,
             } => {
                 write!(
                     f,
                     "SHOW {}VIEWS",
                     if *materialized { "MATERIALIZED " } else { "" }
                 )?;
-                if let Some(show_clause) = show_clause {
-                    write!(f, " {show_clause}")?;
-                }
-                if let Some(db_name) = db_name {
-                    write!(f, " {db_name}")?;
-                }
-                if let Some(filter) = filter {
-                    write!(f, " {filter}")?;
-                }
+                write!(f, "{options}")?;
                 Ok(())
             }
             Statement::ShowFunctions { filter } => {
@@ -6187,6 +6157,174 @@ impl fmt::Display for ShowClause {
     }
 }
 
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub enum ShowStatementModifier {
+    Terse,
+    History,
+    External,
+}
+
+impl fmt::Display for ShowStatementModifier {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        use ShowStatementModifier::*;
+        match self {
+            Terse => write!(f, "TERSE"),
+            History => write!(f, "HISTORY"),
+            External => write!(f, "EXTERNAL"),
+        }
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub struct ShowStatementLimit {
+    pub quantity: Expr,
+    pub from: Option<String>,
+}
+
+impl fmt::Display for ShowStatementLimit {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "LIMIT {}", self.quantity)?;
+        if let Some(from) = &self.from {
+            write!(
+                f,
+                " FROM '{}'",
+                value::escape_single_quote_string(from)
+            )?;
+        }
+        Ok(())
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub enum ShowScopeItem {
+    Ident(Ident),
+    Dot,
+}
+
+impl fmt::Display for ShowScopeItem {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            ShowScopeItem::Ident(ident) => write!(f, "{}", ident),
+            ShowScopeItem::Dot => write!(f, "."),
+        }
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub struct ShowStatementScope {
+    pub clause: ShowClause,
+    pub tokens: Vec<ShowScopeItem>,
+}
+
+impl fmt::Display for ShowStatementScope {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}", self.clause)?;
+        let mut needs_space = true;
+        for token in &self.tokens {
+            match token {
+                ShowScopeItem::Dot => {
+                    f.write_str(".")?;
+                    needs_space = false;
+                }
+                ShowScopeItem::Ident(_) => {
+                    if needs_space {
+                        f.write_str(" ")?;
+                    }
+                    write!(f, "{}", token)?;
+                    needs_space = true;
+                }
+            }
+        }
+        Ok(())
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub struct ShowStatementOptions {
+    pub scope: Option<ShowStatementScope>,
+    pub filter: Option<ShowStatementFilter>,
+    pub starts_with: Option<String>,
+    pub limit: Option<ShowStatementLimit>,
+    pub modifiers: Vec<ShowStatementModifier>,
+    pub like_before_scope: bool,
+}
+
+impl ShowStatementOptions {
+    pub fn new(like_before_scope: bool) -> Self {
+        Self {
+            scope: None,
+            filter: None,
+            starts_with: None,
+            limit: None,
+            modifiers: Vec::new(),
+            like_before_scope,
+        }
+    }
+}
+
+impl Default for ShowStatementOptions {
+    fn default() -> Self {
+        Self::new(false)
+    }
+}
+
+impl fmt::Display for ShowStatementOptions {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if self.scope.is_none()
+            && self.filter.is_none()
+            && self.starts_with.is_none()
+            && self.limit.is_none()
+            && self.modifiers.is_empty()
+        {
+            return Ok(());
+        }
+
+        for modifier in &self.modifiers {
+            write!(f, " {}", modifier)?;
+        }
+
+        if self.like_before_scope {
+            if let Some(filter) = &self.filter {
+                write!(f, " {}", filter)?;
+            }
+            if let Some(scope) = &self.scope {
+                write!(f, " {}", scope)?;
+            }
+        } else {
+            if let Some(scope) = &self.scope {
+                write!(f, " {}", scope)?;
+            }
+            if let Some(filter) = &self.filter {
+                write!(f, " {}", filter)?;
+            }
+        }
+
+        if let Some(starts_with) = &self.starts_with {
+            write!(
+                f,
+                " STARTS WITH '{}'",
+                value::escape_single_quote_string(starts_with)
+            )?;
+        }
+
+        if let Some(limit) = &self.limit {
+            write!(f, " {}", limit)?;
+        }
+
+        Ok(())
+    }
+}
+
 /// Sqlite specific syntax
 ///
 /// See [Sqlite documentation](https://sqlite.org/lang_conflict.html)
diff --git a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/dialect/mod.rs b/app/src/dialect/mod.rs
index c8c11bc..301a4dd 100644
--- a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/dialect/mod.rs
+++ b/app/src/dialect/mod.rs
@@ -540,6 +540,11 @@ pub trait Dialect: Debug + Any {
         false
     }
 
+    /// Returns true if the dialect treats `LIKE` as appearing before the scope clause in SHOW statements.
+    fn show_like_before_scope(&self) -> bool {
+        false
+    }
+
     /// Does the dialect support with clause in create index statement?
     /// e.g. `CREATE INDEX idx ON t WITH (key = value, key2)`
     fn supports_create_index_with_clause(&self) -> bool {
diff --git a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/dialect/snowflake.rs b/app/src/dialect/snowflake.rs
index d9331d9..7789357 100644
--- a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/dialect/snowflake.rs
+++ b/app/src/dialect/snowflake.rs
@@ -203,6 +203,10 @@ impl Dialect for SnowflakeDialect {
     fn allow_extract_single_quotes(&self) -> bool {
         true
     }
+
+    fn show_like_before_scope(&self) -> bool {
+        true
+    }
 }
 
 /// Parse snowflake create table statement.
diff --git a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/parser/mod.rs b/app/src/parser/mod.rs
index d3f4320..9dfbc71 100644
--- a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/src/parser/mod.rs
+++ b/app/src/parser/mod.rs
@@ -9665,13 +9665,13 @@ impl<'a> Parser<'a> {
 
     fn parse_show_databases(&mut self) -> Result<Statement, ParserError> {
         Ok(Statement::ShowDatabases {
-            filter: self.parse_show_statement_filter()?,
+            options: self.parse_show_statement_options()?,
         })
     }
 
     fn parse_show_schemas(&mut self) -> Result<Statement, ParserError> {
         Ok(Statement::ShowSchemas {
-            filter: self.parse_show_statement_filter()?,
+            options: self.parse_show_statement_options()?,
         })
     }
 
@@ -9716,12 +9716,12 @@ impl<'a> Parser<'a> {
             }
             None => object_name,
         };
-        let filter = self.parse_show_statement_filter()?;
+        let options = self.parse_show_statement_options()?;
         Ok(Statement::ShowColumns {
             extended,
             full,
             table_name,
-            filter,
+            options,
         })
     }
 
@@ -9730,33 +9730,19 @@ impl<'a> Parser<'a> {
         extended: bool,
         full: bool,
     ) -> Result<Statement, ParserError> {
-        let (clause, db_name) = match self.parse_one_of_keywords(&[Keyword::FROM, Keyword::IN]) {
-            Some(Keyword::FROM) => (Some(ShowClause::FROM), Some(self.parse_identifier(false)?)),
-            Some(Keyword::IN) => (Some(ShowClause::IN), Some(self.parse_identifier(false)?)),
-            _ => (None, None),
-        };
-        let filter = self.parse_show_statement_filter()?;
+        let options = self.parse_show_statement_options()?;
         Ok(Statement::ShowTables {
             extended,
             full,
-            clause,
-            db_name,
-            filter,
+            options,
         })
     }
 
     fn parse_show_views(&mut self, materialized: bool) -> Result<Statement, ParserError> {
-        let (clause, db_name) = match self.parse_one_of_keywords(&[Keyword::FROM, Keyword::IN]) {
-            Some(Keyword::FROM) => (Some(ShowClause::FROM), Some(self.parse_identifier(false)?)),
-            Some(Keyword::IN) => (Some(ShowClause::IN), Some(self.parse_identifier(false)?)),
-            _ => (None, None),
-        };
-        let filter = self.parse_show_statement_filter()?;
+        let options = self.parse_show_statement_options()?;
         Ok(Statement::ShowViews {
             materialized,
-            clause,
-            db_name,
-            filter,
+            options,
         })
     }
 
@@ -9793,6 +9779,181 @@ impl<'a> Parser<'a> {
         }
     }
 
+    fn parse_show_statement_options(&mut self) -> Result<ShowStatementOptions, ParserError> {
+        let mut options = ShowStatementOptions::new(self.dialect.show_like_before_scope());
+        loop {
+            if self.parse_show_modifier(&mut options)? {
+                continue;
+            }
+            if self.parse_show_scope_clause(&mut options)? {
+                continue;
+            }
+            if self.parse_show_filter_clause(&mut options)? {
+                continue;
+            }
+            if self.parse_show_starts_with(&mut options)? {
+                continue;
+            }
+            if self.parse_show_limit_clause(&mut options)? {
+                continue;
+            }
+            break;
+        }
+        Ok(options)
+    }
+
+    fn parse_show_modifier(
+        &mut self,
+        options: &mut ShowStatementOptions,
+    ) -> Result<bool, ParserError> {
+        let modifier = if self.parse_keyword(Keyword::TERSE) {
+            Some(ShowStatementModifier::Terse)
+        } else if self.parse_keyword(Keyword::HISTORY) {
+            Some(ShowStatementModifier::History)
+        } else if self.parse_keyword(Keyword::EXTERNAL) {
+            Some(ShowStatementModifier::External)
+        } else {
+            None
+        };
+
+        if let Some(modifier) = modifier {
+            options.modifiers.push(modifier);
+            return Ok(true);
+        }
+        Ok(false)
+    }
+
+    fn parse_show_scope_clause(
+        &mut self,
+        options: &mut ShowStatementOptions,
+    ) -> Result<bool, ParserError> {
+        if options.scope.is_some() {
+            return Ok(false);
+        }
+        let clause = match self.parse_one_of_keywords(&[Keyword::FROM, Keyword::IN]) {
+            Some(Keyword::FROM) => ShowClause::FROM,
+            Some(Keyword::IN) => ShowClause::IN,
+            None => return Ok(false),
+            _ => unreachable!(),
+        };
+        let tokens = self.parse_show_scope_tokens()?;
+        options.scope = Some(ShowStatementScope { clause, tokens });
+        Ok(true)
+    }
+
+    fn parse_show_scope_tokens(&mut self) -> Result<Vec<ShowScopeItem>, ParserError> {
+        let mut tokens = Vec::new();
+        loop {
+            match &self.peek_token().token {
+                Token::Word(word) => {
+                    if Self::show_scope_terminator(word.keyword) {
+                        break;
+                    }
+                    tokens.push(ShowScopeItem::Ident(self.parse_identifier(false)?));
+                }
+                Token::Char('.') => {
+                    self.next_token();
+                    tokens.push(ShowScopeItem::Dot);
+                }
+                Token::SingleQuotedString(_)
+                | Token::DoubleQuotedString(_)
+                | Token::TripleSingleQuotedString(_)
+                | Token::TripleDoubleQuotedString(_)
+                | Token::DollarQuotedString(_)
+                | Token::SingleQuotedByteStringLiteral(_)
+                | Token::DoubleQuotedByteStringLiteral(_)
+                | Token::TripleSingleQuotedByteStringLiteral(_)
+                | Token::TripleDoubleQuotedByteStringLiteral(_)
+                | Token::SingleQuotedRawStringLiteral(_)
+                | Token::DoubleQuotedRawStringLiteral(_)
+                | Token::TripleSingleQuotedRawStringLiteral(_)
+                | Token::TripleDoubleQuotedRawStringLiteral(_)
+                | Token::NationalStringLiteral(_)
+                | Token::EscapedStringLiteral(_)
+                | Token::UnicodeStringLiteral(_)
+                | Token::HexStringLiteral(_) => break,
+                Token::EOF => break,
+                _ => break,
+            }
+        }
+
+        if tokens.is_empty() {
+            return Err(ParserError::ParserError(
+                \"Expected identifier after IN/FROM\".to_string(),
+            ));
+        }
+
+        Ok(tokens)
+    }
+
+    fn parse_show_filter_clause(
+        &mut self,
+        options: &mut ShowStatementOptions,
+    ) -> Result<bool, ParserError> {
+        if options.filter.is_some() {
+            return Ok(false);
+        }
+        if let Some(filter) = self.parse_show_statement_filter()? {
+            options.filter = Some(filter);
+            return Ok(true);
+        }
+        Ok(false)
+    }
+
+    fn parse_show_starts_with(
+        &mut self,
+        options: &mut ShowStatementOptions,
+    ) -> Result<bool, ParserError> {
+        if !self.parse_keyword(Keyword::STARTS) {
+            return Ok(false);
+        }
+        self.expect_keyword(Keyword::WITH)?;
+        if options.starts_with.is_some() {
+            return Err(ParserError::ParserError(
+                \"SHOW STARTS WITH clause already defined\".to_string(),
+            ));
+        }
+        options.starts_with = Some(self.parse_literal_string()?);
+        Ok(true)
+    }
+
+    fn parse_show_limit_clause(
+        &mut self,
+        options: &mut ShowStatementOptions,
+    ) -> Result<bool, ParserError> {
+        if !self.parse_keyword(Keyword::LIMIT) {
+            return Ok(false);
+        }
+        if options.limit.is_some() {
+            return Err(ParserError::ParserError(
+                \"SHOW LIMIT clause already defined\".to_string(),
+            ));
+        }
+        let quantity = self.parse_expr()?;
+        let from = if self.parse_keyword(Keyword::FROM) {
+            Some(self.parse_literal_string()?)
+        } else {
+            None
+        };
+        options.limit = Some(ShowStatementLimit { quantity, from });
+        Ok(true)
+    }
+
+    fn show_scope_terminator(keyword: Keyword) -> bool {
+        matches!(
+            keyword,
+            Keyword::LIKE
+                | Keyword::ILIKE
+                | Keyword::WHERE
+                | Keyword::STARTS
+                | Keyword::WITH
+                | Keyword::LIMIT
+                | Keyword::TERSE
+                | Keyword::HISTORY
+                | Keyword::EXTERNAL
+        )
+    }
+
     pub fn parse_use(&mut self) -> Result<Statement, ParserError> {
         // Determine which keywords are recognized by the current dialect
         let parsed_keyword = if dialect_of!(self is HiveDialect) {
diff --git a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/tests/sqlparser_mysql.rs b/app/tests/sqlparser_mysql.rs
index 44b2ac6..d47091f 100644
--- a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/tests/sqlparser_mysql.rs
+++ b/app/tests/sqlparser_mysql.rs
@@ -230,7 +230,7 @@ fn parse_show_columns() {
             extended: false,
             full: false,
             table_name: table_name.clone(),
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -239,7 +239,7 @@ fn parse_show_columns() {
             extended: false,
             full: false,
             table_name: ObjectName(vec![Ident::new("mydb"), Ident::new("mytable")]),
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -248,7 +248,7 @@ fn parse_show_columns() {
             extended: true,
             full: false,
             table_name: table_name.clone(),
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -257,7 +257,7 @@ fn parse_show_columns() {
             extended: false,
             full: true,
             table_name: table_name.clone(),
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -266,7 +266,10 @@ fn parse_show_columns() {
             extended: false,
             full: false,
             table_name: table_name.clone(),
-            filter: Some(ShowStatementFilter::Like("pattern".into())),
+            options: ShowStatementOptions {
+                filter: Some(ShowStatementFilter::Like("pattern".into())),
+                ..ShowStatementOptions::default()
+            },
         }
     );
     assert_eq!(
@@ -275,9 +278,12 @@ fn parse_show_columns() {
             extended: false,
             full: false,
             table_name,
-            filter: Some(ShowStatementFilter::Where(
-                mysql_and_generic().verified_expr("1 = 2")
-            )),
+            options: ShowStatementOptions {
+                filter: Some(ShowStatementFilter::Where(
+                    mysql_and_generic().verified_expr("1 = 2")
+                )),
+                ..ShowStatementOptions::default()
+            },
         }
     );
     mysql_and_generic()
@@ -329,9 +335,7 @@ fn parse_show_tables() {
         Statement::ShowTables {
             extended: false,
             full: false,
-            clause: None,
-            db_name: None,
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -339,9 +343,13 @@ fn parse_show_tables() {
         Statement::ShowTables {
             extended: false,
             full: false,
-            clause: Some(ShowClause::FROM),
-            db_name: Some(Ident::new("mydb")),
-            filter: None,
+            options: ShowStatementOptions {
+                scope: Some(ShowStatementScope {
+                    clause: ShowClause::FROM,
+                    tokens: vec![ShowScopeItem::Ident(Ident::new("mydb"))],
+                }),
+                ..ShowStatementOptions::default()
+            },
         }
     );
     assert_eq!(
@@ -349,9 +357,7 @@ fn parse_show_tables() {
         Statement::ShowTables {
             extended: true,
             full: false,
-            clause: None,
-            db_name: None,
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -359,9 +365,7 @@ fn parse_show_tables() {
         Statement::ShowTables {
             extended: false,
             full: true,
-            clause: None,
-            db_name: None,
-            filter: None,
+            options: ShowStatementOptions::default(),
         }
     );
     assert_eq!(
@@ -369,9 +373,10 @@ fn parse_show_tables() {
         Statement::ShowTables {
             extended: false,
             full: false,
-            clause: None,
-            db_name: None,
-            filter: Some(ShowStatementFilter::Like("pattern".into())),
+            options: ShowStatementOptions {
+                filter: Some(ShowStatementFilter::Like("pattern".into())),
+                ..ShowStatementOptions::default()
+            },
         }
     );
     assert_eq!(
@@ -379,11 +384,12 @@ fn parse_show_tables() {
         Statement::ShowTables {
             extended: false,
             full: false,
-            clause: None,
-            db_name: None,
-            filter: Some(ShowStatementFilter::Where(
-                mysql_and_generic().verified_expr("1 = 2")
-            )),
+            options: ShowStatementOptions {
+                filter: Some(ShowStatementFilter::Where(
+                    mysql_and_generic().verified_expr("1 = 2")
+                )),
+                ..ShowStatementOptions::default()
+            },
         }
     );
     mysql_and_generic().verified_stmt("SHOW TABLES IN mydb");
diff --git a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/tests/sqlparser_snowflake.rs b/app/tests/sqlparser_snowflake.rs
index c17c7b9..dc15dea 100644
--- a/tmp/agent-patch-flux-pr-1501.1-of-1.2026-02-28__18-27-22__gpt-5-1-codex-mini/app/tests/sqlparser_snowflake.rs
+++ b/app/tests/sqlparser_snowflake.rs
@@ -1247,6 +1247,61 @@ fn test_array_agg_func() {
     }
 }
 
+#[test]
+fn parse_snowflake_show_tables_options() {
+    let stmt = snowflake()
+        .verified_stmt("SHOW TERSE HISTORY TABLES LIKE 'pat' IN ACCOUNT STARTS WITH 'pre' LIMIT 5 FROM 'marker'");
+    assert_eq!(
+        stmt,
+        Statement::ShowTables {
+            extended: false,
+            full: false,
+            options: ShowStatementOptions {
+                modifiers: vec![
+                    ShowStatementModifier::Terse,
+                    ShowStatementModifier::History,
+                ],
+                filter: Some(ShowStatementFilter::Like("pat".into())),
+                scope: Some(ShowStatementScope {
+                    clause: ShowClause::IN,
+                    tokens: vec![ShowScopeItem::Ident(Ident::new("ACCOUNT"))],
+                }),
+                starts_with: Some("pre".into()),
+                limit: Some(ShowStatementLimit {
+                    quantity: Expr::Value(Value::Number("5".into(), false)),
+                    from: Some("marker".into()),
+                }),
+                like_before_scope: true,
+            },
+        }
+    );
+}
+
+#[test]
+fn parse_snowflake_show_tables_scope_tokens() {
+    assert_eq!(
+        snowflake().verified_stmt("SHOW TABLES IN DATABASE mydb LIKE 'x'"),
+        Statement::ShowTables {
+            extended: false,
+            full: false,
+            options: ShowStatementOptions {
+                modifiers: vec![],
+                filter: Some(ShowStatementFilter::Like("x".into())),
+                scope: Some(ShowStatementScope {
+                    clause: ShowClause::IN,
+                    tokens: vec![
+                        ShowScopeItem::Ident(Ident::new("DATABASE")),
+                        ShowScopeItem::Ident(Ident::new("mydb")),
+                    ],
+                }),
+                starts_with: None,
+                limit: None,
+                like_before_scope: true,
+            },
+        }
+    );
+}
+
 fn snowflake() -> TestedDialects {
     TestedDialects::new(vec![Box::new(SnowflakeDialect {})])
 }