mysql / mysql/mysql-shell-plugins

Dates not displaying correctly in tables vs text

Open
#52 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
96
Forks
22
PR merge metrics
No merged PRs in 30d

Description

VSCode Mysql-Shell-Plugin Date Issues

I am experiencing an issues when displaying data via the mysql-shell-plugins associated with Date fields.

When data is displayed via a table in the mysql-shell-plugin, the dates displayed are a day earlier than the database.

I am guessing this is something to do with the Timezone default for VSCode or the mysql-plugin but not sure where to configure this?

Query via Terminal / mysql - OK

mysql> select * from aaExchangeRates where erDate between '2024-03-26' and '2024-04-05';
+------------+--------+---------+
| erDate     | erEUR  | erUSD   |
+------------+--------+---------+
| 2024-03-26 | 1.4711 | 1.35720 |
| 2024-03-27 | 1.4701 | 1.35870 |
| 2024-03-28 | 1.4632 | 1.35500 |
| 2024-04-01 | 1.4592 | 1.35740 |
| 2024-04-02 | 1.4609 | 1.35720 |
| 2024-04-03 | 1.4642 | 1.35370 |
| 2024-04-04 | 1.4666 | 1.35040 |
| 2024-04-05 | 1.4723 | 1.35980 |
+------------+--------+---------+
8 rows in set (0.00 sec)

mysql> 

Terminal Mysql Output - OK

Query via mysql-shell-plugin with Results as Text - OK

sql> select * from aaExchangeRates where erDate between '2024-03-26' and '2024-04-05' LIMIT 0, 1001;
+------------+--------+---------+
| erDate     | erEUR  | erUSD   |
+------------+--------+---------+
| 2024-03-26 | 1.4711 | 1.35720 |
| 2024-03-27 | 1.4701 | 1.35870 |
| 2024-03-28 | 1.4632 | 1.35500 |
| 2024-04-01 | 1.4592 | 1.35740 |
| 2024-04-02 | 1.4609 | 1.35720 |
| 2024-04-03 | 1.4642 | 1.35370 |
| 2024-04-04 | 1.4666 | 1.35040 |
| 2024-04-05 | 1.4723 | 1.35980 |
+------------+--------+---------+

VSCode Mysql Plugin Output - OK
Execute the block and print the results as text

Query via mysql-shell-plugin - Table vs Text - TABLE NOT-OK

When the same query is displayed as a table, the dates are displayed shifted 1 day earlier.
I also noticed that the display format has changed to a local format (MM/DD/YYYY) vs the default (YYYY-MM-DD)
Note the data is selected correctly according to the Where clause but displays as a day earlier.

VSCode-MySql-Issue-2

Here is the environment I am using.

  • OS: Linux Fedora 40
  • MySQL: Ver 8.4.0 for Linux on x86_64 (MySQL Community Server - GPL)
  • mysql-shell-plugins: v1.14.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Reproduce the query from the issue in the mysql-shell-plugins text and table result views, then trace the table date formatting and timezone handling. Done means the table preserves the database date value and uses an expected format without shifting it by a day.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, typescript
Domain
database, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.