Ticket #779 (closed Bug: fixed)

Opened 3 months ago

Last modified 5 weeks ago

wrong join statement in Database drivers

Reported by: Steffen Owned by: Shadowhand
Priority: major Milestone: 2.2.1
Component: Libraries:Database Version: SVN HEAD
Keywords: Cc:

Description

The generated statement is something like "JOIN (article_authors) ON ( article_authors . author_id = authors . id )" which results in an SQLite error cause ist can't find "article_authors . author_id".

Patch proposal:

--- Pdosqlite.php
+++ (clipboard)
@@ -149,7 +149,7 @@
 
 		if (count($database['join']) > 0)
 		{
-			$sql .= ' '.$database['join']['type'].'JOIN ('.implode(', ', $database['join']['tables']).') ON '.implode(' AND ', $database['join']['conditions']);
+			$sql .= ' '.$database['join']['type'].'JOIN '.implode(', ', $database['join']['tables']).' ON '.implode(' AND ', $database['join']['conditions']);
 		}
 
 		if (count($database['where']) > 0)

Change History

Changed 5 weeks ago by Shadowhand

  • owner changed from zombor to Shadowhand
  • status changed from new to assigned
  • version changed from 2.2 Release to SVN HEAD
  • summary changed from [patch proposal] wrong join statement in Pdosqlite driver to wrong join statement in Database drivers

Changed 5 weeks ago by Shadowhand

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r3622, merged in r3623.

Note: See TracTickets for help on using tickets.