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

DDL部分功能不支持 #53

Closed
ddcw opened this issue Dec 11, 2024 · 2 comments · Fixed by #54
Closed

DDL部分功能不支持 #53

ddcw opened this issue Dec 11, 2024 · 2 comments · Fixed by #54

Comments

@ddcw
Copy link

ddcw commented Dec 11, 2024

你好, 你的项目写得非常好. 给你点赞!

但, 目前发现有部分DDL信息没有列出来

  1. 字段的invisible属性没有列出来
  2. 空间坐标的srid没有列出来
  3. 没有外键
  4. 没有约束

参考DDL:

create table test_ibd2sql_ddl_00(
	id bigint unsigned not null primary key auto_increment,
  	name varchar(200)
);

create table test_ibd2sql_ddl_01(
  `id` serial primary key auto_increment, -- serial: bigint unsigned not null
  `id_default` int default 0,
  `id_unsigned_zerofill` int unsigned zerofill,
  `int_col` int DEFAULT NULL,
  `id_invisible` int /*!80023 INVISIBLE */,
  `tinyint_col` tinyint DEFAULT '1',
  `boolean_col` boolean, -- tinyint(1)
  `smallint_col` smallint DEFAULT NULL,
  `mediumint_col` mediumint DEFAULT NULL,
  `bigint_col` bigint DEFAULT NULL,
  `float_col` float DEFAULT NULL,
  `double_col` double DEFAULT NULL,
  `decimal_col` decimal(10,2) DEFAULT NULL,
  `date_col` date DEFAULT NULL,
  `datetime_col` datetime(6),
  `timestamp_col` timestamp DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `time_col` time(4) DEFAULT NULL,
  `year_col` year DEFAULT NULL,
  `char_col` char(100) CHARACTER SET utf8 COLLATE utf8_danish_ci DEFAULT NULL,
  `nchar_col` nchar(10), -- 同char(10)
  `varchar_col` varchar(100),
  `nvarchar_col` nvarchar(10), -- 同nvarchar(10)
  `binary_col` binary(10) DEFAULT NULL,
  `varbinary_col` varbinary(20) DEFAULT NULL,
  `bit_col` bit(4) DEFAULT NULL,
  `enum_col` enum('A','B','C'),
  `set_col` set('X','Y','Z'),
  `json_type_col` json DEFAULT NULL,
  `tinyblob_col` tinyblob,
  `mediumblob_col` mediumblob,
  `blob_col` blob,
  `longblob_col` longblob,
  `tinytext_col` tinytext,
  `mediumtext_col` mediumtext,
  `text_col` text,
  `longtext_col` longtext,
  `gen_stored` INT GENERATED ALWAYS AS (int_col + 1) STORED,
  `gen_virtual` INT GENERATED ALWAYS AS (id_default + 1) virtual,
  `spatial_geometry` geometry,
  `spatial_point` point not null /*!80003 SRID 4326 */,
  `spatial_linestring` linestring,
  `spatial_polygon` polygon,
  `spatial_geometrycollection` geometrycollection,
  `spatial_multipoint` multipoint,
  `spatial_multilinestring` multilinestring,
  `spatial_multipolygon` multipolygon,
  `concat_char` varchar(201) as (concat(char_col,' ',varchar_col)),
  unique key(int_col),
  key(bigint_col),
  key(concat_char),
  key(varchar_col desc),
  key(int_col,time_col),
  key(int_col) /*!80000 INVISIBLE */,
  fulltext(varchar_col,text_col),
  spatial index(spatial_point),
  check (int_col>0 and tinyint_col>0),
  foreign key(id) references test_ibd2sql_ddl_00(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@WinChua
Copy link
Owner

WinChua commented Dec 14, 2024

你好,谢谢,你的写的也很nice;

谢谢反馈,我研究下,边学边做的😂

@WinChua WinChua linked a pull request Dec 18, 2024 that will close this issue
@WinChua
Copy link
Owner

WinChua commented Dec 18, 2024

加上了,感谢反馈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants