Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: migrate from deprecated line/column to startPosition/endPosition (#17760)
Danny Xu0ab00fc1abad
diff --git a/action/common/common.go b/action/common/common.goindex 44b9355a9b..a91d781723 100644--- a/action/common/common.go+++ b/action/common/common.go@@ -2,8 +2,8 @@package commonfunc ConvertLineToActionLine(line int) int {- if line < 0 {+ if line < 1 {return 1}- return line + 1+ return line}diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex b3819ff183..515a895ffc 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -421,8 +421,6 @@ func convertToPlanCheckRunResult(result *storepb.PlanCheckRunResult_Result) *v1pcase *storepb.PlanCheckRunResult_Result_SqlReviewReport_:resultV1.Report = &v1pb.PlanCheckRun_Result_SqlReviewReport_{SqlReviewReport: &v1pb.PlanCheckRun_Result_SqlReviewReport{- Line: report.SqlReviewReport.Line,- Column: report.SqlReviewReport.Column,StartPosition: convertToPosition(report.SqlReviewReport.StartPosition),EndPosition: convertToPosition(report.SqlReviewReport.EndPosition),},diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.goindex ec96df4d5b..d0cd9f38f2 100644--- a/backend/api/v1/sql_service.go+++ b/backend/api/v1/sql_service.go@@ -257,8 +257,7 @@ func (s *SQLService) Query(ctx context.Context, req *connect.Request[v1pb.QueryRStatus: v1pb.Advice_ERROR,Report: &v1pb.PlanCheckRun_Result_SqlReviewReport_{SqlReviewReport: &v1pb.PlanCheckRun_Result_SqlReviewReport{- Line: int32(syntaxErr.Position.GetLine()),- Column: int32(syntaxErr.Position.GetColumn()),+ StartPosition: convertToPosition(syntaxErr.Position),},},}); detailErr == nil {@@ -1572,8 +1571,7 @@ func validateQueryRequest(instance *store.InstanceMessage, statement string) errStatus: v1pb.Advice_ERROR,Report: &v1pb.PlanCheckRun_Result_SqlReviewReport_{SqlReviewReport: &v1pb.PlanCheckRun_Result_SqlReviewReport{- Line: int32(syntaxErr.Position.GetLine()),- Column: int32(syntaxErr.Position.GetColumn()),+ StartPosition: convertToPosition(syntaxErr.Position),},},}); detailErr == nil {diff --git a/backend/generated-go/store/common.pb.go b/backend/generated-go/store/common.pb.goindex 5f84abf42c..71f00c4e73 100644--- a/backend/generated-go/store/common.pb.go+++ b/backend/generated-go/store/common.pb.go@@ -524,12 +524,12 @@ func (x *PageToken) GetOffset() int32 {return 0}-// Position in a text expressed as zero-based line and column byte offset.+// Position in a text expressed as one-based line and one-based column.type Position struct {state protoimpl.MessageState `protogen:"open.v1"`- // Line position in a text (zero-based).+ // Line position in a text (one-based).Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`- // Column position in a text (zero-based), equivalent to byte offset.+ // Column position in a text (one-based).Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCachediff --git a/backend/generated-go/store/plan_check_run.pb.go b/backend/generated-go/store/plan_check_run.pb.goindex 539c931e42..5313605ed6 100644--- a/backend/generated-go/store/plan_check_run.pb.go+++ b/backend/generated-go/store/plan_check_run.pb.go@@ -404,11 +404,8 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) GetChangedResources() *Chan}type PlanCheckRunResult_Result_SqlReviewReport struct {- state protoimpl.MessageState `protogen:"open.v1"`- Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`- Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`- // 1-based position of the SQL statement.- // To supersede `line` and `column` above.+ state protoimpl.MessageState `protogen:"open.v1"`+ // Position of the SQL statement.StartPosition *Position `protobuf:"bytes,8,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"`EndPosition *Position `protobuf:"bytes,9,opt,name=end_position,json=endPosition,proto3" json:"end_position,omitempty"`unknownFields protoimpl.UnknownFields@@ -445,20 +442,6 @@ func (*PlanCheckRunResult_Result_SqlReviewReport) Descriptor() ([]byte, []int) {return file_store_plan_check_run_proto_rawDescGZIP(), []int{1, 0, 1}}-func (x *PlanCheckRunResult_Result_SqlReviewReport) GetLine() int32 {- if x != nil {- return x.Line- }- return 0-}--func (x *PlanCheckRunResult_Result_SqlReviewReport) GetColumn() int32 {- if x != nil {- return x.Column- }- return 0-}-func (x *PlanCheckRunResult_Result_SqlReviewReport) GetStartPosition() *Position {if x != nil {return x.StartPosition@@ -499,10 +482,10 @@ const file_store_plan_check_run_proto_rawDesc = "" +"\tDDL_GHOST\x10\x04\x12\x0e\n" +"\n" +"SQL_EDITOR\x10\x05B\x15\n" +- "\x13_database_group_uid\"\xd6\x06\n" ++ "\x13_database_group_uid\"\xb6\x06\n" +"\x12PlanCheckRunResult\x12C\n" +"\aresults\x18\x01 \x03(\v2).bytebase.store.PlanCheckRunResult.ResultR\aresults\x12\x14\n" +- "\x05error\x18\x02 \x01(\tR\x05error\x1a\xe4\x05\n" ++ "\x05error\x18\x02 \x01(\tR\x05error\x1a\xc4\x05\n" +"\x06Result\x125\n" +"\x06status\x18\x01 \x01(\x0e2\x1d.bytebase.store.Advice.StatusR\x06status\x12\x14\n" +"\x05title\x18\x02 \x01(\tR\x05title\x12\x18\n" +@@ -513,12 +496,10 @@ const file_store_plan_check_run_proto_rawDesc = "" +"\x10SqlSummaryReport\x12'\n" +"\x0fstatement_types\x18\x02 \x03(\tR\x0estatementTypes\x12#\n" +"\raffected_rows\x18\x03 \x01(\x03R\faffectedRows\x12M\n" +- "\x11changed_resources\x18\x04 \x01(\v2 .bytebase.store.ChangedResourcesR\x10changedResourcesJ\x04\b\x01\x10\x02\x1a\xc7\x01\n" +- "\x0fSqlReviewReport\x12\x12\n" +- "\x04line\x18\x01 \x01(\x05R\x04line\x12\x16\n" +- "\x06column\x18\x02 \x01(\x05R\x06column\x12?\n" ++ "\x11changed_resources\x18\x04 \x01(\v2 .bytebase.store.ChangedResourcesR\x10changedResourcesJ\x04\b\x01\x10\x02\x1a\xa7\x01\n" ++ "\x0fSqlReviewReport\x12?\n" +"\x0estart_position\x18\b \x01(\v2\x18.bytebase.store.PositionR\rstartPosition\x12;\n" +- "\fend_position\x18\t \x01(\v2\x18.bytebase.store.PositionR\vendPositionJ\x04\b\x03\x10\x04J\x04\b\x04\x10\x05B\b\n" ++ "\fend_position\x18\t \x01(\v2\x18.bytebase.store.PositionR\vendPositionJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x04\x10\x05B\b\n" +"\x06reportB\x14Z\x12generated-go/storeb\x06proto3"var (diff --git a/backend/generated-go/store/plan_check_run_equal.pb.go b/backend/generated-go/store/plan_check_run_equal.pb.goindex ec5c3b06c0..d813099025 100644--- a/backend/generated-go/store/plan_check_run_equal.pb.go+++ b/backend/generated-go/store/plan_check_run_equal.pb.go@@ -74,12 +74,6 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) Equal(y *PlanCheckRunResult_if x == nil || y == nil {return x == nil && y == nil}- if x.Line != y.Line {- return false- }- if x.Column != y.Column {- return false- }if !x.StartPosition.Equal(y.StartPosition) {return false}diff --git a/backend/generated-go/v1/common.pb.go b/backend/generated-go/v1/common.pb.goindex d177e4c5d2..841bf9aa95 100644--- a/backend/generated-go/v1/common.pb.go+++ b/backend/generated-go/v1/common.pb.go@@ -505,13 +505,12 @@ func (RiskLevel) EnumDescriptor() ([]byte, []int) {return file_v1_common_proto_rawDescGZIP(), []int{6}}-// Position in a text expressed as zero-based line and zero-based column byte-// offset.+// Position in a text expressed as one-based line and one-based column.type Position struct {state protoimpl.MessageState `protogen:"open.v1"`- // Line position in a text (zero-based).+ // Line position in a text (one-based).Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`- // Column position in a text (zero-based), equivalent to byte offset.+ // Column position in a text (one-based).Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCachediff --git a/backend/generated-go/v1/plan_service.pb.go b/backend/generated-go/v1/plan_service.pb.goindex ffee550a2a..d5ec1be24f 100644--- a/backend/generated-go/v1/plan_service.pb.go+++ b/backend/generated-go/v1/plan_service.pb.go@@ -1872,11 +1872,8 @@ func (x *PlanCheckRun_Result_SqlSummaryReport) GetChangedResources() *ChangedRes}type PlanCheckRun_Result_SqlReviewReport struct {- state protoimpl.MessageState `protogen:"open.v1"`- Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`- Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`- // 1-based Position of the SQL statement.- // To supersede `line` and `column` above.+ state protoimpl.MessageState `protogen:"open.v1"`+ // Position of the SQL statement.StartPosition *Position `protobuf:"bytes,5,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"`EndPosition *Position `protobuf:"bytes,6,opt,name=end_position,json=endPosition,proto3" json:"end_position,omitempty"`unknownFields protoimpl.UnknownFields@@ -1913,20 +1910,6 @@ func (*PlanCheckRun_Result_SqlReviewReport) Descriptor() ([]byte, []int) {return file_v1_plan_service_proto_rawDescGZIP(), []int{14, 0, 1}}-func (x *PlanCheckRun_Result_SqlReviewReport) GetLine() int32 {- if x != nil {- return x.Line- }- return 0-}--func (x *PlanCheckRun_Result_SqlReviewReport) GetColumn() int32 {- if x != nil {- return x.Column- }- return 0-}-func (x *PlanCheckRun_Result_SqlReviewReport) GetStartPosition() *Position {if x != nil {return x.StartPosition@@ -2063,7 +2046,7 @@ const file_v1_plan_service_proto_rawDesc = "" +"\x06parent\x18\x01 \x01(\tB\x19\xe0A\x02\xfaA\x13\n" +"\x11bytebase.com/PlanR\x06parent\x12&\n" +"\x0fplan_check_runs\x18\x02 \x03(\tR\rplanCheckRuns\"\"\n" +- " BatchCancelPlanCheckRunsResponse\"\xab\n" ++ " BatchCancelPlanCheckRunsResponse\"\x8b\n" +"\n" +"\fPlanCheckRun\x12\x12\n" +"\x04name\x18\x01 \x01(\tR\x04name\x122\n" +@@ -2074,7 +2057,7 @@ const file_v1_plan_service_proto_rawDesc = "" +"\aresults\x18\a \x03(\v2 .bytebase.v1.PlanCheckRun.ResultR\aresults\x12\x14\n" +"\x05error\x18\b \x01(\tR\x05error\x12@\n" +"\vcreate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +- "createTime\x1a\xc5\x05\n" ++ "createTime\x1a\xa5\x05\n" +"\x06Result\x121\n" +"\x06status\x18\x01 \x01(\x0e2\x19.bytebase.v1.Advice.LevelR\x06status\x12\x14\n" +"\x05title\x18\x02 \x01(\tR\x05title\x12\x18\n" +@@ -2085,12 +2068,10 @@ const file_v1_plan_service_proto_rawDesc = "" +"\x10SqlSummaryReport\x12'\n" +"\x0fstatement_types\x18\x02 \x03(\tR\x0estatementTypes\x12#\n" +"\raffected_rows\x18\x03 \x01(\x03R\faffectedRows\x12J\n" +- "\x11changed_resources\x18\x04 \x01(\v2\x1d.bytebase.v1.ChangedResourcesR\x10changedResourcesJ\x04\b\x01\x10\x02\x1a\xc1\x01\n" +- "\x0fSqlReviewReport\x12\x12\n" +- "\x04line\x18\x01 \x01(\x05R\x04line\x12\x16\n" +- "\x06column\x18\x02 \x01(\x05R\x06column\x12<\n" ++ "\x11changed_resources\x18\x04 \x01(\v2\x1d.bytebase.v1.ChangedResourcesR\x10changedResourcesJ\x04\b\x01\x10\x02\x1a\xa1\x01\n" ++ "\x0fSqlReviewReport\x12<\n" +"\x0estart_position\x18\x05 \x01(\v2\x15.bytebase.v1.PositionR\rstartPosition\x128\n" +- "\fend_position\x18\x06 \x01(\v2\x15.bytebase.v1.PositionR\vendPositionJ\x04\b\x03\x10\x04J\x04\b\x04\x10\x05B\b\n" ++ "\fend_position\x18\x06 \x01(\v2\x15.bytebase.v1.PositionR\vendPositionJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x04\x10\x05B\b\n" +"\x06report\"\xb5\x01\n" +"\x04Type\x12\x14\n" +"\x10TYPE_UNSPECIFIED\x10\x00\x12\"\n" +diff --git a/backend/generated-go/v1/plan_service_equal.pb.go b/backend/generated-go/v1/plan_service_equal.pb.goindex 35b9f7c486..1a4480d756 100644--- a/backend/generated-go/v1/plan_service_equal.pb.go+++ b/backend/generated-go/v1/plan_service_equal.pb.go@@ -512,12 +512,6 @@ func (x *PlanCheckRun_Result_SqlReviewReport) Equal(y *PlanCheckRun_Result_SqlReif x == nil || y == nil {return x == nil && y == nil}- if x.Line != y.Line {- return false- }- if x.Column != y.Column {- return false- }if !x.StartPosition.Equal(y.StartPosition) {return false}diff --git a/backend/plugin/parser/mysql/statement_type_check.go b/backend/plugin/parser/mysql/statement_type_check.goindex f760368c85..ee64265690 100644--- a/backend/plugin/parser/mysql/statement_type_check.go+++ b/backend/plugin/parser/mysql/statement_type_check.go@@ -1,45 +1,9 @@package mysqlimport (- "fmt"-mysql "github.com/bytebase/mysql-parser"-- "github.com/bytebase/bytebase/backend/common"- storepb "github.com/bytebase/bytebase/backend/generated-go/store")-type CreateAndDropDatabaseChecker struct {- *mysql.BaseMySQLParserListener-- Text string- Results []*storepb.PlanCheckRunResult_Result-}--func (checker *CreateAndDropDatabaseChecker) EnterQuery(ctx *mysql.QueryContext) {- checker.Text = ctx.GetParser().GetTokenStream().GetTextFromRuleContext(ctx)-}--// EnterCreateDatabase is called when production createDatabase is entered.-func (checker *CreateAndDropDatabaseChecker) EnterCreateDatabase(_ *mysql.CreateDatabaseContext) {- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_ERROR,- Code: common.TaskTypeCreateDatabase.Int32(),- Title: "Cannot create database",- Content: fmt.Sprintf(`The statement "%s" creates database`, checker.Text),- })-}--// EnterDropDatabase is called when production dropDatabase is entered.-func (checker *CreateAndDropDatabaseChecker) EnterDropDatabase(_ *mysql.DropDatabaseContext) {- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_ERROR,- Code: common.TaskTypeDropDatabase.Int32(),- Title: "Cannot drop database",- Content: fmt.Sprintf(`The statement "%s" drops database`, checker.Text),- })-}-type StatementTypeChecker struct {*mysql.BaseMySQLParserListener@@ -231,144 +195,3 @@ func (checker *StatementTypeChecker) EnterPreparedStatement(ctx *mysql.PreparedS}}}--type SDLTypeChecker struct {- *mysql.BaseMySQLParserListener-- baseLine int- Results []*storepb.PlanCheckRunResult_Result-}--// for SDL.-// EnterDropTable is called when production dropTable is entered.-func (checker *SDLTypeChecker) EnterDropTable(ctx *mysql.DropTableContext) {- if ctx.TableRefList() == nil {- return- }-- for _, tableRef := range ctx.TableRefList().AllTableRef() {- _, tableName := NormalizeMySQLTableRef(tableRef)- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_WARNING,- Code: common.TaskTypeDropTable.Int32(),- Title: "Plan to drop table",- Content: fmt.Sprintf("Plan to drop table `%s`", tableName),- Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{- SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: int32(checker.baseLine + ctx.GetStart().GetLine()),- },- },- })- }-}--// EnterDropIndex is called when production dropIndex is entered.-func (checker *SDLTypeChecker) EnterDropIndex(ctx *mysql.DropIndexContext) {- if ctx.IndexRef() == nil || ctx.TableRef() == nil {- return- }-- _, _, indexName := NormalizeIndexRef(ctx.IndexRef())- _, tableName := NormalizeMySQLTableRef(ctx.TableRef())- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_WARNING,- Code: common.TaskTypeDropIndex.Int32(),- Title: "Plan to drop index",- Content: fmt.Sprintf("Plan to drop index `%s` on table `%s`", indexName, tableName),- Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{- SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: int32(checker.baseLine + ctx.GetStart().GetLine()),- },- },- })-}--// EnterAlterTable is called when production alterTable is entered.-func (checker *SDLTypeChecker) EnterAlterTable(ctx *mysql.AlterTableContext) {- if ctx.TableRef() == nil {- // todo: maybe need to do error handle.- return- }-- _, tableName := NormalizeMySQLTableRef(ctx.TableRef())-- if ctx.AlterTableActions() == nil {- return- }- if ctx.AlterTableActions().AlterCommandList() == nil {- return- }- if ctx.AlterTableActions().AlterCommandList().AlterList() == nil {- return- }-- for _, alterListItem := range ctx.AlterTableActions().AlterCommandList().AlterList().AllAlterListItem() {- if alterListItem == nil {- continue- }-- switch {- case alterListItem.DROP_SYMBOL() != nil:- switch {- // drop column.- case alterListItem.ColumnInternalRef() != nil:- columnName := NormalizeMySQLColumnInternalRef(alterListItem.ColumnInternalRef())- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_WARNING,- Code: common.TaskTypeDropColumn.Int32(),- Title: "Plan to drop column",- Content: fmt.Sprintf("Plan to drop column `%s` on table `%s`", columnName, tableName),- Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{- SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: int32(checker.baseLine + alterListItem.GetStart().GetLine()),- },- },- })- // drop primary key.- case alterListItem.PRIMARY_SYMBOL() != nil && alterListItem.KEY_SYMBOL() != nil:- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_WARNING,- Code: common.TaskTypeDropPrimaryKey.Int32(),- Title: "Plan to drop primary key",- Content: fmt.Sprintf("Plan to drop primary key on table `%s`", tableName),- Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{- SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: int32(checker.baseLine + ctx.GetStart().GetLine()),- },- },- })- // drop foreign key.- case alterListItem.FOREIGN_SYMBOL() != nil && alterListItem.KEY_SYMBOL() != nil && alterListItem.ColumnInternalRef() != nil:- name := NormalizeMySQLColumnInternalRef(alterListItem.ColumnInternalRef())- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_WARNING,- Code: common.TaskTypeDropForeignKey.Int32(),- Title: "Plan to drop foreign key",- Content: fmt.Sprintf("Plan to drop foreign key `%s` on table `%s`", name, tableName),- Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{- SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: int32(checker.baseLine + ctx.GetStart().GetLine()),- },- },- })- // drop check.- case alterListItem.CHECK_SYMBOL() != nil && alterListItem.Identifier() != nil:- constraintName := NormalizeMySQLIdentifier(alterListItem.Identifier())- checker.Results = append(checker.Results, &storepb.PlanCheckRunResult_Result{- Status: storepb.Advice_WARNING,- Code: common.TaskTypeDropCheck.Int32(),- Title: "Plan to drop check constraint",- Content: fmt.Sprintf("Plan to drop check constraint `%s` on table `%s`", constraintName, tableName),- Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{- SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: int32(checker.baseLine + ctx.GetStart().GetLine()),- },- },- })- default:- // Other drop types are not tracked- }- default:- }- }-}diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.goindex cce921ca7e..6faa4165d8 100644--- a/backend/runner/plancheck/statement_advise_executor.go+++ b/backend/runner/plancheck/statement_advise_executor.go@@ -213,8 +213,6 @@ func (e *StatementAdviseExecutor) runReview(Code: advice.Code,Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: advice.GetStartPosition().GetLine(),- Column: advice.GetStartPosition().GetColumn(),StartPosition: advice.StartPosition,EndPosition: advice.EndPosition,},diff --git a/backend/runner/plancheck/statement_report_executor.go b/backend/runner/plancheck/statement_report_executor.goindex 80bd6a056b..fc089504b6 100644--- a/backend/runner/plancheck/statement_report_executor.go+++ b/backend/runner/plancheck/statement_report_executor.go@@ -109,8 +109,6 @@ func (e *StatementReportExecutor) Run(ctx context.Context, config *storepb.PlanCCode: advice.Code,Report: &storepb.PlanCheckRunResult_Result_SqlReviewReport_{SqlReviewReport: &storepb.PlanCheckRunResult_Result_SqlReviewReport{- Line: advice.GetStartPosition().GetLine(),- Column: advice.GetStartPosition().GetColumn(),StartPosition: advice.StartPosition,EndPosition: advice.EndPosition,},diff --git a/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts b/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.tsindex 3146fa75d9..43f5b15655 100644--- a/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts+++ b/frontend/src/components/IssueV1/components/StatementSection/useSQLAdviceMarkers.ts@@ -64,13 +64,14 @@ const getLatestAdviceOptions = (planCheckRunList: PlanCheckRun[]) => {.filter((result) =>result.report?.case === "sqlReviewReport" &&- result.report.value.line !== undefined+ result.report.value.startPosition !== undefined).map<AdviceOption>((result) => {const sqlReviewReport =result.report?.case === "sqlReviewReport" ? result.report.value : null;- const line = sqlReviewReport?.line ?? 0;- const column = sqlReviewReport?.column ?? Number.MAX_SAFE_INTEGER;+ const line = sqlReviewReport?.startPosition?.line ?? 0;+ const column =+ sqlReviewReport?.startPosition?.column ?? Number.MAX_SAFE_INTEGER;const code = result.code;return {severity: result.status === Advice_Level.ERROR ? "ERROR" : "WARNING",diff --git a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vueindex dc0ac4a30b..6798d816b7 100644--- a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue+++ b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue@@ -298,7 +298,6 @@ const transformToFormattedCheckRuns = (case: "sqlReviewReport",value: {startPosition: advice.startPosition,- line: advice.startPosition ? advice.startPosition.line : 0,},},});diff --git a/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts b/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.tsindex 59918bbf79..8cf495ac1c 100644--- a/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts+++ b/frontend/src/components/Plan/components/StatementSection/useSQLAdviceMarkers.ts@@ -62,13 +62,11 @@ const getLatestAdviceOptions = (planCheckRuns: PlanCheckRun[]) => {.filter((result) =>result.report.case === "sqlReviewReport" &&- result.report.value.startPosition+ result.report.value.startPosition !== undefined).map<AdviceOption>((result) => {const sqlReviewReport =- result.report.case === "sqlReviewReport"- ? result.report.value- : undefined;+ result.report.case === "sqlReviewReport" ? result.report.value : null;const line = sqlReviewReport?.startPosition?.line ?? 0;const column =sqlReviewReport?.startPosition?.column ?? Number.MAX_SAFE_INTEGER;diff --git a/frontend/src/components/Plan/components/common/CheckResultItem.vue b/frontend/src/components/Plan/components/common/CheckResultItem.vueindex 525f1e50cd..34ffbbdd6e 100644--- a/frontend/src/components/Plan/components/common/CheckResultItem.vue+++ b/frontend/src/components/Plan/components/common/CheckResultItem.vue@@ -14,7 +14,7 @@{{ content }}</div><div v-if="position" class="text-sm mt-1 text-control-light">- Line {{ position.line + 1 }}, Column {{ position.column + 1 }}+ Line {{ position.line }}, Column {{ position.column }}</div><divv-if="affectedRows !== undefined"diff --git a/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue b/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vueindex bb9797feb3..fe53651ef8 100644--- a/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue+++ b/frontend/src/components/PlanCheckRun/PlanCheckRunDetail.vue@@ -94,7 +94,7 @@v-if="showCodeLocation &&row.checkResult.report.case === 'sqlReviewReport' &&- row.checkResult.report.value.line+ row.checkResult.report.value.startPosition"class="pl-2 first:pl-0">@@ -102,14 +102,14 @@class="normal-link"@click="convertPositionLineToMonacoLine(- row.checkResult.report.value.line+ row.checkResult.report.value.startPosition.line)">Line{{convertPositionLineToMonacoLine(- row.checkResult.report.value.line+ row.checkResult.report.value.startPosition.line)}}</span>@@ -178,7 +178,7 @@v-if="showCodeLocation &&row.checkResult.report.case === 'sqlReviewReport' &&- row.checkResult.report.value.line+ row.checkResult.report.value.startPosition"><span class="border-r border-control-border ml-1"></span>@@ -187,14 +187,16 @@@click="handleClickPlanCheckDetailLine(convertPositionLineToMonacoLine(- row.checkResult.report.value.line+ row.checkResult.report.value.startPosition.line))">Line{{- convertPositionLineToMonacoLine(row.checkResult.report.value.line)+ convertPositionLineToMonacoLine(+ row.checkResult.report.value.startPosition.line+ )}}</span></template>diff --git a/frontend/src/components/SQLCheck/SQLCheckPanel.vue b/frontend/src/components/SQLCheck/SQLCheckPanel.vueindex 23f98f5926..a96f34c19d 100644--- a/frontend/src/components/SQLCheck/SQLCheckPanel.vue+++ b/frontend/src/components/SQLCheck/SQLCheckPanel.vue@@ -145,8 +145,7 @@ const planCheckRun = computed((): PlanCheckRun => {report: {case: "sqlReviewReport",value: createProto(PlanCheckRun_Result_SqlReviewReportSchema, {- line: advice.startPosition?.line ?? 0,- column: advice.startPosition?.column ?? Number.MAX_SAFE_INTEGER,+ startPosition: advice.startPosition,}),},});diff --git a/frontend/src/store/modules/v1/sql.ts b/frontend/src/store/modules/v1/sql.tsindex 0c0e944c06..458d62a08f 100644--- a/frontend/src/store/modules/v1/sql.ts+++ b/frontend/src/store/modules/v1/sql.ts@@ -25,10 +25,7 @@ export const getSqlReviewReports = (err: unknown): Advice[] => {for (const report of err.findDetails(PlanCheckRun_ResultSchema)) {const startPosition =report.report.case === "sqlReviewReport"- ? {- line: report.report.value.line,- column: report.report.value.column,- }+ ? report.report.value.startPosition: undefined;advices.push(createProto(AdviceSchema, {diff --git a/frontend/src/types/proto-es/v1/common_pb.d.ts b/frontend/src/types/proto-es/v1/common_pb.d.tsindex ed0189267a..cbbf6a7d28 100644--- a/frontend/src/types/proto-es/v1/common_pb.d.ts+++ b/frontend/src/types/proto-es/v1/common_pb.d.ts@@ -11,21 +11,20 @@ import type { Message } from "@bufbuild/protobuf";export declare const file_v1_common: GenFile;/**- * Position in a text expressed as zero-based line and zero-based column byte- * offset.+ * Position in a text expressed as one-based line and one-based column.** @generated from message bytebase.v1.Position*/export declare type Position = Message<"bytebase.v1.Position"> & {/**- * Line position in a text (zero-based).+ * Line position in a text (one-based).** @generated from field: int32 line = 1;*/line: number;/**- * Column position in a text (zero-based), equivalent to byte offset.+ * Column position in a text (one-based).** @generated from field: int32 column = 2;*/diff --git a/frontend/src/types/proto-es/v1/plan_service_pb.d.ts b/frontend/src/types/proto-es/v1/plan_service_pb.d.tsindex 079586c283..fccef4ff90 100644--- a/frontend/src/types/proto-es/v1/plan_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/plan_service_pb.d.ts@@ -934,18 +934,7 @@ export declare const PlanCheckRun_Result_SqlSummaryReportSchema: GenMessage<Plan*/export declare type PlanCheckRun_Result_SqlReviewReport = Message<"bytebase.v1.PlanCheckRun.Result.SqlReviewReport"> & {/**- * @generated from field: int32 line = 1;- */- line: number;-- /**- * @generated from field: int32 column = 2;- */- column: number;-- /**- * 1-based Position of the SQL statement.- * To supersede `line` and `column` above.+ * Position of the SQL statement.** @generated from field: bytebase.v1.Position start_position = 5;*/diff --git a/frontend/src/types/proto-es/v1/plan_service_pb.js b/frontend/src/types/proto-es/v1/plan_service_pb.jsindex 3aaa281d66..c27c5a87f9 100644--- a/frontend/src/types/proto-es/v1/plan_service_pb.js+++ b/frontend/src/types/proto-es/v1/plan_service_pb.js@@ -17,7 +17,7 @@ import { file_v1_sql_service } from "./sql_service_pb";* Describes the file v1/plan_service.proto.*/export const file_v1_plan_service = /*@__PURE__*/- fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4iZwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASAB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kNoZWNrUnVucy5saXN0kOowAYLT5JMCLxItL3YxL3twYXJlbnQ9cHJvamVjdHMvKi9wbGFucy8qfS9wbGFuQ2hlY2tSdW5zErEBCg1SdW5QbGFuQ2hlY2tzEiEuYnl0ZWJhc2UudjEuUnVuUGxhbkNoZWNrc1JlcXVlc3QaIi5ieXRlYmFzZS52MS5SdW5QbGFuQ2hlY2tzUmVzcG9uc2UiWdpBBG5hbWWK6jAUYmIucGxhbkNoZWNrUnVucy5ydW6Q6jABgtPkkwIwOgEqIisvdjEve25hbWU9cHJvamVjdHMvKi9wbGFucy8qfTpydW5QbGFuQ2hlY2tzEuIBChhCYXRjaENhbmNlbFBsYW5DaGVja1J1bnMSLC5ieXRlYmFzZS52MS5CYXRjaENhbmNlbFBsYW5DaGVja1J1bnNSZXF1ZXN0Gi0uYnl0ZWJhc2UudjEuQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zUmVzcG9uc2UiadpBBnBhcmVudIrqMBRiYi5wbGFuQ2hlY2tSdW5zLnJ1bpDqMAGC0+STAj46ASoiOS92MS97cGFyZW50PXByb2plY3RzLyovcGxhbnMvKn0vcGxhbkNoZWNrUnVuczpiYXRjaENhbmNlbEI2WjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_database_service, file_v1_sql_service]);+ fileDesc("ChV2MS9wbGFuX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIjkKDkdldFBsYW5SZXF1ZXN0EicKBG5hbWUYASABKAlCGeBBAvpBEwoRYnl0ZWJhc2UuY29tL1BsYW4iZwoQTGlzdFBsYW5zUmVxdWVzdBIsCgZwYXJlbnQYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QSEQoJc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bGFuQ2hlY2tSdW5zErEBCg1SdW5QbGFuQ2hlY2tzEiEuYnl0ZWJhc2UudjEuUnVuUGxhbkNoZWNrc1JlcXVlc3QaIi5ieXRlYmFzZS52MS5SdW5QbGFuQ2hlY2tzUmVzcG9uc2UiWdpBBG5hbWWK6jAUYmIucGxhbkNoZWNrUnVucy5ydW6Q6jABgtPkkwIwOgEqIisvdjEve25hbWU9cHJvamVjdHMvKi9wbGFucy8qfTpydW5QbGFuQ2hlY2tzEuIBChhCYXRjaENhbmNlbFBsYW5DaGVja1J1bnMSLC5ieXRlYmFzZS52MS5CYXRjaENhbmNlbFBsYW5DaGVja1J1bnNSZXF1ZXN0Gi0uYnl0ZWJhc2UudjEuQmF0Y2hDYW5jZWxQbGFuQ2hlY2tSdW5zUmVzcG9uc2UiadpBBnBhcmVudIrqMBRiYi5wbGFuQ2hlY2tSdW5zLnJ1bpDqMAGC0+STAj46ASoiOS92MS97cGFyZW50PXByb2plY3RzLyovcGxhbnMvKn0vcGxhbkNoZWNrUnVuczpiYXRjaENhbmNlbEI2WjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_database_service, file_v1_sql_service]);/*** Describes the message bytebase.v1.GetPlanRequest.diff --git a/frontend/src/utils/v1/position.ts b/frontend/src/utils/v1/position.tsindex 9f85c9abbc..af82aa9228 100644--- a/frontend/src/utils/v1/position.ts+++ b/frontend/src/utils/v1/position.ts@@ -10,7 +10,7 @@ export function batchConvertPositionToMonacoPosition(const lines = text.split("\n");const result: monaco.IPosition[] = [];for (const position of positions) {- if (position.line < 0) {+ if (position.line < 1) {result.push({lineNumber: 1,column: 1,@@ -18,7 +18,7 @@ export function batchConvertPositionToMonacoPosition(continue;}// Assuming the text is in utf-8 encoding.- const lineNumber = position.line + 1;+ const lineNumber = position.line;if (lineNumber > lines.length) {// Out of bounds, return the first character of the last line.result.push({@@ -31,7 +31,7 @@ export function batchConvertPositionToMonacoPosition(const line = lines[lineNumber - 1];let column = 1;for (let i = 0; i < line.length; i++) {- if (position.column <= i) {+ if (position.column <= i + 1) {result.push({lineNumber: lineNumber,column: column,@@ -55,8 +55,8 @@ export function batchConvertPositionToMonacoPosition(}export function convertPositionLineToMonacoLine(line: number) {- if (line < 0) {+ if (line < 1) {return 1;}- return line + 1;+ return line;}diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex 176a1eb0b1..95a5c60200 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -12467,15 +12467,13 @@ components:properties:line:type: integer- description: Line position in a text (zero-based).+ description: Line position in a text (one-based).format: int32column:type: integer- description: Column position in a text (zero-based), equivalent to byte offset.+ description: Column position in a text (one-based).format: int32- description: |-- Position in a text expressed as zero-based line and zero-based column byte- offset.+ description: Position in a text expressed as one-based line and one-based column.Postgres_Session:type: objectproperties:@@ -13133,18 +13131,10 @@ components:Result_SqlReviewReport:type: objectproperties:- line:- type: integer- format: int32- column:- type: integer- format: int32startPosition:allOf:- $ref: '#/components/schemas/Position'- description: |-- 1-based position of the SQL statement.- To supersede `line` and `column` above.+ description: Position of the SQL statement.endPosition:$ref: '#/components/schemas/Position'Result_SqlSummaryReport:diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 8c529fd589..ead04a10b8 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -360,13 +360,13 @@ PageToken is used internally for obfuscating pagination tokens.<a name="bytebase-store-Position"></a>### Position-Position in a text expressed as zero-based line and column byte offset.+Position in a text expressed as one-based line and one-based column.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | Line position in a text (zero-based). |-| column | [int32](#int32) | | Column position in a text (zero-based), equivalent to byte offset. |+| line | [int32](#int32) | | Line position in a text (one-based). |+| column | [int32](#int32) | | Column position in a text (one-based). |@@ -3325,9 +3325,7 @@ Type is the database change type.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | |-| column | [int32](#int32) | | |-| start_position | [Position](#bytebase-store-Position) | | 1-based position of the SQL statement. To supersede `line` and `column` above. |+| start_position | [Position](#bytebase-store-Position) | | Position of the SQL statement. || end_position | [Position](#bytebase-store-Position) | | |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex d8f72004cc..1443623f3f 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -1543,7 +1543,7 @@<h3 id="bytebase.store.Position">Position</h3>- <p>Position in a text expressed as zero-based line and column byte offset.</p>+ <p>Position in a text expressed as one-based line and one-based column.</p><table class="field-table">@@ -1556,14 +1556,14 @@<td>line</td><td><a href="#int32">int32</a></td><td></td>- <td><p>Line position in a text (zero-based). </p></td>+ <td><p>Line position in a text (one-based). </p></td></tr><tr><td>column</td><td><a href="#int32">int32</a></td><td></td>- <td><p>Column position in a text (zero-based), equivalent to byte offset. </p></td>+ <td><p>Column position in a text (one-based). </p></td></tr></tbody>@@ -9362,26 +9362,11 @@ Leave it empty if there is no need to encrypt the zip file. </p></td></thead><tbody>- <tr>- <td>line</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>column</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-<tr><td>start_position</td><td><a href="#bytebase.store.Position">Position</a></td><td></td>- <td><p>1-based position of the SQL statement.-To supersede `line` and `column` above. </p></td>+ <td><p>Position of the SQL statement. </p></td></tr><tr>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 949127d0b7..8be4404821 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -762,14 +762,13 @@ Authorization method for RPC calls.<a name="bytebase-v1-Position"></a>### Position-Position in a text expressed as zero-based line and zero-based column byte-offset.+Position in a text expressed as one-based line and one-based column.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | Line position in a text (zero-based). |-| column | [int32](#int32) | | Column position in a text (zero-based), equivalent to byte offset. |+| line | [int32](#int32) | | Line position in a text (one-based). |+| column | [int32](#int32) | | Column position in a text (one-based). |@@ -8185,9 +8184,7 @@ When paginating, all other parameters provided to `ListPlans` must match the cal| Field | Type | Label | Description || ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | |-| column | [int32](#int32) | | |-| start_position | [Position](#bytebase-v1-Position) | | 1-based Position of the SQL statement. To supersede `line` and `column` above. |+| start_position | [Position](#bytebase-v1-Position) | | Position of the SQL statement. || end_position | [Position](#bytebase-v1-Position) | | |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 0eb9eaceed..5281ed470f 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -2982,7 +2982,7 @@ Example: UpdateRole with allow_missing requires both bb.roles.update<h3 id="bytebase.v1.Position">Position</h3>- <p>Position in a text expressed as zero-based line and zero-based column byte</p><p>offset.</p>+ <p>Position in a text expressed as one-based line and one-based column.</p><table class="field-table">@@ -2995,14 +2995,14 @@ Example: UpdateRole with allow_missing requires both bb.roles.update<td>line</td><td><a href="#int32">int32</a></td><td></td>- <td><p>Line position in a text (zero-based). </p></td>+ <td><p>Line position in a text (one-based). </p></td></tr><tr><td>column</td><td><a href="#int32">int32</a></td><td></td>- <td><p>Column position in a text (zero-based), equivalent to byte offset. </p></td>+ <td><p>Column position in a text (one-based). </p></td></tr></tbody>@@ -23124,26 +23124,11 @@ Leave it empty if no needs to encrypt the zip file. </p></td></thead><tbody>- <tr>- <td>line</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>column</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-<tr><td>start_position</td><td><a href="#bytebase.v1.Position">Position</a></td><td></td>- <td><p>1-based Position of the SQL statement.-To supersede `line` and `column` above. </p></td>+ <td><p>Position of the SQL statement. </p></td></tr><tr>diff --git a/proto/store/store/common.proto b/proto/store/store/common.protoindex d30057ad3b..51051cff3d 100644--- a/proto/store/store/common.proto+++ b/proto/store/store/common.proto@@ -99,11 +99,11 @@ enum SchemaChangeType {DECLARATIVE = 2;}-// Position in a text expressed as zero-based line and column byte offset.+// Position in a text expressed as one-based line and one-based column.message Position {- // Line position in a text (zero-based).+ // Line position in a text (one-based).int32 line = 1;- // Column position in a text (zero-based), equivalent to byte offset.+ // Column position in a text (one-based).int32 column = 2;}diff --git a/proto/store/store/plan_check_run.proto b/proto/store/store/plan_check_run.protoindex 07d3464eb1..a4a00163b2 100644--- a/proto/store/store/plan_check_run.proto+++ b/proto/store/store/plan_check_run.proto@@ -55,12 +55,9 @@ message PlanCheckRunResult {ChangedResources changed_resources = 4;}message SqlReviewReport {- reserved 3, 4;+ reserved 1, 2, 3, 4;- int32 line = 1;- int32 column = 2;- // 1-based position of the SQL statement.- // To supersede `line` and `column` above.+ // Position of the SQL statement.Position start_position = 8;Position end_position = 9;}diff --git a/proto/v1/v1/common.proto b/proto/v1/v1/common.protoindex 7189715ad0..3becac9a65 100644--- a/proto/v1/v1/common.proto+++ b/proto/v1/v1/common.proto@@ -97,12 +97,11 @@ enum ExportFormat {XLSX = 4;}-// Position in a text expressed as zero-based line and zero-based column byte-// offset.+// Position in a text expressed as one-based line and one-based column.message Position {- // Line position in a text (zero-based).+ // Line position in a text (one-based).int32 line = 1;- // Column position in a text (zero-based), equivalent to byte offset.+ // Column position in a text (one-based).int32 column = 2;}diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.protoindex 3bcbb0ec8f..6dd60c32f1 100644--- a/proto/v1/v1/plan_service.proto+++ b/proto/v1/v1/plan_service.proto@@ -508,12 +508,9 @@ message PlanCheckRun {ChangedResources changed_resources = 4;}message SqlReviewReport {- reserved 3, 4;+ reserved 1, 2, 3, 4;- int32 line = 1;- int32 column = 2;- // 1-based Position of the SQL statement.- // To supersede `line` and `column` above.+ // Position of the SQL statement.Position start_position = 5;Position end_position = 6;}