From ca37e14530bf9f2846f881f62e91ed97f366f081 Mon Sep 17 00:00:00 2001 From: Ivan Krivosheev Date: Wed, 1 Feb 2023 19:38:13 +0300 Subject: [PATCH] issues-583 Fix ALTER TABLE Sqlite --- src/backend/sqlite/table.rs | 5 ++++- tests/sqlite/table.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/sqlite/table.rs b/src/backend/sqlite/table.rs index 9791c38b3..3eb95acdd 100644 --- a/src/backend/sqlite/table.rs +++ b/src/backend/sqlite/table.rs @@ -111,7 +111,10 @@ impl TableBuilder for SqliteQueryBuilder { fn prepare_table_alter_statement(&self, alter: &TableAlterStatement, sql: &mut dyn SqlWriter) { if alter.options.is_empty() { panic!("No alter option found") - }; + } + if alter.options.len() > 1 { + panic!("Sqlite doesn't support multiple alter options") + } write!(sql, "ALTER TABLE ").unwrap(); if let Some(table) = &alter.table { self.prepare_table_ref_table_stmt(table, sql); diff --git a/tests/sqlite/table.rs b/tests/sqlite/table.rs index 01eaee3b2..e6cb6dfce 100644 --- a/tests/sqlite/table.rs +++ b/tests/sqlite/table.rs @@ -403,6 +403,7 @@ fn alter_6() { } #[test] +#[should_panic(expected = "Sqlite doesn't support multiple alter options")] fn alter_7() { let _ = Table::alter() .table(Font::Table)