Skip to content

Commit 79caca1

Browse files
author
monty@hundin.mysql.fi
committed
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
2 parents 6aef747 + ce7a0a0 commit 79caca1

File tree

12 files changed

+216
-63
lines changed

12 files changed

+216
-63
lines changed

Build-tools/Do-compile

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if ($opt_innodb || $opt_bdb)
1919

2020
chomp($host=`hostname`);
2121
$full_host_name=$host;
22-
info("Compiling MySQL$version_suffix at $host, stage: $opt_stage\n");
22+
info("Compiling MySQL$version_suffix at $host$suffix, stage: $opt_stage\n");
2323
$connect_option= ($opt_tcpip ? "--host=$host" : "");
2424
$host =~ /^([^.-]*)/;
2525
$host=$1 . $opt_suffix;
@@ -36,6 +36,10 @@ if (defined($gcc_version) && ! $opt_config_env)
3636
{
3737
$opt_config_env= 'CC=gcc CFLAGS="-O2 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O2 -fno-omit-frame-pointer"';
3838
}
39+
elsif ($tmp =~ /version 3\.0\./)
40+
{
41+
$opt_config_env= 'CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"';
42+
}
3943
else
4044
{
4145
$opt_config_env= 'CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"';
@@ -107,7 +111,6 @@ $|=1;
107111
safe_cd("$host");
108112
if ($opt_stage == 0 && ! $opt_use_old_distribution)
109113
{
110-
my ($name);
111114
safe_system("gunzip < $opt_distribution | $tar xf -");
112115

113116
# Fix file times; This is needed because the time for files may be

Docs/manual.texi

+104-32
Original file line numberDiff line numberDiff line change
@@ -7704,6 +7704,11 @@ also work. There have been some problems with the @code{glibc} RPMs from
77047704
RedHat, so if you have problems, check whether or not there are any updates!
77057705
The @code{glibc} 2.0.7-19 and 2.0.7-29 RPMs are known to work.
77067706

7707+
If you are using gcc 3.0 and above to compile MySQL, you must install
7708+
the @code{libstdc++v3} library before compiling MySQL; If you don't do
7709+
this you will get an error about a missing @code{__cxa_pure_virtual}
7710+
symbol during linking!
7711+
77077712
On some older Linux distributions, @code{configure} may produce an error
77087713
like this:
77097714

@@ -7757,7 +7762,7 @@ shell> CXX=gcc ./configure
77577762
@end example
77587763

77597764
If you are running gcc 3.0 and above, you can't use the above trick with
7760-
CXX=gcc, but you have to install libstd++.
7765+
setting to CXX=gcc.
77617766

77627767
@node Linux-SPARC, Linux-Alpha, Linux-x86, Linux
77637768
@subsubsection Linux SPARC Notes
@@ -9419,7 +9424,7 @@ work:
94199424
CC="cc -pthread"
94209425
CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all -arch host"
94219426
CXX="cxx -pthread"
9422-
CXXFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all -arch host"
9427+
CXXFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all -arch host -noexceptions -nortti"
94239428
export CC CFLAGS CXX CXXFLAGS
94249429
./configure \
94259430
--prefix=/usr/local/mysql \
@@ -18622,36 +18627,103 @@ one extra connection for a client with the @code{Process_priv} privilege
1862218627
to ensure that you should always be able to login and check the system
1862318628
(assuming you are not giving this privilege to all your users).
1862418629

18625-
Some frequently asked states in @code{mysqladmin processlist}
18626-
18627-
@code{WAITING FOR TABLES}
18628-
18629-
This means that the server is trying to get a lock of a
18630-
table(s). Usually this should happen very fast, unless there is some
18631-
problem around, such as another program holding table files open (e.g
18632-
@code{myisamchk}, anohter instance of @code{mysqld}), @code{mysqld} is
18633-
run without @code{--skip-locking}, table files are nfs mounted for
18634-
@code{mysqld}, etc.
18635-
18636-
@code{OPENING TABLES}
18637-
18638-
This simply means that the thread is trying to open a table. This also
18639-
should be very instant procedure, unless something prevents opening. An
18640-
@code{ALTER TABLE}, for example, can prevent opening a table until the
18641-
command is finished. If someone runs @code{FLUSH TABLES} simultaneously
18642-
with an @code{ALTER TABLE}, then all the threads that are trying to use
18643-
the table in @code{ALTER TABLE} query will be in this state.
18644-
18645-
@code{CLOSING TABLES}
18646-
18647-
Means that the thread is closing the tables that the thread was using.
18648-
If this is taking long, please check for the above for possible reasons
18649-
why it might be taking long.
18650-
18651-
All of the above are usually very quick operations. If threads last
18652-
in any of these states for many seconds, there may be a problem around
18653-
that needs to be investigated. Check also that you have not run out
18654-
of harddisk space.
18630+
Some frequently states in @code{mysqladmin processlist}
18631+
18632+
@itemize @bullet
18633+
@item @code{Checking table}
18634+
The thread doing an [automatic ?] checking of the table.
18635+
@item @code{Closing tables}
18636+
Means that the thread is flushing the changed table data to disk and
18637+
closing the used tables. This should be a fast operation. If not, then
18638+
you should check that you don't have a full disk or that the disk is not
18639+
in very heavy use.
18640+
@item @code{Copying to tmp table on disk}
18641+
The temporary result set was larger than @code{tmp_table_size} and the
18642+
thread is now changing the in memory based temporary table to a disk
18643+
based one to save memory.
18644+
@item @code{Creating tmp table}
18645+
The thread is creating a temporary table to hold a part of the result for
18646+
the query.
18647+
@item @code{deleting from main table}
18648+
When executing the first part of a multi-table delete and we are only
18649+
deleting from the first table.
18650+
@item @code{deleting from reference tables}
18651+
When executing the second part of a multi-table delete and we are deleting
18652+
the matched rows from the other tables.
18653+
@item @code{Flushing tables}
18654+
The thread is executing @code{FLUSH TABLES} and is waiting for all
18655+
threads to close their tables.
18656+
@item @code{Killed}
18657+
Someone has sent a kill to the thread and it should abort next time it
18658+
checks the kill flag. The flag is checked in each major loop in MySQL,
18659+
but in some cases it may still take a short time for the thread to die.
18660+
If the thread is locked by some other thread, the kill will take affect
18661+
as soon as the other thread releases it's lock.
18662+
@item @code{Sending data}
18663+
The thread is processing rows for a @code{SELECT} statement and is
18664+
also sending data to the client.
18665+
@item @code{Sorting for group}
18666+
The thread is doing a sort to satsify a @code{GROUP BY}.
18667+
@item @code{Sorting for order}
18668+
The thread is doing a sort to satsify a @code{ORDER BY}.
18669+
@item @code{Opening tables}
18670+
This simply means that the thread is trying to open a table. This is
18671+
should be very fast procedure, unless something prevents opening. For
18672+
example an @code{ALTER TABLE} or a @code{LOCK TABLE} can prevent opening
18673+
a table until the command is finished.
18674+
@item @code{Removing duplicates}
18675+
The query was using @code{SELECT DISTINCT} in such a way that MySQL
18676+
couldn't optimize that distinct away at an early stage. Because of this
18677+
MySQL has to do an extra stage to remove all duplicated rows before
18678+
sending the result to the client.
18679+
@item @code{Reopen table}
18680+
The thread got a lock for the table, but noticed after getting the lock
18681+
that the underlying table structure changed. It has freed the lock,
18682+
closed the table and is now trying to reopen it.
18683+
@item @code{Repair by sorting}
18684+
The repair code is using sorting to create indexes.
18685+
@item @code{Repair with keycache}
18686+
The repair code is using creating keys one by one through the key cache.
18687+
This is much slower than @code{Repair by sorting}.
18688+
@item @code{Searching rows for update}
18689+
The thread is doing a first phase to find all matching rows before
18690+
updating them. This has to be done if the @code{UPDATE} is changing
18691+
the index that is used to find the involved rows.
18692+
@item @code{Sleeping}
18693+
The thread is wating for the client to send a new command to it.
18694+
@item @code{System lock}
18695+
The thread is waiting for getting to get a external system lock for the
18696+
table. If you are not using multiple mysqld servers that are accessing
18697+
the same tables, you can disable system locks with the
18698+
@code{--skip-locking} option.
18699+
@item @code{Upgrading lock}
18700+
The @code{INSERT DELAYED} handler is trying to get a lock for the table
18701+
to insert rows.
18702+
@item @code{Updating}
18703+
The thread is searching for rows to update and updating them.
18704+
@item @code{User Lock}
18705+
The thread is waiting on a @code{GET_LOCK()}.
18706+
@item @code{Waiting for tables}
18707+
The thread got a notification that the underlying structure for a table
18708+
has changed and it needs to reopen the table to get the new structure.
18709+
To be able to reopen the table it must however wait until all other
18710+
threads have closed the table in question.
18711+
18712+
This notification happens if another thread has used @code{FLUSH TABLES}
18713+
or one of the following commands on the table in question: @code{FLUSH
18714+
TABLES table_name}, @code{ALTER TABLE}, @code{RENAME TABLE},
18715+
@code{REPAIR TABLE}, @code{ANALYZE TABLE} or @code{OPTIMIZE TABLE}.
18716+
@item @code{waiting for handler insert}
18717+
The @code{INSERT DELAYED} handler has processed all inserts and are
18718+
waiting to get new ones.
18719+
@end itemize
18720+
18721+
Most states are very quick operations. If threads last in any of these
18722+
states for many seconds, there may be a problem around that needs to be
18723+
investigated.
18724+
18725+
There are some other states that are not mentioned above, but most of
18726+
these are only useful to find bugs in @code{mysqld}.
1865518727

1865618728
@node SHOW GRANTS, SHOW CREATE TABLE, SHOW PROCESSLIST, SHOW
1865718729
@subsubsection @code{SHOW GRANTS}

client/get_password.c

+13-13
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ char *get_tty_password(char *opt_message)
7272
char *pos=to,*end=to+sizeof(to)-1;
7373
int i=0;
7474
DBUG_ENTER("get_tty_password");
75-
fprintf(stdout,opt_message ? opt_message : "Enter password: ");
75+
fprintf(stderr,opt_message ? opt_message : "Enter password: ");
7676
for (;;)
7777
{
7878
char tmp;
@@ -125,8 +125,8 @@ static void get_password(char *to,uint length,int fd,bool echo)
125125
{
126126
if (echo)
127127
{
128-
fputs("\b \b",stdout);
129-
fflush(stdout);
128+
fputs("\b \b",stderr);
129+
fflush(stderr);
130130
}
131131
pos--;
132132
continue;
@@ -138,8 +138,8 @@ static void get_password(char *to,uint length,int fd,bool echo)
138138
continue;
139139
if (echo)
140140
{
141-
fputc('*',stdout);
142-
fflush(stdout);
141+
fputc('*',stderr);
142+
fflush(stderr);
143143
}
144144
*(pos++) = tmp;
145145
}
@@ -172,10 +172,10 @@ char *get_tty_password(char *opt_message)
172172
memset(passbuff, 0, _PASSWORD_LEN);
173173
#endif
174174
#else
175-
if (isatty(fileno(stdout)))
175+
if (isatty(fileno(stderr)))
176176
{
177-
fputs(opt_message ? opt_message : "Enter password: ",stdout);
178-
fflush(stdout);
177+
fputs(opt_message ? opt_message : "Enter password: ",stderr);
178+
fflush(stderr);
179179
}
180180
#if defined(HAVE_TERMIOS_H)
181181
tcgetattr(fileno(stdin), &org);
@@ -184,7 +184,7 @@ char *get_tty_password(char *opt_message)
184184
tmp.c_cc[VMIN] = 1;
185185
tmp.c_cc[VTIME] = 0;
186186
tcsetattr(fileno(stdin), TCSADRAIN, &tmp);
187-
get_password(buff, sizeof(buff)-1, fileno(stdin), isatty(fileno(stdout)));
187+
get_password(buff, sizeof(buff)-1, fileno(stdin), isatty(fileno(stderr)));
188188
tcsetattr(fileno(stdin), TCSADRAIN, &org);
189189
#elif defined(HAVE_TERMIO_H)
190190
ioctl(fileno(stdin), (int) TCGETA, &org);
@@ -193,19 +193,19 @@ char *get_tty_password(char *opt_message)
193193
tmp.c_cc[VMIN] = 1;
194194
tmp.c_cc[VTIME]= 0;
195195
ioctl(fileno(stdin),(int) TCSETA, &tmp);
196-
get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stdout)));
196+
get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stderr)));
197197
ioctl(fileno(stdin),(int) TCSETA, &org);
198198
#else
199199
gtty(fileno(stdin), &org);
200200
tmp=org;
201201
tmp.sg_flags &= ~ECHO;
202202
tmp.sg_flags |= RAW;
203203
stty(fileno(stdin), &tmp);
204-
get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stdout)));
204+
get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stderr)));
205205
stty(fileno(stdin), &org);
206206
#endif
207-
if (isatty(fileno(stdout)))
208-
fputc('\n',stdout);
207+
if (isatty(fileno(stderr)))
208+
fputc('\n',stderr);
209209
#endif /* HAVE_GETPASS */
210210

211211
DBUG_RETURN(my_strdup(buff,MYF(MY_FAE)));

myisam/mi_locking.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,9 @@ int _mi_readinfo(register MI_INFO *info, int lock_type, int check_keybuffer)
305305
MYISAM_SHARE *share=info->s;
306306
if (!share->tot_locks)
307307
{
308-
if ((info->tmp_lock_type=lock_type) != F_RDLCK)
309-
if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
310-
info->lock_wait | MY_SEEK_NOT_DONE))
311-
DBUG_RETURN(1);
308+
if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
309+
info->lock_wait | MY_SEEK_NOT_DONE))
310+
DBUG_RETURN(1);
312311
if (mi_state_info_read_dsk(share->kfile, &share->state, 1))
313312
{
314313
int error=my_errno ? my_errno : -1;

myisam/myisamdef.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ enum myisam_log_commands {
589589
#define myisam_log_record(a,b,c,d,e) if (myisam_log_file >= 0) _myisam_log_record(a,b,c,d,e)
590590

591591
#define fast_mi_writeinfo(INFO) if (!(INFO)->s->tot_locks) (void) _mi_writeinfo((INFO),0)
592-
#define fast_mi_readinfo(INFO) (!(INFO)->lock_type == F_UNLCK) && _mi_readinfo((INFO),F_RDLCK,1)
592+
#define fast_mi_readinfo(INFO) ((INFO)->lock_type == F_UNLCK) && _mi_readinfo((INFO),F_RDLCK,1)
593593

594594
#ifdef __cplusplus
595595
extern "C" {

mysys/my_init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void my_end(int infoflag)
125125
DBUG_PRINT("error",("%s",errbuff[0]));
126126
}
127127
}
128+
free_charsets();
128129
if (infoflag & MY_GIVE_INFO || info_file != stderr)
129130
{
130131
#ifdef HAVE_GETRUSAGE
@@ -149,7 +150,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
149150
#if defined(MSDOS) && !defined(__WIN__)
150151
fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC);
151152
#endif
152-
free_charsets();
153153
#if defined(SAFEMALLOC)
154154
TERMINATE(stderr); /* Give statistic on screen */
155155
#elif defined(__WIN__) && defined(_MSC_VER)

mysys/my_seek.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
3535
DBUG_PRINT("error",("lseek: %lu, errno: %d",newpos,errno));
3636
DBUG_RETURN(MY_FILEPOS_ERROR);
3737
}
38-
if (newpos != pos)
38+
if ((my_off_t) newpos != pos)
3939
{
4040
DBUG_PRINT("exit",("pos: %lu", (ulong) newpos));
4141
}

0 commit comments

Comments
 (0)