diff options
author | unknown <monty@mysql.com> | 2004-03-06 10:43:35 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-03-06 10:43:35 +0200 |
commit | aa20bd9e8c44fbc14396fa418983b8c515b4e8ad (patch) | |
tree | 1cf950921cf3e82b17e59b8516f0db0627a429a2 /mysys/my_getopt.c | |
parent | 0b751edc57385e125415a3d0aa8f37ad772e7178 (diff) | |
download | mariadb-git-aa20bd9e8c44fbc14396fa418983b8c515b4e8ad.tar.gz |
Ensure that one can't from the command line set a variable too small. (Bug #2710)
Allow one to force lower_case_table_names to 0, even if the file system is case insensitive. This fixes some issues on Mac OS X (Bug #2994)
Added variables "lower_case_file_system", "version_compile_os" and "license"
mysql-test/t/lowercase_table3-master.opt:
Rename: mysql-test/t/lowercase_table2-master.opt -> mysql-test/t/lowercase_table3-master.opt
mysys/my_getopt.c:
Ensure that one can't from the command line set a variable too small (could happen when sub_size was set)
sql/mysql_priv.h:
Added lower_case_file_system
sql/mysqld.cc:
Allow one to force lower_case_table_names to 0, even if the file system is case insensitive
sql/set_var.cc:
Added variable "lower_case_file_system"
Added variable "version_compile_os"
Added variable "license"
sql/set_var.h:
Added support for read only strings
sql/sql_select.cc:
Make join optimizer killable
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r-- | mysys/my_getopt.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index a8c57b4cd1d..8e1276990c0 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -576,18 +576,15 @@ static longlong eval_num_suffix (char *argument, int *error, char *option_name) static longlong getopt_ll(char *arg, const struct my_option *optp, int *err) { longlong num; + ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L); num= eval_num_suffix(arg, err, (char*) optp->name); - if (num < (longlong) optp->min_value) - num= (longlong) optp->min_value; - else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value - && optp->max_value) /* if max value is not set -> no upper limit */ + 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; - num= ((num - (longlong) optp->sub_size) / (optp->block_size ? - (ulonglong) optp->block_size : - 1L)); - return (longlong) (num * (optp->block_size ? (ulonglong) optp->block_size : - 1L)); + num= ((num - (longlong) optp->sub_size) / block_size); + num= (longlong) (num * block_size); + return max(num, optp->min_value); } /* |