triggers - How do I increase the maximum length of a MySQL error message? -
i wrote before insert trigger on particular table in database in order impose value constraints. code returns semicolon-separated list of errors. intent have flask app return list of user-defined error messages client.
however, if more 1 error occurs, message gets cut off mid sentence.
here sort of redacted error message:
the specified xxxxxxx xxxxx xxxxxxxx (105) exceeds maximum value (100).; specified xxxxxxx xxxxxxx xxxxx xxxxxxxx (90)
here of code trigger:
begin declare rtn text; declare error boolean; -- declare variables here -- select values variables -- check new row fields against variables if error signal sqlstate '02001' set message_text = rtn; end if;
assuming using php, there maximum limit exception messages. defined log_errors_max_len in php.ini. refer here more details https://bugs.php.net/bug.php?id=31955
you can try , change that.
but suggest using stored procedure/function insert data. can return error value of length.
Comments
Post a Comment