subsonic/SubSonic-3.0-Templates — Issue #60: MySql Inner Join issues
Author: think8848
Created: 2012-02-01 07:46:56+00:00
State: open

var query = new Select().From().InnerJoin("afid","bid");

Generated sql:

SELECT ... FROM `A`,`B` INNER JOIN `B` ON `afid` = `bid`

Is Should be

"SELECT ... FROM `A` INNER JOIN `B` ON `afid` = `bid`"

So in MySqlGenerator.cs no need to override GenerateFromList Method.

---------------------------------------------

At MySqlProvider.cs line 31 should be qualifiedFormat = String.IsNullOrEmpty(column.SchemaName) ? "`{1}`.`{2}`" : "`{0}`.`{1}`.`{2}`";

Now is :
27 public override string QualifyColumnName(IColumn column)
28 {
29 string qualifiedFormat;
30
31 qualifiedFormat = String.IsNullOrEmpty(column.SchemaName) ? "`{2}`" : "`{0}`.`{1}`.`{2}`";
32
33 return String.Format(qualifiedFormat, column.Table.SchemaName, column.Table.Name, column.Name);
34 }