diff options
| author | 2023-04-30 18:31:18 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:31:18 -0400 | |
| commit | 4de57f628bc74f00ba1885e91c84ea07c5405d8f (patch) | |
| tree | 5d91900751e826d491ff1b2ebc571a787e84f864 /Plugins/SqlEnterpriseFormatter/formatstatement.cpp | |
| parent | 74d881cefa9097e58e129e37b9c44d680d8c7dfe (diff) | |
| parent | 3565aad630864ecdbe53fdaa501ea708555b3c7c (diff) | |
Update upstream source from tag 'upstream/3.4.4+dfsg'
Update to upstream version '3.4.4+dfsg'
with Debian dir 482614bd23f0ef52dabc9803477204ad88e917ed
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; } |
