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 := `
|
query := `
|
||||||
SELECT DISTINCT lr.prefix, lr.mask_length, lr.origin_asn, lr.last_updated, a.handle, a.description
|
SELECT DISTINCT lr.prefix, lr.mask_length, lr.origin_asn, lr.last_updated, a.handle, a.description
|
||||||
FROM live_routes_v4 lr
|
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 >= ?
|
WHERE lr.ip_start <= ? AND lr.ip_end >= ?
|
||||||
ORDER BY lr.mask_length DESC
|
ORDER BY lr.mask_length DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
@ -1220,7 +1220,7 @@ func (d *Database) GetASInfoForIPContext(ctx context.Context, ip string) (*ASInf
|
|||||||
query := `
|
query := `
|
||||||
SELECT DISTINCT lr.prefix, lr.mask_length, lr.origin_asn, lr.last_updated, a.handle, a.description
|
SELECT DISTINCT lr.prefix, lr.mask_length, lr.origin_asn, lr.last_updated, a.handle, a.description
|
||||||
FROM live_routes_v6 lr
|
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
|
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,
|
SELECT lr.origin_asn, lr.peer_ip, lr.as_path, lr.next_hop, lr.last_updated,
|
||||||
a.handle, a.description
|
a.handle, a.description
|
||||||
FROM %s lr
|
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 = ?
|
WHERE lr.prefix = ?
|
||||||
ORDER BY lr.origin_asn, lr.peer_ip
|
ORDER BY lr.origin_asn, lr.peer_ip
|
||||||
`, tableName)
|
`, tableName)
|
||||||
|
Loading…
Reference in New Issue
Block a user