Changeset: d202abf0fd50 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d202abf0fd50 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/SQL-dump.stable.out clients/Tests/SQL-dump.stable.out.int128 clients/Tests/exports.stable.out monetdb5/modules/atoms/mtime.c monetdb5/modules/atoms/mtime.h monetdb5/modules/atoms/mtime.mal sql/scripts/13_date.sql sql/server/rel_updates.c sql/test/Tests/systemfunctions.stable.out sql/test/Tests/systemfunctions.stable.out.int128 sql/test/leaks/Tests/check1.stable.out.int128 sql/test/leaks/Tests/check2.stable.out.int128 sql/test/leaks/Tests/check3.stable.out.int128 sql/test/leaks/Tests/check4.stable.out.int128 sql/test/leaks/Tests/check5.stable.out.int128 Branch: default Log Message:
added timestamp and time conversion functions (based on strptime and strftime) The new format options in copy into is now based on sqltypename_to_str functions being available. diffs (truncated from 4098 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -39477,7 +39477,7 @@ address MTIMEdaytime1; comment default time with zeroed components command mtime.date_to_str(d:date,format:str):str -address MTIMEstrftime; +address MTIMEdate_to_str; comment create a string from the date, using the specified format (see man strftime) command mtime.dayname(day:int):str @@ -39668,8 +39668,16 @@ command mtime.sql_seconds(t:timestamp):i address MTIMEtimestamp_sql_seconds; command mtime.seconds(t:timestamp):int address MTIMEtimestamp_seconds; +command mtime.str_to_timestamp(s:str,format:str):timestamp +address MTIMEstr_to_timestamp; +comment create a timestamp from the string, using the specified format (see man strptime) + +command mtime.str_to_time(s:str,format:str):daytime +address MTIMEstr_to_time; +comment create a time from the string, using the specified format (see man strptime) + command mtime.str_to_date(s:str,format:str):date -address MTIMEstrptime; +address MTIMEstr_to_date; comment create a date from the string, using the specified format (see man strptime) command mtime.start_dst(t:timezone):zrule @@ -39688,6 +39696,14 @@ command mtime.seconds(d:daytime):int address MTIMEdaytime_extract_seconds; comment extracts seconds from daytime +command mtime.timestamp_to_str(d:timestamp,format:str):str +address MTIMEtimestamp_to_str; +comment create a string from the time, using the specified format (see man strftime) + +command mtime.time_to_str(d:daytime,format:str):str +address MTIMEtime_to_str; +comment create a string from the time, using the specified format (see man strftime) + command mtime.time_synonyms(allow:bit):void address MTIMEsynonyms; comment Allow synonyms for the parse format of date/timestamp. diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -50412,7 +50412,7 @@ address MTIMEdaytime1; comment default time with zeroed components command mtime.date_to_str(d:date,format:str):str -address MTIMEstrftime; +address MTIMEdate_to_str; comment create a string from the date, using the specified format (see man strftime) command mtime.dayname(day:int):str @@ -50603,8 +50603,16 @@ command mtime.sql_seconds(t:timestamp):i address MTIMEtimestamp_sql_seconds; command mtime.seconds(t:timestamp):int address MTIMEtimestamp_seconds; +command mtime.str_to_timestamp(s:str,format:str):timestamp +address MTIMEstr_to_timestamp; +comment create a timestamp from the string, using the specified format (see man strptime) + +command mtime.str_to_time(s:str,format:str):daytime +address MTIMEstr_to_time; +comment create a time from the string, using the specified format (see man strptime) + command mtime.str_to_date(s:str,format:str):date -address MTIMEstrptime; +address MTIMEstr_to_date; comment create a date from the string, using the specified format (see man strptime) command mtime.start_dst(t:timezone):zrule @@ -50623,6 +50631,14 @@ command mtime.seconds(d:daytime):int address MTIMEdaytime_extract_seconds; comment extracts seconds from daytime +command mtime.timestamp_to_str(d:timestamp,format:str):str +address MTIMEtimestamp_to_str; +comment create a string from the time, using the specified format (see man strftime) + +command mtime.time_to_str(d:daytime,format:str):str +address MTIMEtime_to_str; +comment create a string from the time, using the specified format (see man strftime) + command mtime.time_synonyms(allow:bit):void address MTIMEsynonyms; comment Allow synonyms for the parse format of date/timestamp. diff --git a/clients/Tests/SQL-dump.stable.out b/clients/Tests/SQL-dump.stable.out --- a/clients/Tests/SQL-dump.stable.out +++ b/clients/Tests/SQL-dump.stable.out @@ -111,7 +111,6 @@ SYSTEM FUNCTION sys.buffer SYSTEM FUNCTION sys.chi2prob SYSTEM FUNCTION sys.columnsize SYSTEM FUNCTION sys.contains -SYSTEM FUNCTION sys.convert SYSTEM FUNCTION sys.convexhull SYSTEM FUNCTION sys.corr SYSTEM FUNCTION sys.crosses @@ -241,9 +240,13 @@ SYSTEM FUNCTION sys.storage SYSTEM FUNCTION sys.storagemodel SYSTEM FUNCTION sys.storagemodelinit SYSTEM FUNCTION sys.str_to_date +SYSTEM FUNCTION sys.str_to_time +SYSTEM FUNCTION sys.str_to_timestamp SYSTEM FUNCTION sys.symdifference SYSTEM FUNCTION sys.text +SYSTEM FUNCTION sys.time_to_str SYSTEM FUNCTION sys.times +SYSTEM FUNCTION sys.timestamp_to_str SYSTEM FUNCTION sys.touches SYSTEM FUNCTION sys.tracelog SYSTEM FUNCTION sys.uuid diff --git a/clients/Tests/SQL-dump.stable.out.int128 b/clients/Tests/SQL-dump.stable.out.int128 --- a/clients/Tests/SQL-dump.stable.out.int128 +++ b/clients/Tests/SQL-dump.stable.out.int128 @@ -107,7 +107,6 @@ SYSTEM FUNCTION sys.buffer SYSTEM FUNCTION sys.chi2prob SYSTEM FUNCTION sys.columnsize SYSTEM FUNCTION sys.contains -SYSTEM FUNCTION sys.convert SYSTEM FUNCTION sys.convexhull SYSTEM FUNCTION sys.corr SYSTEM FUNCTION sys.crosses @@ -237,9 +236,13 @@ SYSTEM FUNCTION sys.storage SYSTEM FUNCTION sys.storagemodel SYSTEM FUNCTION sys.storagemodelinit SYSTEM FUNCTION sys.str_to_date +SYSTEM FUNCTION sys.str_to_time +SYSTEM FUNCTION sys.str_to_timestamp SYSTEM FUNCTION sys.symdifference SYSTEM FUNCTION sys.text +SYSTEM FUNCTION sys.time_to_str SYSTEM FUNCTION sys.times +SYSTEM FUNCTION sys.timestamp_to_str SYSTEM FUNCTION sys.touches SYSTEM FUNCTION sys.tracelog SYSTEM FUNCTION sys.uuid @@ -1547,190 +1550,190 @@ 5699 "auth_id" "int" 32 0 5697 NULL true 5700 "privileges" "int" 32 0 5697 NULL true 2 NULL 5701 "grantor" "int" 32 0 5697 NULL true 3 NULL 5702 "grantable" "int" 32 0 5697 NULL true 4 NULL -5896 "id" "oid" 63 0 5904 NULL true 0 NULL -5897 "owner" "clob" 0 0 5904 NULL true 1 NULL -5898 "defined" "timestamp" 7 0 5904 NULL true 2 NULL -5899 "query" "clob" 0 0 5904 NULL true 3 NULL -5900 "pipe" "clob" 0 0 5904 NULL true 4 NULL -5901 "plan" "clob" 0 0 5904 NULL true 5 NULL -5902 "mal" "int" 32 0 5904 NULL true 6 NULL -5903 "optimize" "bigint" 64 0 5904 NULL true 7 NULL -5906 "id" "oid" 63 0 5915 NULL true 0 NULL -5907 "start" "timestamp" 7 0 5915 NULL true 1 NULL -5908 "stop" "timestamp" 7 0 5915 NULL true 2 NULL -5909 "arguments" "clob" 0 0 5915 NULL true 3 NULL -5910 "tuples" "wrd" 64 0 5915 NULL true 4 NULL -5911 "run" "bigint" 64 0 5915 NULL true 5 NULL -5912 "ship" "bigint" 64 0 5915 NULL true 6 NULL -5913 "cpu" "int" 32 0 5915 NULL true 7 NULL -5914 "io" "int" 32 0 5915 NULL true 8 NULL -5917 "id" "oid" 63 0 5933 NULL true 0 NULL -5918 "owner" "clob" 0 0 5933 NULL true 1 NULL -5919 "defined" "timestamp" 7 0 5933 NULL true 2 NULL -5920 "query" "clob" 0 0 5933 NULL true 3 NULL -5921 "pipe" "clob" 0 0 5933 NULL true 4 NULL -5922 "plan" "clob" 0 0 5933 NULL true 5 NULL -5923 "mal" "int" 32 0 5933 NULL true 6 NULL -5924 "optimize" "bigint" 64 0 5933 NULL true 7 NULL -5925 "start" "timestamp" 7 0 5933 NULL true 8 NULL -5926 "stop" "timestamp" 7 0 5933 NULL true 9 NULL -5927 "arguments" "clob" 0 0 5933 NULL true 10 NULL -5928 "tuples" "wrd" 64 0 5933 NULL true 11 NULL -5929 "run" "bigint" 64 0 5933 NULL true 12 NULL -5930 "ship" "bigint" 64 0 5933 NULL true 13 NULL -5931 "cpu" "int" 32 0 5933 NULL true 14 NULL -5932 "io" "int" 32 0 5933 NULL true 15 NULL -5959 "event" "int" 32 0 5972 NULL true 0 NULL -5960 "clk" "varchar" 20 0 5972 NULL true 1 NULL -5961 "pc" "varchar" 50 0 5972 NULL true 2 NULL -5962 "thread" "int" 32 0 5972 NULL true 3 NULL -5963 "ticks" "bigint" 64 0 5972 NULL true 4 NULL -5964 "rrsmb" "bigint" 64 0 5972 NULL true 5 NULL -5965 "vmmb" "bigint" 64 0 5972 NULL true 6 NULL -5966 "reads" "bigint" 64 0 5972 NULL true 7 NULL -5967 "writes" "bigint" 64 0 5972 NULL true 8 NULL -5968 "minflt" "bigint" 64 0 5972 NULL true 9 NULL -5969 "majflt" "bigint" 64 0 5972 NULL true 10 NULL -5970 "nvcsw" "bigint" 64 0 5972 NULL true 11 NULL -5971 "stmt" "clob" 0 0 5972 NULL true 12 NULL -6102 "user" "clob" 0 0 6108 NULL true 0 NULL -6103 "login" "timestamp" 7 0 6108 NULL true 1 NULL -6104 "sessiontimeout" "bigint" 64 0 6108 NULL true 2 NULL -6105 "lastcommand" "timestamp" 7 0 6108 NULL true 3 NULL -6106 "querytimeout" "bigint" 64 0 6108 NULL true 4 NULL -6107 "active" "boolean" 1 0 6108 NULL true 5 NULL -6185 "name" "clob" 0 0 6188 NULL true 0 NULL -6186 "def" "clob" 0 0 6188 NULL true 1 NULL -6187 "status" "clob" 0 0 6188 NULL true 2 NULL -6194 "name" "clob" 0 0 6196 NULL true 0 NULL -6195 "value" "clob" 0 0 6196 NULL true 1 NULL -6226 "qtag" "bigint" 64 0 6234 NULL true 0 NULL -6227 "user" "clob" 0 0 6234 NULL true 1 NULL -6228 "started" "timestamp" 7 0 6234 NULL true 2 NULL -6229 "estimate" "timestamp" 7 0 6234 NULL true 3 NULL -6230 "progress" "int" 32 0 6234 NULL true 4 NULL -6231 "status" "clob" 0 0 6234 NULL true 5 NULL -6232 "tag" "oid" 63 0 6234 NULL true 6 NULL -6233 "query" "clob" 0 0 6234 NULL true 7 NULL -6912 "file_id" "int" 32 0 6914 NULL true 0 NULL -6913 "location" "char" 256 0 6914 NULL true 1 NULL -6916 "dim_id" "int" 32 0 6920 NULL true 0 NULL -6917 "file_id" "int" 32 0 6920 NULL true 1 NULL -6918 "name" "varchar" 64 0 6920 NULL true 2 NULL -6919 "length" "int" 32 0 6920 NULL true 3 NULL -6922 "var_id" "int" 32 0 6928 NULL true 0 NULL -6923 "file_id" "int" 32 0 6928 NULL true 1 NULL -6924 "name" "varchar" 64 0 6928 NULL true 2 NULL -6925 "vartype" "varchar" 64 0 6928 NULL true 3 NULL -6926 "ndim" "int" 32 0 6928 NULL true 4 NULL -6927 "coord_dim_id" "int" 32 0 6928 NULL true 5 NULL -6930 "var_id" "int" 32 0 6934 NULL true 0 NULL -6931 "dim_id" "int" 32 0 6934 NULL true 1 NULL -6932 "file_id" "int" 32 0 6934 NULL true 2 NULL -6933 "dimpos" "int" 32 0 6934 NULL true 3 NULL -6936 "obj_name" "varchar" 256 0 6942 NULL true 0 NULL -6937 "att_name" "varchar" 256 0 6942 NULL true 1 NULL -6938 "att_type" "varchar" 64 0 6942 NULL true 2 NULL -6939 "value" "clob" 0 0 6942 NULL true 3 NULL -6940 "file_id" "int" 32 0 6942 NULL true 4 NULL -6941 "gr_name" "varchar" 256 0 6942 NULL true 5 NULL -6967 "schema" "clob" 0 0 6981 NULL true 0 NULL -6968 "table" "clob" 0 0 6981 NULL true 1 NULL -6969 "column" "clob" 0 0 6981 NULL true 2 NULL -6970 "type" "clob" 0 0 6981 NULL true 3 NULL -6971 "mode" "clob" 0 0 6981 NULL true 4 NULL -6972 "location" "clob" 0 0 6981 NULL true 5 NULL -6973 "count" "bigint" 64 0 6981 NULL true 6 NULL -6974 "typewidth" "int" 32 0 6981 NULL true 7 NULL -6975 "columnsize" "bigint" 64 0 6981 NULL true 8 NULL -6976 "heapsize" "bigint" 64 0 6981 NULL true 9 NULL -6977 "hashes" "bigint" 64 0 6981 NULL true 10 NULL -6978 "phash" "boolean" 1 0 6981 NULL true 11 NULL -6979 "imprints" "bigint" 64 0 6981 NULL true 12 NULL -6980 "sorted" "boolean" 1 0 6981 NULL true 13 NULL -6983 "schema" "clob" 0 0 6993 NULL true 0 NULL -6984 "table" "clob" 0 0 6993 NULL true 1 NULL -6985 "column" "clob" 0 0 6993 NULL true 2 NULL -6986 "type" "clob" 0 0 6993 NULL true 3 NULL -6987 "typewidth" "int" 32 0 6993 NULL true 4 NULL -6988 "count" "bigint" 64 0 6993 NULL true 5 NULL -6989 "distinct" "bigint" 64 0 6993 NULL true 6 NULL -6990 "atomwidth" "int" 32 0 6993 NULL true 7 NULL -6991 "reference" "boolean" 1 0 6993 NULL true 8 NULL -6992 "sorted" "boolean" 1 0 6993 NULL true 9 NULL -7031 "schema" "clob" 0 0 7041 NULL true 0 NULL -7032 "table" "clob" 0 0 7041 NULL true 1 NULL -7033 "column" "clob" 0 0 7041 NULL true 2 NULL -7034 "type" "clob" 0 0 7041 NULL true 3 NULL -7035 "count" "bigint" 64 0 7041 NULL true 4 NULL -7036 "columnsize" "bigint" 64 0 7041 NULL true 5 NULL -7037 "heapsize" "bigint" 64 0 7041 NULL true 6 NULL -7038 "hashes" "bigint" 64 0 7041 NULL true 7 NULL -7039 "imprints" "bigint" 64 0 7041 NULL true 8 NULL -7040 "sorted" "boolean" 1 0 7041 NULL true 9 NULL -7043 "schema" "clob" 0 0 7051 NULL true 0 NULL -7044 "table" "clob" 0 0 7051 NULL true 1 NULL -7045 "count" "bigint" 64 0 7051 NULL true 2 NULL -7046 "columnsize" "hugeint" 128 0 7051 NULL true 3 NULL -7047 "heapsize" "hugeint" 128 0 7051 NULL true 4 NULL -7048 "hashes" "hugeint" 128 0 7051 NULL true 5 NULL -7049 "imprints" "hugeint" 128 0 7051 NULL true 6 NULL -7050 "auxiliary" "hugeint" 128 0 7051 NULL true 7 NULL -7053 "column_id" "int" 32 0 7064 NULL true 0 NULL -7054 "type" "clob" 0 0 7064 NULL true 1 NULL -7055 "width" "int" 32 0 7064 NULL true 2 NULL -7056 "stamp" "timestamp" 7 0 7064 NULL true 3 NULL -7057 "sample" "bigint" 64 0 7064 NULL true 4 NULL -7058 "count" "bigint" 64 0 7064 NULL true 5 NULL -7059 "unique" "bigint" 64 0 7064 NULL true 6 NULL -7060 "nils" "bigint" 64 0 7064 NULL true 7 NULL -7061 "minval" "clob" 0 0 7064 NULL true 8 NULL -7062 "maxval" "clob" 0 0 7064 NULL true 9 NULL -7063 "sorted" "boolean" 1 0 7064 NULL true 10 NULL -7164 "file_id" "bigint" 64 0 7172 NULL false 0 NULL -7165 "file_location" "clob" 0 0 7172 NULL false 1 NULL -7166 "dbschema" "smallint" 16 0 7172 NULL false 2 NULL -7167 "format_version" "varchar" 7 0 7172 NULL true 3 NULL -7168 "sorting_order" "varchar" 10 0 7172 NULL true 4 NULL -7169 "comments" "clob" 0 0 7172 NULL true 5 NULL -7174 "sn" "clob" 0 0 7185 NULL false 0 NULL -7175 "file_id" "bigint" 64 0 7185 NULL false 1 NULL -7176 "ln" "int" 32 0 7185 NULL true 2 NULL -7177 "as" "int" 32 0 7185 NULL true 3 NULL -7178 "m5" "clob" 0 0 7185 NULL true 4 NULL -7179 "sp" "clob" 0 0 7185 NULL true 5 NULL -7180 "ur" "clob" 0 0 7185 NULL true 6 NULL -7187 "id" "clob" 0 0 7204 NULL false 0 NULL -7188 "file_id" "bigint" 64 0 7204 NULL false 1 NULL -7189 "cn" "clob" 0 0 7204 NULL true 2 NULL _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list