Unverified 提交 3b3c53f9 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #1289 from migaman/master

Add Function "LEN" #1196
...@@ -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 #1196: Feature request for MS SQL Server Compatibility Mode
</li>
<li>Issue #1177: Resource leak in Recover tool <li>Issue #1177: Resource leak in Recover tool
</li> </li>
<li>PR #1183: Improve concurrency of connection pool with wait-free implement <li>PR #1183: Improve concurrency of connection pool with wait-free implement
......
...@@ -239,6 +239,8 @@ public class Function extends Expression implements FunctionCall { ...@@ -239,6 +239,8 @@ public class Function extends Expression implements FunctionCall {
addFunction("LCASE", LCASE, 1, Value.STRING); addFunction("LCASE", LCASE, 1, Value.STRING);
addFunction("LEFT", LEFT, 2, Value.STRING); addFunction("LEFT", LEFT, 2, Value.STRING);
addFunction("LENGTH", LENGTH, 1, Value.LONG); addFunction("LENGTH", LENGTH, 1, Value.LONG);
// alias for MSSQLServer
addFunction("LEN", LENGTH, 1, Value.LONG);
// 2 or 3 arguments // 2 or 3 arguments
addFunction("LOCATE", LOCATE, VAR_ARGS, Value.INT); addFunction("LOCATE", LOCATE, VAR_ARGS, Value.INT);
// alias for MSSQLServer // alias for MSSQLServer
......
...@@ -2,3 +2,15 @@ ...@@ -2,3 +2,15 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html). -- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group -- Initial Developer: H2 Group
-- --
create memory table test(id int primary key, name varchar(255));
> ok
insert into test values(1, 'Hello');
> update count: 1
select length(null) en, len(null) en2, length('This has 17 chars') e_17, len('MSSQLServer uses the len keyword') e_32 from test;
> EN EN2 E_17 E_32
> ---- ---- ---- ----
> null null 17 32
> rows: 1
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论