From 301f6bc2bd131afe9122ae82537472569f5df9cb Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Mon, 9 Dec 2024 19:26:47 +0000 Subject: [PATCH] Fix. --- conn.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conn.go b/conn.go index 3ba4375..5ae0eef 100644 --- a/conn.go +++ b/conn.go @@ -501,8 +501,12 @@ func (c *Conn) TableColumnMetadata(schema, table, column string) (declType, coll uint64(declTypePtr), uint64(collSeqPtr), uint64(notNullPtr), uint64(primaryKeyPtr), uint64(autoIncPtr)) if err = c.error(r); err == nil && column != "" { - declType = util.ReadString(c.mod, util.ReadUint32(c.mod, declTypePtr), _MAX_NAME) - collSeq = util.ReadString(c.mod, util.ReadUint32(c.mod, collSeqPtr), _MAX_NAME) + if ptr := util.ReadUint32(c.mod, declTypePtr); ptr != 0 { + declType = util.ReadString(c.mod, ptr, _MAX_NAME) + } + if ptr := util.ReadUint32(c.mod, collSeqPtr); ptr != 0 { + collSeq = util.ReadString(c.mod, ptr, _MAX_NAME) + } notNull = util.ReadUint32(c.mod, notNullPtr) != 0 autoInc = util.ReadUint32(c.mod, autoIncPtr) != 0 primaryKey = util.ReadUint32(c.mod, primaryKeyPtr) != 0