The below function works fine except it throws a warning 'No data - zero rows fetched, selected, or processed (errno. 1329)'. and since i start using this function with django there cant be any warning or error because it stop the whole process
any idea how to fix this?
DELIMITER $$
DROP FUNCTION IF EXISTS objtree_node_add $$
CREATE FUNCTION objtree_node_add(i_开发者_C百科name VARCHAR(255), i_parent_id BIGINT, i_type_id BIGINT) RETURNS bigint(20)
BEGIN
DECLARE a_name VARCHAR(255);
IF NOT i_name RLIKE '^[a-zA-Z0-9_-]+$' THEN
RETURN -1;
END IF;
SELECT name INTO a_name FROM objtree_nodes WHERE parent_id = i_parent_id AND name = i_name;
IF NOT a_name IS NULL THEN
RETURN -5;
END IF;
...
I don't know where you read that there is no warnings filtering in Django. Django is just Python, so you can use the Python warnings
module.
import warnings
warnings.filterwarnings("ignore", "No data .*")
import warnings
warnings.filterwarnings("ignore", "No data .*")
精彩评论