Below is the list of changes that have just been committed into a local
4.1 repository of mysqldev. When mysqldev does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2428 05/09/12 19:09:43 jimw@stripped +3 -0
Fix incorrect casts in my_getopt code that capped the maximum of longlong
options to the wrong value. (Bug #12925)
tests/mysql_client_test.c
1.159 05/09/12 19:08:48 jimw@stripped +19 -0
Add test case for Bug #12925 (my_getopt bug)
mysys/my_getopt.c
1.51 05/09/12 19:08:24 jimw@stripped +3 -3
Remove incorrect and unnecessary casts
mysql-test/t/mysql_client_test.test
1.14 05/09/12 19:08:09 jimw@stripped +2 -2
Add parameter for testing getopt bug
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jimw
# Host: production.mysql.com
# Root: /data0/mysqldev/jimw/mysql-4.1
--- 1.50/mysys/my_getopt.c 2004-09-01 03:12:06 +02:00
+++ 1.51/mysys/my_getopt.c 2005-09-12 19:08:24 +02:00
@@ -689,10 +689,10 @@
ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L);
num= eval_num_suffix(arg, err, (char*) optp->name);
- if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value
&&
+ if (num > 0 && num > optp->max_value &&
optp->max_value) /* if max value is not set -> no upper limit */
- num= (longlong) (ulong) optp->max_value;
- num= ((num - (longlong) optp->sub_size) / block_size);
+ num= optp->max_value;
+ num= ((num - optp->sub_size) / block_size);
num= (longlong) (num * block_size);
return max(num, optp->min_value);
}
--- 1.13/mysql-test/t/mysql_client_test.test 2005-07-28 02:21:44 +02:00
+++ 1.14/mysql-test/t/mysql_client_test.test 2005-09-12 19:08:09 +02:00
@@ -6,7 +6,7 @@
# var/log/mysql_client_test.trace
--disable_result_log
---exec echo $MYSQL_CLIENT_TEST
---exec $MYSQL_CLIENT_TEST
+--exec echo $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
+--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
# End of 4.1 tests
--- 1.158/tests/mysql_client_test.c 2005-09-09 10:22:12 +02:00
+++ 1.159/tests/mysql_client_test.c 2005-09-12 19:08:48 +02:00
@@ -51,6 +51,8 @@
static const char *opt_basedir= "./";
+static longlong opt_getopt_ll_test= 0;
+
static int embedded_server_arg_count= 0;
static char *embedded_server_args[MAX_SERVER_ARGS];
@@ -11830,6 +11832,19 @@
rc= mysql_query(mysql, "drop table t1, t2");
myquery(rc);
}
+
+
+/*
+ Bug #12925: Bad handling of maximum values in getopt
+*/
+static void test_bug12925()
+{
+ myheader("test_bug12925");
+ if (opt_getopt_ll_test)
+ DIE_UNLESS(opt_getopt_ll_test == LL(25600*1024*1024));
+}
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -11872,6 +11887,9 @@
{"user", 'u', "User for login if not current user", (char **) &opt_user,
(char **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
+ {"getopt-ll-test", 'g', "Option for testing bug in getopt library",
+ (char **) &opt_getopt_ll_test, (char **) &opt_getopt_ll_test, 0,
+ GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -12048,6 +12066,7 @@
{ "test_bug11183", test_bug11183 },
{ "test_bug12001", test_bug12001 },
{ "test_bug11718", test_bug11718 },
+ { "test_bug12925", test_bug12925 },
{ 0, 0 }
};
| Thread |
|---|
| • bk commit into 4.1 tree (jimw:1.2428) BUG#12925 | Jim Winstead | 12 Sep |