from mysql 5.1, 5.5, 5.6, 5.7 manual
http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_cot
http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html#function_cot
http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html#function_cot
http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_cot

  •  COT(X)

    Returns the cotangent of X.

    mysql> SELECT COT(12);
            -> -1.5726734063977
    mysql> SELECT COT(0);
            -> NULL

maybe a sql_mode parameter change the output of this function?