Support national string literals (N'...')

Widely used in MS SQL and specified in ANSI.
This commit is contained in:
Nickolay Ponomarev 2019-02-03 05:49:15 +03:00
parent b9f4b503b6
commit 35dd9342e2
4 changed files with 76 additions and 33 deletions

View file

@ -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]