From 3dab19ffed61a69166045d6e90e1e114d81f85a8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 13 Nov 2017 13:03:36 +0100 Subject: 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 --- src/plugins/sqldrivers/oci/qsql_oci.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/sqldrivers') 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; -- cgit v1.2.3