- Timestamp:
- 11/12/04 11:52:03 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r61 r63 118 118 $sth = $ip_dbh->prepare("insert into masterblocks values ('$webvar{cidr}')"); 119 119 $sth->execute; 120 # Don't need this with RaiseError, but leave it for now.121 # croak $sth->errstr if ($sth->errstr());122 120 123 121 # Unrouted blocks aren't associated with a city (yet). We don't rely on this … … 128 126 $cidr->masklen.",'<NULL>','n')"); 129 127 $sth->execute; 130 # Don't need this with RaiseError, but leave it for now.131 # croak $sth->errstr if ($sth->errstr());132 128 133 129 # If we get here, everything is happy. Commit changes. … … 998 994 # Allow transactions, and make errors much easier to catch. 999 995 # Much as I would like to error-track specifically on each ->execute, 1000 # that's a LOT of code. :/ 1001 $ip_dbh->{AutoCommit} = 0; 1002 $ip_dbh->{RaiseError} = 1; 996 # that's a LOT of code, and some SQL blocks MUST be atomic at a 997 # multi-statement level. :/ 998 local $ip_dbh->{AutoCommit} = 0; # These need to be local so we don't 999 local $ip_dbh->{RaiseError} = 1; # step on our toes by accident. 1003 1000 1004 1001 if ($webvar{fullcidr} eq $webvar{alloc_from}) { … … 1133 1130 syslog "notice", "$full_alloc_types{$webvar{alloctype}} '$webvar{fullcidr}' successfully initialized by $authuser"; 1134 1131 1135 # Turn off transactions and exception-on-error'ing1136 $ip_dbh->{AutoCommit} = 0;1137 $ip_dbh->{RaiseError} = 1;1138 1139 1132 print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was sucessfully added as type '$webvar{alloctype}' ($full_alloc_types{$webvar{alloctype}})</div></div>); 1140 1133
Note:
See TracChangeset
for help on using the changeset viewer.