Unverified 提交 05b546d5 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov 提交者: GitHub

Merge pull request #1519 from katzyn/enum

Fix ValueEnumBase.getSQL()
...@@ -21,6 +21,8 @@ Change Log ...@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul> <ul>
<li>Issue #1518: ENUM and VIEW with filtering on enum column
</li>
<li>Issue #1516: Array element reference array[index] should be 1-based <li>Issue #1516: Array element reference array[index] should be 1-based
</li> </li>
<li>Issue #1512: TestMVTableEngine.testLowRetentionTime(): NPE in VersionedValue.Type <li>Issue #1512: TestMVTableEngine.testLowRetentionTime(): NPE in VersionedValue.Type
......
...@@ -9,6 +9,7 @@ import java.sql.PreparedStatement; ...@@ -9,6 +9,7 @@ import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
import org.h2.engine.Mode; import org.h2.engine.Mode;
import org.h2.util.StringUtils;
/** /**
* Base implementation of the ENUM data type. * Base implementation of the ENUM data type.
...@@ -94,7 +95,7 @@ public class ValueEnumBase extends Value { ...@@ -94,7 +95,7 @@ public class ValueEnumBase extends Value {
@Override @Override
public String getSQL() { public String getSQL() {
return getString(); return StringUtils.quoteStringSQL(label);
} }
@Override @Override
......
...@@ -277,3 +277,12 @@ DROP TABLE TEST; ...@@ -277,3 +277,12 @@ DROP TABLE TEST;
SELECT CAST (2 AS ENUM('a', 'b', 'c', 'd')); SELECT CAST (2 AS ENUM('a', 'b', 'c', 'd'));
>> c >> c
CREATE TABLE TEST(E ENUM('a', 'b'));
> ok
EXPLAIN SELECT * FROM TEST WHERE E = 'a';
>> SELECT TEST.E FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */ WHERE E = 'a'
DROP TABLE TEST;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论