| 6978 | */ |
| 6979 | |
| 6980 | int check_proc_record(const CHARSET_INFO *name_field_charset, |
| 6981 | const LOOKUP_FIELD_VALUES *lookup, |
| 6982 | const LEX_CSTRING &db, |
| 6983 | const LEX_CSTRING &name) |
| 6984 | { |
| 6985 | if (lookup->db_value.str && cmp(lookup->db_value, db)) |
| 6986 | { |
| 6987 | /* |
| 6988 | We have the name of target database. If we got a non-matching |
| 6989 | record, this means we've finished reading matching mysql.proc records |
| 6990 | */ |
| 6991 | return HA_ERR_END_OF_FILE; |
| 6992 | } |
| 6993 | |
| 6994 | if (lookup->table_value.str) |
| 6995 | { |
| 6996 | if ((my_ci_strnncoll(name_field_charset, |
| 6997 | (const uchar *) lookup->table_value.str, |
| 6998 | lookup->table_value.length, |
| 6999 | (const uchar *) name.str, name.length, 0))) |
| 7000 | { |
| 7001 | /* Routine name doesn't match. */ |
| 7002 | if (lookup->db_value.str) |
| 7003 | { |
| 7004 | /* |
| 7005 | We're using index lookup. A non-matching record means we've |
| 7006 | finished reading matches. |
| 7007 | */ |
| 7008 | return HA_ERR_END_OF_FILE; |
| 7009 | } |
| 7010 | else |
| 7011 | { |
| 7012 | /* The routine name doesn't match, but we're scanning all databases */ |
| 7013 | return 0; /* Continue scanning */ |
| 7014 | } |
| 7015 | } |
| 7016 | } |
| 7017 | return -1; /* This is a match */ |
| 7018 | } |
| 7019 | |
| 7020 | /** |
| 7021 | @brief Store record into I_S.PARAMETERS table |
no test coverage detected