We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Here is a bug with MySQL composite index. There is the first column of index is recorded, but miss the following columns.
To Reproduce Steps to reproduce the behavior:
CREATE TABLE `employee` ( `employee_id` int NOT NULL, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `email` varchar(100) NOT NULL, `phone_number` varchar(20) DEFAULT NULL, `hire_date` date NOT NULL, `job_id` int NOT NULL, `department_id` int DEFAULT NULL, `manager_id` int DEFAULT NULL, `salary` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`employee_id`), KEY `composite_full_name` (`first_name`,`last_name`), KEY `idx_job_id` (`job_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */;
parser_output = DDLParser(ddl).run(output_mode="mysql")
{ "table_name":"`employee`", "schema":"None", "primary_key":[ "`employee_id`" ], "columns":[ { "name":"`employee_id`", "type":"int", "size":"None", "references":"None", "unique":false, "nullable":false, "default":"None", "check":"None" }, { "name":"`first_name`", "type":"varchar", "size":50, "references":"None", "unique":false, "nullable":false, "default":"None", "check":"None" }, { "name":"`last_name`", "type":"varchar", "size":50, "references":"None", "unique":false, "nullable":false, "default":"None", "check":"None" }, { "name":"`email`", "type":"varchar", "size":100, "references":"None", "unique":false, "nullable":false, "default":"None", "check":"None" }, { "name":"`phone_number`", "type":"varchar", "size":20, "references":"None", "unique":false, "nullable":true, "default":"NULL", "check":"None" }, { "name":"`hire_date`", "type":"date", "size":"None", "references":"None", "unique":false, "nullable":false, "default":"None", "check":"None" }, { "name":"`job_id`", "type":"int", "size":"None", "references":"None", "unique":false, "nullable":false, "default":"None", "check":"None" }, { "name":"`department_id`", "type":"int", "size":"None", "references":"None", "unique":false, "nullable":true, "default":"NULL", "check":"None" }, { "name":"`manager_id`", "type":"int", "size":"None", "references":"None", "unique":false, "nullable":true, "default":"NULL", "check":"None" }, { "name":"`salary`", "type":"decimal", "size":(10, 2), "references":"None", "unique":false, "nullable":true, "default":"NULL", "check":"None" } ], "alter":{ }, "checks":[ ], "index":[ { "clustered":false, "columns":[ "`first_name`" ], "detailed_columns":[ { "name":"`first_name`", "nulls":"LAST", "order":"ASC" } ], "index_name":"`composite_full_name`", "unique":false }, { "clustered":false, "columns":[ "`job_id`" ], "detailed_columns":[ { "name":"`job_id`", "nulls":"LAST", "order":"ASC" } ], "index_name":"`idx_job_id`", "unique":false } ], "partitioned_by":[ ], "tablespace":"None", "table_properties":{ "collate":"utf8mb4_0900_ai_ci" }, "engine":"InnoDB", "default_charset":"utf8mb4" }{ "comments":[ "!40101 SET @saved_cs_client = @@character_set_client */;", "!50503 SET character_set_client = utf8mb4 */;", "!40101 SET character_set_client = @saved_cs_client */;" ] }
Expected behavior
{ ... "index":[ { "clustered":false, "columns":[ "`first_name`" ], "detailed_columns":[ { "name":"`first_name`", "nulls":"LAST", "order":"ASC" }, **{ "name":"`last_name`", "nulls":"LAST", "order":"ASC" }** ], "index_name":"`composite_full_name`", "unique":false }, { "clustered":false, "columns":[ "`job_id`" ], "detailed_columns":[ { "name":"`job_id`", "nulls":"LAST", "order":"ASC" } ], "index_name":"`idx_job_id`", "unique":false } ], ... }
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
@finnou0817 thanks for reporting the issue, I will try to fix on the weekend
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Here is a bug with MySQL composite index. There is the first column of index is recorded, but miss the following columns.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: