Skip to content

Conversation

@chakkk309
Copy link
Contributor

@chakkk309 chakkk309 commented Jul 19, 2025

Ref #34029

Changes proposed in this pull request:

  • Support flush statement SQL bind

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

if (sqlStatement instanceof ExplainStatement) {
return new ExplainStatementContext(metaData, (ExplainStatement) sqlStatement, params, currentDatabaseName);
}
if (sqlStatement instanceof FlushStatement) {
Copy link
Member

Choose a reason for hiding this comment

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

Please use CommonSQLStatementContext.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

* Flush statement context.
*/
@Getter
public final class FlushStatementContext implements SQLStatementContext {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you can use CommonSQLStatementContext.

if (tables.isEmpty()) {
return sqlStatement;
}

Copy link
Member

Choose a reason for hiding this comment

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

Please remove useless blank line.

Collection<SimpleTableSegment> boundTables = tables.stream()
.map(each -> SimpleTableSegmentBinder.bind(each, binderContext, tableBinderContexts))
.collect(Collectors.toList());

Copy link
Member

Choose a reason for hiding this comment

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

Please remove useless blank line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@chakkk309 chakkk309 requested a review from strongduanmu July 21, 2025 02:01
@chakkk309
Copy link
Contributor Author

Hi @strongduanmu , I’ve made the updates, could u take a quick look at this PR? Thanks!

}

private FlushStatement copyFlushStatement(final FlushStatement sqlStatement, final Collection<SimpleTableSegment> tables) {
FlushStatement result = new FlushStatement(sqlStatement.getDatabaseType()) {
Copy link
Member

Choose a reason for hiding this comment

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

Hi @chakkk309, can you merge the latest branch. There is no FlushStatement now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created FlushStatement in this pr, please have a check ~

@chakkk309 chakkk309 requested a review from strongduanmu July 29, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants