diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-03-12 14:50:05 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-03-17 20:33:16 +0100 |
commit | 1981ebe8ada68f600ecb10d9e9b7270cf9e19866 (patch) | |
tree | df0f563b03004e737ae3865dae137a450092fab6 /src/plugins/sqldrivers | |
parent | f49f3f2f942e98a44277eea09fa2e985b8b2924a (diff) |
SQL/OCI: add maximumIdentifierLength()
A table name or identifier must not be longer than 30 (< Oracle 12.2) or
128 bytes (sadly not characters).
Change-Id: I49192afaf908e12f5cfd20c754640b6117b03a71
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers')
-rw-r--r-- | src/plugins/sqldrivers/oci/qsql_oci.cpp | 7 | ||||
-rw-r--r-- | src/plugins/sqldrivers/oci/qsql_oci_p.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index ffad5e88cd..b670efc15b 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -2759,4 +2759,11 @@ QString QOCIDriver::escapeIdentifier(const QString &identifier, IdentifierType t return res; } +int QOCIDriver::maximumIdentifierLength(IdentifierType type) const +{ + Q_D(const QOCIDriver); + Q_UNUSED(type); + return d->serverVersion > 12 ? 128 : 30; +} + QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/oci/qsql_oci_p.h b/src/plugins/sqldrivers/oci/qsql_oci_p.h index b2aca6d563..91fef9de7b 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci_p.h +++ b/src/plugins/sqldrivers/oci/qsql_oci_p.h @@ -58,6 +58,7 @@ public: bool trimStrings) const override; QVariant handle() const override; QString escapeIdentifier(const QString &identifier, IdentifierType) const override; + int maximumIdentifierLength(IdentifierType type) const override; protected: bool beginTransaction() override; |