From 0727f4aca68f2d34c467206f0f5f65110f2275c2 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 24 Mar 2025 10:38:55 +0200 Subject: [PATCH] core: Move temporary table handling to translate_create_table() --- core/translate/mod.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/translate/mod.rs b/core/translate/mod.rs index 516685a13..738011d6d 100644 --- a/core/translate/mod.rs +++ b/core/translate/mod.rs @@ -69,13 +69,14 @@ pub fn translate( if_not_exists, tbl_name, body, - } => { - if temporary { - bail_parse_error!("TEMPORARY table not supported yet"); - } - - translate_create_table(query_mode, tbl_name, *body, if_not_exists, schema)? - } + } => translate_create_table( + query_mode, + tbl_name, + temporary, + *body, + if_not_exists, + schema, + )?, ast::Stmt::CreateTrigger { .. } => bail_parse_error!("CREATE TRIGGER not supported yet"), ast::Stmt::CreateView { .. } => bail_parse_error!("CREATE VIEW not supported yet"), ast::Stmt::CreateVirtualTable(vtab) => { @@ -394,10 +395,14 @@ fn check_automatic_pk_index_required( fn translate_create_table( query_mode: QueryMode, tbl_name: ast::QualifiedName, + temporary: bool, body: ast::CreateTableBody, if_not_exists: bool, schema: &Schema, ) -> Result { + if temporary { + bail_parse_error!("TEMPORARY table not supported yet"); + } let mut program = ProgramBuilder::new(ProgramBuilderOpts { query_mode, num_cursors: 1,