sameNormalizedExpr compares two expressions after normalization, case-sensitively and quote-aware.
(a, b parser.Expr)
| 5729 | |
| 5730 | // sameNormalizedExpr compares two expressions after normalization, case-sensitively and quote-aware. |
| 5731 | func (g *Generator) sameNormalizedExpr(a, b parser.Expr) bool { |
| 5732 | if a == nil && b == nil { |
| 5733 | return true |
| 5734 | } |
| 5735 | if a == nil || b == nil { |
| 5736 | return false |
| 5737 | } |
| 5738 | |
| 5739 | normalizedA := normalizeExpr(a, g.mode) |
| 5740 | normalizedB := normalizeExpr(b, g.mode) |
| 5741 | |
| 5742 | if !g.config.LegacyIgnoreQuotes { |
| 5743 | return g.formatExprQuoteAware(normalizedA) == g.formatExprQuoteAware(normalizedB) |
| 5744 | } |
| 5745 | return parser.String(normalizedA) == parser.String(normalizedB) |
| 5746 | } |
| 5747 | |
| 5748 | func (g *Generator) areSameForeignKeys(foreignKeyA ForeignKey, foreignKeyB ForeignKey) bool { |
| 5749 | // Compare index columns (source columns of the FK) |
no test coverage detected