mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Added strptime function to SQL parser as a feature. This is needed to i.e. be able to query time-fields in DB and to use dates <1.1.1970 and >19.1.2038. All changes should be backwards-compatible to not break existing queries.
This commit is contained in:
@@ -42,7 +42,7 @@ static MdbSQL *g_sql;
|
||||
|
||||
|
||||
%token <name> IDENT NAME PATH STRING NUMBER
|
||||
%token SELECT FROM WHERE CONNECT DISCONNECT TO LIST TABLES AND OR NOT COUNT
|
||||
%token SELECT FROM WHERE CONNECT DISCONNECT TO LIST TABLES AND OR NOT COUNT STRPTIME
|
||||
%token DESCRIBE TABLE
|
||||
%token LTEQ GTEQ LIKE IS NUL
|
||||
|
||||
@@ -132,7 +132,12 @@ nulloperator:
|
||||
;
|
||||
|
||||
constant:
|
||||
NUMBER { $$ = $1; }
|
||||
STRPTIME '(' constant ',' constant ')' {
|
||||
$$ = mdb_sql_strptime(_mdb_sql(NULL), $3, $5);
|
||||
free($3);
|
||||
free($5);
|
||||
}
|
||||
| NUMBER { $$ = $1; }
|
||||
| STRING { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user