Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1af923c9
提交
1af923c9
authored
12月 14, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Issue 266: Domains: a NOT NULL clause in a domain definition ignored.
上级
e3a746af
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
7 行删除
+24
-7
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+2
-1
test-1.3.txt
h2/src/test/org/h2/test/test-1.3.txt
+20
-5
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
1af923c9
...
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
More accurate calculation of variance and standard deviation for large number of samples with low variance
<ul><li>
Issue 266: Domains: a NOT NULL clause in a domain definition ignored.
</li><li>
More accurate calculation of variance and standard deviation for large number of samples with low variance
(now using Welford's method).
</li><li>
Server: CLOB data with unicode characters between character code 0xd800 and 0xdfff
were not transferred correctly. In many cases, the thread was stuck afterwards.
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
1af923c9
...
...
@@ -3422,7 +3422,8 @@ public class Parser {
}
else
if
(
readIf
(
"NULL"
))
{
column
.
setNullable
(
true
);
}
else
{
column
.
setNullable
(
defaultNullable
);
// domains may be defined as not nullable
column
.
setNullable
(
defaultNullable
&
column
.
isNullable
());
}
if
(
readIf
(
"AS"
))
{
if
(
isIdentity
)
{
...
...
h2/src/test/org/h2/test/test-1.3.txt
浏览文件 @
1af923c9
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create domain x as int not null;
> ok
create table test(id x);
> ok
insert into test values(null);
> exception
drop table test;
> ok
drop domain x;
> ok
create table test(id int primary key);
> ok
...
...
@@ -2480,13 +2495,13 @@ create domain string_x as string3;
create memory table test(a string, b string1, c string2, d string3);
> ok
insert into test(
) values(
);
insert into test(
c) values('x'
);
> update count: 1
select * from test;
> A B C
D
> - ---- -
---
-------
> null
null
<empty>
> A B C D
> - ---- - -------
> null
x
<empty>
> rows: 1
select DOMAIN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, PRECISION, SCALE, TYPE_NAME, SELECTIVITY, CHECK_CONSTRAINT, REMARKS, SQL from information_schema.domains;
...
...
@@ -2515,7 +2530,7 @@ script nodata nopasswords nosettings;
> CREATE DOMAIN STRING3 AS VARCHAR DEFAULT '<empty>';
> CREATE DOMAIN STRING_X AS VARCHAR DEFAULT '<empty>';
> CREATE MEMORY TABLE PUBLIC.ADDRESS( ID INT NOT NULL, NAME VARCHAR(200) CHECK (POSITION('@', NAME) > 1), NAME2 VARCHAR(200) DEFAULT '@gmail.com' CHECK ((POSITION('@', NAME2) > 1) AND (POSITION('gmail', NAME2) > 1)) );
> CREATE MEMORY TABLE PUBLIC.TEST( A VARCHAR(255) DEFAULT ''
, B VARCHAR, C VARCHAR
, D VARCHAR DEFAULT '<empty>' );
> CREATE MEMORY TABLE PUBLIC.TEST( A VARCHAR(255) DEFAULT ''
NOT NULL, B VARCHAR, C VARCHAR NOT NULL
, D VARCHAR DEFAULT '<empty>' );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 13
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论