mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +00:00
Support national string literals (N'...')
Widely used in MS SQL and specified in ANSI.
This commit is contained in:
parent
b9f4b503b6
commit
35dd9342e2
4 changed files with 76 additions and 33 deletions
|
@ -368,13 +368,17 @@ fn parse_aggregate_with_group_by() {
|
|||
|
||||
#[test]
|
||||
fn parse_literal_string() {
|
||||
let sql = "SELECT 'one'";
|
||||
let sql = "SELECT 'one', N'national string'";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(1, select.projection.len());
|
||||
assert_eq!(2, select.projection.len());
|
||||
assert_eq!(
|
||||
&ASTNode::SQLValue(Value::SingleQuotedString("one".to_string())),
|
||||
expr_from_projection(&select.projection[0])
|
||||
);
|
||||
assert_eq!(
|
||||
&ASTNode::SQLValue(Value::NationalStringLiteral("national string".to_string())),
|
||||
expr_from_projection(&select.projection[1])
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue