diff options
| author | 2023-04-30 18:30:36 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:30:36 -0400 | |
| commit | 3565aad630864ecdbe53fdaa501ea708555b3c7c (patch) | |
| tree | c743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /Plugins/SqlEnterpriseFormatter/formatstatement.cpp | |
| parent | 1fdc150116cad39aae5c5da407c3312b47a59e3a (diff) | |
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatstatement.cpp')
| -rw-r--r-- | Plugins/SqlEnterpriseFormatter/formatstatement.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatstatement.cpp b/Plugins/SqlEnterpriseFormatter/formatstatement.cpp index be924e1..250fde4 100644 --- a/Plugins/SqlEnterpriseFormatter/formatstatement.cpp +++ b/Plugins/SqlEnterpriseFormatter/formatstatement.cpp @@ -16,7 +16,6 @@ #include "formatattach.h" #include "formatbegintrans.h" #include "formatcommittrans.h" -#include "formatcopy.h" #include "formatcreateindex.h" #include "formatcreatetrigger.h" #include "formatcreateview.h" @@ -48,7 +47,6 @@ #include "parser/ast/sqliteattach.h" #include "parser/ast/sqlitebegintrans.h" #include "parser/ast/sqlitecommittrans.h" -#include "parser/ast/sqlitecopy.h" #include "parser/ast/sqlitecreateindex.h" #include "parser/ast/sqlitecreatetrigger.h" #include "parser/ast/sqlitecreateview.h" @@ -145,7 +143,6 @@ FormatStatement *FormatStatement::forQuery(SqliteStatement *query) FORMATTER_FACTORY_ENTRY(query, SqliteAttach, FormatAttach); FORMATTER_FACTORY_ENTRY(query, SqliteBeginTrans, FormatBeginTrans); FORMATTER_FACTORY_ENTRY(query, SqliteCommitTrans, FormatCommitTrans); - FORMATTER_FACTORY_ENTRY(query, SqliteCopy, FormatCopy); FORMATTER_FACTORY_ENTRY(query, SqliteCreateVirtualTable, FormatCreateVirtualTable); FORMATTER_FACTORY_ENTRY(query, SqliteCreateIndex, FormatCreateIndex); FORMATTER_FACTORY_ENTRY(query, SqliteCreateTrigger, FormatCreateTrigger); @@ -362,6 +359,13 @@ FormatStatement& FormatStatement::withLiteral(const QVariant& value) return *this; } + if (value.userType() == QVariant::ByteArray) + { + static_qstring(blobLiteral, "X'%1'"); + withBlob(blobLiteral.arg(QString::fromLatin1(value.toByteArray().toHex()))); + return *this; + } + bool ok; if (value.userType() == QVariant::Double) { @@ -380,14 +384,7 @@ FormatStatement& FormatStatement::withLiteral(const QVariant& value) return *this; } - QString str = value.toString(); - if (str.startsWith("x'", Qt::CaseInsensitive) && str.endsWith("'")) - { - withBlob(str); - return *this; - } - - withString(str); + withString(value.toString()); return *this; } |
