@@ -115,7 +115,7 @@ func PrintResetResourceGroupStatements(metadataFile *utils.FileWithByteCount, to
115115 }
116116 defSettings := make ([]DefSetting , 0 )
117117
118- if gpdbVersion .IsGPDB () && gpdbVersion .Before ("7" ) {
118+ if srcDBVersion .IsGPDB () && srcDBVersion .Before ("7" ) {
119119 defSettings = append (defSettings , DefSetting {"admin_group" , "SET CPU_RATE_LIMIT 1" })
120120 defSettings = append (defSettings , DefSetting {"admin_group" , "SET MEMORY_LIMIT 1" })
121121 defSettings = append (defSettings , DefSetting {"default_group" , "SET CPU_RATE_LIMIT 1" })
@@ -181,7 +181,7 @@ func PrintCreateResourceGroupStatementsAtLeast7(metadataFile *utils.FileWithByte
181181 if ! strings .HasPrefix (resGroup .CpuMaxPercent , "-" ) {
182182 /* cpu rate mode */
183183 attributes = append (attributes , fmt .Sprintf ("CPU_MAX_PERCENT=%s" , resGroup .CpuMaxPercent ))
184- } else if (gpdbVersion .IsGPDB () && gpdbVersion .AtLeast ("5.9.0" )) || gpdbVersion .IsCBDBFamily () {
184+ } else if (srcDBVersion .IsGPDB () && srcDBVersion .AtLeast ("5.9.0" )) || srcDBVersion .IsCBDBFamily () {
185185 /* cpuset mode */
186186 attributes = append (attributes , fmt .Sprintf ("CPUSET='%s'" , resGroup .Cpuset ))
187187 }
@@ -201,7 +201,7 @@ func PrintCreateResourceGroupStatementsBefore7(metadataFile *utils.FileWithByteC
201201 // temporarily special case for 5x resource groups #temp5xResGroup
202202 memorySpillRatio := resGroup .MemorySpillRatio
203203
204- if gpdbVersion .IsGPDB () && gpdbVersion .Is ("5" ) {
204+ if srcDBVersion .IsGPDB () && srcDBVersion .Is ("5" ) {
205205 /*
206206 * memory_spill_ratio can be set in absolute value format since 5.20,
207207 * such as '1 MB', it has to be set as a quoted string, otherwise set
@@ -238,7 +238,7 @@ func PrintCreateResourceGroupStatementsBefore7(metadataFile *utils.FileWithByteC
238238 if ! strings .HasPrefix (resGroup .CPURateLimit , "-" ) {
239239 /* cpu rate mode */
240240 metadataFile .MustPrintf ("\n \n ALTER RESOURCE GROUP %s SET CPU_RATE_LIMIT %s;" , resGroup .Name , resGroup .CPURateLimit )
241- } else if (gpdbVersion .IsGPDB () && gpdbVersion .AtLeast ("5.9.0" )) || gpdbVersion .IsCBDBFamily () {
241+ } else if (srcDBVersion .IsGPDB () && srcDBVersion .AtLeast ("5.9.0" )) || srcDBVersion .IsCBDBFamily () {
242242 /* cpuset mode */
243243 metadataFile .MustPrintf ("\n \n ALTER RESOURCE GROUP %s SET CPUSET '%s';" , resGroup .Name , resGroup .Cpuset )
244244 }
@@ -253,7 +253,7 @@ func PrintCreateResourceGroupStatementsBefore7(metadataFile *utils.FileWithByteC
253253 if ! strings .HasPrefix (resGroup .CPURateLimit , "-" ) {
254254 /* cpu rate mode */
255255 attributes = append (attributes , fmt .Sprintf ("CPU_RATE_LIMIT=%s" , resGroup .CPURateLimit ))
256- } else if (gpdbVersion .IsGPDB () && gpdbVersion .AtLeast ("5.9.0" )) || gpdbVersion .IsCBDBFamily () {
256+ } else if (srcDBVersion .IsGPDB () && srcDBVersion .AtLeast ("5.9.0" )) || srcDBVersion .IsCBDBFamily () {
257257 /* cpuset mode */
258258 attributes = append (attributes , fmt .Sprintf ("CPUSET='%s'" , resGroup .Cpuset ))
259259 }
@@ -265,7 +265,7 @@ func PrintCreateResourceGroupStatementsBefore7(metadataFile *utils.FileWithByteC
265265 */
266266 if resGroup .MemoryAuditor == "1" {
267267 attributes = append (attributes , "MEMORY_AUDITOR=cgroup" )
268- } else if (gpdbVersion .IsGPDB () && gpdbVersion .AtLeast ("5.8.0" )) || gpdbVersion .IsCBDBFamily () {
268+ } else if (srcDBVersion .IsGPDB () && srcDBVersion .AtLeast ("5.8.0" )) || srcDBVersion .IsCBDBFamily () {
269269 attributes = append (attributes , "MEMORY_AUDITOR=vmtracker" )
270270 }
271271
@@ -338,7 +338,7 @@ func PrintCreateRoleStatements(metadataFile *utils.FileWithByteCount, toc *toc.T
338338
339339 attrs = append (attrs , fmt .Sprintf ("RESOURCE QUEUE %s" , role .ResQueue ))
340340
341- if (gpdbVersion .IsGPDB () && gpdbVersion .AtLeast ("5" )) || gpdbVersion .IsCBDBFamily () {
341+ if (srcDBVersion .IsGPDB () && srcDBVersion .AtLeast ("5" )) || srcDBVersion .IsCBDBFamily () {
342342 attrs = append (attrs , fmt .Sprintf ("RESOURCE GROUP %s" , role .ResGroup ))
343343 }
344344
@@ -402,7 +402,7 @@ func PrintObjectMetadataEx(file *utils.FileWithByteCount, toc *toc.TOC,
402402 statements = append (statements , strings .TrimSpace (comment ))
403403 }
404404 if owner := metadata .GetOwnerStatement (obj .FQN (), entry .ObjectType ); owner != "" {
405- if ! ((gpdbVersion .IsGPDB () && gpdbVersion .Before ("5" )) && entry .ObjectType == "LANGUAGE" ) {
405+ if ! ((srcDBVersion .IsGPDB () && srcDBVersion .Before ("5" )) && entry .ObjectType == "LANGUAGE" ) {
406406 // Languages have implicit owners in 4.3, but do not support ALTER OWNER
407407 statements = append (statements , strings .TrimSpace (owner ))
408408 }
0 commit comments