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

Expression default column value is not worked as MySQL #46931

Closed
jackysp opened this issue Sep 13, 2023 · 3 comments
Closed

Expression default column value is not worked as MySQL #46931

jackysp opened this issue Sep 13, 2023 · 3 comments
Labels
compatibility-mysql80 This is a compatibility issue with MySQL 8.0(but NOT 5.7) component/ddl This issue is related to DDL of TiDB. found/gs found by gs may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/major type/bug The issue is confirmed as a bug.

Comments

@jackysp
Copy link
Member

jackysp commented Sep 13, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (i varchar(36));
alter table t alter column i set default ((replace(uuid(), '-', '')));
show create table t;

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

mysql> show create table t;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                             |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `i` varchar(36) DEFAULT (replace(uuid(),_utf8mb3'-',_utf8mb4''))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

mysql> show create table t;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `i` varchar(36) DEFAULT '2b6aeed451e211ee84b03ec3810b9cf3'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

f1067a1

@jackysp jackysp added type/bug The issue is confirmed as a bug. component/ddl This issue is related to DDL of TiDB. labels Sep 13, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 13, 2023
@seiya-annie
Copy link

/found gs

@ti-chi-bot ti-chi-bot bot added the found/gs found by gs label Sep 20, 2023
@ti-chi-bot ti-chi-bot added the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Oct 23, 2023
@dveeden
Copy link
Contributor

dveeden commented Nov 1, 2023

@jackysp Isn't this the same issue as #45506 ?

@dveeden dveeden added the compatibility-mysql80 This is a compatibility issue with MySQL 8.0(but NOT 5.7) label Nov 1, 2023
@jackysp
Copy link
Member Author

jackysp commented Nov 1, 2023

Yes, it is the same as it. I'll close it.

@jackysp jackysp closed this as completed Nov 1, 2023
@Benjamin2037 Benjamin2037 removed the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility-mysql80 This is a compatibility issue with MySQL 8.0(but NOT 5.7) component/ddl This issue is related to DDL of TiDB. found/gs found by gs may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

6 participants