From fa6ee0bcfd71b54038d9a4b0119a48563052751f Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Mon, 8 Jan 2024 12:21:36 +0200 Subject: [PATCH] do not dump generated columns Signed-off-by: Avi Deitcher --- pkg/database/mysql/dump.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/database/mysql/dump.go b/pkg/database/mysql/dump.go index 747552e2..f1cc813f 100644 --- a/pkg/database/mysql/dump.go +++ b/pkg/database/mysql/dump.go @@ -420,8 +420,10 @@ func (table *table) initColumnData() error { return err } - // Ignore the virtual columns - if !info[extraIndex].Valid || !strings.Contains(info[extraIndex].String, "VIRTUAL") { + // Ignore the virtual columns and generated columns + // if there is an Extra column and it is a valid string, then only include this column if + // the column is not marked as VIRTUAL or GENERATED + if !info[extraIndex].Valid || (!strings.Contains(info[extraIndex].String, "VIRTUAL") && !strings.Contains(info[extraIndex].String, "GENERATED")) { result = append(result, info[fieldIndex].String) } }