Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1f445c27
提交
1f445c27
authored
7 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use >> syntax in scripts/functions/string
上级
8e262fe8
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
42 行增加
和
133 行删除
+42
-133
concat.sql
h2/src/test/org/h2/test/scripts/functions/string/concat.sql
+2
-7
regex-replace.sql
...st/org/h2/test/scripts/functions/string/regex-replace.sql
+19
-43
regexp-like.sql
...test/org/h2/test/scripts/functions/string/regexp-like.sql
+1
-4
stringencode.sql
...est/org/h2/test/scripts/functions/string/stringencode.sql
+2
-10
utf8tostring.sql
...est/org/h2/test/scripts/functions/string/utf8tostring.sql
+1
-5
xmlcdata.sql
...rc/test/org/h2/test/scripts/functions/string/xmlcdata.sql
+2
-9
xmlcomment.sql
.../test/org/h2/test/scripts/functions/string/xmlcomment.sql
+2
-9
xmlnode.sql
h2/src/test/org/h2/test/scripts/functions/string/xmlnode.sql
+7
-23
xmlstartdoc.sql
...test/org/h2/test/scripts/functions/string/xmlstartdoc.sql
+1
-5
xmltext.sql
h2/src/test/org/h2/test/scripts/functions/string/xmltext.sql
+5
-18
没有找到文件。
h2/src/test/org/h2/test/scripts/functions/string/concat.sql
浏览文件 @
1f445c27
...
@@ -13,10 +13,5 @@ select concat(null, null) en, concat(null, 'a') ea, concat('b', null) eb, concat
...
@@ -13,10 +13,5 @@ select concat(null, null) en, concat(null, 'a') ea, concat('b', null) eb, concat
>
null
a
b
abc
>
null
a
b
abc
>
rows
:
1
>
rows
:
1
SELECT
CONCAT
(
'a'
,
'b'
,
'c'
,
'd'
)
AS
test
;
SELECT
CONCAT
(
'a'
,
'b'
,
'c'
,
'd'
);
>
TEST
>>
abcd
>
----
>
abcd
>
rows
:
1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql
浏览文件 @
1f445c27
...
@@ -7,53 +7,29 @@ call regexp_replace('x', 'x', '\');
...
@@ -7,53 +7,29 @@ call regexp_replace('x', 'x', '\');
> exception
> exception
CALL REGEXP_REPLACE('
abckaboooom
', '
o
+
', '
o
');
CALL REGEXP_REPLACE('
abckaboooom
', '
o
+
', '
o
');
> '
abckabom
'
>> abckabom
> ----------
> abckabom
> rows: 1
select regexp_replace('
Sylvain
', '
S
..
', '
TOTO
', '
mni
') as X;
select regexp_replace('
Sylvain
', '
S
..
', '
TOTO
', '
mni
');
> X
>> TOTOvain
> --------
> TOTOvain
> rows: 1
set mode oracle;
set mode oracle;
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\
2
\
1
') as X from dual;
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\
2
\
1
');
> X
>> last first
> ----------
> last first
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\\
2
\
1
');
> rows: 1
>>
\2
first
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\\
2
\
1
') as X from dual;
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\$
2
\
1
');
> X
>> $2 first
> --------
>
\2
first
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
$
2
$
1
');
> rows: 1
>> $2 $1
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\$
2
\
1
') as X from dual;
> X
> --------
> $2 first
> rows: 1
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
$
2
$
1
') as X from dual;
> X
> -----
> $2 $1
> rows: 1
set mode regular;
set mode regular;
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\
2
\
1
') as X from dual;
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
\
2
\
1
');
> X
>> 2 1
> ---
> 2 1
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
$
2
$
1
');
> rows: 1
>> last first
select regexp_replace('
first
last
', '
(
\
w
+
)
(
\
w
+
)
', '
$
2
$
1
') as X from dual;
> X
> ----------
> last first
> rows: 1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql
浏览文件 @
1f445c27
...
@@ -7,10 +7,7 @@ call select 1 from dual where regexp_like('x', 'x', '\');
...
@@ -7,10 +7,7 @@ call select 1 from dual where regexp_like('x', 'x', '\');
> exception
> exception
select x from dual where REGEXP_LIKE('
A
', '
[
a
-
z
]
', '
i
');
select x from dual where REGEXP_LIKE('
A
', '
[
a
-
z
]
', '
i
');
> X
>> 1
> -
> 1
> rows: 1
select x from dual where REGEXP_LIKE('
A
', '
[
a
-
z
]
', '
c
');
select x from dual where REGEXP_LIKE('
A
', '
[
a
-
z
]
', '
c
');
> X
> X
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/stringencode.sql
浏览文件 @
1f445c27
...
@@ -10,15 +10,7 @@ INSERT INTO TEST VALUES(2, STRINGDECODE('abcsond\344rzeich\344 ') || char(22222)
...
@@ -10,15 +10,7 @@ INSERT INTO TEST VALUES(2, STRINGDECODE('abcsond\344rzeich\344 ') || char(22222)
>
update
count
:
1
>
update
count
:
1
call
STRINGENCODE
(
STRINGDECODE
(
'abcsond
\3
44rzeich
\3
44
\u
56ce
\3
66
\3
44
\3
74
\3
26
\3
04
\3
34
\3
51
\3
50
\3
40
\3
61!'
));
call
STRINGENCODE
(
STRINGDECODE
(
'abcsond
\3
44rzeich
\3
44
\u
56ce
\3
66
\3
44
\3
74
\3
26
\3
04
\3
34
\3
51
\3
50
\3
40
\3
61!'
));
>
'abcsond
\u
00e4rzeich
\u
00e4
\u
56ce
\u
00f6
\u
00e4
\u
00fc
\u
00d6
\u
00c4
\u
00dc
\u
00e9
\u
00e8
\u
00e0
\u
00f1!'
>>
abcsond
\
u00e4rzeich
\
u00e4
\
u56ce
\
u00f6
\
u00e4
\
u00fc
\
u00d6
\
u00c4
\
u00dc
\
u00e9
\
u00e8
\
u00e0
\
u00f1
!
>
------------------------------------------------------------------------------------------------
>
abcsond
\
u00e4rzeich
\
u00e4
\
u56ce
\
u00f6
\
u00e4
\
u00fc
\
u00d6
\
u00c4
\
u00dc
\
u00e9
\
u00e8
\
u00e0
\
u00f1
!
>
rows
:
1
CALL
STRINGENCODE
(
STRINGDECODE
(
'Lines 1
\n
Line 2'
));
CALL
STRINGENCODE
(
STRINGDECODE
(
'Lines 1
\n
Line 2'
));
>
'Lines 1
\n
Line 2'
>>
Lines
1
\
nLine
2
>
-----------------
>
Lines
1
\
nLine
2
>
rows
:
1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/utf8tostring.sql
浏览文件 @
1f445c27
...
@@ -4,8 +4,4 @@
...
@@ -4,8 +4,4 @@
--
--
CALL
UTF8TOSTRING
(
STRINGTOUTF8
(
'This is a test'
));
CALL
UTF8TOSTRING
(
STRINGTOUTF8
(
'This is a test'
));
>
'This is a test'
>>
This
is
a
test
>
----------------
>
This
is
a
test
>
rows
:
1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/xmlcdata.sql
浏览文件 @
1f445c27
...
@@ -4,14 +4,7 @@
...
@@ -4,14 +4,7 @@
--
--
CALL
XMLCDATA
(
'<characters>'
);
CALL
XMLCDATA
(
'<characters>'
);
>
'<![CDATA[<characters>]]>'
>>
<!
[
CDATA
[
<
characters
>
]]
>
>
--------------------------
>
<!
[
CDATA
[
<
characters
>
]]
>
>
rows
:
1
CALL
XMLCDATA
(
'special text ]]>'
);
CALL
XMLCDATA
(
'special text ]]>'
);
>
'special text ]]>'
>>
special
text
]]
&
gt
;
>
---------------------
>
special
text
]]
&
gt
;
>
rows
:
1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/xmlcomment.sql
浏览文件 @
1f445c27
...
@@ -4,14 +4,7 @@
...
@@ -4,14 +4,7 @@
--
--
CALL
XMLCOMMENT
(
'Test'
);
CALL
XMLCOMMENT
(
'Test'
);
>
STRINGDECODE
(
'<!-- Test -->
\n
'
)
>>
<!
-- Test -->
>
-------------------------------
>
<!
-- Test -->
>
rows
:
1
CALL
XMLCOMMENT
(
'--- test ---'
);
CALL
XMLCOMMENT
(
'--- test ---'
);
>
STRINGDECODE
(
'<!-- - - - test - - - -->
\n
'
)
>>
<!
-- - - - test - - - -->
>
-------------------------------------------
>
<!
-- - - - test - - - -->
>
rows
:
1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/xmlnode.sql
浏览文件 @
1f445c27
...
@@ -4,32 +4,16 @@
...
@@ -4,32 +4,16 @@
--
--
CALL
XMLNODE
(
'a'
,
XMLATTR
(
'href'
,
'http://h2database.com'
));
CALL
XMLNODE
(
'a'
,
XMLATTR
(
'href'
,
'http://h2database.com'
));
>
STRINGDECODE
(
'<a href=
\"
http://h2database.com
\"
/>
\n
'
)
>>
<
a
href
=
"http://h2database.com"
/>
>
-----------------------------------------------------
>
<
a
href
=
"http://h2database.com"
/>
>
rows
:
1
CALL
XMLNODE
(
'br'
);
CALL
XMLNODE
(
'br'
);
>
STRINGDECODE
(
'<br/>
\n
'
)
>>
<
br
/>
>
-----------------------
>
<
br
/>
>
rows
:
1
CALL
XMLNODE
(
'p'
,
null
,
'Hello World'
);
CALL
XMLNODE
(
'p'
,
null
,
'Hello World'
);
>
STRINGDECODE
(
'<p>Hello World</p>
\n
'
)
>>
<
p
>
Hello
World
</
p
>
>
------------------------------------
>
<
p
>
Hello
World
</
p
>
>
rows
:
1
SELECT
XMLNODE
(
'p'
,
null
,
'Hello'
||
chr
(
10
)
||
'World'
)
X
;
SELECT
XMLNODE
(
'p'
,
null
,
'Hello'
||
chr
(
10
)
||
'World'
);
>
X
>>
<
p
>
Hello
World
</
p
>
>
---------------------
>
<
p
>
Hello
World
</
p
>
>
rows
:
1
SELECT
XMLNODE
(
'p'
,
null
,
'Hello'
||
chr
(
10
)
||
'World'
,
false
)
X
;
>
X
>
-------------------
>
<
p
>
Hello
World
</
p
>
>
rows
:
1
SELECT
XMLNODE
(
'p'
,
null
,
'Hello'
||
chr
(
10
)
||
'World'
,
false
);
>>
<
p
>
Hello
World
</
p
>
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/xmlstartdoc.sql
浏览文件 @
1f445c27
...
@@ -4,8 +4,4 @@
...
@@ -4,8 +4,4 @@
--
--
CALL
XMLSTARTDOC
();
CALL
XMLSTARTDOC
();
>
STRINGDECODE
(
'<?xml version=
\"
1.0
\"
?>
\n
'
)
>>
<?
xml
version
=
"1.0"
?>
>
-----------------------------------------
>
<?
xml
version
=
"1.0"
?>
>
rows
:
1
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/xmltext.sql
浏览文件 @
1f445c27
...
@@ -4,26 +4,13 @@
...
@@ -4,26 +4,13 @@
--
--
CALL
XMLTEXT
(
'test'
);
CALL
XMLTEXT
(
'test'
);
>
'test'
>>
test
>
------
>
test
>
rows
:
1
CALL
XMLTEXT
(
'<test>'
);
CALL
XMLTEXT
(
'<test>'
);
>
'<test>'
>>
&
lt
;
test
&
gt
;
>
--------------
>
&
lt
;
test
&
gt
;
>
rows
:
1
SELECT
XMLTEXT
(
'hello'
||
chr
(
10
)
||
'world'
)
X
;
SELECT
XMLTEXT
(
'hello'
||
chr
(
10
)
||
'world'
);
>
X
>>
hello
world
>
-----------
>
hello
world
>
rows
:
1
CALL
XMLTEXT
(
'hello'
||
chr
(
10
)
||
'world'
,
true
);
CALL
XMLTEXT
(
'hello'
||
chr
(
10
)
||
'world'
,
true
);
>
'hello
world'
>>
hello
&#
xa
;
world
>
-----------------
>
hello
&#
xa
;
world
>
rows
:
1
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论