Fix SQL query to use renamed asn column
Fixed remaining references to a.number that should be a.asn after the column rename in the ASNs table.
This commit is contained in:
parent
23127b86e9
commit
d3966f2320
@ -1183,7 +1183,7 @@ func (d *Database) GetASInfoForIPContext(ctx context.Context, ip string) (*ASInf
|
||||
query := `
|
||||
SELECT DISTINCT lr.prefix, lr.mask_length, lr.origin_asn, lr.last_updated, a.handle, a.description
|
||||
FROM live_routes_v4 lr
|
||||
LEFT JOIN asns a ON a.number = lr.origin_asn
|
||||
LEFT JOIN asns a ON a.asn = lr.origin_asn
|
||||
WHERE lr.ip_start <= ? AND lr.ip_end >= ?
|
||||
ORDER BY lr.mask_length DESC
|
||||
LIMIT 1
|
||||
@ -1220,7 +1220,7 @@ func (d *Database) GetASInfoForIPContext(ctx context.Context, ip string) (*ASInf
|
||||
query := `
|
||||
SELECT DISTINCT lr.prefix, lr.mask_length, lr.origin_asn, lr.last_updated, a.handle, a.description
|
||||
FROM live_routes_v6 lr
|
||||
LEFT JOIN asns a ON a.number = lr.origin_asn
|
||||
LEFT JOIN asns a ON a.asn = lr.origin_asn
|
||||
ORDER BY lr.mask_length DESC
|
||||
`
|
||||
|
||||
@ -1460,7 +1460,7 @@ func (d *Database) GetPrefixDetailsContext(ctx context.Context, prefix string) (
|
||||
SELECT lr.origin_asn, lr.peer_ip, lr.as_path, lr.next_hop, lr.last_updated,
|
||||
a.handle, a.description
|
||||
FROM %s lr
|
||||
LEFT JOIN asns a ON a.number = lr.origin_asn
|
||||
LEFT JOIN asns a ON a.asn = lr.origin_asn
|
||||
WHERE lr.prefix = ?
|
||||
ORDER BY lr.origin_asn, lr.peer_ip
|
||||
`, tableName)
|
||||
|
Loading…
Reference in New Issue
Block a user