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

Move sign into quotes

上级 8549969a
......@@ -1654,9 +1654,11 @@ public class DateTimeUtils {
boolean negative = leading < 0;
if (negative) {
leading = -leading;
buff.append('-');
}
buff.append('\'');
if (negative) {
buff.append('-');
}
switch (qualifier) {
case YEAR:
case MONTH:
......
......@@ -3,7 +3,8 @@
-- Initial Developer: H2 Group
--
CREATE TABLE TEST(I01 INTERVAL YEAR, I02 INTERVAL MONTH, I03 INTERVAL DAY, I04 INTERVAL HOUR, I05 INTERVAL MINUTE,
CREATE TABLE TEST(ID INT PRIMARY KEY,
I01 INTERVAL YEAR, I02 INTERVAL MONTH, I03 INTERVAL DAY, I04 INTERVAL HOUR, I05 INTERVAL MINUTE,
I06 INTERVAL SECOND, I07 INTERVAL YEAR TO MONTH, I08 INTERVAL DAY TO HOUR, I09 INTERVAL DAY TO MINUTE,
I10 INTERVAL DAY TO SECOND, I11 INTERVAL HOUR TO MINUTE, I12 INTERVAL HOUR TO SECOND,
I13 INTERVAL MINUTE TO SECOND,
......@@ -19,6 +20,7 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_PRECISION, NUMERI
WHERE TABLE_NAME = 'TEST' ORDER BY ORDINAL_POSITION;
> COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_TYPE NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION
> ----------- --------- --------- ------------------------------- ----------------- ------------- ------------------ ---------------------- ------------------
> ID 4 INTEGER INT NOT NULL 10 0 null null null
> I01 1111 INTERVAL INTERVAL YEAR 2 0 null YEAR 2
> I02 1111 INTERVAL INTERVAL MONTH 2 0 null MONTH 2
> I03 1111 INTERVAL INTERVAL DAY 2 0 null DAY 2
......@@ -45,9 +47,10 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_PRECISION, NUMERI
> J11 1111 INTERVAL INTERVAL HOUR(5) TO MINUTE 5 0 null HOUR(5) TO MINUTE 5
> J12 1111 INTERVAL INTERVAL HOUR(5) TO SECOND(9) 5 9 9 HOUR(5) TO SECOND(9) 5
> J13 1111 INTERVAL INTERVAL MINUTE(5) TO SECOND(9) 5 9 9 MINUTE(5) TO SECOND(9) 5
> rows (ordered): 26
> rows (ordered): 27
INSERT INTO TEST VALUES (
1,
INTERVAL '1' YEAR, INTERVAL '1' MONTH, INTERVAL '1' DAY, INTERVAL '1' HOUR, INTERVAL '1' MINUTE,
INTERVAL '1.123456789' SECOND, INTERVAL '1-2' YEAR TO MONTH, INTERVAL '1 2' DAY TO HOUR,
INTERVAL '1 2:3' DAY TO MINUTE, INTERVAL '1 2:3:4.123456789' DAY TO SECOND, INTERVAL '1:2' HOUR TO MINUTE,
......@@ -57,6 +60,7 @@ INSERT INTO TEST VALUES (
INTERVAL '1 2:3' DAY TO MINUTE, INTERVAL '1 2:3:4.123456789' DAY TO SECOND, INTERVAL '1:2' HOUR TO MINUTE,
INTERVAL '1:2:3.123456789' HOUR TO SECOND, INTERVAL '1:2.123456789' MINUTE TO SECOND
), (
2,
INTERVAL '-1' YEAR, INTERVAL '-1' MONTH, INTERVAL '-1' DAY, INTERVAL '-1' HOUR, INTERVAL '-1' MINUTE,
INTERVAL '-1.123456789' SECOND, INTERVAL '-1-2' YEAR TO MONTH, INTERVAL '-1 2' DAY TO HOUR,
INTERVAL '-1 2:3' DAY TO MINUTE, INTERVAL '-1 2:3:4.123456789' DAY TO SECOND, INTERVAL '-1:2' HOUR TO MINUTE,
......@@ -67,47 +71,47 @@ INSERT INTO TEST VALUES (
INTERVAL -'1:2:3.123456789' HOUR TO SECOND, INTERVAL -'1:2.123456789' MINUTE TO SECOND);
> update count: 2
SELECT I01, I02, I03, I04, I05, I06 FROM TEST;
SELECT I01, I02, I03, I04, I05, I06 FROM TEST ORDER BY ID;
> I01 I02 I03 I04 I05 I06
> ------------------ ------------------- ----------------- ------------------ -------------------- --------------------------
> INTERVAL '1' YEAR INTERVAL '1' MONTH INTERVAL '1' DAY INTERVAL '1' HOUR INTERVAL '1' MINUTE INTERVAL '1.123457' SECOND
> INTERVAL -'1' YEAR INTERVAL -'1' MONTH INTERVAL -'1' DAY INTERVAL -'1' HOUR INTERVAL -'1' MINUTE INTERVAL '1.123457' SECOND
> rows: 2
> INTERVAL '-1' YEAR INTERVAL '-1' MONTH INTERVAL '-1' DAY INTERVAL '-1' HOUR INTERVAL '-1' MINUTE INTERVAL '1.123457' SECOND
> rows (ordered): 2
SELECT I07, I08, I09, I10 FROM TEST;
SELECT I07, I08, I09, I10 FROM TEST ORDER BY ID;
> I07 I08 I09 I10
> ----------------------------- ---------------------------- --------------------------------- ------------------------------------------
> INTERVAL '1-2' YEAR TO MONTH INTERVAL '1 02' DAY TO HOUR INTERVAL '1 02:03' DAY TO MINUTE INTERVAL '1 02:03:04.123457' DAY TO SECOND
> INTERVAL -'1-2' YEAR TO MONTH INTERVAL -'1 02' DAY TO HOUR INTERVAL -'1 02:03' DAY TO MINUTE INTERVAL '1 02:03:04.123457' DAY TO SECOND
> rows: 2
> INTERVAL '-1-2' YEAR TO MONTH INTERVAL '-1 02' DAY TO HOUR INTERVAL '-1 02:03' DAY TO MINUTE INTERVAL '1 02:03:04.123457' DAY TO SECOND
> rows (ordered): 2
SELECT I11, I12, I12 FROM TEST;
SELECT I11, I12, I12 FROM TEST ORDER BY ID;
> I11 I12 I12
> ------------------------------- ---------------------------------------- ----------------------------------------
> INTERVAL '1:02' HOUR TO MINUTE INTERVAL '1:02:03.123457' HOUR TO SECOND INTERVAL '1:02:03.123457' HOUR TO SECOND
> INTERVAL -'1:02' HOUR TO MINUTE INTERVAL '1:02:03.123457' HOUR TO SECOND INTERVAL '1:02:03.123457' HOUR TO SECOND
> rows: 2
> INTERVAL '-1:02' HOUR TO MINUTE INTERVAL '1:02:03.123457' HOUR TO SECOND INTERVAL '1:02:03.123457' HOUR TO SECOND
> rows (ordered): 2
SELECT J01, J02, J03, J04, J05, J06 FROM TEST;
SELECT J01, J02, J03, J04, J05, J06 FROM TEST ORDER BY ID;
> J01 J02 J03 J04 J05 J06
> ------------------ ------------------- ----------------- ------------------ -------------------- ------------------------------
> INTERVAL '1' YEAR INTERVAL '1' MONTH INTERVAL '1' DAY INTERVAL '1' HOUR INTERVAL '1' MINUTE INTERVAL '1.123456789' SECOND
> INTERVAL -'1' YEAR INTERVAL -'1' MONTH INTERVAL -'1' DAY INTERVAL -'1' HOUR INTERVAL -'1' MINUTE INTERVAL -'1.123456789' SECOND
> rows: 2
> INTERVAL '-1' YEAR INTERVAL '-1' MONTH INTERVAL '-1' DAY INTERVAL '-1' HOUR INTERVAL '-1' MINUTE INTERVAL '-1.123456789' SECOND
> rows (ordered): 2
SELECT J07, J08, J09, J10 FROM TEST;
SELECT J07, J08, J09, J10 FROM TEST ORDER BY ID;
> J07 J08 J09 J10
> ----------------------------- ---------------------------- --------------------------------- ----------------------------------------------
> INTERVAL '1-2' YEAR TO MONTH INTERVAL '1 02' DAY TO HOUR INTERVAL '1 02:03' DAY TO MINUTE INTERVAL '1 02:03:04.123456789' DAY TO SECOND
> INTERVAL -'1-2' YEAR TO MONTH INTERVAL -'1 02' DAY TO HOUR INTERVAL -'1 02:03' DAY TO MINUTE INTERVAL -'1 02:03:04.123456789' DAY TO SECOND
> rows: 2
> INTERVAL '-1-2' YEAR TO MONTH INTERVAL '-1 02' DAY TO HOUR INTERVAL '-1 02:03' DAY TO MINUTE INTERVAL '-1 02:03:04.123456789' DAY TO SECOND
> rows (ordered): 2
SELECT J11, J12, J12 FROM TEST;
SELECT J11, J12, J12 FROM TEST ORDER BY ID;
> J11 J12 J12
> ------------------------------- -------------------------------------------- --------------------------------------------
> INTERVAL '1:02' HOUR TO MINUTE INTERVAL '1:02:03.123456789' HOUR TO SECOND INTERVAL '1:02:03.123456789' HOUR TO SECOND
> INTERVAL -'1:02' HOUR TO MINUTE INTERVAL -'1:02:03.123456789' HOUR TO SECOND INTERVAL -'1:02:03.123456789' HOUR TO SECOND
> rows: 2
> INTERVAL '-1:02' HOUR TO MINUTE INTERVAL '-1:02:03.123456789' HOUR TO SECOND INTERVAL '-1:02:03.123456789' HOUR TO SECOND
> rows (ordered): 2
DROP TABLE TEST;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论