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

Support Mysql REPLACE statement and PRIORITY clause of INSERT #1072

Merged
merged 7 commits into from
Dec 24, 2023

Conversation

emin100
Copy link
Contributor

@emin100 emin100 commented Dec 22, 2023

New feature support

  • Mysql replace statement was added
  • Mysql insert and replace statement priority part were added

Examples:

REPLACE DELAYED INTO tasks (title, priority) VALUES ('Test Some Inserts', 1)

INSERT HIGH_PRIORITY INTO tasks (title, priority) VALUES ('Test Some Inserts', 1)

- Mysql replace statement was added
- Mysql insert and replace statement priority part were added

Examples:

REPLACE DELAYED INTO tasks (title, priority) VALUES ('Test Some Inserts', 1)

INSERT HIGH_PRIORITY INTO tasks (title, priority) VALUES ('Test Some Inserts', 1)
@coveralls
Copy link

coveralls commented Dec 22, 2023

Pull Request Test Coverage Report for Build 7308586737

  • 115 of 119 (96.64%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 87.732%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 19 20 95.0%
src/ast/mod.rs 12 15 80.0%
Files with Coverage Reduction New Missed Lines %
src/ast/mod.rs 2 79.28%
Totals Coverage Status
Change from base Build 7303175792: 0.05%
Covered Lines: 18401
Relevant Lines: 20974

💛 - Coveralls

@alamb alamb changed the title Mysql replace statement and priority part to insert and replace statements support added Support Mysql REPLACE statement and PRIORITY clause of INSERT Dec 22, 2023
@alamb
Copy link
Contributor

alamb commented Dec 22, 2023

Retrigger CI

@alamb alamb closed this Dec 22, 2023
@alamb alamb reopened this Dec 22, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution @emin100 -- I think this is looking pretty close. I left some suggestions for your consideration.

src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_mysql.rs Show resolved Hide resolved
- Fixed error message
- Added generic dialect
- Added extra tests
@emin100
Copy link
Contributor Author

emin100 commented Dec 22, 2023

@alamb thanks for the suggestions. I changed the pr.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @emin100 -- this is looking quite close. Thank you for sticking with it

src/parser/mod.rs Outdated Show resolved Hide resolved
src/ast/mod.rs Outdated Show resolved Hide resolved
- Removed HighPriprty check
- Changed returning object
@emin100
Copy link
Contributor Author

emin100 commented Dec 23, 2023

@alamb If possible, can you release a new version that includes this change?

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @emin100 -- this looks good to me. Thank you for sticking with it

@alamb alamb merged commit c62ecb1 into apache:main Dec 24, 2023
10 checks passed
@emin100 emin100 deleted the replace_into branch December 24, 2023 14:03
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 this pull request may close these issues.

3 participants