Skip to content

Commit 963e89f

Browse files
Merge branch 'main' into sqlite-trigger
2 parents cb9ec89 + 0fb3b6b commit 963e89f

25 files changed

+2172
-726
lines changed

CHANGELOG.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,4 @@ technically be breaking and thus will result in a `0.(N+1)` version.
2828

2929

3030
- Unreleased: Check https://github.com/sqlparser-rs/sqlparser-rs/commits/main for undocumented changes.
31-
- `0.56.0`: [changelog/0.56.0.md](changelog/0.56.0.md)
32-
- `0.55.0`: [changelog/0.55.0.md](changelog/0.55.0.md)
33-
- `0.54.0`: [changelog/0.54.0.md](changelog/0.54.0.md)
34-
- `0.53.0`: [changelog/0.53.0.md](changelog/0.53.0.md)
35-
- `0.52.0`: [changelog/0.52.0.md](changelog/0.52.0.md)
36-
- `0.51.0` and earlier: [changelog/0.51.0-pre.md](changelog/0.51.0-pre.md)
31+
- Past releases: See https://github.com/apache/datafusion-sqlparser-rs/tree/main/changelog

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[package]
1919
name = "sqlparser"
2020
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
21-
version = "0.58.0"
21+
version = "0.59.0"
2222
authors = ["Apache DataFusion <[email protected]>"]
2323
homepage = "https://github.com/apache/datafusion-sqlparser-rs"
2424
documentation = "https://docs.rs/sqlparser/"

changelog/0.59.0.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# sqlparser-rs 0.59.0 Changelog
21+
22+
This release consists of 59 commits from 22 contributors. See credits at the end of this changelog for more information.
23+
24+
**Implemented enhancements:**
25+
26+
- feat: support export data for bigquery [#1976](https://github.com/apache/datafusion-sqlparser-rs/pull/1976) (chenkovsky)
27+
- feat: support multi value columns and aliases in unpivot [#1969](https://github.com/apache/datafusion-sqlparser-rs/pull/1969) (chenkovsky)
28+
- feat: Include end token in `ALTER TABLE` statement [#1999](https://github.com/apache/datafusion-sqlparser-rs/pull/1999) (IndexSeek)
29+
- feat: support multiple value for pivot [#1970](https://github.com/apache/datafusion-sqlparser-rs/pull/1970) (chenkovsky)
30+
- feat: Add `ALTER SCHEMA` support [#1980](https://github.com/apache/datafusion-sqlparser-rs/pull/1980) (chenkovsky)
31+
- feat: MERGE statements: add RETURNING and OUTPUT without INTO [#2011](https://github.com/apache/datafusion-sqlparser-rs/pull/2011) (lovasoa)
32+
- feat: support postgres alter schema [#2038](https://github.com/apache/datafusion-sqlparser-rs/pull/2038) (chenkovsky)
33+
34+
**Fixed bugs:**
35+
36+
- fix: begin statement for bigquery [#1975](https://github.com/apache/datafusion-sqlparser-rs/pull/1975) (chenkovsky)
37+
- fix: update DuckDB and ClickHouse documentation links [#1978](https://github.com/apache/datafusion-sqlparser-rs/pull/1978) (IndexSeek)
38+
39+
**Other:**
40+
41+
- MySQL: Support `EXPLAIN ANALYZE` format variants [#1945](https://github.com/apache/datafusion-sqlparser-rs/pull/1945) (yoavcloud)
42+
- Add support for `NOT NULL` and `NOTNULL` expressions [#1927](https://github.com/apache/datafusion-sqlparser-rs/pull/1927) (ryanschneider)
43+
- Snowflake: Support `CLONE` option in `CREATE DATABASE/SCHEMA` statements [#1958](https://github.com/apache/datafusion-sqlparser-rs/pull/1958) (yoavcloud)
44+
- Add support for `GRANT DROP` statement [#1959](https://github.com/apache/datafusion-sqlparser-rs/pull/1959) (yoavcloud)
45+
- Snowflake: Add support for `CREATE USER` [#1950](https://github.com/apache/datafusion-sqlparser-rs/pull/1950) (yoavcloud)
46+
- Postgres: Support parenthesized `SET` options for `ALTER TABLE` [#1947](https://github.com/apache/datafusion-sqlparser-rs/pull/1947) (achristmascarl)
47+
- Snowflake: Support IDENTIFIER for GRANT ROLE [#1957](https://github.com/apache/datafusion-sqlparser-rs/pull/1957) (yoavcloud)
48+
- Snowflake: Numeric prefix for stage name part [#1966](https://github.com/apache/datafusion-sqlparser-rs/pull/1966) (yoavcloud)
49+
- Snowflake: Support `GRANT CREATE SCHEMA` `GRANT .. ON ALL FUNCTIONS IN SCHEMA` [#1964](https://github.com/apache/datafusion-sqlparser-rs/pull/1964) (yoavcloud)
50+
- Snowflake: DROP STREAM [#1973](https://github.com/apache/datafusion-sqlparser-rs/pull/1973) (yoavcloud)
51+
- Add ODBC escape syntax support for time expressions [#1953](https://github.com/apache/datafusion-sqlparser-rs/pull/1953) (etgarperets)
52+
- Add support for `SHOW CHARSET` [#1974](https://github.com/apache/datafusion-sqlparser-rs/pull/1974) (etgarperets)
53+
- Snowflake: Support `CREATE VIEW myview IF NOT EXISTS` [#1961](https://github.com/apache/datafusion-sqlparser-rs/pull/1961) (etgarperets)
54+
- Update criterion requirement from 0.6 to 0.7 in /sqlparser_bench [#1981](https://github.com/apache/datafusion-sqlparser-rs/pull/1981) (dependabot[bot])
55+
- Snowflake: Improve support for reserved keywords for table factor [#1942](https://github.com/apache/datafusion-sqlparser-rs/pull/1942) (yoavcloud)
56+
- MySQL: Allow optional `SIGNED` suffix on integer data types [#1985](https://github.com/apache/datafusion-sqlparser-rs/pull/1985) (mvzink)
57+
- Fix placeholder spans [#1979](https://github.com/apache/datafusion-sqlparser-rs/pull/1979) (xitep)
58+
- Snowflake create database [#1939](https://github.com/apache/datafusion-sqlparser-rs/pull/1939) (osipovartem)
59+
- Postgres: Support `INTERVAL` data type options [#1984](https://github.com/apache/datafusion-sqlparser-rs/pull/1984) (mvzink)
60+
- MySQL: Support comma-separated `CREATE TABLE` options [#1989](https://github.com/apache/datafusion-sqlparser-rs/pull/1989) (mvzink)
61+
- MySQL: Support `ALTER TABLE RENAME AS` [#1965](https://github.com/apache/datafusion-sqlparser-rs/pull/1965) (altmannmarcelo)
62+
- Improve MySQL `CREATE TRIGGER` parsing [#1998](https://github.com/apache/datafusion-sqlparser-rs/pull/1998) (mvzink)
63+
- Snowflake - support table function in table factor (regression) [#1996](https://github.com/apache/datafusion-sqlparser-rs/pull/1996) (tomershaniii)
64+
- Improve MySQL option parsing in index definitions [#1997](https://github.com/apache/datafusion-sqlparser-rs/pull/1997) (mvzink)
65+
- Add support for `UPDATE ... LIMIT ...` [#1991](https://github.com/apache/datafusion-sqlparser-rs/pull/1991) (xtuc)
66+
- Postgres: enhance NUMERIC/DECIMAL parsing to support negative scale [#1990](https://github.com/apache/datafusion-sqlparser-rs/pull/1990) (IndexSeek)
67+
- Fix column definition `COLLATE` parsing [#1986](https://github.com/apache/datafusion-sqlparser-rs/pull/1986) (mvzink)
68+
- Redshift: CREATE TABLE ... (LIKE ..) [#1967](https://github.com/apache/datafusion-sqlparser-rs/pull/1967) (yoavcloud)
69+
- Add drop behavior to `DROP PRIMARY/FOREIGN KEY` [#2002](https://github.com/apache/datafusion-sqlparser-rs/pull/2002) (yoavcloud)
70+
- Redshift: Add support for IAM_ROLE and IGNOREHEADER COPY options [#1968](https://github.com/apache/datafusion-sqlparser-rs/pull/1968) (yoavcloud)
71+
- Snowflake: Add support for `CREATE DYNAMIC TABLE` [#1960](https://github.com/apache/datafusion-sqlparser-rs/pull/1960) (yoavcloud)
72+
- Add support for VACUUM in Redshift [#2005](https://github.com/apache/datafusion-sqlparser-rs/pull/2005) (yoavcloud)
73+
- Add support for `SEMANTIC_VIEW` table factor [#2009](https://github.com/apache/datafusion-sqlparser-rs/pull/2009) (bombsimon)
74+
- Redshift: Add more copy options [#2008](https://github.com/apache/datafusion-sqlparser-rs/pull/2008) (yoavcloud)
75+
- `GenericDialect`: Support pipe operator [#2012](https://github.com/apache/datafusion-sqlparser-rs/pull/2012) (simonvandel)
76+
- Add SECURE keyword for views in Snowflake [#2004](https://github.com/apache/datafusion-sqlparser-rs/pull/2004) (Vedin)
77+
- Add support for PostgreSQL JSON function 'RETURNING' clauses [#2001](https://github.com/apache/datafusion-sqlparser-rs/pull/2001) (adamchainz)
78+
- Snowflake: Minus char in stage name [#2014](https://github.com/apache/datafusion-sqlparser-rs/pull/2014) (yoavcloud)
79+
- Support wildcard metrics for `SEMANTIC_VIEW` [#2016](https://github.com/apache/datafusion-sqlparser-rs/pull/2016) (bombsimon)
80+
- Allow wilrdacrd for all `SEMANTIC_VIEW` types [#2017](https://github.com/apache/datafusion-sqlparser-rs/pull/2017) (bombsimon)
81+
- Redshift: UNLOAD [#2013](https://github.com/apache/datafusion-sqlparser-rs/pull/2013) (yoavcloud)
82+
- Add support for string literal concatenation [#2003](https://github.com/apache/datafusion-sqlparser-rs/pull/2003) (etgarperets)
83+
- Enable merge queue in sqlparser-rs [#2007](https://github.com/apache/datafusion-sqlparser-rs/pull/2007) (blaginin)
84+
- Merge Queue Test [#2019](https://github.com/apache/datafusion-sqlparser-rs/pull/2019) (blaginin)
85+
- Added derive trait `Copy` to `OrderByOptions` struct [#2021](https://github.com/apache/datafusion-sqlparser-rs/pull/2021) (LucaCappelletti94)
86+
- Moved `CreateTrigger` and `DropTrigger` out of `Statement` enum [#2026](https://github.com/apache/datafusion-sqlparser-rs/pull/2026) (LucaCappelletti94)
87+
- MySQL: Support `CROSS JOIN` constraint [#2025](https://github.com/apache/datafusion-sqlparser-rs/pull/2025) (rs-sac)
88+
- Implemented the `From` method for all clear variants in Statement [#2028](https://github.com/apache/datafusion-sqlparser-rs/pull/2028) (LucaCappelletti94)
89+
- DuckDB: Allow quoted date parts in EXTRACT [#2030](https://github.com/apache/datafusion-sqlparser-rs/pull/2030) (ryanschneider)
90+
- MySQL: Add support for unsigned numeric types [#2031](https://github.com/apache/datafusion-sqlparser-rs/pull/2031) (MohamedAbdeen21)
91+
92+
## Credits
93+
94+
Thank you to everyone who contributed to this release. Here is a breakdown of commits (PRs merged) per contributor.
95+
96+
```
97+
17 Yoav Cohen
98+
6 Chen Chongchen
99+
6 Michael Victor Zink
100+
4 etgarperets
101+
3 Luca Cappelletti
102+
3 Simon Sawert
103+
3 Tyler White
104+
2 Dmitrii Blaginin
105+
2 Ryan Schneider
106+
1 Adam Johnson
107+
1 Artem Osipov
108+
1 Denys Tsomenko
109+
1 Marcelo Altmann
110+
1 Mohamed Abdeen
111+
1 Ophir LOJKINE
112+
1 Sidney Cammeresi
113+
1 Simon Vandel Sillesen
114+
1 Sven Sauleau
115+
1 carl
116+
1 dependabot[bot]
117+
1 tomershaniii
118+
1 xitep
119+
```
120+
121+
Thank you also to everyone who contributed in other ways such as filing issues, reviewing PRs, and providing feedback on this release.
122+

src/ast/data_type.rs

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ pub enum DataType {
131131
///
132132
/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#exact-numeric-type
133133
Decimal(ExactNumberInfo),
134+
/// [MySQL] unsigned decimal with optional precision and scale, e.g. DECIMAL UNSIGNED or DECIMAL(10,2) UNSIGNED.
135+
/// Note: Using UNSIGNED with DECIMAL is deprecated in recent versions of MySQL.
136+
///
137+
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
138+
DecimalUnsigned(ExactNumberInfo),
134139
/// [BigNumeric] type used in BigQuery.
135140
///
136141
/// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals
@@ -143,8 +148,19 @@ pub enum DataType {
143148
///
144149
/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#exact-numeric-type
145150
Dec(ExactNumberInfo),
146-
/// Floating point with optional precision, e.g. FLOAT(8).
147-
Float(Option<u64>),
151+
/// [MySQL] unsigned decimal (DEC alias) with optional precision and scale, e.g. DEC UNSIGNED or DEC(10,2) UNSIGNED.
152+
/// Note: Using UNSIGNED with DEC is deprecated in recent versions of MySQL.
153+
///
154+
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
155+
DecUnsigned(ExactNumberInfo),
156+
/// Floating point with optional precision and scale, e.g. FLOAT, FLOAT(8), or FLOAT(8,2).
157+
Float(ExactNumberInfo),
158+
/// [MySQL] unsigned floating point with optional precision and scale, e.g.
159+
/// FLOAT UNSIGNED, FLOAT(10) UNSIGNED or FLOAT(10,2) UNSIGNED.
160+
/// Note: Using UNSIGNED with FLOAT is deprecated in recent versions of MySQL.
161+
///
162+
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
163+
FloatUnsigned(ExactNumberInfo),
148164
/// Tiny integer with optional display width, e.g. TINYINT or TINYINT(3).
149165
TinyInt(Option<u64>),
150166
/// Unsigned tiny integer with optional display width,
@@ -302,17 +318,32 @@ pub enum DataType {
302318
Float64,
303319
/// Floating point, e.g. REAL.
304320
Real,
321+
/// [MySQL] unsigned real, e.g. REAL UNSIGNED.
322+
/// Note: Using UNSIGNED with REAL is deprecated in recent versions of MySQL.
323+
///
324+
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
325+
RealUnsigned,
305326
/// Float8 is an alias for Double in [PostgreSQL].
306327
///
307328
/// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
308329
Float8,
309330
/// Double
310331
Double(ExactNumberInfo),
332+
/// [MySQL] unsigned double precision with optional precision, e.g. DOUBLE UNSIGNED or DOUBLE(10,2) UNSIGNED.
333+
/// Note: Using UNSIGNED with DOUBLE is deprecated in recent versions of MySQL.
334+
///
335+
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
336+
DoubleUnsigned(ExactNumberInfo),
311337
/// Double Precision, see [SQL Standard], [PostgreSQL].
312338
///
313339
/// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#approximate-numeric-type
314340
/// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype-numeric.html
315341
DoublePrecision,
342+
/// [MySQL] unsigned double precision, e.g. DOUBLE PRECISION UNSIGNED.
343+
/// Note: Using UNSIGNED with DOUBLE PRECISION is deprecated in recent versions of MySQL.
344+
///
345+
/// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
346+
DoublePrecisionUnsigned,
316347
/// Bool is an alias for Boolean, see [PostgreSQL].
317348
///
318349
/// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
@@ -497,12 +528,19 @@ impl fmt::Display for DataType {
497528
DataType::Decimal(info) => {
498529
write!(f, "DECIMAL{info}")
499530
}
531+
DataType::DecimalUnsigned(info) => {
532+
write!(f, "DECIMAL{info} UNSIGNED")
533+
}
500534
DataType::Dec(info) => {
501535
write!(f, "DEC{info}")
502536
}
537+
DataType::DecUnsigned(info) => {
538+
write!(f, "DEC{info} UNSIGNED")
539+
}
503540
DataType::BigNumeric(info) => write!(f, "BIGNUMERIC{info}"),
504541
DataType::BigDecimal(info) => write!(f, "BIGDECIMAL{info}"),
505-
DataType::Float(size) => format_type_with_optional_length(f, "FLOAT", size, false),
542+
DataType::Float(info) => write!(f, "FLOAT{info}"),
543+
DataType::FloatUnsigned(info) => write!(f, "FLOAT{info} UNSIGNED"),
506544
DataType::TinyInt(zerofill) => {
507545
format_type_with_optional_length(f, "TINYINT", zerofill, false)
508546
}
@@ -616,12 +654,15 @@ impl fmt::Display for DataType {
616654
write!(f, "UNSIGNED INTEGER")
617655
}
618656
DataType::Real => write!(f, "REAL"),
657+
DataType::RealUnsigned => write!(f, "REAL UNSIGNED"),
619658
DataType::Float4 => write!(f, "FLOAT4"),
620659
DataType::Float32 => write!(f, "Float32"),
621660
DataType::Float64 => write!(f, "FLOAT64"),
622661
DataType::Double(info) => write!(f, "DOUBLE{info}"),
662+
DataType::DoubleUnsigned(info) => write!(f, "DOUBLE{info} UNSIGNED"),
623663
DataType::Float8 => write!(f, "FLOAT8"),
624664
DataType::DoublePrecision => write!(f, "DOUBLE PRECISION"),
665+
DataType::DoublePrecisionUnsigned => write!(f, "DOUBLE PRECISION UNSIGNED"),
625666
DataType::Bool => write!(f, "BOOL"),
626667
DataType::Boolean => write!(f, "BOOLEAN"),
627668
DataType::Date => write!(f, "DATE"),

0 commit comments

Comments
 (0)