Skip to content

Commit

Permalink
Add one more test with a charset
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Budiu <[email protected]>
  • Loading branch information
mihaibudiu committed Sep 25, 2023
1 parent 371bf50 commit 18fc0cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ public static SqlNode toSql(RexLiteral literal) {
+ " has null SqlTypeFamily, and is SqlTypeName is " + typeName);
switch (family) {
case CHARACTER: {
NlsString value = literal.getValueAs(NlsString.class);
final NlsString value = literal.getValueAs(NlsString.class);
if (value != null) {
String charsetName = value.getCharsetName();
if (charsetName != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import org.apache.calcite.tools.RelBuilder;
import org.apache.calcite.tools.RuleSet;
import org.apache.calcite.tools.RuleSets;
import org.apache.calcite.util.ConversionUtil;
import org.apache.calcite.util.ImmutableBitSet;
import org.apache.calcite.util.TestUtil;
import org.apache.calcite.util.Util;
Expand Down Expand Up @@ -288,6 +289,9 @@ private static String toSql(RelNode root, SqlDialect dialect,
sql("select _UTF8'\u4F60\u597D'")
.withMysql() // produces a simpler output query
.ok("SELECT _UTF-8'\u4F60\u597D'");
sql("select _UTF16'" + ConversionUtil.TEST_UNICODE_STRING + "'")
.withMysql()
.ok("SELECT _UTF-16LE'" + ConversionUtil.TEST_UNICODE_STRING + "'");
}

/** Test case for
Expand Down

0 comments on commit 18fc0cc

Please sign in to comment.