From f6f128caf6f35a20c5737ae11b165fbf45bd25d5 Mon Sep 17 00:00:00 2001 From: asthamohta Date: Thu, 26 Dec 2024 09:55:46 +0000 Subject: [PATCH] Changes --- conversion/conversion_from_source.go | 6 ------ expressions_api/expression_verify.go | 1 - sources/common/toddl.go | 2 +- webv2/api/schema.go | 3 --- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/conversion/conversion_from_source.go b/conversion/conversion_from_source.go index a700db0ba..5a30badc0 100644 --- a/conversion/conversion_from_source.go +++ b/conversion/conversion_from_source.go @@ -58,9 +58,6 @@ func (sads *SchemaFromSourceImpl) schemaFromDatabase(migrationProjectId string, conv.SpProjectId = targetProfile.Conn.Sp.Project conv.SpInstanceId = targetProfile.Conn.Sp.Instance conv.Source = sourceProfile.Driver - fmt.Println("###2") - fmt.Println(conv.SpProjectId) - fmt.Println(conv.SpInstanceId) //handle fetching schema differently for sharded migrations, we only connect to the primary shard to //fetch the schema. We reuse the SourceProfileConnection object for this purpose. var infoSchema common.InfoSchema @@ -177,9 +174,6 @@ func (sads *DataFromSourceImpl) dataFromCSV(ctx context.Context, sourceProfile p conv.SpProjectId = targetProfile.Conn.Sp.Project conv.SpInstanceId = targetProfile.Conn.Sp.Instance conv.Source = sourceProfile.Driver - fmt.Println("###3") - fmt.Println(conv.SpProjectId) - fmt.Println(conv.SpInstanceId) dialect, err := targetProfile.FetchTargetDialect(ctx) if err != nil { return nil, fmt.Errorf("could not fetch dialect: %v", err) diff --git a/expressions_api/expression_verify.go b/expressions_api/expression_verify.go index 35ec6256f..e01861987 100644 --- a/expressions_api/expression_verify.go +++ b/expressions_api/expression_verify.go @@ -178,7 +178,6 @@ func (ddlv *DDLVerifierImpl) VerifySpannerDDL(conv *internal.Conv, expressionDet Source: conv.Source, ExpressionDetailList: expressionDetails, } - ddlv.Expressions.RefreshSpannerClient(context.Background(), conv.SpProjectId, conv.SpInstanceId) verificationResults := ddlv.Expressions.VerifyExpressions(ctx, verifyExpressionsInput) return verificationResults, verificationResults.Err diff --git a/sources/common/toddl.go b/sources/common/toddl.go index 7f4e5fe42..b23d2d6f7 100644 --- a/sources/common/toddl.go +++ b/sources/common/toddl.go @@ -75,7 +75,7 @@ func (ss *SchemaToSpannerImpl) SchemaToSpannerDDL(conv *internal.Conv, toddl ToD srcTable := conv.SrcSchema[tableId] ss.SchemaToSpannerDDLHelper(conv, toddl, srcTable, false) } - if conv.Source == constants.MYSQL { + if conv.Source == constants.MYSQL && conv.SpProjectId!="" && conv.SpInstanceId!=""{ expressionDetails := ss.DdlV.GetSourceExpressionDetails(conv, tableIds) expressions, err := ss.DdlV.VerifySpannerDDL(conv, expressionDetails) if err != nil && !strings.Contains(err.Error(), "expressions either failed verification") { diff --git a/webv2/api/schema.go b/webv2/api/schema.go index 2047a2d31..7467f8ad2 100644 --- a/webv2/api/schema.go +++ b/webv2/api/schema.go @@ -74,9 +74,6 @@ func ConvertSchemaSQL(w http.ResponseWriter, r *http.Request) { conv.SpProjectId = sessionState.SpannerProjectId conv.SpInstanceId = sessionState.SpannerInstanceID conv.Source = sessionState.Driver - fmt.Println("####4") - fmt.Println(conv.SpProjectId) - fmt.Println(conv.SpInstanceId) conv.IsSharded = sessionState.IsSharded var err error additionalSchemaAttributes := internal.AdditionalSchemaAttributes{