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

[Bug]: Show Create table Result Error #16179

Closed
1 task done
qingxinhome opened this issue May 16, 2024 · 2 comments
Closed
1 task done

[Bug]: Show Create table Result Error #16179

qingxinhome opened this issue May 16, 2024 · 2 comments
Assignees
Labels
kind/bug Something isn't working resolved/v1.2.1 severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Milestone

Comments

@qingxinhome
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main, 1.2-dev

Commit ID

9571a73

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

mysql> CREATE TABLE t (
-> id INT PRIMARY KEY,
-> a VARCHAR(30) NULL default 'foo',
-> b VARCHAR(30) NOT NULL default 'foo',
-> c INT NULL DEFAULT 1000,
-> d INT NOT NULL DEFAULT 2000
-> );
Query OK, 0 rows affected (0.35 sec)

mysql> show create table t;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE t (
id INT NOT NULL,
a VARCHAR(30) DEFAULT 'foo',
b VARCHAR(30) DEFAULT 'foo',
c INT DEFAULT 1000,
d INT DEFAULT 2000,
PRIMARY KEY (id)
) |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Note: MO execute of show create table lost table column not null constraint information

Expected Behavior

mysql> CREATE TABLE t (
-> id INT PRIMARY KEY,
-> a VARCHAR(30) NULL default 'foo',
-> b VARCHAR(30) NOT NULL default 'foo',
-> c INT NULL DEFAULT 1000,
-> d INT NOT NULL DEFAULT 2000
-> );
Query OK, 0 rows affected (0.00 sec)

mysql> show create table t;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE t (
id int NOT NULL,
a varchar(30) DEFAULT 'foo',
b varchar(30) NOT NULL DEFAULT 'foo',
c int DEFAULT '1000',
d int NOT NULL DEFAULT '2000',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Steps to Reproduce

CREATE TABLE t (
	id INT PRIMARY KEY,
	a VARCHAR(30) NULL default 'foo',
	b VARCHAR(30) NOT NULL default 'foo',
	c INT NULL DEFAULT 1000,
	d INT NOT NULL DEFAULT 2000
);

show create table t;

Additional information

No response

@qingxinhome qingxinhome added kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use labels May 16, 2024
@qingxinhome qingxinhome added this to the 1.2.0 milestone May 16, 2024
@aressu1985 aressu1985 modified the milestones: 1.2.0, 1.2.1 May 17, 2024
@qingxinhome
Copy link
Contributor Author

The issue has been resolved, please verify and test, @sukki37 @heni02 @aressu1985 @daviszhen

@Ariznawlll
Copy link
Contributor

commit:18f806e26a516a2990d1b348728d7f838a5ba43b
image

verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working resolved/v1.2.1 severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Projects
None yet
Development

No branches or pull requests

5 participants