Skip to content

[Enhancement] make insert into tbl values () compliance with mysql protocol #20582

@Hastyshell

Description

@Hastyshell

Search before asking

  • I had searched in the issues and found no similar issues.

Description

In mysql, insert into tbl values() will attempt to insert default values for all columns if their default values are set.

However, insert into tbl values() will result in Column count doesn't match value count in our logic.

Solution

The logic around

// check if size of select item equal with columns mentioned in statement
if (mentionedColumns.size() != queryStmt.getResultExprs().size()) {
ErrorReport.reportAnalysisException(ErrorCode.ERR_WRONG_VALUE_COUNT);
}
should be optimized.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions