fix insert bugs

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@396 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-09-14 16:58:11 +00:00
parent af87e1a66e
commit f235b05026
3 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 0.7.0
Version: 0.7.0-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.3),hmt(>=1.0.6),ssmtp

View File

@ -29,11 +29,11 @@ if {![file exists $ffile]} {
}
if {[catch { set fd [open $ffile r] } msg]} {
puts "Error opening backup file. - $msg"
puts "Error opening <i>$file</i> - $msg"
exit
}
puts "Restoring scheduled events..."
puts "Restoring scheduled events from <i>$file</i>..."
$rsvdb query {begin transaction;}
$rsvdb query {delete from TBL_RESERVATION;}
@ -76,7 +76,11 @@ foreach line $data {
}
}
if {!$bad} { $rsv insert }
if {!$bad} {
if {[catch {$rsv insert pending 1} msg]} {
puts " Error inserting event, $msg"
}
}
}
$rsvdb query {commit transaction;}

View File

@ -137,11 +137,11 @@ rsv method fix_hsvc {} {
return $hsvc
}
rsv method insert {{table pending}} {
rsv method insert {{table pending} {force 0}} {
global rsvdb
# Duplicate check - all tables
if {$szCRID ne "" && $action == 0} {
if {!$force && $szCRID ne "" && $action == 0} {
foreach tab {pending TBL_RESERVATION} {
set rec [$rsvdb query "
select ulslot from $tab
@ -302,7 +302,7 @@ proc {rsv commit} {} {
foreach rec [rsv list pending] {
if {[$rec get action] == 0} {
$rec clear_ulslot
$rec insert TBL_RESERVATION
$rec insert TBL_RESERVATION 1
}
}
$::rsvdb query {delete from pending}