Changeset 185


Ignore:
Timestamp:
03/01/05 16:31:04 (20 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Backport SQL/SQL-related bugfixes from /trunk r180 through 184

Location:
branches/stable/cgi-bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/IPDB.pm

    r168 r185  
    122122# Return here if we can't select.  Note that this indicates a
    123123# problem executing the select.
    124   my $sth = $dbh->prepare("select cidr from masterblocks");
     124  my $sth = $dbh->prepare("select type from alloctypes");
    125125  $sth->execute();
    126126  return (undef,$DBI::errstr) if ($sth->err);
     
    156156  } else {
    157157    # it connects, try a stmt.
    158     my $sth = $dbh->prepare("select cidr from masterblocks");
     158    my $sth = $dbh->prepare("select type from alloctypes");
    159159    my $err = $sth->execute();
    160160
  • branches/stable/cgi-bin/ipdb.psql

    r178 r185  
    1 \connect - postgres
     1CREATE DATABASE ipdb;
    22
    33\connect ipdb ipdb
     
    4949
    5050CREATE TABLE "freeblocks" (
    51         "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY
     51        "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
    5252        "maskbits" integer DEFAULT 128,
    5353        "city" character varying(30) DEFAULT '',
     
    120120GRANT ALL on "cities" to "ipdb";
    121121
     122COPY "alloctypes" FROM stdin;
     123cd      Static Pool - Cable     Cable pool      41      CBL-BUS
     124dp      Static Pool - DSL       DSL pool        42      DSL-BUS
     125mp      Static Pool - Dialup    Static dialup pool      43      DIAL-BUS
     126wp      Static Pool - Wireless  Static wireless pool    44      WL-BUS
     127dc      Dynamic cable block     Dynamic cable block     103     CBL-RES
     128dy      Dynamic DSL block       Dynamic DSL block       102     DSL-RES
     129dn      Dialup netblock Dialup netblock 101     DIAL-RES
     130dw      Dynamic WiFi block      Dynamic WiFi block      104     WL-RES
     131mm      Master block    Master block    999     6750400
     132rr      Routing Routed netblock 500     6750400
     133in      Internal netblock       Internal netblock       990     6750400
     134ee      End-use netblock        End-use netblock        100     6750400
     135sd      Static Pool - Servers   Server pool     40      6750400
     136cn      Customer netblock       Customer netblock       0       
     137ci      Static IP - Cable       Static cable IP 21     
     138di      Static IP - DSL Static DSL IP   22     
     139mi      Static IP - Dialup      Static dialup IP        23     
     140wi      Static IP - Wireless    Static wireless IP      24     
     141si      Static IP - Server pool Server pool IP  20      6750400
     142\.
  • branches/stable/cgi-bin/main.cgi

    r174 r185  
    4040($ip_dbh,$errstr) = connectDB_My;
    4141if (!$ip_dbh) {
    42   printAndExit("Failed to connect to database: $errstr\n");
    43 }
    44 checkDBSanity($ip_dbh);
     42  printAndExit("Database error: $errstr\n");
     43}
    4544initIPDBGlobals($ip_dbh);
    4645
Note: See TracChangeset for help on using the changeset viewer.