diff options
author | unknown <sanja@montyprogram.com> | 2012-03-14 13:58:18 +0200 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2012-03-14 13:58:18 +0200 |
commit | 5338a28912589f1169b66b880a489ec5636bcd83 (patch) | |
tree | d0e1156d56a95d2051d499b065d78395bc302528 /sql | |
parent | 0f3b8ef28ed19145e0cd850ef522ddf7cf662592 (diff) | |
parent | e638e605895fb572047ec8027e91c5438d77cbf4 (diff) | |
download | mariadb-git-5338a28912589f1169b66b880a489ec5636bcd83.tar.gz |
Merge 5.2->5.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/opt_sum.cc | 10 | ||||
-rw-r--r-- | sql/signal_handler.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 4 | ||||
-rw-r--r-- | sql/winservice.c | 39 |
4 files changed, 49 insertions, 6 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 5298c57954d..9e097af1e6e 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -482,8 +482,8 @@ int opt_sum_query(THD *thd, 'const op field' @retval - 0 func_item is a simple predicate: a field is compared with - constants + 0 func_item is a simple predicate: a field is compared with a constant + whose length does not exceed the max length of the field values @retval 1 Otherwise */ @@ -503,6 +503,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) if (!(item= it++)) return 0; args[0]= item->real_item(); + if (args[0]->max_length < args[1]->max_length) + return 0; if (it++) return 0; } @@ -536,6 +538,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) } else return 0; + if (args[0]->max_length < args[1]->max_length) + return 0; break; case 3: /* field BETWEEN const AND const */ @@ -549,6 +553,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) if (!item->const_item()) return 0; args[i]= item; + if (args[0]->max_length < args[i]->max_length) + return 0; } } else diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 819b87e3fdc..d58c28c2936 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -72,7 +72,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) curr_time= my_time(0); localtime_r(&curr_time, &tm); - my_safe_printf_stderr("%02d%02d%02d %2d:%02d:%02d ", + fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d ", tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); if (opt_expect_abort diff --git a/sql/table.cc b/sql/table.cc index 13e643f015b..9174168bd68 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2335,8 +2335,8 @@ partititon_err: /* Check virtual columns against table's storage engine. */ if (share->vfields && - !(outparam->file && - (outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS))) + (outparam->file && + !(outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS))) { my_error(ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS, MYF(0), plugin_name(share->db_plugin)->str); diff --git a/sql/winservice.c b/sql/winservice.c index 3ec91c26835..f70f8018509 100644 --- a/sql/winservice.c +++ b/sql/winservice.c @@ -59,6 +59,41 @@ void normalize_path(char *path, size_t size) } /* + Exclusion rules. + + Some hardware manufacturers deliver systems with own preinstalled MySQL copy + and services. We do not want to mess up with these installations. We will + just ignore such services, pretending it is not MySQL. + + ´@return + TRUE, if this service should be excluded from UI lists etc (OEM install) + FALSE otherwise. +*/ +BOOL exclude_service(mysqld_service_properties *props) +{ + static const char* exclude_patterns[] = + { + "common files\\dell\\mysql\\bin\\", /* Dell's private installation */ + NULL + }; + int i; + char buf[MAX_PATH]; + + /* Convert mysqld path to lower case, rules for paths are case-insensitive. */ + memcpy(buf, props->mysqld_exe, sizeof(props->mysqld_exe)); + _strlwr(buf); + + for(i= 0; exclude_patterns[i]; i++) + { + if (strstr(buf, exclude_patterns[i])) + return TRUE; + } + + return FALSE; +} + + +/* Retrieve some properties from windows mysqld service binary path. We're interested in ini file location and datadir, and also in version of the data. We tolerate missing mysqld.exe. @@ -240,7 +275,9 @@ int get_mysql_service_properties(const wchar_t *bin_path, } } } - retval = 0; + + if (!exclude_service(props)) + retval = 0; end: LocalFree((HLOCAL)args); return retval; |