I write function for MySql. There are lines in the function body
SELECT `id`, `val` INTO @CACHEID, @OLDVAL FROM `shop_ch_cache` WHERE `prodid` = PRODID AND `nameid` = NAMEID LIMIT 1; IF @CACHEID THEN INSERT INTO `_db_log`(`log`) VALUES(CONCAT('id isset ', @CACHEID)); RETURN 1; END IF; INSERT INTO `_db_log`(`log`) VALUES('id don`t isset '); RETURN 0; Gives an error message
SQLSTATE [23000]: Integrity constraint violation: 1048 Column 'log' cannot be null
How can it be NULL if there is an IF @CACHEID condition?
IF @CACHEID THENtoIF @CHACHEID IS NOT NULL THENwill the error remain or everything will work fine? - ApInvent