From b939916b0777e736f16ae6534147601c36fca1b6 Mon Sep 17 00:00:00 2001 From: eelke Date: Mon, 19 Aug 2019 19:44:07 +0200 Subject: [PATCH] Fix incorrect ALTER TABLE statement for columns in the instepctor. Was caused by incorrect condition for determining the use of IDENTITY. --- pglablib/catalog/PgAttribute.cpp | 2 +- pglablib/catalog/PgAttribute.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pglablib/catalog/PgAttribute.cpp b/pglablib/catalog/PgAttribute.cpp index bfb4724..3e697d8 100644 --- a/pglablib/catalog/PgAttribute.cpp +++ b/pglablib/catalog/PgAttribute.cpp @@ -28,7 +28,7 @@ QString PgAttribute::columnDefinition(const PgDatabaseCatalog &cat) const if (hasdef) sql += " DEFAULT " % defaultValue; - if (identity != ' ') { + if (identity != '\0') { sql += " GENERATED "; if (identity == 'a') sql += "ALWAYS"; else if (identity == 'd') sql += "BY DEFAULT"; diff --git a/pglablib/catalog/PgAttribute.h b/pglablib/catalog/PgAttribute.h index 1e0cd8a..de887b2 100644 --- a/pglablib/catalog/PgAttribute.h +++ b/pglablib/catalog/PgAttribute.h @@ -22,7 +22,7 @@ public: int32_t typmod = -1; bool notnull = false; bool hasdef = false; - char identity = ' '; + char identity = '\0'; bool isdropped = false; bool islocal = true; Oid collation = InvalidOid;