From 981144f6dea630f4fa586164cc7b665576fcb7d5 Mon Sep 17 00:00:00 2001 From: StrikeW Date: Wed, 8 May 2024 17:06:11 +0800 Subject: [PATCH] minor --- src/sqlparser/src/ast/statement.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/sqlparser/src/ast/statement.rs b/src/sqlparser/src/ast/statement.rs index 0c5d0bd87191e..3f437d6d60347 100644 --- a/src/sqlparser/src/ast/statement.rs +++ b/src/sqlparser/src/ast/statement.rs @@ -377,12 +377,10 @@ impl ParseTo for CreateSourceStatement { .find(|&opt| opt.name.real_value() == UPSTREAM_SOURCE_KEY); let connector: String = option.map(|opt| opt.value.to_string()).unwrap_or_default(); let cdc_source_job = connector.contains("-cdc"); - if cdc_source_job { - if !columns.is_empty() || !constraints.is_empty() { - return Err(ParserError::ParserError( - "CDC source cannot define columns and constraints".to_string(), - )); - } + if cdc_source_job && (!columns.is_empty() || !constraints.is_empty()) { + return Err(ParserError::ParserError( + "CDC source cannot define columns and constraints".to_string(), + )); } // row format for nexmark source must be native