提交 dc88072d authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Add some tests of precision checks

上级 fd7d45f6
......@@ -725,3 +725,53 @@ SELECT * FROM TEST ORDER BY I;
DROP TABLE TEST;
> ok
-- Some precision tests
CREATE TABLE TEST(I INTERVAL DAY, IL INTERVAL DAY(5));
> ok
INSERT INTO TEST VALUES ('99', '99999'), ('-99', '-99999');
> update count: 2
INSERT INTO TEST(I) VALUES ('100');
> exception VALUE_TOO_LONG_2
INSERT INTO TEST(I) VALUES ('-100');
> exception VALUE_TOO_LONG_2
INSERT INTO TEST(IL) VALUES ('100000');
> exception VALUE_TOO_LONG_2
INSERT INTO TEST(IL) VALUES ('-100000');
> exception VALUE_TOO_LONG_2
DROP TABLE TEST;
> ok
CREATE TABLE TEST(I INTERVAL DAY(0));
> exception INVALID_VALUE_SCALE_PRECISION
CREATE TABLE TEST(I INTERVAL DAY(18));
> ok
DROP TABLE TEST;
> ok
CREATE TABLE TEST(I INTERVAL DAY(19));
> exception INVALID_VALUE_SCALE_PRECISION
CREATE TABLE TEST(I INTERVAL HOUR TO SECOND(0));
> ok
DROP TABLE TEST;
> ok
CREATE TABLE TEST(I INTERVAL HOUR TO SECOND(9));
> ok
DROP TABLE TEST;
> ok
CREATE TABLE TEST(I INTERVAL HOUR TO SECOND(10));
> exception INVALID_VALUE_SCALE_PRECISION
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论