mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 15:04:04 +00:00
Fix parse_time() handling of fractional seconds
There's no Token::Period in such situation, so fractional part (from sec) was silently truncated.
Can't uncomment the test yet, because parse_timestamp() is effectively
unused: the code added to parse_value() in 5abd9e7dec
was wrong as it attempted to handle unquoted date/time literals. One
part of it was commented out earlier, the other can't work as far as I
can see, as it tries to parse a Number token - `([0-9]|\.)+` - as a
timestamp, so I removed it as well.
This commit is contained in:
parent
52277c3025
commit
3b13e153a8
2 changed files with 18 additions and 35 deletions
|
@ -657,6 +657,7 @@ fn parse_timestamps_example() {
|
|||
let sql = "2016-02-15 09:43:33";
|
||||
let _ = parse_sql(sql);
|
||||
//TODO add assertion
|
||||
//assert_eq!(sql, ast.to_string());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -664,6 +665,7 @@ fn parse_timestamps_with_millis_example() {
|
|||
let sql = "2017-11-02 19:15:42.308637";
|
||||
let _ = parse_sql(sql);
|
||||
//TODO add assertion
|
||||
//assert_eq!(sql, ast.to_string());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue