If called with one parameter, this function returns the natural logarithm of X. If X is less than or equal to 0.0E0, the function returns NULL and (as of MySQL 5.7.4) a warning “Invalid argument for logarithm” is reported.
The inverse of this function (when called with a single argument) is the EXP() function.
If called with two parameters, this function returns the logarithm of X to the base B. If X is less than or equal to 0, or if B is less than or equal to 1, then NULL is returned.
LOG(2) -> 0.69314718055995
LOG(-2) -> NULL
LOG(2,65536) -> 16
LOG(10,100) -> 2
LOG(1,100) -> NULL
- See more:
NOTE- In this JIRA. NULL case will throw IllegalArgumentException.