List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:January 26 2002 10:08pm
Subject:Syntax for changing variables on the fly, etc?
View as plain text  
Hi!

>>>>> "Jeremy" == Jeremy Zawodny <jzawodn@stripped> writes:

Jeremy> I'm working on the section of my book which deals with MySQL
Jeremy> configuration.  Since my goal is to cover *at least* MySQL 4.0
Jeremy> (possibly 4.1 if I'm too slow), I need to make sure that I cover
Jeremy> things on the 4.0 TODO list.

I have today updated the 4.0 and 4.1 lists in the MySQL manual.
This should be available on our web site by early next week.

Jeremy> One that I've been anxiously awaiting is listed as:

Jeremy>   Allow users to change startup options without taking down the
Jeremy>   server.

Jani is working on this just now ;  He did push preliminary code for
this yesterday;  There is however 3-4 days of work days left to finish
this up. If things goes as planned, this should be done before middle
of February.

Jeremy> So I have a few questions.

Jeremy>   (1) Does that refer to only "set-variable" options?  Clearly you
Jeremy>       can't change EVERYTHING after startup, such as the user=foo
Jeremy>       value.  And there is probably little point in being able to
Jeremy>       change port=3306 at runtime.

The set variable things are intended for the server side (which
doesn't have an user option).

The mysqld options that we are going to allow to be changed in the
first version are:

big-tables
binlog-do-db
binlog-ignore-db
des-key-file
default-character-set ?
default-table-type
delay-key-write-for-all-tables
log
log-bin
log-bin-index
log-update
log-slow-queries
log-long-format
log-slave-updates
low-priority-updates
myisam-recover
disconnect-slave-event-count
abort-slave-event-count
max-binlog-dump-events
sporadic-binlog-dump-fail
replicate*
safe-show-database
safe-user-create
server-id ?
show-slave-auth-info
skip-concurrent-insert
skip-delay-key-write
skip-host-cache
skip-name-resolve
skip-show-database
skip-symlink
slave-load-tmpdir ?
sql-bin-update-same
sql-mode
transaction-isolation
tmpdir ?
warnings

Note that we will also clean up all the above options to make
everything consistent.

The new getopt library we have created will allow the user to specify
any of the above boolean options with the following syntax:

big-tables=0		 Disable big-tables option
big-tables=1		 Enable big-tables option
big-tables		 Same as big-tables=1
skip-big-tables		 Same as big-tables=0
enable-big-tables	 Same as big-tables=1

you can also use '_' instead of '-'.

The above is of course just for the command line and for my.cnf.
In SQL you have to always use the '_' form for an variable.

For the variables, we should be able to change all variables shown in
'show variables' EXCEPT:

back_log
bdb_*
ft_min_word_len
ft_max_word_len
ft_max_word_len_for_sort
innodb_*
lower_case_table_names
open_files_limit

Note that for the variables, all that are not global variables (like
the key cache) there will be a thread specific and a global value.

Jeremy>   (2) What will the syntax be?  Anyone prototyped that yet?

The syntax will be:

SET [ GLOBAL | SESSION | MAX ] variable=value

GLOBAL is what a new user will get when he connects.

This is the same as what you get when using 'set-variable' in
my.cnf and restart mysqld.

MAX is used to set up an upper limit up to which a normal user can
increase his buffer.

The following is just something that was not planned, but I come up
with just now:

In the my.cnf file, you will be able to set the variable
maximum-variable-name=#
which will allow you to set the limit for a variable.

If you are using the old style:

set-variable= variable-name

This will set both the default and max bound for a variable.

Jeremy, what do you think about the above?

Jeremy>   (3) What privilege will be required?  PROCESS?  Or a new one
Jeremy>       perhaps?

To set a GLOBAL and MAX value, one has to have 'PROCESS' privileges for now.
(We plan to clean up the privilege part in 5.0)

Jeremy> If there's a better place to send these questions, let me know.  I
Jeremy> have a feeling there will be many in the next several months...

No, this is a good place to send the questions.

Note that we will should have the above things ironed out within the
next few weeks!

Regards,
Monty
Thread
Syntax for changing variables on the fly, etc?Jeremy Zawodny20 Jan
  • Re: Syntax for changing variables on the fly, etc?Sinisa Milivojevic21 Jan
  • Syntax for changing variables on the fly, etc?Michael Widenius26 Jan