diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-11-13 13:03:36 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-11-15 06:40:45 +0000 |
commit | 3dab19ffed61a69166045d6e90e1e114d81f85a8 (patch) | |
tree | 50fb9c325a391f80f9641b08ef2d06e6eac1d7d1 /src/plugins | |
parent | 66bace390ba4c0d20f006f02dbcba45e30d08590 (diff) |
OCI: Match the constraints on the index_name column
When looking for the primary index, it is possible that the
constraint_name in the all_ind_columns table does not match that of the
index_name. Whereas the index_name will match in this case, so the query
should set the where clause on the index_name in both tables.
Task-number: QTBUG-64427
Change-Id: I1bf1fb580e620b9f75f2fde1ecf408842e377365
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/sqldrivers/oci/qsql_oci.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index a4793351de..9ce2fc1b55 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -2603,7 +2603,7 @@ QSqlIndex QOCIDriver::primaryIndex(const QString& tablename) const QString stmt(QLatin1String("select b.column_name, b.index_name, a.table_name, a.owner " "from all_constraints a, all_ind_columns b " "where a.constraint_type='P' " - "and b.index_name = a.constraint_name " + "and b.index_name = a.index_name " "and b.index_owner = a.owner")); bool buildIndex = false; |