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

[Feature Request]: Support insert ignore #11224

Closed
1 task done
DanielZhangQD opened this issue Aug 15, 2023 · 11 comments
Closed
1 task done

[Feature Request]: Support insert ignore #11224

DanielZhangQD opened this issue Aug 15, 2023 · 11 comments
Assignees
Labels
attention/doc-influence need to complete design document kind/feature phase/testing priority/p0.5 source/dev issues from devs source/on-demand issues on the demands of users, customers or market
Milestone

Comments

@DanielZhangQD
Copy link
Contributor

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

MO does not support `insert ignore` now:

mysql> INSERT IGNORE INTO `test`.`storage` (`collecttime`,`value`,`account`,`interval`) VALUES ('2023-08-15 14:19:00',4790.699000,'test1',1);
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 13 near " IGNORE INTO `test`.`storage` (`collecttime`,`value`,`account`,`interval`) VALUES ('2023-08-15 14:19:00',4790.699000,'test1',1)";


### Describe the feature you'd like

MO supports `insert ignore`

### Describe implementation you've considered

_No response_

### Documentation, Adoption, Use Case, Migration Strategy

_No response_

### Additional information

_No response_
@DanielZhangQD DanielZhangQD added priority/p0 Critical feature that should be implemented in this version kind/feature labels Aug 15, 2023
@DanielZhangQD DanielZhangQD added this to the 1.0.0 milestone Aug 15, 2023
@domingozhang domingozhang modified the milestones: 1.0.0, Backlog Aug 15, 2023
@domingozhang
Copy link
Contributor

to be implemented in next release

@domingozhang domingozhang modified the milestones: Backlog, 1.1.0 Aug 21, 2023
@LiSong0214 LiSong0214 assigned daviszhen and unassigned daviszhen Aug 21, 2023
@sukki37 sukki37 added source/dev issues from devs source/on-demand issues on the demands of users, customers or market labels Aug 27, 2023
@lacrimosaprinz lacrimosaprinz added the attention/doc-influence need to complete design document label Aug 29, 2023
@ouyuanning
Copy link
Contributor

you can try SQL like:

INSERT INTO test.storage (collecttime,value,account,interval) VALUES ('2023-08-15 14:19:00',4790.699000,'test1',1) on duplicate key update account=account;

@DanielZhangQD
Copy link
Contributor Author

you can try SQL like:

INSERT INTO test.storage (collecttime,value,account,interval) VALUES ('2023-08-15 14:19:00',4790.699000,'test1',1) on duplicate key update account=account;

@ouyuanning 试了一下可以满足我们需求,我们就用这个语句

@domingozhang domingozhang added priority/p0.5 and removed priority/p0 Critical feature that should be implemented in this version labels Sep 4, 2023
@sukki37 sukki37 modified the milestones: 1.1.0, 1.2.0 Nov 20, 2023
@dengn
Copy link
Contributor

dengn commented Jan 15, 2024

Update in 1.2. For test and doc side, follow MySQL behavior, and performance should be equal to INSERT INTO.

@YANGGMM
Copy link
Contributor

YANGGMM commented Mar 27, 2024

support insert ignore synatx in #15020

@heni02
Copy link
Contributor

heni02 commented Apr 7, 2024

测试总结,目前和mysql差异:@dengn cc
1: null约束报错,mysql不报错
企业微信截图_83957d89-7354-420b-b17d-f3023d0376a4
企业微信截图_50f89551-2692-4e43-b636-fc713798da9e

2.外键约束报错,mysql不报错
企业微信截图_51c6b1e0-5286-4230-94ad-896bd9223c23
3.超出类型值范围报错,mysql不报错
企业微信截图_8b145678-3969-40fb-ad09-63b84bc716be
4.类型不匹配也报错
企业微信截图_c0b33fd2-9f98-4b63-9abc-c46272eaa612

@heni02
Copy link
Contributor

heni02 commented Apr 7, 2024

mo目前没有记录ignore的数据,mysql可以查到ingore的数据 ,@dengn cc
企业微信截图_1eb517ce-4633-4274-80cf-9b71f5b9acc9

@heni02 heni02 mentioned this issue Apr 7, 2024
7 tasks
@ouyuanning ouyuanning assigned jensenojs and unassigned daviszhen Apr 12, 2024
@ouyuanning
Copy link
Contributor

@ouyuanning
Copy link
Contributor

@jensenojs 重新实现一下insert ignore吧。
1、应该要用另外的算子实现,不能走on duplicate key
2、应该就是类似先join一遍,检查通过的行才流入到insert算子 (这里我一时半会也想不出来要不要新增一个join类型)
3、先实现当前的语义,只是不走on duplicate key。 MySQL的语义更复杂,可以逐步来。

@jensenojs
Copy link
Contributor

@dengn dengn modified the milestones: 1.2.0, 1.3.0-Backlog May 9, 2024
@sukki37 sukki37 modified the milestones: 1.3.0-Backlog, 1.3.0 Jul 16, 2024
@sukki37 sukki37 assigned aunjgr and unassigned jensenojs Jul 16, 2024
@aunjgr
Copy link
Contributor

aunjgr commented Jul 17, 2024

insert ignore语法本身已经支持。性能问题使用 #17500 继续跟踪。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention/doc-influence need to complete design document kind/feature phase/testing priority/p0.5 source/dev issues from devs source/on-demand issues on the demands of users, customers or market
Projects
None yet
Development

No branches or pull requests