Mysql – SubSonic Error with MySql CONVERT()

MySQLsubsonicsubsonic3

I has encountered conversion from integer to string with MySql+SubSonic3 (it generates wrong SQL query). After I found root of the problem in SubSonic sources and fixed it, everything works fine, but I'm not sure that it won't pull some other stuff.

I believe in MySqlFormatter.cs the following code on line 309

                sb.Append("CONVERT(VARCHAR(MAX), ");
                this.Visit(m.Object);
                sb.Append(")");

must be replaced with

                sb.Append("CONVERT(");
                this.Visit(m.Object);
                sb.Append(", CHAR)");

Is it right?

Best Answer

Nice one! Yep - that should be VARCHAR(200) - change made and pushed. Thanks!