From: Andy S. <an...@us...> - 2005-11-19 02:10:42
|
Update of /cvsroot/gallery/gallery2/modules/core/classes/helpers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32234/helpers Modified Files: GalleryItemHelper_simple.class GalleryItemHelper_advanced.class Log Message: Another milestone in DB2 support for G2: - G2_BIT_AND User defined function (UDF) by Larry Menard (LM) - G2_LIKE UDF by LM (the DB2 LIKE function can't handle concatenations of columns as LIKE pattern) - Casting CONCAT arguments to CHAR - Still missing: A user defined BIT_OR aggregate function (and thus DB2 / G2 still won't work) Index: GalleryItemHelper_advanced.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/classes/helpers/GalleryItemHelper_advanced.class,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- GalleryItemHelper_advanced.class 23 Aug 2005 03:49:04 -0000 1.27 +++ GalleryItemHelper_advanced.class 19 Nov 2005 02:10:35 -0000 1.28 @@ -273,6 +273,16 @@ return array(GalleryStatus::success(), array()); } + list ($ret, $like) = + $storage->getFunctionSql( + 'LIKE', + array('[GalleryItemAttributesMap=2::parentSequence]', + $concat) + ); + if ($ret->isError()) { + return array($ret->wrap(__FILE__, __LINE__), null); + } + $accessListMarkers = GalleryUtilities::makeMarkers(count($aclIds)); $query = sprintf(' @@ -291,14 +301,14 @@ WHERE [GalleryItemAttributesMap=1::itemId] IN (%s) AND - [GalleryItemAttributesMap=2::parentSequence] LIKE %s + %s AND [GalleryItemAttributesMap=2::itemId] = [GalleryAccessSubscriberMap::itemId] AND [GalleryAccessSubscriberMap::accessListId] IN (%s) GROUP BY [GalleryItemAttributesMap=1::itemId] - ', $itemIdMarkers, $concat, $accessListMarkers); + ', $itemIdMarkers, $like, $accessListMarkers); $data = array_merge($itemIds, $aclIds); Index: GalleryItemHelper_simple.class =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/core/classes/helpers/GalleryItemHelper_simple.class,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- GalleryItemHelper_simple.class 23 Aug 2005 03:49:04 -0000 1.20 +++ GalleryItemHelper_simple.class 19 Nov 2005 02:10:35 -0000 1.21 @@ -267,6 +267,16 @@ return array($ret->wrap(__FILE__, __LINE__), null); } + list ($ret, $like) = + $storage->getFunctionSql( + 'LIKE', + array('[GalleryItemAttributesMap=2::parentSequence]', + $concat) + ); + if ($ret->isError()) { + return array($ret->wrap(__FILE__, __LINE__), null); + } + $query = sprintf(' SELECT [GalleryItemAttributesMap=1::itemId], @@ -278,14 +288,14 @@ WHERE [GalleryItemAttributesMap=1::itemId] IN (%s) AND - [GalleryItemAttributesMap=2::parentSequence] LIKE %s + %s AND [GalleryItemAttributesMap=2::itemId] = [GalleryAccessSubscriberMap::itemId] AND [GalleryAccessSubscriberMap::accessListId] IN (%s) GROUP BY [GalleryItemAttributesMap=1::itemId] - ', $itemMarkers, $concat, $aclMarkers); + ', $itemMarkers, $like, $aclMarkers); $data = array_merge($itemIds, $aclIds); list ($ret, $searchResults) = $gallery->search($query, $data); |