Commit graph

221 commits

Author SHA1 Message Date
unknown
c472a17db5 Fixed two bugs in my_getopt.
mysys/my_getopt.c:
  Fixed two bugs in my_getopt:
  
  - argc was decremented twice when type was GET_BOOL and short
    option was used. This caused all GET_BOOL -type short-options
    to malfunction.
  
  - Fixed a bug in argv handling. Any program that used argv directly
    without checking argc first, tried to use (already handled) options
    as non-option arguments, after all true non-option arguments were
    handled. At least mysqldump was affected by this bug.
2002-06-03 03:02:32 +03:00
unknown
2e86ba7e9e Fixed a bug in my_getopt.
mysys/my_getopt.c:
  Fixed two bugs in my_getopt:
  - Didn't exit with error if a short option was not recognized. Fixed.
  - If unrecognized short option was not the first one in the list,
    printed "unknown option" error for wrong option. Fixed.
2002-05-31 16:23:36 +03:00
unknown
a90b2f309e Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.

Changed some exit code names and corresponding numbers.

Fixed a bug in mysqld.cc, in replication related options.

Added a global flag in my_getopt, which can be set by any program
that is using my_getopt, which tells whether the client should
print the error message itself, or whether my_getopt should do it.
The default is that my_getopt will print the error messages.


client/mysql.cc:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqladmin.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqlbinlog.cc:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqlcheck.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqldump.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqlimport.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqlmanager-pwgen.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqlmanagerc.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqlshow.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/mysqltest.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
client/thread_test.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
extra/my_print_defaults.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
extra/mysql_install.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
extra/perror.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
extra/resolve_stack_dump.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
extra/resolveip.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
include/my_getopt.h:
  Added global (flag) variable which tells my_getopt whether to
  print errors or just silently exit with proper error code.
include/mysys_err.h:
  Changed exit code names and corresponding numbers.
isam/isamchk.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
isam/pack_isam.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
myisam/ft_dump.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
myisam/ft_eval.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
myisam/ft_test1.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
myisam/mi_test1.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
myisam/myisamchk.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
myisam/myisampack.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
mysys/my_getopt.c:
  Changed exit code names and corresponding numbers. Added a flag
  for checking whether my_getopt should print the error message,
  or whether it should be printed by the client itself.
sql/gen_lex_hash.cc:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
sql/mysqld.cc:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
  
  Fixed a bug when compiling in non-debug mode, some replication
  related options were not enabled while they should be. This made
  'make test' to fail in rpl000010 when --with-debug was not used.
tools/mysqlmanager.c:
  Added useful exit error code for programs using my_getopt in case
  of an error in option handling. This can sometimes be useful in
  scripts.
2002-05-29 15:07:30 +03:00
unknown
072e605cdc Changed ft_dump, ft_eval, ft_test1, mi_test1, myisampack, gen_lex_hash,
mysqlmanager from using GNU getopt to use my_getopt.

Changed some files that just included old getopt.h to include
my_getopt.h now.

Fixed a bug in my_print_help() in my_getopt.c.

Made better documentation for option -G in mysql client.


client/mysql.cc:
  Documented --named-commands better.
myisam/ft_dump.c:
  Changed getopt to my_getopt.
myisam/ft_eval.c:
  Changed getopt to my_getopt.
myisam/ft_test1.c:
  Changed getopt to my_getopt.
myisam/mi_check.c:
  getopt.h -> my_getopt.h
myisam/mi_test1.c:
  Changed getopt to my_getopt.
myisam/myisampack.c:
  Changed getopt to my_getopt.
mysys/my_getopt.c:
  Fixed a bug when printing help for option that didn't have a
  description.
sql/gen_lex_hash.cc:
  Changed getopt to my_getopt.
tools/mysqlmanager.c:
  Changed getopt to my_getopt.
vio/test-ssl.c:
  getopt.h -> my_getopt.h
vio/test-sslclient.c:
  getopt.h -> my_getopt.h
vio/test-sslserver.c:
  getopt.h -> my_getopt.h
vio/viotest-ssl.c:
  getopt.h -> my_getopt.h
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2002-05-24 14:06:58 +03:00
unknown
ebb98af730 my_getopt:
- some minor bugfixes
- made code more readable
- support for printing GET_BOOL type options in my_print_variables(),
  value is either TRUE or FALSE


client/mysqlbinlog.cc:
  Changes in my_getopt my_print_variables()
client/mysqlmanager-pwgen.c:
  Changes in my_getopt my_print_variables()
client/mysqlmanagerc.c:
  Changes in my_getopt my_print_variables()
client/mysqltest.c:
  Changes in my_getopt my_print_variables()
myisam/myisamchk.c:
  Changes in my_getopt my_print_variables()
mysys/my_getopt.c:
  Made code more readable.
  Fixed bug in my_print_variables().
  Added printing for options whether they are enabled or not
  FALSE / TRUE. This also separates GET_BOOL type options from
  variables that can actually take values as an argument.
2002-05-22 20:45:19 +03:00
unknown
bb07d5c043 Changed mysqlbinlog, mysqlmanager-pwgen, mysqlmanagerc, mysqltest,
thread_test and isamchk to use my_getopt.

Fixed a bug in my_getopt.


client/mysqlbinlog.cc:
  Changed mysqlbinlog.cc to use my_getopt.
client/mysqlmanager-pwgen.c:
  Changed mysqlmanager-pwgen to use my_getopt.
client/mysqlmanagerc.c:
  Changed mysqlmanagerc to use my_getopt.
client/mysqltest.c:
  Changed mysqltest to use my_getopt.
client/thread_test.c:
  Changed thread_test to use my_getopt.
isam/isamchk.c:
  Changed isamchk to use my_getopt.
mysys/my_getopt.c:
  Fixed a bug in printing options when option didn't have a comment.
  Added startup initializing and printing for 'GET_BOOL' type variables.
sql/mysql_priv.h:
  Changed type.
sql/mysqld.cc:
  Fixed a bug in --local-infile option.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2002-05-22 00:05:05 +03:00
unknown
89617526c8 Changed GET_STRALC to GET_STR_ALLOC
mysys/my_getopt.c:
  Changed GET_STRALC to GET_STR_ALLOC
  Added error checking for my_strdup()
2002-05-15 20:24:00 +03:00
unknown
9ab6d21c52 Some bug fixes.
myisam/myisamchk.c:
  Fixed a type.
mysys/my_getopt.c:
  Made GET_STRALC to work like x_free() when doing a freeing.
  Fixed a bug in my_print_variables() when printing a ulonglong value.
sql/mysqld.cc:
  Fixed some wrongly alloced/freed variables and removed some
  unneccessary code.
2002-05-15 02:33:41 +03:00
unknown
21c1e5be44 - Added new type GET_STRALC to my_getopt.
- Fixed some bugs, wrongly freed pointers, in some clients.
- Removed unneccessary code.
- Fixed some other minor bugs and added some options into
  variables category, which had accidently been left out earlier.


client/mysql.cc:
  Fixed some wrong freed pointers. Removed unneccessary code.
  Changed some types from GET_STR to GET_STRALC.
client/mysqladmin.c:
  Fixed some wrong freed pointers. Removed unneccessary code.
  Changed some types from GET_STR to GET_STRALC.
client/mysqlcheck.c:
  Fixed some wrong freed pointers. Removed unneccessary code.
  Changed some types from GET_STR to GET_STRALC.
client/mysqldump.c:
  Fixed some wrong freed pointers. Removed unneccessary code.
  Changed some types from GET_STR to GET_STRALC.
client/mysqlimport.c:
  Removed unneccessary code.
  Fixed a bug in option --ignore-lines
client/mysqlshow.c:
  Removed unneccessary code.
include/my_getopt.h:
  Added new type, GET_STRALC. The name stands for GET STRING ALLOC,
  which means that the struct member value and u_max_value are
  strings that must be alloced and freed when used.
  The normal GET_STR works similarly otherwise, except that it's
  arguments are just pointers to strings, not alloced ones.
mysys/my_getopt.c:
  Added support for GET_STRALC
2002-05-14 21:41:55 +03:00
unknown
b2a96dd884 Fixed some bugs and added support for --loose-set-variable
mysys/my_getopt.c:
  Added support for --loose-set-variable
sql/mysqld.cc:
  Fixed a bug when compiling with innodb and/or bdb.
2002-05-13 22:03:47 +03:00
unknown
3dd3414739 - Fixed some option types in my_getopt struct in all clients.
- Added special option/variable prefix '--loose-' to my_getopt.c


client/mysql.cc:
  Fixed some variable types.
client/mysqladmin.c:
  Fixed some variable types.
client/mysqlcheck.c:
  Fixed some variable types.
client/mysqldump.c:
  Fixed some variable types.
client/mysqlimport.c:
  Fixed some variable types.
client/mysqlshow.c:
  Fixed some variable types.
myisam/myisamchk.c:
  Fixed some variable types.
mysys/my_getopt.c:
  Fixed a bug in noticing whether argument was allowed to option (variable).
  Added support for prefix --loose-option-name
  This will work with options and variables, but not with --set-variable (!)
  --set-variable is depricated and --variable-name=value should be used
  instead. When used, my_getopt will not return error if option/variable
  was not found, but print a warning, do a no-op and continue.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2002-05-11 14:36:34 +03:00
unknown
9f8a75a168 Fixed some bugs in my_getopt.c, added functionality for new GET_*
types, migrated mysqld.cc to use my_getopt.


include/my_getopt.h:
  
  Added missing types; GET_INT, GET_UINT, GET_ULONG, GET_ULL
mysys/my_getopt.c:
  - Fixed a bug in processing short options; variable value was set
    wrongly after processing it in get_one_option(), when it needed
    to be done before it.
  - Fixed a bug in setting variable values; if type was OPT_ARG,
    a call without argument destroyed the default value
  - Added functionality for new GET_* types.
sql/mysqld.cc:
  Changed mysqld.cc to use my_getopt.
2002-05-07 20:35:06 +03:00
unknown
91c373fc72 fixes to make it compile and pass the test suite again after the last
accidental push of broken code.


client/mysqladmin.c:
  fixed crash in free_defaults()
libmysql/Makefile.shared:
  added my_getopt to libmysqlclient
mysys/my_getopt.c:
  fixed bug in parsing -O var=val
2002-04-04 21:36:24 -07:00
unknown
02f0a2f2eb Merge and two bug fixes in my_getopt.c
client/mysql.cc:
  merge
client/mysqldump.c:
  merge
myisam/myisamchk.c:
  merge
mysys/my_getopt.c:
  Fixed a bug with short options when type was GET_BOOL.
  Fixed a bug in my_print_help() function.
2002-04-03 15:44:20 +03:00
unknown
38cd4fdeb2 Merged in some changes made to MySQL clients by other
developers before pushing my_getopt.


client/mysqladmin.c:
  Auto merged
mysys/my_getopt.c:
  Auto merged
sql/mysqld.cc:
  Auto merged
client/client_priv.h:
  Merged in previous changes for new client_priv.h (my_getopt)
2002-04-03 13:33:25 +03:00
unknown
a2e75474b5 Changed mysql, mysqladmin, mysqlshow, mysqldump, mysqlimport,
mysqlcheck and myisamchk to use new my_getopt struct.


client/client_priv.h:
  Changes for my_getopt
client/mysql.cc:
  Uses new my_getopt
client/mysqladmin.c:
  Uses new my_getopt
client/mysqlcheck.c:
  Uses new my_getopt
client/mysqldump.c:
  Uses new my_getopt
client/mysqlimport.c:
  Uses new my_getopt
client/mysqlshow.c:
  Uses new my_getopt
include/my_getopt.h:
  Added GET_BOOL type
include/sslopt-case.h:
  This is shouldn't be needed anymore.
include/sslopt-longopts.h:
  Uses new my_getopt
myisam/myisamchk.c:
  Uses new my_getopt
mysys/my_getopt.c:
  Some bug fixes and small feature adds to my_getopt
sql/mysqld.cc:
  mysqld.cc will be changed next. sslopt-* had to be removed
  temporarily.
2002-04-02 20:29:53 +03:00
unknown
749246cc29 Portability fixes
Fix bug when using option groups


libmysql/libmysql.c:
  Fix bug when using option groups
myisam/myisamchk.c:
  Portability fix
mysys/my_getopt.c:
  Portability fix
2002-03-06 22:12:08 +02:00
unknown
dc7af9f035 Bug fixes and new functionality added in my_getopt and myisamchk
include/my_getopt.h:
  Removed a member from my_getopt struct.
myisam/myisamchk.c:
  pdated myisamchk. More features in use from my_getopt
mysys/my_getopt.c:
  Fixed a bug in handle_options(). Short options were not tested
  whether existed when given from the command line. Fixed a bug
  in getopt_ll, got division by zero in some cases. Added new functions
  my_print_help() and my_print_variables() to be used by mysql server
  and most clients.
2002-02-06 17:22:43 +02:00
unknown
83c83a0223 Fixes for new getopt
Bug fix when using --no-deaults
Sets ref_length to right value (faster rnd_pos() handling in InnoDB).
Fixed problem with multi-table-delete and InnoDB
Fixed problem with truncate table, which required a COMMIT before.
Fixed multi-table-delete bug with InnoDB.
Remove not used index from EXPLAIN


Docs/manual.texi:
  ChangeLog
include/my_getopt.h:
  Removed compiler warnings
myisam/myisamchk.c:
  Fixes for new getopt
mysql-test/r/explain.result:
  Updated test results
mysql-test/r/innodb.result:
  Updated test results
mysql-test/r/join.result:
  Updated test results
mysql-test/t/innodb.test:
  Updated test results
mysys/default.c:
  Bug fix when using --no-defaults
mysys/my_getopt.c:
  Fixes for new getopt
sql/ha_innodb.cc:
  Sets ref_length to right value (faster rnd_pos() handling).
  Fixed problem with multi-table-delete.
  Fixed problem with truncate table, which required a COMMIT before.
sql/opt_sum.cc:
  Remove not used index from EXPLAIN
sql/sql_cache.cc:
  Fixed core dump bug when not using query cache
sql/sql_select.cc:
  Remove not used index from EXPLAIN
2002-01-31 04:36:58 +02:00
unknown
c4f1ced9f1 New functionality to my_getopt. myisamchk now uses my_getopt
only.


include/my_getopt.h:
  Added u_max_value as for user definable maximum value for
  a variable in my_getopt.
myisam/myisamchk.c:
  myisamchk now uses my_getopt struct for variables also.
  Variables can be set with -O var=val, --set-variable=var=val and
  --variable=val now.
mysys/getvar.c:
  my_set_changeable_var moved to my_getopt.c
mysys/my_getopt.c:
  Added special prefix --maximum[-variable-name=...] for user
  definable maximum values for variables, among other things.
2002-01-30 05:08:17 +02:00
unknown
845db7c20b Added my_getopt struct and modified myisamchk to the bk tree.
include/Makefile.am:
  Added my_getopt.h
myisam/myisamchk.c:
  myisamcheck is using my_getopt struct now. Old code left:
  changeable_var[], will be changed later.
mysys/Makefile.am:
  added my_getopt.c
mysys/getvar.c:
  Added my_set_changeable_var. This is not being used yet, and
  is mostly a copy of set_changeable_var still.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2002-01-25 23:34:37 +02:00