You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/02/25 21:08:39 UTC

[GitHub] [calcite] vineetgarg02 opened a new pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

vineetgarg02 opened a new 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
 
 
   … 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384131233
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   No need for this, dialects just propagate the context.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vineetgarg02 commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
vineetgarg02 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_r384192071
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   Ok make sense

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384149928
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   The context seems to be set externally and dialects just use the given context which would come with the type system set; observe that this is not being done for other dialects, e.g., Postgres. I see that _ SqlDialectFactoryImpl.create_ sets a bunch of properties depending on the database product. It seems we should add the type system over there instead of overriding within each individual constructor?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vineetgarg02 commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
vineetgarg02 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_r384136326
 
 

 ##########
 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:
   `@Override public SqlNode getCastSpec(RelDataType type) {
       switch (type.getSqlTypeName()) {
       case VARCHAR:
         // MySQL doesn't have a VARCHAR type, only CHAR.
         return new SqlDataTypeSpec(
             new SqlBasicTypeNameSpec(SqlTypeName.CHAR, type.getPrecision(), SqlParserPos.ZERO),
             SqlParserPos.ZERO);`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vineetgarg02 commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
vineetgarg02 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_r384192335
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
 ##########
 @@ -1712,6 +1712,22 @@ private static String toSql(RelNode root, SqlDialect dialect) {
     sql(query).dialect(MysqlSqlDialect.DEFAULT).ok(expected);
   }
 
+  @Test public void testMySqlCastToVarcharWithLessThanMaxPrecision() {
+    final String query = "select cast(\"product_id\" as varchar(50)), \"product_id\" "
+        + "from \"product\" ";
+    final String expected = "SELECT CAST(`product_id` AS CHAR(50)), `product_id`\n"
+        + "FROM `foodmart`.`product`";
+    sql(query).dialect(mySqlDialect(NullCollation.HIGH)).ok(expected);
 
 Review comment:
   @julianhyde I have changed the test to use`withMysql()`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384149928
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   The context seems to be set externally and dialects just use the given context which would come with the type system set; observe that the context is not being modified for other dialects, e.g., Postgres. I see that _ SqlDialectFactoryImpl.create_ sets a bunch of properties depending on the database product. It seems we should add the type system over there instead of overriding within each individual constructor?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384131233
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   No need for this.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] asfgit closed pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
asfgit closed 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
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vineetgarg02 commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
vineetgarg02 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_r384135463
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   This is needed because `SqlDialectFactoryImpl.create` creates dialect with its own context (without using DEFAULT context).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vineetgarg02 commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
vineetgarg02 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_r384192178
 
 

 ##########
 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:
   Addressed this in latest push

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384195622
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
 ##########
 @@ -1712,6 +1712,24 @@ private static String toSql(RelNode root, SqlDialect dialect) {
     sql(query).dialect(MysqlSqlDialect.DEFAULT).ok(expected);
   }
 
+  @Test public void testMySqlCastToVarcharWithLessThanMaxPrecision() {
+    final String query = "select cast(\"product_id\" as varchar(50)), \"product_id\" "
+        + "from \"product\" ";
+    final String expected = "SELECT CAST(`product_id` AS CHAR(50)), `product_id`\n"
+        + "FROM `foodmart`.`product`";
+    sql(query).withMysql().ok(expected);
+    //sql(query).dialect(mySqlDialect(NullCollation.HIGH)).ok(expected);
+  }
+
+  @Test public void testMySqlCastToVarcharWithGreaterThanMaxPrecision() {
+    final String query = "select cast(\"product_id\" as varchar(500)), \"product_id\" "
+        + "from \"product\" ";
+    final String expected = "SELECT CAST(`product_id` AS CHAR(255)), `product_id`\n"
+        + "FROM `foodmart`.`product`";
+    sql(query).withMysql().ok(expected);
+    //sql(query).dialect(mySqlDialect(NullCollation.HIGH)).ok(expected);
 
 Review comment:
   This can be removed?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] julianhyde commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
julianhyde 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_r384143551
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
 ##########
 @@ -1712,6 +1712,22 @@ private static String toSql(RelNode root, SqlDialect dialect) {
     sql(query).dialect(MysqlSqlDialect.DEFAULT).ok(expected);
   }
 
+  @Test public void testMySqlCastToVarcharWithLessThanMaxPrecision() {
+    final String query = "select cast(\"product_id\" as varchar(50)), \"product_id\" "
+        + "from \"product\" ";
+    final String expected = "SELECT CAST(`product_id` AS CHAR(50)), `product_id`\n"
+        + "FROM `foodmart`.`product`";
+    sql(query).dialect(mySqlDialect(NullCollation.HIGH)).ok(expected);
 
 Review comment:
   Rather than `.dialect(mySqlDialect(NullCollation.HIGH))`, is `withMysql()` sufficient?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384195647
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
 ##########
 @@ -1712,6 +1712,24 @@ private static String toSql(RelNode root, SqlDialect dialect) {
     sql(query).dialect(MysqlSqlDialect.DEFAULT).ok(expected);
   }
 
+  @Test public void testMySqlCastToVarcharWithLessThanMaxPrecision() {
+    final String query = "select cast(\"product_id\" as varchar(50)), \"product_id\" "
+        + "from \"product\" ";
+    final String expected = "SELECT CAST(`product_id` AS CHAR(50)), `product_id`\n"
+        + "FROM `foodmart`.`product`";
+    sql(query).withMysql().ok(expected);
+    //sql(query).dialect(mySqlDialect(NullCollation.HIGH)).ok(expected);
 
 Review comment:
   This can be removed?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vineetgarg02 commented on a change in pull request #1828: [CALCITE-3734] MySQL JDBC rewrite is producing queries with CHAR with range beyond 255 (Vineet Garg)

Posted by GitBox <gi...@apache.org>.
vineetgarg02 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_r384136264
 
 

 ##########
 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:
   calcite's mysql dialect rewrites VARCHAR into CHAR (not yet sure why), as a result getMaxPrecision uses same max precision for both

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384134756
 
 

 ##########
 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:
   This seems to override the max precision for VARCHAR to same value.
   I just checked the documentation and value seems to be higher than that:
   https://dev.mysql.com/doc/refman/5.7/en/char.html
   Can we change it accordingly (and update tests)?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384131233
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
 ##########
 @@ -67,7 +84,7 @@
 
   /** Creates a MysqlSqlDialect. */
   public MysqlSqlDialect(Context context) {
-    super(context);
+    super(context.withDataTypeSystem(MYSQL_TYPE_SYSTEM));
 
 Review comment:
   No need to override the data type system here.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] 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)

Posted by GitBox <gi...@apache.org>.
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_r384195545
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/SqlDialectFactoryImpl.java
 ##########
 @@ -122,7 +122,7 @@ public SqlDialect create(DatabaseMetaData databaseMetaData) {
     case "MYSQL (INFOBRIGHT)":
       return new InfobrightSqlDialect(c);
     case "MYSQL":
-      return new MysqlSqlDialect(c);
+      return new MysqlSqlDialect(c.withDataTypeSystem(MysqlSqlDialect.MYSQL_TYPE_SYSTEM));
 
 Review comment:
   Can we add the same for Postgres? Seems to have same problem.
   
   Nit. Can we push after _(_ to new line?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services