You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by lu...@apache.org on 2026/10/17 16:06:12 UTC
(datafusion-sqlparser-rs) branch upstream/sqlite-insert-value updated (9d231b964 -> f93787238)
This is an automated email from the ASF dual-hosted git repository.
LucaCappelletti94 pushed a change to branch upstream/sqlite-insert-value
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
discard 9d231b964 SQLite: Reject VALUE as a synonym of VALUES
add e790703ab Parser: fix exponential parse time on nested POSITION calls (#2619)
add dacdbc99c ClickHouse: Support GLOBAL IN / GLOBAL NOT IN (#2598)
add 5d1eaf352 Assert exact errors in negative tests (1/4): PostgreSQL tests (#2628)
add 5d653a257 ci: raise the merge queue status check timeout to 360 minutes (#2638)
add 7cac9e17a MySQL: Add support for `ZEROFILL` on numeric data types (#2636)
add fef1e355f Postgres: support OVERRIDING { SYSTEM | USER } VALUE in INSERT (#2626)
add 92e88502a ClickHouse: Support ON CLUSTER and SETTINGS in DELETE and UPDATE (#2617)
add a6f518bf7 Bump serde_json from 1.0.151 to 1.0.154 (#2637)
add 6434b5a22 Assert exact errors in negative tests (2/4): common and parser unit tests (#2629)
add f1854e47e Assert exact errors in negative tests (3/4): dialect tests (#2630)
add a80289f9f Assert exact errors in negative tests (4/4): deny clippy::assertions_on_result_states (#2631)
add de737560d Deny `clippy::manual_assert_eq` (#2644)
add f88f68507 Parser: Fix array suffixes after a `>>` that closes two nested types (#2643)
add 942f36afc SQLite: Support comma-separated WITHOUT ROWID and STRICT table options (#2575)
add c62f01d93 PostgreSQL: Remove unreachable empty op_types branch in operator FUNCTION items (#2632)
add 8338588e9 Commit the fuzz crate's Cargo.lock (#2647)
add 7d34c89b7 Deny `clippy::should_panic_without_expect` (#2648)
add 66d90faaa SetExpr: apply recursive-protection to Display (#2623)
add dcbc923dd MySQL: Bind && with the precedence of AND (#2576)
add c98351352 Postgres: Support aliases for JOIN USING (#2492)
add 0ab37b9e2 SQLite: Support `$` inside identifiers (#2554)
add 5a975d0f4 Deny `clippy::ignore_without_reason` (#2652)
add 7b5821dd4 Deny `clippy::allow_attributes` and `allow_attributes_without_reason` (#2653)
add 1aabd12d1 Add `Dialect::supports_cte_materialization` and enable it for DuckDB (#2651)
new f93787238 Accept `VALUE` as a synonym of `VALUES` only in MySQL
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (9d231b964)
\
N -- N -- N refs/heads/upstream/sqlite-insert-value (f93787238)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.asf.yaml | 37 +
.github/dependabot.yml | 5 +
Cargo.lock | 4 +-
Cargo.toml | 8 +
fuzz/.gitignore | 1 -
fuzz/Cargo.lock | 1139 ++++++++++++++++++++++++++++++
fuzz/fuzz_seeds/clickhouse_delete.sql | 5 +
fuzz/fuzz_seeds/clickhouse_global_in.sql | 63 ++
fuzz/fuzz_seeds/clickhouse_update.sql | 5 +
src/ast/data_type.rs | 5 +
src/ast/ddl.rs | 62 +-
src/ast/dml.rs | 56 ++
src/ast/helpers/stmt_create_table.rs | 31 +-
src/ast/mod.rs | 38 +-
src/ast/query.rs | 7 +-
src/ast/spans.rs | 71 +-
src/dialect/clickhouse.rs | 5 +
src/dialect/duckdb.rs | 4 +
src/dialect/generic.rs | 8 +
src/dialect/mod.rs | 51 +-
src/dialect/mysql.rs | 20 +-
src/dialect/postgresql.rs | 4 +
src/dialect/snowflake.rs | 6 +-
src/dialect/sqlite.rs | 7 +-
src/keywords.rs | 7 +-
src/lib.rs | 9 +-
src/parser/mod.rs | 219 +++++-
src/tokenizer.rs | 5 +-
tests/no_std_recursion.rs | 14 +-
tests/sqlparser_bigquery.rs | 39 +-
tests/sqlparser_clickhouse.rs | 320 ++++++++-
tests/sqlparser_common.rs | 682 ++++++++++++------
tests/sqlparser_custom_dialect.rs | 22 +-
tests/sqlparser_databricks.rs | 39 +-
tests/sqlparser_derive_dialect.rs | 12 +-
tests/sqlparser_duckdb.rs | 15 +-
tests/sqlparser_mssql.rs | 87 ++-
tests/sqlparser_mysql.rs | 213 ++++--
tests/sqlparser_postgres.rs | 992 +++++++++++++-------------
tests/sqlparser_redshift.rs | 10 +-
tests/sqlparser_regression.rs | 3 +-
tests/sqlparser_snowflake.rs | 172 +++--
tests/sqlparser_sqlite.rs | 140 +++-
tests/sqlparser_teradata.rs | 10 +-
44 files changed, 3606 insertions(+), 1046 deletions(-)
create mode 100644 fuzz/Cargo.lock
create mode 100644 fuzz/fuzz_seeds/clickhouse_delete.sql
create mode 100644 fuzz/fuzz_seeds/clickhouse_global_in.sql
create mode 100644 fuzz/fuzz_seeds/clickhouse_update.sql
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion-sqlparser-rs) 01/01: Accept `VALUE` as a synonym of `VALUES` only in MySQL
Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
LucaCappelletti94 pushed a commit to branch upstream/sqlite-insert-value
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
commit f937872385699125764d3fca14f1e1b583b8b6b0
Author: LucaCappelletti94 <ca...@gmail.com>
AuthorDate: Fri Oct 2 21:59:12 2026 +0200
Accept `VALUE` as a synonym of `VALUES` only in MySQL
---
src/dialect/generic.rs | 4 ++++
src/dialect/mod.rs | 7 +++++++
src/dialect/mysql.rs | 4 ++++
src/parser/mod.rs | 4 +++-
tests/sqlparser_common.rs | 16 +++++++++++++++-
5 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/dialect/generic.rs b/src/dialect/generic.rs
index 694eb8f19..b94038617 100644
--- a/src/dialect/generic.rs
+++ b/src/dialect/generic.rs
@@ -173,6 +173,10 @@ impl Dialect for GenericDialect {
true
}
+ fn supports_singular_value_keyword(&self) -> bool {
+ true
+ }
+
fn supports_comment_on(&self) -> bool {
true
}
diff --git a/src/dialect/mod.rs b/src/dialect/mod.rs
index f7c54a9b7..67b3e2afc 100644
--- a/src/dialect/mod.rs
+++ b/src/dialect/mod.rs
@@ -1486,6 +1486,13 @@ pub trait Dialect: Debug + Any {
false
}
+ /// Returns true if the dialect accepts `VALUE` as a synonym of `VALUES`.
+ ///
+ /// [MySQL](https://dev.mysql.com/doc/refman/8.4/en/insert.html)
+ fn supports_singular_value_keyword(&self) -> bool {
+ false
+ }
+
/// Returns true if this dialect supports `SET` statements without an explicit
/// assignment operator such as `=`. For example: `SET SHOWPLAN_XML ON`.
fn supports_set_stmt_without_operator(&self) -> bool {
diff --git a/src/dialect/mysql.rs b/src/dialect/mysql.rs
index b85b43f58..2aaafc145 100644
--- a/src/dialect/mysql.rs
+++ b/src/dialect/mysql.rs
@@ -90,6 +90,10 @@ impl Dialect for MySqlDialect {
true
}
+ fn supports_singular_value_keyword(&self) -> bool {
+ true
+ }
+
/// see <https://dev.mysql.com/doc/refman/8.4/en/comments.html>
fn supports_multiline_comment_hints(&self) -> bool {
true
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index 340b2d077..56b97ca80 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -15405,7 +15405,9 @@ impl<'a> Parser<'a> {
} else if self.parse_keyword(Keyword::VALUES) {
let is_mysql = dialect_of!(self is MySqlDialect);
SetExpr::Values(self.parse_values(is_mysql, false)?)
- } else if self.parse_keyword(Keyword::VALUE) {
+ } else if self.dialect.supports_singular_value_keyword()
+ && self.parse_keyword(Keyword::VALUE)
+ {
let is_mysql = dialect_of!(self is MySqlDialect);
SetExpr::Values(self.parse_values(is_mysql, true)?)
} else if self.parse_keyword(Keyword::TABLE) {
diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs
index 1959bcd34..39222691b 100644
--- a/tests/sqlparser_common.rs
+++ b/tests/sqlparser_common.rs
@@ -161,7 +161,9 @@ fn parse_insert_values() {
expected_rows: &[Parens<Vec<Expr>>],
expected_value_keyword: bool,
) {
- match verified_stmt(sql) {
+ let dialects =
+ all_dialects_where(|d| !expected_value_keyword || d.supports_singular_value_keyword());
+ match dialects.verified_stmt(sql) {
Statement::Insert(Insert {
table: table_name,
columns,
@@ -20699,3 +20701,15 @@ fn parse_cte_materialization() {
}
}
}
+
+#[test]
+fn parse_singular_value_keyword() {
+ let sql = "INSERT INTO t (a) VALUE (1)";
+ all_dialects_where(|d| d.supports_singular_value_keyword()).verified_stmt(sql);
+ assert_eq!(
+ all_dialects_where(|d| !d.supports_singular_value_keyword()).parse_sql_statements(sql),
+ Err(ParserError::ParserError(
+ "Expected: SELECT, VALUES, or a subquery in the query body, found: VALUE".to_string()
+ ))
+ );
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org