You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a bug or it's intentional, so I apologise if this is not a bug.
When using test_all_types() together with castTimestampToDate: true the timestamps are cast into invalid dates. This is due to maximum timestamp in JavaScript being slightly smaller than Number.MAX_SAFE_INTEGER. See MDN.
To Reproduce
constdb=newduckdb.AsyncDuckDB(logger,worker);awaitdb.instantiate(bundle.mainModule,bundle.pthreadWorker);awaitdb.open({query: {castTimestampToDate: true,}});constconn=awaitdb.connect();constresult=awaitconn.query(` SELECT "timestamp", "timestamp_s", "timestamp_ms", "timestamp_ns", "timestamp_tz", "timestamp_array", "timestamptz_array", epoch_ms(-8640000000000000) AS min_date, epoch_ms(8640000000000000) AS max_date FROM test_all_types()`);// timestamp, timestamp_ms, timestamp_s, timestamp_tz are all invalid dates// min_date and max_date are validconsole.log(result.toArray().map((item)=>item.toJSON()));
What happens?
Not sure if this is a bug or it's intentional, so I apologise if this is not a bug.
When using
test_all_types()
together withcastTimestampToDate: true
the timestamps are cast into invalid dates. This is due to maximum timestamp in JavaScript being slightly smaller thanNumber.MAX_SAFE_INTEGER
. See MDN.To Reproduce
Please see an example in Codesandbox.
Browser/Environment:
Any
Device:
Any
DuckDB-Wasm Version:
1.28.1-dev248.0
DuckDB-Wasm Deployment:
N/A
Full Name:
Katarina Anton
Affiliation:
Individual
The text was updated successfully, but these errors were encountered: