MCPcopy Create free account
hub / github.com/bytebase/bytebase / functionsEqual

Function functionsEqual

backend/plugin/schema/differ.go:1776–1801  ·  view source on GitHub ↗

functionsEqual checks if two functions are equal.

(fn1, fn2 *storepb.FunctionMetadata)

Source from the content-addressed store, hash-verified

1774
1775// functionsEqual checks if two functions are equal.
1776func functionsEqual(fn1, fn2 *storepb.FunctionMetadata) bool {
1777 if fn1.Definition != fn2.Definition {
1778 // Try normalized comparison for PostgreSQL functions
1779 norm1 := normalizePostgreSQLFunction(fn1.Definition)
1780 norm2 := normalizePostgreSQLFunction(fn2.Definition)
1781 if norm1 != norm2 {
1782 return false
1783 }
1784 }
1785 if fn1.CharacterSetClient != fn2.CharacterSetClient {
1786 return false
1787 }
1788 if fn1.CollationConnection != fn2.CollationConnection {
1789 return false
1790 }
1791 if fn1.DatabaseCollation != fn2.DatabaseCollation {
1792 return false
1793 }
1794 if fn1.SqlMode != fn2.SqlMode {
1795 return false
1796 }
1797 if fn1.Comment != fn2.Comment {
1798 return false
1799 }
1800 return true
1801}
1802
1803// compareProcedures compares procedures between two schemas.
1804func compareProcedures(diff *MetadataDiff, schemaName string, oldSchema, newSchema *model.SchemaMetadata) {

Callers 2

EqualMethod · 0.85
CompareDetailedMethod · 0.85

Calls 1

Tested by

no test coverage detected