From: Reini U. <ru...@us...> - 2006-05-14 12:28:18
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14420 Modified Files: ADODB.php PDO.php PearDB.php PearDB_mysql.php Log Message: mysql 5.x fix for wantedpages join Index: ADODB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/ADODB.php,v retrieving revision 1.87 retrieving revision 1.88 diff -u -2 -b -p -d -r1.87 -r1.88 --- ADODB.php 17 Apr 2006 17:28:21 -0000 1.87 +++ ADODB.php 14 May 2006 12:28:03 -0000 1.88 @@ -967,5 +967,5 @@ id pagename linkrelation */ $sql = "SELECT p.pagename, pp.pagename as wantedfrom" - . " FROM $page_tbl p, $link_tbl linked " + . " FROM $page_tbl p JOIN $link_tbl linked " . " LEFT JOIN $page_tbl pp ON linked.linkto = pp.id" . " LEFT JOIN $nonempty_tbl ne ON linked.linkto = ne.id" @@ -1436,4 +1436,7 @@ class WikiDB_backend_ADODB_search extend // $Log$ +// Revision 1.88 2006/05/14 12:28:03 rurban +// mysql 5.x fix for wantedpages join +// // Revision 1.87 2006/04/17 17:28:21 rurban // honor getWikiPageLinks change linkto=>relation Index: PDO.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PDO.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -2 -b -p -d -r1.6 -r1.7 --- PDO.php 14 Nov 2005 22:24:33 -0000 1.6 +++ PDO.php 14 May 2006 12:28:03 -0000 1.7 @@ -1017,9 +1017,10 @@ extends WikiDB_backend where isnull(nonempty.id) and linked.id=link.linkfrom; */ - $sql = "SELECT $page_tbl.pagename,linked.pagename as wantedfrom" - . " FROM $link_tbl,$page_tbl as linked " - . " LEFT JOIN $page_tbl ON($link_tbl.linkto=$page_tbl.id)" - . " LEFT JOIN $nonempty_tbl ON($link_tbl.linkto=$nonempty_tbl.id)" - . " WHERE ISNULL($nonempty_tbl.id) AND linked.id=$link_tbl.linkfrom" + $sql = "SELECT p.pagename, pp.pagename as wantedfrom" + . " FROM $page_tbl p JOIN $link_tbl linked" + . " LEFT JOIN $page_tbl pp ON linked.linkto = pp.id" + . " LEFT JOIN $nonempty_tbl ne ON linked.linkto = ne.id" + . " WHERE ne.id is NULL" + . " AND p.id = linked.linkfrom" . $exclude_from . $exclude @@ -1460,4 +1461,7 @@ class WikiDB_backend_PDO_search extends // $Log$ +// Revision 1.7 2006/05/14 12:28:03 rurban +// mysql 5.x fix for wantedpages join +// // Revision 1.6 2005/11/14 22:24:33 rurban // fix fulltext search, Index: PearDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v retrieving revision 1.96 retrieving revision 1.97 diff -u -2 -b -p -d -r1.96 -r1.97 --- PearDB.php 15 Apr 2006 12:28:53 -0000 1.96 +++ PearDB.php 14 May 2006 12:28:03 -0000 1.97 @@ -531,4 +531,8 @@ extends WikiDB_backend /** * Find pages which link to or are linked from a page. + * + * TESTME relations: get_links is responsible to add the relation to the pagehash + * as 'linkrelation' key as pagename. See WikiDB_PageIterator::next + * if (isset($next['linkrelation'])) */ function get_links($pagename, $reversed=true, $include_empty=false, @@ -863,5 +867,5 @@ extends WikiDB_backend $exclude = " AND p.pagename NOT IN ".$this->_sql_set($exclude); $sql = "SELECT p.pagename, pp.pagename as wantedfrom" - . " FROM $page_tbl p, $link_tbl linked " + . " FROM $page_tbl p JOIN $link_tbl linked" . " LEFT JOIN $page_tbl pp ON linked.linkto = pp.id" . " LEFT JOIN $nonempty_tbl ne ON linked.linkto = ne.id" @@ -1232,4 +1236,7 @@ class WikiDB_backend_PearDB_search exten // $Log$ +// Revision 1.97 2006/05/14 12:28:03 rurban +// mysql 5.x fix for wantedpages join +// // Revision 1.96 2006/04/15 12:28:53 rurban // use pear nextID Index: PearDB_mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB_mysql.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -2 -b -p -d -r1.21 -r1.22 --- PearDB_mysql.php 10 Oct 2005 19:42:15 -0000 1.21 +++ PearDB_mysql.php 14 May 2006 12:28:03 -0000 1.22 @@ -125,8 +125,9 @@ extends WikiDB_backend_PearDB $sql = "SELECT $page_tbl.pagename,linked.pagename as wantedfrom" - . " FROM $link_tbl,$page_tbl as linked " - . " LEFT JOIN $page_tbl ON ($link_tbl.linkto=$page_tbl.id)" - . " LEFT JOIN $nonempty_tbl ON ($link_tbl.linkto=$nonempty_tbl.id)" - . " WHERE ISNULL($nonempty_tbl.id) AND linked.id=$link_tbl.linkfrom" + . " FROM $page_tbl p JOIN $link_tbl linked" + . " LEFT JOIN $page_tbl pp ON (linked.linkto = pp.id)" + . " LEFT JOIN $nonempty_tbl ne ON (linked_tbl.linkto = ne.id)" + . " WHERE ISNULL(ne.id)" + . " AND p.id = linked.linkfrom" . $exclude_from . $exclude |