jcamachor commented on a change in pull request #1828: [CALCITE-3734] MySQL
JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)
URL: https://github.com/apache/calcite/pull/1828#discussion_r384151433
##########
File path:
core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
##########
@@ -49,9 +50,25 @@
* A <code>SqlDialect</code> implementation for the MySQL database.
*/
public class MysqlSqlDialect extends SqlDialect {
+
+ /** MySQL type system. */
+ private static final RelDataTypeSystem MYSQL_TYPE_SYSTEM =
+ new RelDataTypeSystemImpl() {
+ @Override public int getMaxPrecision(SqlTypeName typeName) {
+ switch (typeName) {
+ case CHAR:
+ case VARCHAR:
Review comment:
Even if CAST to VARCHAR is not allowed as per the comment below, I believe
the max precision in the type system should be set correctly, since other
methods may rely on it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services