make the empty insert statement work in pk + not null situations

This commit is contained in:
Peinthor Rene
2013-03-24 21:53:01 +01:00
parent ec650b0024
commit be239d0f05

View File

@@ -173,10 +173,17 @@ QString Table::emptyInsertStmt() const
foreach(FieldPtr f, m_fields) {
if(f->notnull())
{
if(f->isInteger())
vals << "0";
if( m_primarykey.contains(f) && f->isInteger() )
{
vals << "NULL";
}
else
vals << "''";
{
if(f->isInteger())
vals << "0";
else
vals << "''";
}
}
else
vals << "NULL";