From 572630197cd84ab174d21acd4141c8161eef202b Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Thu, 4 Sep 2014 20:50:15 +0200 Subject: [PATCH] Fix Table::emptyInsertStmt for NOT NULL fields with default value See issue #97. --- src/sqlitetypes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqlitetypes.cpp b/src/sqlitetypes.cpp index 8534996d..c93fa135 100644 --- a/src/sqlitetypes.cpp +++ b/src/sqlitetypes.cpp @@ -181,7 +181,7 @@ QString Table::emptyInsertStmt(int pk_value) const vals << QString::number(pk_value); else vals << "NULL"; - } else if(f->notnull()) { + } else if(f->notnull() && f->defaultValue().length() == 0) { fields << f->name(); if(f->isInteger())