MEDIUM: checks: Make post-41 the default mode for mysql checks
MySQL 4.1 is old enough to be the default mode for mysql checks. So now, once a
username is defined, post-41 mode is automatically used. To do mysql checks on
previous MySQL version, the argument "pre-41" must be used.
Note, it is a compatibility breakage for everyone using an antique and
unsupported MySQL version.
diff --git a/src/checks.c b/src/checks.c
index d22c113..74b0fc8 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -6852,21 +6852,21 @@
goto error;
}
- if (*args[cur_arg+2]) {
- if (strcmp(args[cur_arg+2], "post-41") != 0) {
- ha_alert("parsing [%s:%d] : keyword '%s' only supports option 'post-41' (got '%s').\n",
- file, line, args[cur_arg], args[cur_arg+2]);
- goto error;
- }
+ if (!*args[cur_arg+2] || strcmp(args[cur_arg+2], "post-41") == 0) {
packetlen = userlen + 7 + 27;
mysql_req = mysql41_req;
mysql_rsname = mysql41_rsname;
}
- else {
+ else if (strcmp(args[cur_arg+2], "pre-41") == 0) {
packetlen = userlen + 7;
mysql_req = mysql40_req;
mysql_rsname = mysql40_rsname;
}
+ else {
+ ha_alert("parsing [%s:%d] : keyword '%s' only supports 'post-41' and 'pre-41' (got '%s').\n",
+ file, line, args[cur_arg], args[cur_arg+2]);
+ goto error;
+ }
hdr[0] = (unsigned char)(packetlen & 0xff);
hdr[1] = (unsigned char)((packetlen >> 8) & 0xff);