exportsql: only quote if text or blob datatype

This commit is contained in:
Peinthor Rene
2014-11-18 21:37:14 +01:00
parent f829f06050
commit 85578bd9b6

View File

@@ -357,6 +357,7 @@ bool DBBrowserDB::dump(const QString& filename)
for (int i = 0; i < columns; ++i)
{
int fieldsize = sqlite3_column_bytes(stmt, i);
int fieldtype = sqlite3_column_type(stmt, i);
if(fieldsize)
{
QByteArray bcontent(
@@ -369,7 +370,14 @@ bool DBBrowserDB::dump(const QString& filename)
}
else
{
stream << "'" << bcontent.replace("'", "''") << "'";
if(fieldtype == SQLITE_TEXT || fieldtype == SQLITE_BLOB)
{
stream << "'" << bcontent.replace("'", "''") << "'";
}
else
{
stream << bcontent;
}
}
}
else