mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-28 08:24:48 +00:00
NULL need to be detected in COPY
This commit is contained in:
parent
5abd9e7dec
commit
ba8a9bd48f
3 changed files with 8 additions and 1 deletions
|
@ -223,6 +223,7 @@ impl ToString for ASTNode{
|
||||||
.collect::<Vec<String>>().join("\t")
|
.collect::<Vec<String>>().join("\t")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
s += "\n\\.";
|
||||||
s
|
s
|
||||||
}
|
}
|
||||||
ASTNode::SQLUpdate{table_name, assignments, selection} => {
|
ASTNode::SQLUpdate{table_name, assignments, selection} => {
|
||||||
|
|
|
@ -656,6 +656,10 @@ impl Parser {
|
||||||
Token::Backslash => {
|
Token::Backslash => {
|
||||||
if let Ok(true) = self.consume_token(&Token::Period) {
|
if let Ok(true) = self.consume_token(&Token::Period) {
|
||||||
return Ok(values);
|
return Ok(values);
|
||||||
|
}if let Some(token) = self.next_token(){
|
||||||
|
if token == Token::Identifier("N".to_string()){
|
||||||
|
values.push(Value::Null);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -558,9 +558,11 @@ Kwara & Kogi
|
||||||
{"Deleted Scenes","Behind the Scenes"}
|
{"Deleted Scenes","Behind the Scenes"}
|
||||||
'awe':5 'awe-inspir':4 'barbarella':1 'cat':13 'conquer':16 'dog':18 'feminist':10 'inspir':6 'monasteri':21 'must':15 'stori':7 'streetcar':2
|
'awe':5 'awe-inspir':4 'barbarella':1 'cat':13 'conquer':16 'dog':18 'feminist':10 'inspir':6 'monasteri':21 'must':15 'stori':7 'streetcar':2
|
||||||
PHP ₱ USD $
|
PHP ₱ USD $
|
||||||
|
\N Some other value
|
||||||
\\."#);
|
\\."#);
|
||||||
let ast = parse_sql(&sql);
|
let ast = parse_sql(&sql);
|
||||||
//assert_eq!(sql, ast.to_string());
|
println!("{:#?}", ast);
|
||||||
|
assert_eq!(sql, ast.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue