提交 ba233fa2 authored 作者: thomasmueller's avatar thomasmueller

Javadocs

上级 0f7a451f
......@@ -376,7 +376,10 @@ public class ConnectionInfo implements Cloneable {
if (nameNormalized == null) {
if (!SysProperties.IMPLICIT_RELATIVE_PATH) {
if (!FileUtils.isAbsolute(name)) {
if (!name.contains("./") && !name.contains(".\\") && !name.contains(":/") && !name.contains(":\\")) {
if (!name.contains("./") &&
!name.contains(".\\") &&
!name.contains(":/") &&
!name.contains(":\\")) {
// the name could start with "./", or
// it could start with a prefix such as "nio:./"
// for Windows, the path "\test" is not considered
......
......@@ -107,7 +107,7 @@ public class Function extends Expression implements FunctionCall {
* Pseudo functions for DATEADD, DATEDIFF, and EXTRACT.
*/
public static final int MILLISECOND = 126, EPOCH = 127, MICROSECOND = 128, NANOSECOND = 129,
TIMEZONE_HOUR = 130, TIMEZONE_MINUTE = 131, DECADE = 132, CENTURY = 133,
TIMEZONE_HOUR = 130, TIMEZONE_MINUTE = 131, DECADE = 132, CENTURY = 133,
MILLENNIUM = 134;
public static final int DATABASE = 150, USER = 151, CURRENT_USER = 152,
......
......@@ -385,7 +385,7 @@ public final class DateTimeFunctions {
* Truncate the given date to the unit specified
*
* @param datePartStr the time unit (e.g. 'DAY', 'HOUR', etc.)
* @param value the date
* @param valueDate the date
* @return date truncated to 'day'
*/
public static Value truncateDate(String datePartStr, Value valueDate) {
......
......@@ -729,6 +729,13 @@ public class DateTimeUtils {
return getDayOfWeekFromAbsolute(absoluteDayFromDateValue(dateValue), firstDayOfWeek);
}
/**
* Get the day of the week from the absolute day value.
*
* @param absoluteValue the absolute day
* @param firstDayOfWeek the first day of the week
* @return the day of week
*/
public static int getDayOfWeekFromAbsolute(long absoluteValue, int firstDayOfWeek) {
return absoluteValue >= 0 ? (int) ((absoluteValue - firstDayOfWeek + 11) % 7) + 1
: (int) ((absoluteValue - firstDayOfWeek - 2) % 7) + 7;
......
......@@ -373,7 +373,7 @@ SELECT DATE_TRUNC('SECOND', '2015-05-29 00:00:00');
>> 2015-05-29 00:00:00
--
--
-- Test time unit 'MINUTE'
--
SELECT DATE_TRUNC('MINUTE', time '00:00:00');
......@@ -547,7 +547,7 @@ SELECT DATE_TRUNC('hour', '2015-05-29 00:00:00');
SELECT DATE_TRUNC('HOUR', '2015-05-29 00:00:00');
>> 2015-05-29 00:00:00
--
--
-- Test time unit 'DAY'
--
select DATE_TRUNC('day', time '00:00:00');
......
......@@ -770,5 +770,5 @@ openoffice organize libre systemtables gmane sea borders announced millennium al
opti excessively
iterators tech enums incompatibilities loses reimplement readme reorganize
iterators tech enums incompatibilities loses reimplement readme reorganize milli subdirectory
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论