This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new b24e275 make special function return functionSegment (#13517)
b24e275 is described below
commit b24e27549a7507a3a5baa5cbad1973fea8900d50
Author: tuichenchuxin <[email protected]>
AuthorDate: Wed Nov 10 09:46:02 2021 +0800
make special function return functionSegment (#13517)
---
.../src/main/antlr4/imports/mysql/BaseRule.g4 | 7 +-
.../src/main/antlr4/imports/mysql/DMLStatement.g4 | 2 +-
.../statement/impl/MySQLStatementSQLVisitor.java | 89 +++++++------
.../resources/case/dml/select-special-function.xml | 138 +++++++++++++++++++++
.../src/main/resources/case/dml/select.xml | 18 ++-
.../sql/supported/dml/select-special-function.xml | 32 +++++
6 files changed, 244 insertions(+), 42 deletions(-)
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
index fd06049..619285d 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
@@ -896,11 +896,11 @@ distinct
;
overClause
- : OVER (LP_ windowSpecification RP_ | identifier)
+ : OVER (windowSpecification | identifier)
;
windowSpecification
- : identifier? (PARTITION BY expr (COMMA_ expr)*)? orderByClause?
frameClause?
+ : LP_ identifier? (PARTITION BY expr (COMMA_ expr)*)? orderByClause?
frameClause? RP_
;
frameClause
@@ -1007,7 +1007,8 @@ charFunction
;
trimFunction
- : TRIM LP_ (LEADING | BOTH | TRAILING) string_ FROM string_ RP_
+ : TRIM LP_ ((LEADING | BOTH | TRAILING) string_? FROM)? string_ RP_
+ | TRIM LP_ (string_ FROM)? string_ RP_
;
valuesFunction
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
index c565ba8..9209a7b 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
@@ -354,7 +354,7 @@ windowClause
;
windowItem
- : identifier AS LP_ windowSpecification RP_
+ : identifier AS windowSpecification
;
subquery
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
index 6118da8..499d793 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
@@ -125,6 +125,9 @@ import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WhereCl
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WindowClauseContext;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WindowFunctionContext;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.FunctionNameContext;
+import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.TrimFunctionContext;
+import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ValuesFunctionContext;
+import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CurrentUserFunctionContext;
import
org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
@@ -739,88 +742,104 @@ public abstract class MySQLStatementSQLVisitor extends
MySQLStatementBaseVisitor
@Override
public final ASTNode visitSpecialFunction(final SpecialFunctionContext
ctx) {
+ FunctionSegment functionSegment;
if (null != ctx.groupConcatFunction()) {
- return visit(ctx.groupConcatFunction());
- }
- if (null != ctx.windowFunction()) {
- return visit(ctx.windowFunction());
- }
- if (null != ctx.castFunction()) {
- return visit(ctx.castFunction());
- }
- if (null != ctx.convertFunction()) {
- return visit(ctx.convertFunction());
- }
- if (null != ctx.positionFunction()) {
- return visit(ctx.positionFunction());
- }
- if (null != ctx.substringFunction()) {
- return visit(ctx.substringFunction());
- }
- if (null != ctx.extractFunction()) {
- return visit(ctx.extractFunction());
- }
- if (null != ctx.charFunction()) {
- return visit(ctx.charFunction());
- }
- if (null != ctx.weightStringFunction()) {
- return visit(ctx.weightStringFunction());
+ functionSegment = (FunctionSegment)
visit(ctx.groupConcatFunction());
+ } else if (null != ctx.windowFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.windowFunction());
+ } else if (null != ctx.castFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.castFunction());
+ } else if (null != ctx.convertFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.convertFunction());
+ } else if (null != ctx.positionFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.positionFunction());
+ } else if (null != ctx.substringFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.substringFunction());
+ } else if (null != ctx.extractFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.extractFunction());
+ } else if (null != ctx.charFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.charFunction());
+ } else if (null != ctx.trimFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.trimFunction());
+ } else if (null != ctx.weightStringFunction()) {
+ functionSegment = (FunctionSegment)
visit(ctx.weightStringFunction());
+ } else if (null != ctx.valuesFunction()) {
+ functionSegment = (FunctionSegment) visit(ctx.valuesFunction());
+ } else if (null != ctx.currentUserFunction()) {
+ functionSegment = (FunctionSegment)
visit(ctx.currentUserFunction());
+ } else {
+ functionSegment = new
FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(),
getOriginalText(ctx), getOriginalText(ctx));
}
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx), functionSegment);
}
@Override
public final ASTNode visitGroupConcatFunction(final
GroupConcatFunctionContext ctx) {
calculateParameterCount(ctx.expr());
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.GROUP_CONCAT().getText(),
getOriginalText(ctx));
}
@Override
public final ASTNode visitWindowFunction(final WindowFunctionContext ctx) {
super.visitWindowFunction(ctx);
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.funcName.getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitCastFunction(final CastFunctionContext ctx) {
calculateParameterCount(Collections.singleton(ctx.expr()));
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.CAST().getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitConvertFunction(final ConvertFunctionContext
ctx) {
calculateParameterCount(Collections.singleton(ctx.expr()));
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.CONVERT().getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitPositionFunction(final PositionFunctionContext
ctx) {
calculateParameterCount(ctx.expr());
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.POSITION().getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitSubstringFunction(final SubstringFunctionContext
ctx) {
calculateParameterCount(Collections.singleton(ctx.expr()));
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), null == ctx.SUBSTR() ? ctx.SUBSTRING().getText()
: ctx.SUBSTR().getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitExtractFunction(final ExtractFunctionContext
ctx) {
calculateParameterCount(Collections.singleton(ctx.expr()));
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.EXTRACT().getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitCharFunction(final CharFunctionContext ctx) {
calculateParameterCount(ctx.expr());
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.CHAR().getText(), getOriginalText(ctx));
+ }
+
+ @Override
+ public final ASTNode visitTrimFunction(final TrimFunctionContext ctx) {
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.TRIM().getText(), getOriginalText(ctx));
}
@Override
public final ASTNode visitWeightStringFunction(final
WeightStringFunctionContext ctx) {
calculateParameterCount(Collections.singleton(ctx.expr()));
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), getOriginalText(ctx));
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.WEIGHT_STRING().getText(),
getOriginalText(ctx));
+ }
+
+ @Override
+ public final ASTNode visitValuesFunction(final ValuesFunctionContext ctx) {
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.VALUES().getText(), getOriginalText(ctx));
+ }
+
+ @Override
+ public final ASTNode visitCurrentUserFunction(final
CurrentUserFunctionContext ctx) {
+ return new FunctionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.CURRENT_USER().getText(),
getOriginalText(ctx));
}
@Override
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select-special-function.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select-special-function.xml
new file mode 100644
index 0000000..c633efb
--- /dev/null
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select-special-function.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-parser-test-cases>
+ <select sql-case-id="select_group_concat">
+ <from>
+ <simple-table name="t_order" start-index="33" stop-index="39"/>
+ </from>
+ <projections start-index="7" stop-index="26">
+ <expression-projection text="GROUP_CONCAT(status)" start-index="7"
stop-index="26">
+ <expr>
+ <function function-name="GROUP_CONCAT" start-index="7"
stop-index="26" text="GROUP_CONCAT(status)" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_window_function">
+ <from>
+ <simple-table name="t_order" start-index="42" stop-index="48"/>
+ </from>
+ <projections start-index="7" stop-index="35">
+ <column-projection name="order_id" start-index="7" stop-index="14"
/>
+ <expression-projection text="ROW_NUMBER() OVER()" start-index="17"
stop-index="35">
+ <expr>
+ <function function-name="ROW_NUMBER" start-index="17"
stop-index="35" text="ROW_NUMBER() OVER()" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_cast_function">
+ <projections start-index="7" stop-index="27">
+ <expression-projection text="CAST('1' AS UNSIGNED)"
start-index="7" stop-index="27">
+ <expr>
+ <function function-name="CAST" start-index="7"
stop-index="27" text="CAST('1' AS UNSIGNED)" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_convert_function">
+ <projections start-index="7" stop-index="33">
+ <expression-projection text="CONVERT('2020-10-01', DATE)"
start-index="7" stop-index="33">
+ <expr>
+ <function function-name="CONVERT" start-index="7"
stop-index="33" text="CONVERT('2020-10-01', DATE)" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_position">
+ <projections start-index="7" stop-index="36">
+ <expression-projection text="POSITION('bar' IN 'foobarbar')"
start-index="7" stop-index="36">
+ <expr>
+ <function function-name="POSITION" start-index="7"
stop-index="36" text="POSITION('bar' IN 'foobarbar')" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_substring">
+ <projections start-index="7" stop-index="35">
+ <expression-projection text="SUBSTRING('foobarbar' from 4)"
start-index="7" stop-index="35">
+ <expr>
+ <function function-name="SUBSTRING" start-index="7"
stop-index="35" text="SUBSTRING('foobarbar' from 4)" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_extract">
+ <projections start-index="7" stop-index="37">
+ <expression-projection text="EXTRACT(YEAR FROM '2019-07-02')"
start-index="7" stop-index="37">
+ <expr>
+ <function function-name="EXTRACT" start-index="7"
stop-index="37" text="EXTRACT(YEAR FROM '2019-07-02')" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_char">
+ <projections start-index="7" stop-index="29">
+ <expression-projection text="CHAR(77,121,83,81,'76')"
start-index="7" stop-index="29">
+ <expr>
+ <function function-name="CHAR" start-index="7"
stop-index="29" text="CHAR(77,121,83,81,'76')" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_trim">
+ <projections start-index="7" stop-index="22">
+ <expression-projection text="TRIM(' bar ')" start-index="7"
stop-index="22">
+ <expr>
+ <function function-name="TRIM" start-index="7"
stop-index="22" text="TRIM(' bar ')" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_weight_string">
+ <projections start-index="7" stop-index="26">
+ <expression-projection text="WEIGHT_STRING('bar')" start-index="7"
stop-index="26">
+ <expr>
+ <function function-name="WEIGHT_STRING" start-index="7"
stop-index="26" text="WEIGHT_STRING('bar')" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_values">
+ <from>
+ <simple-table name="t_order" start-index="29" stop-index="35"/>
+ </from>
+ <projections start-index="7" stop-index="22">
+ <expression-projection text="VALUES(order_id)" start-index="7"
stop-index="22">
+ <expr>
+ <function function-name="VALUES" start-index="7"
stop-index="22" text="VALUES(order_id)" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+ <select sql-case-id="select_current_user_brackets">
+ <projections start-index="7" stop-index="20">
+ <expression-projection text="CURRENT_USER()" start-index="7"
stop-index="20">
+ <expr>
+ <function function-name="CURRENT_USER" start-index="7"
stop-index="20" text="CURRENT_USER()" />
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+</sql-parser-test-cases>
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
index a1a228e..c3bb500 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
@@ -2911,7 +2911,11 @@
<simple-table name="t_order" start-index="70" stop-index="76" />
</from>
<projections start-index="7" stop-index="63">
- <expression-projection text="CONVERT(SUBSTRING(content, 5) ,
SIGNED)" alias="signed_content" start-index="7" stop-index="63" />
+ <expression-projection text="CONVERT(SUBSTRING(content, 5) ,
SIGNED)" alias="signed_content" start-index="7" stop-index="63">
+ <expr>
+ <function function-name="CONVERT" start-index="7"
stop-index="45" text="CONVERT(SUBSTRING(content, 5) , SIGNED)" />
+ </expr>
+ </expression-projection>
</projections>
<where start-index="78" stop-index="95">
<expr>
@@ -3103,7 +3107,11 @@
</from>
<projections start-index="7" stop-index="38">
<column-projection name="user_id" start-index="7" stop-index="13"/>
- <expression-projection text="CAST(order_id AS SIGNED)"
start-index="15" stop-index="38" />
+ <expression-projection text="CAST(order_id AS SIGNED)"
start-index="15" stop-index="38">
+ <expr>
+ <function function-name="CAST" start-index="15"
stop-index="38" text="CAST(order_id AS SIGNED)" />
+ </expr>
+ </expression-projection>
</projections>
</select>
@@ -3112,7 +3120,11 @@
<simple-table name="t_order" start-index="47" stop-index="53"/>
</from>
<projections start-index="7" stop-index="40">
- <expression-projection text="CAST(order_id AS UNSIGNED)"
start-index="7" stop-index="32" />
+ <expression-projection text="CAST(order_id AS UNSIGNED)"
start-index="7" stop-index="32">
+ <expr>
+ <function function-name="CAST" start-index="7"
stop-index="32" text="CAST(order_id AS UNSIGNED)" />
+ </expr>
+ </expression-projection>
<column-projection name="user_id" start-index="34"
stop-index="40"/>
</projections>
</select>
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select-special-function.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select-special-function.xml
new file mode 100644
index 0000000..5d29273
--- /dev/null
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select-special-function.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="select_group_concat" value="SELECT GROUP_CONCAT(status) FROM
t_order" db-types="MySQL" />
+ <sql-case id="select_window_function" value="SELECT order_id, ROW_NUMBER()
OVER() FROM t_order" db-types="MySQL" />
+ <sql-case id="select_cast_function" value="SELECT CAST('1' AS UNSIGNED)"
db-types="MySQL" />
+ <sql-case id="select_convert_function" value="SELECT CONVERT('2020-10-01',
DATE)" db-types="MySQL" />
+ <sql-case id="select_position" value="SELECT POSITION('bar' IN
'foobarbar')" db-types="MySQL" />
+ <sql-case id="select_substring" value="SELECT SUBSTRING('foobarbar' from
4)" db-types="MySQL" />
+ <sql-case id="select_extract" value="SELECT EXTRACT(YEAR FROM
'2019-07-02')" db-types="MySQL" />
+ <sql-case id="select_char" value="SELECT CHAR(77,121,83,81,'76')"
db-types="MySQL" />
+ <sql-case id="select_trim" value="SELECT TRIM(' bar ')"
db-types="MySQL" />
+ <sql-case id="select_weight_string" value="SELECT WEIGHT_STRING('bar')"
db-types="MySQL" />
+ <sql-case id="select_values" value="SELECT VALUES(order_id) FROM t_order"
db-types="MySQL" />
+ <sql-case id="select_current_user_brackets" value="SELECT CURRENT_USER()"
db-types="MySQL" />
+</sql-cases>