Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concat time data type lost the time fsp #23286

Closed
aytrack opened this issue Mar 12, 2021 · 3 comments · Fixed by #23332
Closed

concat time data type lost the time fsp #23286

aytrack opened this issue Mar 12, 2021 · 3 comments · Fixed by #23332
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Mar 12, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a char, b time(1), c datetime(2), d timestamp(3));
insert into t values ('a', '08:30:01.3', '2021-03-01 20:04:11.22', '2021-03-01 20:04:11.333');
select * from t;
select concat(a, b), concat(a, c), concat(a, d), concat(b, c), concat(c, d) from t;

2. What did you expect to see? (Required)

mysql> create table t(a char, b time(1), c datetime(2), d timestamp(3));
Query OK, 0 rows affected (0.08 sec)

mysql> insert into t values ('a', '08:30:01.3', '2021-03-01 20:04:11.22', '2021-03-01 20:04:11.333');
Query OK, 1 row affected (0.05 sec)

mysql> select * from t;
select concat(a, b), concat(a, c), concat(a, d), concat(b, c), concat(c, d) from t;
+------+------------+------------------------+-------------------------+
| a    | b          | c                      | d                       |
+------+------------+------------------------+-------------------------+
| a    | 08:30:01.3 | 2021-03-01 20:04:11.22 | 2021-03-01 20:04:11.333 |
+------+------------+------------------------+-------------------------+
1 row in set (0.05 sec)

mysql> select concat(a, b), concat(a, c), concat(a, d), concat(b, c), concat(c, d) from t;
+--------------+-------------------------+--------------------------+----------------------------------+-----------------------------------------------+
| concat(a, b) | concat(a, c)            | concat(a, d)             | concat(b, c)                     | concat(c, d)                                  |
+--------------+-------------------------+--------------------------+----------------------------------+-----------------------------------------------+
| a08:30:01.3  | a2021-03-01 20:04:11.22 | a2021-03-01 20:04:11.333 | 08:30:01.32021-03-01 20:04:11.22 | 2021-03-01 20:04:11.222021-03-01 20:04:11.333 |
+--------------+-------------------------+--------------------------+----------------------------------+-----------------------------------------------+
1 row in set (0.05 sec)

3. What did you see instead (Required)

mysql> create table t(a char, b time(1), c datetime(2), d timestamp(3));
Query OK, 0 rows affected (0.18 sec)
mysql>  insert into t values ('a', '08:30:01.3', '2021-03-01 20:04:11.22', '2021-03-01 20:04:11.333');
Query OK, 1 row affected (0.08 sec)

mysql> select * from t;
+------+------------+------------------------+-------------------------+
| a    | b          | c                      | d                       |
+------+------------+------------------------+-------------------------+
| a    | 08:30:01.3 | 2021-03-01 20:04:11.22 | 2021-03-01 20:04:11.333 |
+------+------------+------------------------+-------------------------+
1 row in set (0.05 sec)

mysql> select concat(a, b), concat(a, c), concat(a, d), concat(b, c), concat(c, d) from t;
+--------------+-------------------------+--------------------------+--------------------------------+-----------------------------------------------+
| concat(a, b) | concat(a, c)            | concat(a, d)             | concat(b, c)                   | concat(c, d)                                  |
+--------------+-------------------------+--------------------------+--------------------------------+-----------------------------------------------+
| a08:30:01    | a2021-03-01 20:04:11.22 | a2021-03-01 20:04:11.333 | 08:30:012021-03-01 20:04:11.22 | 2021-03-01 20:04:11.222021-03-01 20:04:11.333 |
+--------------+-------------------------+--------------------------+--------------------------------+-----------------------------------------------+

4. What is your TiDB version? (Required)

master: b42a6f4
release-4.0: 122ee4d
5.0-rc: fd4437d

@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major labels Mar 12, 2021
@aytrack aytrack changed the title concat time date type lost the time fsp concat time data type lost the time fsp Mar 12, 2021
@Howie59
Copy link
Contributor

Howie59 commented Mar 15, 2021

i will fix it in my spare time

@Howie59
Copy link
Contributor

Howie59 commented Mar 15, 2021

/assign

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants