From 83f90e060e464292e27ecdf4afd143b914b24c27 Mon Sep 17 00:00:00 2001 From: "monty@mishka.local" <> Date: Mon, 27 Jun 2005 16:46:41 +0300 Subject: Better bug fix for: #9728 'Decreased functionality in "on duplicate key update #8147 'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE' This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part --- mysys/my_access.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mysys/my_access.c') diff --git a/mysys/my_access.c b/mysys/my_access.c index 1b9ad6ff380..8fc83a020cf 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -98,17 +98,16 @@ int check_if_legal_filename(const char *path) for (reserved_name= reserved_names; *reserved_name; reserved_name++) { + const char *reserved= *reserved_name; /* never empty */ const char *name= path; - const char *current_reserved_name= *reserved_name; - while (name != end && *current_reserved_name) + do { - if (*current_reserved_name != my_toupper(&my_charset_latin1, *name)) + if (*reserved != my_toupper(&my_charset_latin1, *name)) break; - current_reserved_name++; if (++name == end) DBUG_RETURN(1); /* Found wrong path */ - } + } while (*++reserved); } DBUG_RETURN(0); } -- cgit v1.2.1