-
- Downloads
Bugfix: Fixup search SQL queries
SQL search queries for subnets and ip_addr are string comparisons and not integer comparisons. To obtain expected search results left pad with zeros to cover whole IPv6 address space, LDAP(ip,39,0). MySQL/MariaDB compare strings left to right until a difference is encountered. The 1st character "9" is greater than the 1st charcter "1", not the expected result. MariaDB [phpipam]> SELECT "9" > "10", 9 > 10, LPAD("9",39,0) > LPAD("10",39,0); +------------+--------+----------------------------------+ | "9" > "10" | 9 > 10 | LPAD("9",39,0) > LPAD("10",39,0) | +------------+--------+----------------------------------+ | 1 | 0 | 0 | +------------+--------+----------------------------------+
Loading
Please register or sign in to comment