-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index 175d62a..6aaa14c 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -594,6 +594,4 @@ UIDArray OPimContactAccessBackend_SQL::queryByExample ( const UIDArray& uidlist, | |||
594 | // automatically after using. | 594 | // automatically after using. |
595 | datediff_query = "CREATE TEMP TABLE bs ( uid, \"Birthday\", \"Anniversary\" );"; | 595 | datediff_query = "SELECT uid,substr(\"Birthday\", 6, 10) as \"BirthdayMD\", substr(\"Anniversary\", 6, 10) as \"AnniversaryMD\" FROM addressbook WHERE ( \"Birthday\" != '' OR \"Anniversary\" != '' ) AND "; |
596 | datediff_query += "INSERT INTO bs SELECT uid,substr(\"Birthday\", 6, 10),substr(\"Anniversary\", 6, 10) FROM addressbook WHERE ( \"Birthday\" != '' OR \"Anniversary\" != '' );"; | 596 | datediff_query += QString( " (\"%1MD\" <= '%2-%3\' AND \"%4MD\" >= '%5-%6')" ) |
597 | datediff_query += QString( "SELECT uid FROM bs WHERE " ) + uid_query; | ||
598 | datediff_query += QString( " (\"%1\" <= '%2-%3\' AND \"%4\" >= '%5-%6')" ) | ||
599 | .arg( *it ) | 597 | .arg( *it ) |
@@ -686,9 +684,2 @@ UIDArray OPimContactAccessBackend_SQL::queryByExample ( const UIDArray& uidlist, | |||
686 | 684 | ||
687 | // Remove temp table if created | ||
688 | if ( !datediff_query.isEmpty( ) ){ | ||
689 | qu = "DROP TABLE bs"; | ||
690 | OSQLRawQuery raw( qu ); | ||
691 | OSQLResult res = m_driver->query( &raw ); | ||
692 | } | ||
693 | |||
694 | return list; | 685 | return list; |