From: Date: March 31 2005 4:12am Subject: bk commit into 4.1 tree (jimw:1.2165) BUG#9472 List-Archive: http://lists.mysql.com/internals/23516 X-Bug: 9472 Message-Id: <20050331021210.C5F0CA82F9@rama.trainedmonkey.com> Below is the list of changes that have just been committed into a local 4.1 repository of jimw. When jimw 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.2165 05/03/30 18:12:07 jimw@stripped +4 -0 Fix handling of max_allowed_packet and net_buffer_length in embedded server when a size suffix (K, M, G) is added. (Bug #9472) sql/mysqld.cc 1.566 05/03/30 18:12:04 jimw@stripped +10 -2 Use my_eval_num_suffix() to parse max_allowed_packet and net_buffer_length in embedded server. mysys/my_getopt.c 1.51 05/03/30 18:12:04 jimw@stripped +4 -4 Change eval_num_suffix() to my_eval_num_suffix() and make it non-static. include/my_getopt.h 1.18 05/03/30 18:12:04 jimw@stripped +3 -0 Add declaration of my_eval_num_suffix() BitKeeper/deleted/.del-myisam-blob.result.es~d498dae7d9f1a6d4 1.2 05/03/30 18:11:15 jimw@stripped +0 -0 Delete: mysql-test/r/myisam-blob.result.es # 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: rama.(none) # Root: /home/jimw/my/mysql-4.1-9472 --- 1.565/sql/mysqld.cc 2005-03-29 02:30:29 -08:00 +++ 1.566/sql/mysqld.cc 2005-03-30 18:12:04 -08:00 @@ -5918,13 +5918,21 @@ break; #ifdef EMBEDDED_LIBRARY case OPT_MAX_ALLOWED_PACKET: - max_allowed_packet= atoi(argument); + { + int error; + max_allowed_packet= (ulong)my_eval_num_suffix(argument, &error, + "max_allowed_packet"); global_system_variables.max_allowed_packet= max_allowed_packet; break; + } case OPT_NET_BUFFER_LENGTH: - net_buffer_length= atoi(argument); + { + int error; + net_buffer_length= (ulong)my_eval_num_suffix(argument, &error, + "net_buffer_length"); global_system_variables.net_buffer_length= net_buffer_length; break; + } #endif #include case 'V': --- 1.17/include/my_getopt.h 2004-08-31 17:23:28 -07:00 +++ 1.18/include/my_getopt.h 2005-03-30 18:12:04 -08:00 @@ -70,6 +70,9 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp); my_bool getopt_compare_strings(const char *s, const char *t, uint length); +extern longlong my_eval_num_suffix (char *argument, int *error, + char *option_name); + C_MODE_END --- 1.50/mysys/my_getopt.c 2004-08-31 18:12:06 -07:00 +++ 1.51/mysys/my_getopt.c 2005-03-30 18:12:04 -08:00 @@ -642,13 +642,13 @@ } /* - function: eval_num_suffix + function: my_eval_num_suffix Transforms a number with a suffix to real number. Suffix can be k|K for kilo, m|M for mega or g|G for giga. */ -static longlong eval_num_suffix (char *argument, int *error, char *option_name) +longlong my_eval_num_suffix (char *argument, int *error, char *option_name) { char *endchar; longlong num; @@ -688,7 +688,7 @@ longlong num; ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L); - num= eval_num_suffix(arg, err, (char*) optp->name); + num= my_eval_num_suffix(arg, err, (char*) optp->name); if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value && optp->max_value) /* if max value is not set -> no upper limit */ num= (longlong) (ulong) optp->max_value; @@ -708,7 +708,7 @@ { ulonglong num; - num= eval_num_suffix(arg, err, (char*) optp->name); + num= my_eval_num_suffix(arg, err, (char*) optp->name); return getopt_ull_limit_value(num, optp); }