Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
93e5c6a0
提交
93e5c6a0
authored
5月 29, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
H2 Console: editing result sets is now also working for database other than H2.
上级
dda74919
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
58 行增加
和
21 行删除
+58
-21
changelog.html
h2/src/docsrc/html/changelog.html
+5
-1
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+39
-9
otherDatabases.txt
h2/src/test/org/h2/test/otherDatabases.txt
+14
-11
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
93e5c6a0
...
@@ -18,7 +18,11 @@ Change Log
...
@@ -18,7 +18,11 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Cluster: an open transaction was committed when a cluster node was stopped
<ul><li>
H2 Console: editing result sets is now also working for database other than H2,
if they do support updateable result sets. The query must be prefixed with "@edit".
Only limited testing has been done on this feature,
some data types may not work (please provide feedback if you find issues).
</li><li>
Cluster: an open transaction was committed when a cluster node was stopped
(because disabling the cluster executes SET CLUSTER '', which committed the transaction).
(because disabling the cluster executes SET CLUSTER '', which committed the transaction).
Transaction are no longer committed when calling SET CLUSTER. Issue 199.
Transaction are no longer committed when calling SET CLUSTER. Issue 199.
</li><li>
Cluster: non-admin users couldn't connect to the cluster and couldn't disable the cluster. Issue 201.
</li><li>
Cluster: non-admin users couldn't connect to the cluster and couldn't disable the cluster. Issue 201.
...
...
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
93e5c6a0
...
@@ -13,6 +13,7 @@ import java.io.StringReader;
...
@@ -13,6 +13,7 @@ import java.io.StringReader;
import
java.io.StringWriter
;
import
java.io.StringWriter
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.DatabaseMetaData
;
import
java.sql.DatabaseMetaData
;
import
java.sql.ParameterMetaData
;
import
java.sql.ParameterMetaData
;
...
@@ -998,7 +999,8 @@ public class WebApp {
...
@@ -998,7 +999,8 @@ public class WebApp {
if
(!(
s
.
startsWith
(
"@"
)
&&
s
.
endsWith
(
"."
)))
{
if
(!(
s
.
startsWith
(
"@"
)
&&
s
.
endsWith
(
"."
)))
{
buff
.
append
(
PageParser
.
escapeHtml
(
s
+
";"
)).
append
(
"<br />"
);
buff
.
append
(
PageParser
.
escapeHtml
(
s
+
";"
)).
append
(
"<br />"
);
}
}
buff
.
append
(
getResult
(
conn
,
i
+
1
,
s
,
size
==
1
,
false
)).
append
(
"<br />"
);
boolean
forceEdit
=
s
.
startsWith
(
"@edit"
);
buff
.
append
(
getResult
(
conn
,
i
+
1
,
s
,
size
==
1
,
forceEdit
)).
append
(
"<br />"
);
}
}
private
String
editResult
()
{
private
String
editResult
()
{
...
@@ -1671,16 +1673,44 @@ public class WebApp {
...
@@ -1671,16 +1673,44 @@ public class WebApp {
return
false
;
return
false
;
}
}
private
void
unescapeData
(
String
d
,
ResultSet
rs
,
int
columnIndex
)
throws
SQLException
{
private
void
unescapeData
(
String
x
,
ResultSet
rs
,
int
columnIndex
)
throws
SQLException
{
if
(
d
.
equals
(
"null"
))
{
if
(
x
.
equals
(
"null"
))
{
rs
.
updateNull
(
columnIndex
);
rs
.
updateNull
(
columnIndex
);
}
else
if
(
d
.
startsWith
(
"=+"
))
{
return
;
}
else
if
(
x
.
startsWith
(
"=+"
))
{
// don't update
// don't update
}
else
if
(
d
.
startsWith
(
"= "
))
{
return
;
d
=
d
.
substring
(
2
);
}
else
if
(
x
.
startsWith
(
"= "
))
{
rs
.
updateString
(
columnIndex
,
d
);
x
=
x
.
substring
(
2
);
}
else
{
}
rs
.
updateString
(
columnIndex
,
d
);
ResultSetMetaData
meta
=
rs
.
getMetaData
();
int
type
=
meta
.
getColumnType
(
columnIndex
);
if
(
session
.
getContents
().
isH2
)
{
rs
.
updateString
(
columnIndex
,
x
);
return
;
}
switch
(
type
)
{
case
Types
.
BIGINT
:
rs
.
updateLong
(
columnIndex
,
Long
.
decode
(
x
));
break
;
case
Types
.
DECIMAL
:
rs
.
updateBigDecimal
(
columnIndex
,
new
BigDecimal
(
x
));
break
;
case
Types
.
DOUBLE
:
case
Types
.
FLOAT
:
rs
.
updateDouble
(
columnIndex
,
Double
.
parseDouble
(
x
));
break
;
case
Types
.
REAL
:
rs
.
updateFloat
(
columnIndex
,
Float
.
parseFloat
(
x
));
break
;
case
Types
.
INTEGER
:
rs
.
updateInt
(
columnIndex
,
Integer
.
decode
(
x
));
break
;
case
Types
.
TINYINT
:
rs
.
updateShort
(
columnIndex
,
Short
.
decode
(
x
));
break
;
default
:
rs
.
updateString
(
columnIndex
,
x
);
}
}
}
}
...
...
h2/src/test/org/h2/test/otherDatabases.txt
浏览文件 @
93e5c6a0
MySQL
MySQL
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
Start:
sudo mysqld_safe
Stop:
sudo mysqladmin shutdown
Configuration:
sudo mysql
create database test;
create user 'sa'@'localhost' identified by 'sa';
use test;
grant all on * to 'sa'@'localhost' with grant option;
'TRADITIONAL' is default; ANSI mode can be set using:
'TRADITIONAL' is default; ANSI mode can be set using:
SET GLOBAL sql_mode='ANSI';
SET GLOBAL sql_mode='ANSI';
SELECT @@global.sql_mode
SELECT @@global.sql_mode
;
Non-standard escape mechanism:
Non-standard escape mechanism:
select 'Joe''s', 'Joe\'s';
select 'Joe''s', 'Joe\'s';
...
@@ -15,16 +28,6 @@ insert into test values(null);
...
@@ -15,16 +28,6 @@ insert into test values(null);
-- 2 rows even in ANSI mode (correct is 1 row):
-- 2 rows even in ANSI mode (correct is 1 row):
select * from test where id=id and 1=1;
select * from test where id=id and 1=1;
Configuration:
create database test;
create user 'sa'@'localhost' identified by 'sa';
use test;
grant all on * to 'sa'@'localhost' with grant option;
Start and Stop:
sudo mysqld_safe
sudo mysqladmin shutdown
MS SQL Server 2005
MS SQL Server 2005
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论