Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

show create table returns incorrect type for varchar #844

Closed
smacker opened this issue Oct 17, 2019 · 0 comments · Fixed by #847
Closed

show create table returns incorrect type for varchar #844

smacker opened this issue Oct 17, 2019 · 0 comments · Fixed by #847
Assignees

Comments

@smacker
Copy link
Contributor

smacker commented Oct 17, 2019

In gitbase we have for example refs table. In which column commit_hash is a VARCHAR(40) which was implemented here: src-d/gitbase#916

But the query

show create table refs

returns

CREATE TABLE `refs` (
  `repository_id` TEXT NOT NULL,
  `ref_name` TEXT NOT NULL,
  `commit_hash` VARCHAR NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

I'm not sure if it's against mysql spec but at least sqlachemy fails to parse such schema with an error:

sqlalchemy.exc.CompileError: VARCHAR requires a length on dialect mysql
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants