Open wencan opened 10 months ago
according to https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_unix-timestamp
When the date argument is a [TIMESTAMP](https://dev.mysql.com/doc/refman/8.4/en/datetime.html) column,
[UNIX_TIMESTAMP()](https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_unix-timestamp)
returns the internal timestamp value directly, with no implicit “string-to-Unix-timestamp” conversion.
it looks like a bug in go-mysql-server
's unix_timestamp
BTW from_unixtime
has same problem
according to https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_from-unixtime
it's should return date in session timezone
I notice TIMESTAMP
and DATE
/DATETIME
/TIME
were stored in time.Time
it may work unexpected
because they all have no timezone info.
but they are processed with timezone in time.Time
os: fedora 38 linux: 6.5 go: 1.20 github.com/dolthub/go-mysql-server v0.17.0 github.com/go-sql-driver/mysql v1.7.1 github.com/jmoiron/sqlx v1.3.5
system timezone: +08:00
code:
output:
expected: