backend/satellite_tools/satCerts.py | 4 backend/satellite_tools/updatePackages.py | 2 backend/server/action_extra_data/script.py | 4 java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml | 4 java/code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml | 10 +- java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 12 +- java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 4 java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml | 4 java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml | 4 monitoring/NPalert/NotificationDB.pm | 4 monitoring/PerlModules/NP/OracleDB/CF_DB.pm | 4 monitoring/SputLite/html/cgi-bin/create_commands.cgi | 4 monitoring/SputLite/lib/UploadResults.pm | 2 schema/spacewalk/postgres/packages/rhn_channel.pkb | 4 schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/010-add_rhncpu_nrsocket.sql.postgresql | 4 schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.oracle | 1 schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.postgresql | 47 ++++++++++ search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml | 4 web/modules/rhn/RHN/DB/DataSource/xml/Action_queries.xml | 4 web/modules/rhn/RHN/DB/KSTree.pm | 2 web/modules/rhn/RHN/DB/TableClass.pm | 4 web/modules/rhn/RHN/DB/TinyURL.pm | 2 22 files changed, 91 insertions(+), 43 deletions(-)
New commits: commit 25c78c2166d97631f471081e9a2925797a5bc778 Author: Jan Pazdziora jpazdziora@redhat.com Date: Mon Mar 25 15:30:35 2013 +0100
Use to_timestamp instead of to_date which should bring the second precision to PostgreSQL.
diff --git a/backend/satellite_tools/satCerts.py b/backend/satellite_tools/satCerts.py index 863598b..50e6973 100644 --- a/backend/satellite_tools/satCerts.py +++ b/backend/satellite_tools/satCerts.py @@ -528,8 +528,8 @@ _query_insert_cert = rhnSQL.Statement(""" INSERT into rhnSatelliteCert (label, version, cert, expires, issued) VALUES (:label, :version, empty_blob(), - TO_DATE(:expires, 'YYYY-MM-DD HH24:MI:SS'), - TO_DATE(:issued, 'YYYY-MM-DD HH24:MI:SS')) + TO_TIMESTAMP(:expires, 'YYYY-MM-DD HH24:MI:SS'), + TO_TIMESTAMP(:issued, 'YYYY-MM-DD HH24:MI:SS')) """)
_query_update_web_customer = rhnSQL.Statement(""" diff --git a/backend/satellite_tools/updatePackages.py b/backend/satellite_tools/updatePackages.py index 2018f82..ee108b3 100644 --- a/backend/satellite_tools/updatePackages.py +++ b/backend/satellite_tools/updatePackages.py @@ -433,7 +433,7 @@ insert_packagefile = """ values ( :pid, lookup_package_capability(:name, null), :device, :inode, :file_mode, :username, :groupname, - :rdev, :file_size, to_date(:mtime, 'YYYY-MM-DD HH24:MI:SS'), :linkto, + :rdev, :file_size, to_timestamp(:mtime, 'YYYY-MM-DD HH24:MI:SS'), :linkto, :flags, :verifyflags, :lang, lookup_checksum(:ctype, :csum) ) """ diff --git a/backend/server/action_extra_data/script.py b/backend/server/action_extra_data/script.py index 26a30fb..f3586a9 100644 --- a/backend/server/action_extra_data/script.py +++ b/backend/server/action_extra_data/script.py @@ -45,8 +45,8 @@ values ( from rhnActionScript ascript where ascript.action_id = :action_id), :output, - TO_DATE(:process_start, 'YYYY-MM-DD HH24:MI:SS'), - TO_DATE(:process_end, 'YYYY-MM-DD HH24:MI:SS'), + TO_TIMESTAMP(:process_start, 'YYYY-MM-DD HH24:MI:SS'), + TO_TIMESTAMP(:process_end, 'YYYY-MM-DD HH24:MI:SS'), :return_code) """)
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml index b5162ca..de38fb0 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Action_queries.xml @@ -13,8 +13,8 @@ SELECT EVENT_ID as ID, DETAILS FROM (SELECT SH.id EVENT_ID, SH.summary SUMMARY, - TO_DATE(NULL,NULL) AS created, - TO_DATE(NULL,NULL) AS picked_up, + TO_TIMESTAMP(NULL,NULL) AS created, + TO_TIMESTAMP(NULL,NULL) AS picked_up, SH.created as completed, -- view this as the "completed" date for sorting reasons NULL AS history_status, NULL AS history_type, diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml index 934b0d5..69027df 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Errata_queries.xml @@ -284,8 +284,8 @@ SELECT DISTINCT E.id, E.issue_date FROM rhnErrata E WHERE - E.issue_date >= TO_DATE(:start_date_str, 'YYYY-MM-DD') - AND E.issue_date <= TO_DATE(:end_date_str, 'YYYY-MM-DD') + E.issue_date >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD') + AND E.issue_date <= TO_TIMESTAMP(:end_date_str, 'YYYY-MM-DD') ORDER BY E.issue_date DESC </query> </mode> @@ -348,8 +348,8 @@ SELECT DISTINCT E.id, rhnChannelErrata CE WHERE CE.channel_id = :cid AND CE.errata_id = E.id - AND E.issue_date >= TO_DATE(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') - AND E.issue_date <= TO_DATE(:end_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND E.issue_date >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND E.issue_date <= TO_TIMESTAMP(:end_date_str, 'YYYY-MM-DD HH24:MI:SS') ORDER BY issue_date DESC </query> </mode> @@ -367,7 +367,7 @@ SELECT DISTINCT rhnChannelErrata CE WHERE CE.channel_id = :cid AND CE.errata_id = E.id - AND E.issue_date >= TO_DATE(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND E.issue_date >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') ORDER BY issue_date DESC </query> </mode> diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml index b204428..1971ce6 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml @@ -1168,7 +1168,7 @@ SELECT AND P.name_id = PN.id AND P.evr_id = PE.id AND PA.id = P.package_arch_id - AND P.last_modified >= TO_DATE(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND P.last_modified >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') ORDER BY UPPER(PN.name), P.id </query> </mode> @@ -1192,8 +1192,8 @@ SELECT AND P.name_id = PN.id AND P.evr_id = PE.id AND PA.id = P.package_arch_id - AND P.last_modified >= TO_DATE(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') - AND P.last_modified <= TO_DATE(:end_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND P.last_modified >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND P.last_modified <= TO_TIMESTAMP(:end_date_str, 'YYYY-MM-DD HH24:MI:SS') ORDER BY UPPER(PN.name), P.id </query> </mode> @@ -1238,7 +1238,7 @@ SELECT AND P.name_id = PN.id AND P.evr_id = PE.id AND PA.id = P.package_arch_id - AND P.last_modified >= TO_DATE(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND P.last_modified >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') ORDER BY last_modified </query> </mode> @@ -1262,8 +1262,8 @@ SELECT AND P.name_id = PN.id AND P.evr_id = PE.id AND PA.id = P.package_arch_id - AND P.last_modified >= TO_DATE(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') - AND P.last_modified <= TO_DATE(:end_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND P.last_modified >= TO_TIMESTAMP(:start_date_str, 'YYYY-MM-DD HH24:MI:SS') + AND P.last_modified <= TO_TIMESTAMP(:end_date_str, 'YYYY-MM-DD HH24:MI:SS') ORDER BY last_modified </query> </mode> diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml index 116b5e6..03fea23 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml @@ -795,7 +795,7 @@ SELECT DISTINCT S.id, S.NAME, AND P.evr_id = SP.evr_id AND P.name_id = SP.name_id AND EP.errata_id = E.id AND EP.package_id = P.id - AND (to_date('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(S.last_boot, 'second')) < SP.installtime + AND (to_timestamp('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(S.last_boot, 'second')) < SP.installtime AND E.id IN (SELECT EK.errata_id FROM rhnErrataKeyword EK WHERE EK.keyword = :keyword) </query>
@@ -826,7 +826,7 @@ SELECT DISTINCT S.id, S.NAME, AND P.evr_id = SP.evr_id AND P.name_id = SP.name_id AND EP.errata_id = E.id AND EP.package_id = P.id - AND (to_date('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(S.last_boot, 'second')) < SP.installtime + AND (to_timestamp('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(S.last_boot, 'second')) < SP.installtime AND E.id IN (SELECT EK.errata_id FROM rhnErrataKeyword EK WHERE EK.keyword = :keyword) </query> </mode> diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml index 6793874..868bac4 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml @@ -823,7 +823,7 @@ ORDER BY SA.completion_time DESC WHERE A.Action_type = ( select id from rhnActionType where label = 'configfiles.deploy' ) AND A.org_id = :org_id AND USP.user_id = :user_id - AND A.earliest_action > TO_DATE(:date, 'YYYY-MM-DD HH24:MI:SS') + AND A.earliest_action > TO_TIMESTAMP(:date, 'YYYY-MM-DD HH24:MI:SS') ORDER BY A.earliest_action desc ) TC where rownum <= :num </query> @@ -847,7 +847,7 @@ ORDER BY SA.completion_time DESC WHERE A.Action_type = ( select id from rhnActionType where label = 'configfiles.deploy' ) AND A.org_id = :org_id AND USP.user_id = :user_id - AND A.earliest_action > TO_DATE(:date, 'YYYY-MM-DD HH24:MI:SS') + AND A.earliest_action > TO_TIMESTAMP(:date, 'YYYY-MM-DD HH24:MI:SS') ORDER BY A.earliest_action desc LIMIT :num </query> diff --git a/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml b/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml index 5635249..6a5f9c0 100644 --- a/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml +++ b/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml @@ -146,8 +146,8 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" from com.redhat.rhn.domain.errata.impl.PublishedErrata as e where :channel in elements(e.channels) and (e.org = :org or e.org is null) and - (e.lastModified > to_date(:start_date, 'YYYY-MM-DD HH24:MI:SS')) and - (e.lastModified < to_date(:end_date, 'YYYY-MM-DD HH24:MI:SS')) + (e.lastModified > to_timestamp(:start_date, 'YYYY-MM-DD HH24:MI:SS')) and + (e.lastModified < to_timestamp(:end_date, 'YYYY-MM-DD HH24:MI:SS')) order by e.issueDate ]]> </query> diff --git a/monitoring/NPalert/NotificationDB.pm b/monitoring/NPalert/NotificationDB.pm index f6dbd58..5196bde 100644 --- a/monitoring/NPalert/NotificationDB.pm +++ b/monitoring/NPalert/NotificationDB.pm @@ -874,7 +874,7 @@ sub _create { if ($fields{$col} =~ /sysdate/i) { push(@bindvars, $fields{$col}); } else { - push(@bindvars, "TO_DATE(?, '" . DEF_DB_DATE_FMT . "')"); + push(@bindvars, "TO_TIMESTAMP(?, '" . DEF_DB_DATE_FMT . "')"); push(@bindvals, $self->timestamp_to_string($fields{$col})); } } else { @@ -1069,7 +1069,7 @@ sub _wherephrase { if ($val =~ /sysdate/i) { push(@wherephrases, "$col = $val"); } else { - push(@wherephrases, "$col = TO_DATE(?, '" . DEF_DB_DATE_FMT . "')"); + push(@wherephrases, "$col = TO_TIMESTAMP(?, '" . DEF_DB_DATE_FMT . "')"); push(@bindvals, $self->timestamp_to_string($val)); } } else { diff --git a/monitoring/PerlModules/NP/OracleDB/CF_DB.pm b/monitoring/PerlModules/NP/OracleDB/CF_DB.pm index fdf209b..455f0a3 100644 --- a/monitoring/PerlModules/NP/OracleDB/CF_DB.pm +++ b/monitoring/PerlModules/NP/OracleDB/CF_DB.pm @@ -1377,7 +1377,7 @@ sub createCQ_Session { my $expdate = sprintf("%-04d-%-02d-%-02d %-02d:%-02d:%-02d", $year+1900, $mon+1, $mday, $hour, $min, $sec);
- my $values = ['?', '?', "TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')"]; + my $values = ['?', '?', "TO_TIMESTAMP(?, 'YYYY-MM-DD HH24:MI:SS')"]; push(@$bindvars, $contact, $sid, $expdate);
$self->CQ_Sessions('insert', $values, $bindvars); @@ -1403,7 +1403,7 @@ sub updateCQ_Session { $year+1900, $mon+1, $mday, $hour, $min, $sec);
my $values = ['session_id = ?', - "expiration_date = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')"]; + "expiration_date = TO_TIMESTAMP(?, 'YYYY-MM-DD HH24:MI:SS')"];
push(@$bindvars, $sid, $expdate);
diff --git a/monitoring/SputLite/html/cgi-bin/create_commands.cgi b/monitoring/SputLite/html/cgi-bin/create_commands.cgi index 4340fb3..f693ee1 100755 --- a/monitoring/SputLite/html/cgi-bin/create_commands.cgi +++ b/monitoring/SputLite/html/cgi-bin/create_commands.cgi @@ -509,7 +509,7 @@ sub execute { my $now = str2time($CF_DB->get_sysdate); my $timestamp = $now + $q->param('expiremin') * 60 + $q->param('expirehours') * 60 * 60 + $q->param('expiredays') * 60 * 60 * 24; my $expstring = strftime($F_DATE_FORMAT,gmtime($timestamp)); - my $expdate = "TO_DATE('$expstring', '$DB_DATE_FORMAT')"; + my $expdate = "TO_TIMESTAMP('$expstring', '$DB_DATE_FORMAT')";
my $instance_id = $CF_DB->createCQ_Instance( $q->param('command_id'), # COMMAND_ID @@ -977,7 +977,7 @@ my $val = $q->param("val_field$_"); $err .= "Invalid date time format entered for "$desc".\n"; last } - $val = sprintf("TO_DATE('%s','DD-MM-YY HH24:MI:SS')",strftime('%d-%m-%Y %H:%M:%S',gmtime($ts))); + $val = sprintf("TO_TIMESTAMP('%s','DD-MM-YY HH24:MI:SS')",strftime('%d-%m-%Y %H:%M:%S',gmtime($ts))); } elsif ($op =~ /like/) { $val=uc($val); $val = "'%$val%'" diff --git a/monitoring/SputLite/lib/UploadResults.pm b/monitoring/SputLite/lib/UploadResults.pm index b341877..5f097b3 100644 --- a/monitoring/SputLite/lib/UploadResults.pm +++ b/monitoring/SputLite/lib/UploadResults.pm @@ -41,7 +41,7 @@ sub ProcessInput { if ($field eq 'date_executed') {
my($sec,$min,$hour,$mday,$mon,$year) = gmtime($value); - my $timespec = "TO_DATE(?, ?)"; + my $timespec = "TO_TIMESTAMP(?, ?)"; my $timestr = sprintf("%s/%s/%s %s:%s:%s", $mon+1, $mday, $year+1900, $hour, $min, $sec); push(@values, "$field = $timespec"); diff --git a/schema/spacewalk/postgres/packages/rhn_channel.pkb b/schema/spacewalk/postgres/packages/rhn_channel.pkb index 11ff70e..5931562 100644 --- a/schema/spacewalk/postgres/packages/rhn_channel.pkb +++ b/schema/spacewalk/postgres/packages/rhn_channel.pkb @@ -1248,14 +1248,14 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_ where channel_id = channel_id_in ) loop if row.relative_filename = path_in - and row.last_modified = to_date(timestamp_in, 'YYYYMMDDHH24MISS') then + and row.last_modified = to_timestamp(timestamp_in, 'YYYYMMDDHH24MISS') then return; end if; end loop; delete from rhnChannelComps where channel_id = channel_id_in; insert into rhnChannelComps (id, channel_id, relative_filename, last_modified, created, modified) - values (sequence_nextval('rhn_channelcomps_id_seq'), channel_id_in, path_in, to_date(timestamp_in, 'YYYYMMDDHH24MISS'), current_timestamp, current_timestamp); + values (sequence_nextval('rhn_channelcomps_id_seq'), channel_id_in, path_in, to_timestamp(timestamp_in, 'YYYYMMDDHH24MISS'), current_timestamp, current_timestamp); end$$ language plpgsql;
-- restore the original setting diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.oracle new file mode 100644 index 0000000..b7b00b1 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.oracle @@ -0,0 +1 @@ +-- This file is intentionally left empty. diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.postgresql new file mode 100644 index 0000000..f49a640 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/011-rhn_channel.pkb.sql.postgresql @@ -0,0 +1,47 @@ +-- oracle equivalent source sha1 b14267384bc104605623a41b755e68e0103b5aa8 +-- +-- Copyright (c) 2008--2013 Red Hat, Inc. +-- +-- This software is licensed to you under the GNU General Public License, +-- version 2 (GPLv2). There is NO WARRANTY for this software, express or +-- implied, including the implied warranties of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 +-- along with this software; if not, see +-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. +-- +-- Red Hat trademarks are not licensed under GPLv2. No permission is +-- granted to use or replicate Red Hat trademarks that are incorporated +-- in this software or its documentation. +-- +-- +-- +-- + +-- create schema rhn_channel; + +--update pg_setting +update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_path'; + + create or replace function set_comps(channel_id_in in numeric, path_in in varchar, timestamp_in in varchar) returns void + as $$ + declare + row record; + begin + for row in ( + select relative_filename, last_modified + from rhnChannelComps + where channel_id = channel_id_in + ) loop + if row.relative_filename = path_in + and row.last_modified = to_timestamp(timestamp_in, 'YYYYMMDDHH24MISS') then + return; + end if; + end loop; + delete from rhnChannelComps + where channel_id = channel_id_in; + insert into rhnChannelComps (id, channel_id, relative_filename, last_modified, created, modified) + values (sequence_nextval('rhn_channelcomps_id_seq'), channel_id_in, path_in, to_timestamp(timestamp_in, 'YYYYMMDDHH24MISS'), current_timestamp, current_timestamp); + end$$ language plpgsql; + +-- restore the original setting +update pg_settings set setting = overlay( setting placing '' from 1 for (length('rhn_channel')+1) ) where name = 'search_path'; diff --git a/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml b/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml index 6dc5f19..4fa590d 100644 --- a/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml +++ b/search-server/spacewalk-search/src/config/com/redhat/satellite/search/db/errata_handler.xml @@ -42,8 +42,8 @@ ac.org_id = wc.org_id and ps.web_user_id = wc.id and ps.id = #sessionId# and - E.issue_date >= TO_DATE(#param0#, 'YYYY-MM-DD HH24:MI:SS') - AND E.issue_date <= TO_DATE(#param1#, 'YYYY-MM-DD HH24:MI:SS') + E.issue_date >= TO_TIMESTAMP(#param0#, 'YYYY-MM-DD HH24:MI:SS') + AND E.issue_date <= TO_TIMESTAMP(#param1#, 'YYYY-MM-DD HH24:MI:SS') ORDER BY E.issue_date ASC </select> </sqlMap> diff --git a/web/modules/rhn/RHN/DB/DataSource/xml/Action_queries.xml b/web/modules/rhn/RHN/DB/DataSource/xml/Action_queries.xml index e7b4caf..87dae3f 100644 --- a/web/modules/rhn/RHN/DB/DataSource/xml/Action_queries.xml +++ b/web/modules/rhn/RHN/DB/DataSource/xml/Action_queries.xml @@ -38,8 +38,8 @@ SELECT EVENT_ID, HISTORY_STATUS FROM (SELECT SH.id EVENT_ID, SH.summary SUMMARY, - TO_DATE(NULL, NULL) AS created, - TO_DATE(NULL, NULL) AS picked_up, + TO_TIMESTAMP(NULL, NULL) AS created, + TO_TIMESTAMP(NULL, NULL) AS picked_up, SH.created as completed, -- view this as the "completed" date for sorting reasons NULL AS history_status, NULL AS history_type, diff --git a/web/modules/rhn/RHN/DB/KSTree.pm b/web/modules/rhn/RHN/DB/KSTree.pm index 5588202..4864c98 100644 --- a/web/modules/rhn/RHN/DB/KSTree.pm +++ b/web/modules/rhn/RHN/DB/KSTree.pm @@ -195,7 +195,7 @@ sub commit_files { INSERT INTO rhnKSTreeFile (kstree_id, relative_filename, checksum_id, last_modified, file_size) VALUES - (:tree_id, :relative_filename, lookup_checksum('md5', :md5sum), TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'), :file_size) + (:tree_id, :relative_filename, lookup_checksum('md5', :md5sum), TO_TIMESTAMP(:last_modified, 'YYYY-MM-DD HH24:MI:SS'), :file_size) EOQ
$sth->execute_h(tree_id => $self->id, map { $_ => $file->{+uc $_} } qw/relative_filename md5sum last_modified file_size/) diff --git a/web/modules/rhn/RHN/DB/TableClass.pm b/web/modules/rhn/RHN/DB/TableClass.pm index 6ef044e..990fcd0 100644 --- a/web/modules/rhn/RHN/DB/TableClass.pm +++ b/web/modules/rhn/RHN/DB/TableClass.pm @@ -80,10 +80,10 @@ sub type_to_placeholder { my $ret;
if ($self->column_flags($type) eq 'longdate') { - $ret = "TO_DATE($fieldname, 'YYYY-MM-DD HH24:MI:SS')"; + $ret = "TO_TIMESTAMP($fieldname, 'YYYY-MM-DD HH24:MI:SS')"; } elsif ($self->column_flags($type) eq 'shortdate') { - $ret = "TO_DATE($fieldname, 'YYYY-MM-DD')"; + $ret = "TO_TIMESTAMP($fieldname, 'YYYY-MM-DD')"; } else { $ret = "$fieldname"; diff --git a/web/modules/rhn/RHN/DB/TinyURL.pm b/web/modules/rhn/RHN/DB/TinyURL.pm index e9e4ebd..ee59c74 100644 --- a/web/modules/rhn/RHN/DB/TinyURL.pm +++ b/web/modules/rhn/RHN/DB/TinyURL.pm @@ -65,7 +65,7 @@ sub create { INSERT INTO rhnTinyURL (token, url, enabled, expires) VALUES - (:token, :url, 'Y', TO_DATE(:expires, 'YYYY-MM-DD HH24:MI:SS') + 1/6) + (:token, :url, 'Y', TO_TIMESTAMP(:expires, 'YYYY-MM-DD HH24:MI:SS') + 1/6) EOS $sth->execute_h(token => $token, url => $url, expires => $expires); $dbh->commit;
commit 53257058ba0b52b56948fc90798d5c599e535172 Author: Jan Pazdziora jpazdziora@redhat.com Date: Tue Mar 26 08:56:24 2013 +0100
Fixing schema upgrade of rhnCpu.nrsocket.
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/010-add_rhncpu_nrsocket.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/010-add_rhncpu_nrsocket.sql.postgresql index 9eb1edc..514bf8d 100644 --- a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/010-add_rhncpu_nrsocket.sql.postgresql +++ b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/010-add_rhncpu_nrsocket.sql.postgresql @@ -1,3 +1,3 @@ --- oracle equivalent source sha1 c9998dc4e416dc187bd61828c345991580dac5dd +-- oracle equivalent source sha1 542a4a49150b8cecd6c9ef947357a1608b1d9f04
-alter table rhnCpu add column nrsocket NUMERIC +alter table rhnCpu add column nrsocket NUMERIC;
spacewalk-commits@lists.fedorahosted.org