-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TranslationWalker CAST fails for a string fieldMapping type on MySQL #1011
Comments
Same problem for me. |
Same problem here, pull request #999 seams to cause problem in TranslationWalker with Mysql plateform. |
will need to have a look, thanks for noting on that |
Regarding the documentation of MySQL http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html#function_cast When I run the request generated from the TreeWalker with CHAR it works fine ! I'm sure it is not a beautiful solution but I replaced the line 322 by : $substituteField = 'CAST(' . $substituteField . ' AS ' . str_replace("VARCHAR","CHAR",$type->getSQLDeclaration($fieldMapping, $this->platform)) . ')'; And it works fine. |
seems that i have related issue |
I will also check it when I can, the sad thing we have tests only on sqlite. on 3.0.0 branch there are tests made for 3 types of database. Maybe will need to move parts slowly from 3.0.0 and start by integrating parts, which does not have BC changes. |
It's working fine for me on Mysql. Thanks |
Working fine for me too. Thanks! |
works for me |
TreeWalker creates the following query
But casting of a translated field fails for string type on MySQL with
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR(255)) AS name3 FROM countries c0_ LEFT JOIN ext_translations t1_ ON t1_.' at line 1
as casting to a VARCHAR type is not possible in MySQL https://dev.mysql.com/doc/refman/5.5/en/cast-functions.html#function_convert
fieldMapping gives:
The text was updated successfully, but these errors were encountered: