Skip to content

Commit 8cd4c23

Browse files
author
monty@hundin.mysql.fi
committed
Fix that mysqladmin shutdown can be interrupted with ^C
Fixed bug with BLOB keys in BDB tables Fixed problem with MERGE tables on OS with 32 bit files Fixed that TIME_TO_SEC() works with negative times
1 parent daa4229 commit 8cd4c23

14 files changed

+121
-42
lines changed

Docs/manual.texi

+69-10
Original file line numberDiff line numberDiff line change
@@ -46791,6 +46791,7 @@ users use this code as the rest of the code and because of this we are
4679146791
not yet 100% confident in this code.
4679246792

4679346793
@menu
46794+
* News-3.23.45:: Changes in release 3.23.45
4679446795
* News-3.23.44:: Changes in release 3.23.44
4679546796
* News-3.23.43:: Changes in release 3.23.43
4679646797
* News-3.23.42:: Changes in release 3.23.42
@@ -46839,7 +46840,18 @@ not yet 100% confident in this code.
4683946840
* News-3.23.0:: Changes in release 3.23.0
4684046841
@end menu
4684146842

46842-
@node News-3.23.44, News-3.23.43, News-3.23.x, News-3.23.x
46843+
@node News-3.23.45, News-3.23.44, News-3.23.x, News-3.23.x
46844+
@appendixsubsec Changes in release 3.23.45
46845+
@itemize @bullet
46846+
@item
46847+
Fixed bug with BDB tables and keys on @code{BLOB}'s.
46848+
@item
46849+
Fixed bug in @code{MERGE} tables on OS with 32 bit file pointers.
46850+
@item
46851+
Fixed bug in @code{TIME_TO_SEC()} when using negative values.
46852+
@end itemize
46853+
46854+
@node News-3.23.44, News-3.23.43, News-3.23.45, News-3.23.x
4684346855
@appendixsubsec Changes in release 3.23.44
4684446856
@itemize @bullet
4684546857
@item
@@ -46861,10 +46873,6 @@ Fixed problem with sjis character strings used within quoted table names.
4686146873
Fixed coredump when using @code{CREATE ... FULLTEXT} keys with other table
4686246874
handlers than MyISAM.
4686346875
@item
46864-
Add missing @code{InnoDB} variables to @code{SHOW VARIABLES}.
46865-
@item
46866-
Foreign keys checking is now done for @code{InnoDB} tables.
46867-
@item
4686846876
Don't use @code{signal()} on windows because this appears to not be
4686946877
100 % reliable.
4687046878
@item
@@ -46881,6 +46889,57 @@ a core dump.
4688146889
Applied portability fixes for OS/2 (Patch by Yuri Dario).
4688246890
@end itemize
4688346891

46892+
The following changes are for @code{InnoDB} tables:
46893+
46894+
@itemize @bullet
46895+
@item
46896+
Add missing @code{InnoDB} variables to @code{SHOW VARIABLES}.
46897+
@item
46898+
Foreign keys checking is now done for @code{InnoDB} tables.
46899+
@item
46900+
@code{DROP DATABASE} now works also for @code{InnoDB} tables.
46901+
@item
46902+
@code{InnoDB} now supports data files and raw disk partitions bigger
46903+
than 4 GB on those operating systems which have big files.
46904+
@item
46905+
@code{InnoDB} calculates better table cardinality estimates for the
46906+
MySQL optimizer.
46907+
@item
46908+
Accent characters in the default character set latin1 are ordered
46909+
according to the MySQL ordering.
46910+
46911+
NOTE: if you are using latin1 and have inserted characters whose code is >
46912+
127 to an indexed CHAR column, you should run CHECK TABLE on your table when
46913+
you upgrade to 3.23.44, and drop and reimport the table if CHECK TABLE
46914+
reports an error!
46915+
@item
46916+
A new @file{my.cnf} parameter @code{innodb_thread_concurrency} helps in
46917+
performance tuning in heavily concurrent environments.
46918+
@item
46919+
A new @code{my.cnf} parameter @code{innodb_fast_shutdown} speeds up
46920+
server shutdown.
46921+
@item
46922+
A new @code{my.cnf} parameter @code{innodb_force_recovery} helps to save
46923+
your data in case the disk image of the database becomes corrupt.
46924+
@item
46925+
@code{innodb_monitor} has been improved and a new
46926+
@code{innodb_table_monitor} added.
46927+
@item
46928+
Increased maximum key length from 500 to 7000 bytes.
46929+
@item
46930+
Fixed a bug in replication of auto-inc columns with multiline inserts.
46931+
@item
46932+
Fixed a bug when the case of letters changes in an update of an indexed
46933+
secondary column.
46934+
@item
46935+
Fixed a hang when there are > 24 data files.
46936+
@item
46937+
Fixed a crash when @code{MAX(col)} is selected from an empty table, and
46938+
col is a not the first column in a multi-column index.
46939+
@item
46940+
Fixed a bug in purge which could cause crashes.
46941+
@end itemize
46942+
4688446943
@node News-3.23.43, News-3.23.42, News-3.23.44, News-3.23.x
4688546944
@appendixsubsec Changes in release 3.23.43
4688646945
@itemize @bullet
@@ -46981,15 +47040,15 @@ Fixed possible problem with @code{shutdown} on Solaris where the
4698147040
@item
4698247041
InnoDB now supports < 4 GB rows. The former limit was 8000 bytes.
4698347042
@item
46984-
The @code{doublewrite} file flush method is used in InnoDB.
47043+
The @code{doublewrite} file flush method is used in @code{InnoDB}.
4698547044
It reduces the need for Unix fsync calls to a fraction and
4698647045
improves performance on most Unix flavors.
4698747046
@item
46988-
You can now use the InnoDB Monitor to print a lot of InnoDB state
47047+
You can now use the @code{InnoDB} Monitor to print a lot of @code{InnoDB} state
4698947048
information, including locks, to the standard output; useful in
4699047049
performance tuning.
4699147050
@item
46992-
Several bugs which could cause hangs in InnoDB have been fixed.
47051+
Several bugs which could cause hangs in @code{InnoDB} have been fixed.
4699347052
@item
4699447053
Split @code{record_buffer} to @code{record_buffer} and
4699547054
@code{record_rnd_buffer}. To make things compatible to previous MySQL
@@ -47103,7 +47162,7 @@ Extended argument length in option files from 256 to 512 chars.
4710347162
Fixed problem with shutdown when @code{INSERT DELAYED} was waiting for
4710447163
a @code{LOCK TABLE}.
4710547164
@item
47106-
Fixed coredump bug in InnoDB when tablespace was full.
47165+
Fixed coredump bug in @code{InnoDB} when tablespace was full.
4710747166
@item
4710847167
Fixed problem with @code{MERGE} tables and big tables (> 4G) when using
4710947168
@code{ORDER BY}.
@@ -47148,7 +47207,7 @@ New program @code{mysqlcheck}.
4714847207
Added database name to output for administrative commands like @code{CHECK},
4714947208
@code{REPAIR}, @code{OPTIMIZE}.
4715047209
@item
47151-
Lots of portability fixes for InnoDB.
47210+
Lots of portability fixes for @code{InnoDB}.
4715247211
@item
4715347212
Changed optimizer so that queries like
4715447213
@code{SELECT * FROM table_name,table_name2 ... ORDER BY key_part1 LIMIT #}

client/mysqladmin.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <my_pthread.h> /* because of signal() */
2424
#endif
2525

26-
#define ADMIN_VERSION "8.22"
26+
#define ADMIN_VERSION "8.23"
2727
#define MAX_MYSQL_VAR 64
2828
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
2929
#define MAX_TRUNC_LENGTH 3
@@ -1130,7 +1130,7 @@ static void wait_pidfile(char *pidfile)
11301130

11311131
system_filename(buff,pidfile);
11321132
while ((fd = my_open(buff, O_RDONLY, MYF(0))) >= 0 &&
1133-
count++ < opt_shutdown_timeout)
1133+
count++ < opt_shutdown_timeout && !interrupted)
11341134
{
11351135
my_close(fd,MYF(0));
11361136
sleep(1);

include/mysqld_error.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
#define ER_DROP_DB_WITH_READ_LOCK 1208
212212
#define ER_CREATE_DB_WITH_READ_LOCK 1209
213213
#define ER_WRONG_ARGUMENTS 1210
214-
#define ER_NO_PERMISSON_TO_CREATE_USER 1211
214+
#define ER_NO_PERMISSION_TO_CREATE_USER 1211
215215
#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212
216216
#define ER_LOCK_DEADLOCK 1213
217217
#define ER_TABLE_CANT_HANDLE_FULLTEXT 1214

mysql-test/r/func_time.result

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestam
88
1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112
99
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") sec_to_time(time_to_sec("0:30:47")/6.21)
1010
02:30:01 23001 54742 00:04:57
11+
sec_to_time(time_to_sec('-838:59:59'))
12+
-838:59:59
1113
now()-curdate()*1000000-curtime()
1214
0
1315
strcmp(current_timestamp(),concat(current_date()," ",current_time()))

mysql-test/t/func_time.test

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_times
99
select from_unixtime(unix_timestamp("1994-03-02 10:11:12")),from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s"),from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0;
1010
select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"),
1111
sec_to_time(time_to_sec("0:30:47")/6.21);
12+
select sec_to_time(time_to_sec('-838:59:59'));
1213
select now()-curdate()*1000000-curtime();
1314
select strcmp(current_timestamp(),concat(current_date()," ",current_time()));
1415
select date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w");

mysql-test/t/rpl000015-slave.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rm $MYSQL_TEST_DIR/var/slave-data/master.info
1+
rm -f $MYSQL_TEST_DIR/var/slave-data/master.info

mysql-test/t/rpl000016-slave.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rm $MYSQL_TEST_DIR/var/slave-data/master.info
1+
rm -f $MYSQL_TEST_DIR/var/slave-data/master.info

sql/field.cc

+18-6
Original file line numberDiff line numberDiff line change
@@ -3466,17 +3466,17 @@ int Field_string::pack_cmp(const char *b, uint length)
34663466
}
34673467

34683468

3469-
uint Field_string::packed_col_length(const char *ptr)
3469+
uint Field_string::packed_col_length(const char *ptr, uint length)
34703470
{
3471-
if (field_length > 255)
3471+
if (length > 255)
34723472
return uint2korr(ptr)+2;
34733473
else
34743474
return (uint) ((uchar) *ptr)+1;
34753475
}
34763476

34773477
uint Field_string::max_packed_col_length(uint max_length)
34783478
{
3479-
return (field_length > 255 ? 2 : 1)+max_length;
3479+
return (max_length > 255 ? 2 : 1)+max_length;
34803480
}
34813481

34823482

@@ -3685,17 +3685,17 @@ int Field_varstring::pack_cmp(const char *b, uint key_length)
36853685
return my_sortncmp(a,a_length, b,b_length);
36863686
}
36873687

3688-
uint Field_varstring::packed_col_length(const char *ptr)
3688+
uint Field_varstring::packed_col_length(const char *ptr, uint length)
36893689
{
3690-
if (field_length > 255)
3690+
if (length > 255)
36913691
return uint2korr(ptr)+2;
36923692
else
36933693
return (uint) ((uchar) *ptr)+1;
36943694
}
36953695

36963696
uint Field_varstring::max_packed_col_length(uint max_length)
36973697
{
3698-
return (field_length > 255 ? 2 : 1)+max_length;
3698+
return (max_length > 255 ? 2 : 1)+max_length;
36993699
}
37003700

37013701
/****************************************************************************
@@ -4225,6 +4225,18 @@ char *Field_blob::pack_key_from_key_image(char *to, const char *from,
42254225
return to+length;
42264226
}
42274227

4228+
uint Field_blob::packed_col_length(const char *ptr, uint length)
4229+
{
4230+
if (length > 255)
4231+
return uint2korr(ptr)+2;
4232+
else
4233+
return (uint) ((uchar) *ptr)+1;
4234+
}
4235+
4236+
uint Field_blob::max_packed_col_length(uint max_length)
4237+
{
4238+
return (max_length > 255 ? 2 : 1)+max_length;
4239+
}
42284240

42294241
/****************************************************************************
42304242
** enum type.

sql/field.h

+7-10
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ class Field {
176176
{
177177
return pack(to,from,max_length);
178178
}
179-
virtual uint packed_col_length(const char *to)
180-
{ return pack_length();}
179+
virtual uint packed_col_length(const char *to, uint length)
180+
{ return length;}
181181
virtual uint max_packed_col_length(uint max_length)
182-
{ return pack_length();}
182+
{ return max_length;}
183183

184184
virtual int pack_cmp(const char *a,const char *b, uint key_length_arg)
185185
{ return cmp(a,b); }
@@ -748,7 +748,7 @@ class Field_string :public Field_str {
748748
const char *unpack(char* to, const char *from);
749749
int pack_cmp(const char *a,const char *b,uint key_length);
750750
int pack_cmp(const char *b,uint key_length);
751-
uint packed_col_length(const char *to);
751+
uint packed_col_length(const char *to, uint length);
752752
uint max_packed_col_length(uint max_length);
753753
uint size_of() const { return sizeof(*this); }
754754
enum_field_types real_type() const { return FIELD_TYPE_STRING; }
@@ -800,7 +800,7 @@ class Field_varstring :public Field_str {
800800
const char *unpack(char* to, const char *from);
801801
int pack_cmp(const char *a, const char *b, uint key_length);
802802
int pack_cmp(const char *b, uint key_length);
803-
uint packed_col_length(const char *to);
803+
uint packed_col_length(const char *to, uint length);
804804
uint max_packed_col_length(uint max_length);
805805
uint size_of() const { return sizeof(*this); }
806806
enum_field_types real_type() const { return FIELD_TYPE_VAR_STRING; }
@@ -901,11 +901,8 @@ class Field_blob :public Field_str {
901901
char *pack_key_from_key_image(char* to, const char *from, uint max_length);
902902
int pack_cmp(const char *a, const char *b, uint key_length);
903903
int pack_cmp(const char *b, uint key_length);
904-
uint packed_col_length(const char *col_ptr)
905-
{ return get_length(col_ptr)+packlength;}
906-
virtual uint max_packed_col_length(uint max_length)
907-
{ return packlength+max_length; }
908-
904+
uint packed_col_length(const char *col_ptr, uint length);
905+
uint max_packed_col_length(uint max_length);
909906
inline void free() { value.free(); }
910907
inline void clear_temporary() { bzero((char*) &value,sizeof(value)); }
911908
friend void field_conv(Field *to,Field *from);

sql/ha_berkeley.cc

+9-7
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
- Get a more accurate count of the number of rows (estimate_number_of_rows()).
2929
We could store the found number of rows when the table is scanned and
3030
then increment the counter for each attempted write.
31-
- We will need a manager thread that calls flush_logs, removes old
32-
logs and makes checkpoints at given intervals.
31+
- We will need to extend the manager thread to makes checkpoints at
32+
given intervals.
3333
- When not using UPDATE IGNORE, don't make a sub transaction but abort
3434
the main transaction on errors.
3535
- Handling of drop table during autocommit=0 ?
@@ -90,7 +90,7 @@ const char *berkeley_lock_names[] =
9090
{ "DEFAULT", "OLDEST","RANDOM","YOUNGEST",0 };
9191
u_int32_t berkeley_lock_types[]=
9292
{ DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM };
93-
TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names),"",
93+
TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names)-1,"",
9494
berkeley_lock_names};
9595

9696
static void berkeley_print_error(const char *db_errpfx, char *buffer);
@@ -372,10 +372,12 @@ berkeley_cmp_packed_key(DB *file, const DBT *new_key, const DBT *saved_key)
372372
if ((cmp=key_part->field->pack_cmp(new_key_ptr,saved_key_ptr,
373373
key_part->length)))
374374
return cmp;
375-
uint length=key_part->field->packed_col_length(new_key_ptr);
375+
uint length=key_part->field->packed_col_length(new_key_ptr,
376+
key_part->length);
376377
new_key_ptr+=length;
377378
key_length-=length;
378-
saved_key_ptr+=key_part->field->packed_col_length(saved_key_ptr);
379+
saved_key_ptr+=key_part->field->packed_col_length(saved_key_ptr,
380+
key_part->length);
379381
}
380382
return key->handler.bdb_return_if_eq;
381383
}
@@ -433,7 +435,7 @@ berkeley_key_cmp(TABLE *table, KEY *key_info, const char *key, uint key_length)
433435
}
434436
if ((cmp=key_part->field->pack_cmp(key,key_part->length)))
435437
return cmp;
436-
uint length=key_part->field->packed_col_length(key);
438+
uint length=key_part->field->packed_col_length(key,key_part->length);
437439
key+=length;
438440
key_length-=length;
439441
}
@@ -1552,7 +1554,7 @@ DBT *ha_berkeley::get_pos(DBT *to, byte *pos)
15521554
KEY_PART_INFO *end=key_part+table->key_info[primary_key].key_parts;
15531555

15541556
for ( ; key_part != end ; key_part++)
1555-
pos+=key_part->field->packed_col_length((char*) pos);
1557+
pos+=key_part->field->packed_col_length((char*) pos,key_part->length);
15561558
to->size= (uint) (pos- (byte*) to->data);
15571559
}
15581560
return to;

sql/ha_myisammrg.cc

+4
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ void ha_myisammrg::info(uint flag)
175175
mean_rec_length=info.reclength;
176176
block_size=0;
177177
update_time=0;
178+
#if SIZEOF_OFF_T > 4
178179
ref_length=6; // Should be big enough
180+
#else
181+
ref_length=4; // Can't be > than my_off_t
182+
#endif
179183
}
180184

181185

sql/item_timefunc.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ longlong Item_func_unix_timestamp::val_int()
248248
longlong Item_func_time_to_sec::val_int()
249249
{
250250
TIME ltime;
251+
longlong seconds;
251252
(void) get_arg0_time(&ltime);
252-
return ltime.hour*3600L+ltime.minute*60+ltime.second;
253+
seconds=ltime.hour*3600L+ltime.minute*60+ltime.second;
254+
return ltime.neg ? -seconds : seconds;
253255
}
254256

255257

sql/share/swedish/errmsg.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
"DROP DATABASE �r inte till�tet n�r man har ett globalt l�s-l�s",
213213
"CREATE DATABASE �r inte till�tet n�r man har ett globalt l�s-l�s",
214214
"Felaktiga argument till %s",
215-
"%-.32s@%-.64s har inte r�ttigheter att skapa nya anv�ndare",
215+
"%-.32s@%-.64s har inte r�ttighet att skapa nya anv�ndare",
216216
"Felaktig tabell definition: Alla tabeller i en MERGE tabell m�ste vara i samma databas",
217217
"Fick 'DEADLOCK' vid l�sf�rs�k av block/rad; F�rs�k att starta om transaktionen",
218218
"Tabelltypen har inte hantering av FULLTEXT index",

sql/sql_acl.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,8 @@ static int replace_user_table(TABLE *table, const LEX_USER &combo,
10031003
my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),
10041004
MYF(0),combo.user.str,combo.host.str);
10051005
else
1006-
my_printf_error(ER_NO_PERMISSON_TO_CREATE_USER,
1007-
ER(ER_NO_PERMISSON_TO_CREATE_USER),
1006+
my_printf_error(ER_NO_PERMISSION_TO_CREATE_USER,
1007+
ER(ER_NO_PERMISSION_TO_CREATE_USER),
10081008
MYF(0),thd->user,
10091009
thd->host ? thd->host : thd->ip ? thd->ip: "");
10101010
error= -1;

0 commit comments

Comments
 (0)