typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[BUG] Error while inserting datetime value #102

Closed meuriceloup closed 4 years ago

meuriceloup commented 4 years ago

Hi guys, This is the ML model I used:

entity "Orders" {
   "OrderDate" : datetime
   "RequiredDate" : datetime
   "ShippedDate" : datetime
   "Freight" : float
   "ShipName" : string[40]
   "ShipAddress" : string[60]
   "ShipCity" : string[15]
   "ShipRegion" : string[15]
   "ShipPostalCode" : string[10]
   "ShipCountry" : string[15]
}

relationaldb RelationalDatabase {
   tables {
      table {
         "Orders" : "Orders"
         index "index_0" {
            attributes ("OrderDate")
         }
      }
   }
}

I tried to insert a new Orders by specifying a datetime value for the OrderDate field. Yet, the following query fails: insert Orders{OrderDate: $2020-03-31T18:08:28.477+00:00$} and the error is: image

I then tried to replace the "08" sub-value by "18" like this: insert Orders{OrderDate: $2020-03-31T18:18:28.477+00:00$} and it returns a new error:

image

I finally removed the millisecond part, like this: insert Orders{OrderDate: $2020-03-31T18:18:28+00:00$} and it works!

In summary, it seems there are two bugs here: 1) when the hour starts with a zero (e.g., 08) 2) when a milliseconds part is specified.

Thanks in advance guys :-) Loup